I'm attempting to extract all defined types from a variable in a constructor.
export interface TestType {
resultType?: 'NUMBER' | 'STRING' | 'DATE' | 'ENUM' | 'AMOUNT' ;
}
My expectation is to achieve something like this.
const types: string[] = ['NUMBER', 'STRING', 'DATE', 'ENUM', 'AMOUNT'];
Is there a way or function to accomplish this without changing the constructor?
I am trying to automate the process of extracting all types so that I can select them easily.
Here is an example showing it may not be possible.
Any thoughts on similar solutions?
Currently, I am using Typescript version 4.0.5
Thank you.