I am currently using JavaScript to create an object and would like to include an interface for the data:
JavaScript:
const childGroups: Children = {};
childGroups.children = [];
// Adding some data
childGroups.children.push(children);
Interface:
export interface Child {
ClusterPoint
}
export interface Children {
children: {
[key: number]: Child
}
}
I am encountering the following errors:
The property 'children' is missing in type '{}' but required in type 'Children'. The property 'push' does not exist on type {[key: number]: Child}
The data appears as follows:
https://i.sstatic.net/B90FX.png
Any assistance would be greatly appreciated.
Update
Credit goes to Nikita Madeev, as I was able to make it work with this solution:
export interface Child {
children: {
ClusterPoint
};
}
export interface Children {
children: Child[];
}