While you can't convert a type into an array. There are ways to create an array and confirm if all the possible values of myType exist in it. By doing: stackoverflow.com/questions/60131681/…
The reason why I need this is, there is an automated tool that extracts possible types from a data object from our API as a ts interface, and I would like to create a generic filtering tool for a table in the UI by mapping the values to checkbox. I am open to ideas.
Your automated tool should generate JavaScript code (objects, arrays, ...) instead of TypeScript interfaces. Note that this JavaScript code could be typed with TypeScript, the important thing is that they should contain runtime constructs and not simply TypeScript types
Thank you, however I have no authority over that utility. I guess I have to enforce all types exist in an array with what @zecuria had suggested, and hope that I did not hurt feelings of future developers.
myTypeexist in it. By doing: stackoverflow.com/questions/60131681/…