Check out example codes for "indexable type in ts". It will help you in understanding the concepts better.
Code Example 1
//Indexable type Typescript
interface ListItem {
[prop: string ] : string | number ;
}
const List: ListItem = {
name: "joyous jackal" ;
email: "[email protected]";
age: 21 ;
}
Learn ReactJs, React Native from akashmittal.com