I am in need of creating an interface to represent data received from the server, where the id
is a number and all other properties are strings.
This is what I attempted:
interface AnyChartsData {
id: number;
[key: string]: string;
}
However, I encountered this error:
[ts] Property 'id' of type 'number' is not assignable to string index type 'string'. [2411]
How do I correctly define this interface?