Is there any way to define a dynamic object type in TypeScript? In the following example, I would like to define a type for "My Complex Type" by saying:
Objects of type "My Complex Type" are objects having "any number of properties" but the values of those properties must be of type IValue.
// value interface
interface IValue {
prop:string
}
// My Complex Type
myType = {
field1:IValue
field2:IValue
.
.
.
fieldN:IValue
}
// Using My Complex Type
interface SomeType {
prop:My Complex Type
}
string->IValue?