I have encountered an issue while referencing a custom type in Typescript that has left me puzzled. Despite my background in c#, I am facing difficulty using the correct syntax to reference the custom type. Here is my current setup:
export type MyCustomeType=
'text1' |
'text2' |
'text3';
export class MyCustomeTypeUtils {}
Within my component, I have declared variables of this custom type:
var1 : MyCustomeType;
Strangely, the only way I can assign a value to var1 is by explicitly providing the string value like so:
var1 = 'text1'
Attempting to assign a value using the type reference itself such as:
var1 = MyCustomeType.0
or
var1 = MyCustomeType.text1
results in an error indicating that it couldn't find the name MyCustomeType. Any assistance on resolving this would be highly appreciated.