How can I represent the following javascript object as an interface: I did try using http://json2ts.com/, however did not give a clean and dynamic interface. Hence, I do not want the id/codes (i.e. 6000, 6001, 6002) to be present in the interface.
{
"6000": {
"id": 6000,
"type": "text",
"subType": "tileDynamicSection",
"title": "Title 1",
"description": "Description 1",
"imageUrl": "https://prod.assets.domain.com/uploads/myimage.jpg"
},
"6001": {
"id": 6001,
"type": "text",
"subType": "tileDynamicSection",
"title": "Title 2",
"description": "Description 2",
"imageUrl": "https://prod.assets.domain.com/uploads/myimage.jpg"
},
"6002": {
"id": 6002,
"type": "text",
"subType": "tileDynamicSection",
"title": "Title 3",
"description": "Description 3",
"imageUrl": "https://prod.assets.domain.com/uploads/myimage.jpg"
}
}
export interface Images {
[key: string]: {
id: number;
type: string;
subType: string;
title: string;
description: string;
imageUrl: string;
}
}