I have this in my list.json
[{"id": "1", "qty": 1}]
I call it via fetch
async function fetchPlaces() {
let response = await fetch(`./data/list.json`);
response = await response.json();
}
how can make the response same type as the interface?
IList {
id: string,
qty: number
}
I tried response = await response.json() as IList[] it doesn't work