I have an object that is used in many parts of my code so I want to export it as an interface. My object is like this :
trueFalse: {'itemList' : Array<{'text'; 'value'}>} = {
itemList: [
{text: 'foundItem', value: true},
{text: 'foundItem', value: false}
]
};
I tried to import it this way but it doesn't work :
export interface ITrueFalse {
text: string = 'foundItem',
value: boolean
itemList: Array<{'text';'value'}>
}
I want to implement the above interface in some way like this:
trueFalse: {'itemList' : ITrueFalse} = {
itemList : [{},{}]
;
As you can see I don't have much idea of typescript interfaces. I've only done basic type definition. So I don't know what I'm doing wrong. Thank you for any suggestions :)