Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

An index signature parameter type cannot be a type alias. Consider writing '[key: string]:

In my angular application i have this code

  getLocalStreams: () => {
        [key: Stream['key']]: Stream;
    };

getting this error on compilation

    An index signature parameter type cannot be a type alias. Consider writing '[key: string]: { readonly id: string; readonly key: string;
> readonly participantId: string; readonly origin: "local" | "remote";
> readonly isAudioEnabled: boolean; readonly isVideoEnabled: boolean;
> ... 4 more ...; readonly isConfigured: boolean; }' instead

any solution to fix this issue, Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Do you mean to write this? We indicate the key will be of type string and the value of type Stream

getLocalStreams: () => {
    [key: string]: Stream;
};
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading