Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a field in a Firestore collection that looks like this:
urls: map
-- 0: map
----type: string
----value: string
-- 1: map
----type: string
----value: string

Since upgrading to Typescript 4.4 the compiler is complaining, "No index signature with a parameter of type 'string' was found on type"

The model looks like this:
export interface URLS {
     urls?:  {
          type?: string;
          value?: string;
     };
}

How do I change the interface model so that the compiler understands that urls is a map?


What I have tried:

I am still confused even after reading the documentation at https://www.typescriptlang.org/docs/handbook/2/mapped-types.html
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900