Consider the following code:
type PredefinedStrings = 'test' | 'otherTest';
interface MyObject {
type: string | PredefinedStrings;
}
The MyObject interface should have a single type property, which could be either one of the PredefinedStrings or a string that was defined somewhere along the line by the developer.
What I would like to achieve with this, is to let the developer type in any string as the type property (this is achieved by the above code), BUT also show the predefined types as an IntelliSense suggestion when starting to provide the value for the type property.
Is there any way to achieve both of the above requirements?