Let's say I have an object with example data:
const responseData = {
"results": [{
"id": 1,
"name": "Alice"
},
{
"id": 2,
"name": "Bob"
}
]
}
To extract the type of this object, we can do the following:
type ResponseType = typeof responseData;
The issue is that when compiling the .ts file, the example data is unnecessarily exported as well.
I only require the type information during compile time and don't need the actual example data. Is there a solution to avoid exporting the example data?