One of my abstract classes includes a static property with various properties, where default
is consistently named while the others may have random names.
public static data = {
default: { //only this one always have 'dafault' name
name: 'someName',
category: ['cat 1','cat2','catN'],
urls: ['url1', 'url2']
},
property1: { //can have any random name 'property3' 'xyz'
name: 'property1',
category: ['cat 3','cat4','cat1'],
urls: ['url3', 'url5']
},
anotherThing: { //can have any random name 'oneMoreThing' 'abc'
name: 'anotherThing',
category: ['cat 2','catN','cat5'],
urls: ['url5', 'url2']
}
};
I am looking to enforce strict typing for this property in order to improve error validation. How would you define this structure using a TypeScript interface?