ARTICLE AD BOX
An existing codebase has this interface declaration:
type TForValue = boolean | string; interface ISomeInterface { parameters: { [parameter: string]: TForValue }; foo: number; }What is the type or meaning of parameters in this interface?
How would I create an object that satisfies this interface? What syntax would I use for that?
My initial thought was that parameters is simply a map from string to TForValue, but that idea appears to be completely misguided - I cannot assign a Map<string, TForValue> to parameters nor construct a Map<string, TForValue> object from parameters, so my thinking is that parameters cannot be a map.
I have read the docs on "mapped types" but it was not helpful to me.
I have entered this syntax in TypeScript Playground and in my IDE (PyCharm), but neither shows any helpful completion for members of the parameters field.
124k31 gold badges279 silver badges489 bronze badges
6,9269 gold badges52 silver badges58 bronze badges
9
