I have array of object like this:
export const EXAMPLE_CONFIG: IExampleConfig = [
{
urlPath: '/test/test',
page: 'test',
fields: {
fullName: 'a',
mobilePhoneNumber: 'b',
emailAddress: 'c',
.......
}
},
{
... same as above
},
]
And i create an interface like this:
export interface IExampleConfig {
path: string;
pageTitle: string;
fields: { [key: string]: string };
}
It gives me error: Type '({ path: string; pageTitle: string; fields: { fullName: string; mobilePhoneNumber: string; emailAddress: string; emailIsOwn: string; mediasource: string; }; } | { path: string; pageTitle: string; fields: { ...; }; } | ... 7 more ... | { ...; })[]' is missing the following properties from type 'IExampleConfig': path, pageTitle, fields
EXAMPLE_CONFIG: IExampleConfig->EXAMPLE_CONFIG: IExampleConfig[]to specify an array