We are currently using typescript version 2.9.2
I encountered an issue while trying to extend the interface DropDownOption. I received the error "error TS2312: An interface may only extend a class or another interface."
Is there an alternate approach to defining this that does not involve using types so that it remains a pure interface and can still be extended?
export interface BaseDropdownOption {
id: string;
}
export interface ValueDropdownOption extends BaseDropdownOption {
value: string;
template?: never;
}
export interface TemplateDropdownOption extends BaseDropdownOption {
template: TemplateRef<any>;
value?: never;
}
export type DropdownOption = ValueDropdownOption | TemplateDropdownOption;
For instance, the following snippet results in the aforementioned error:
export interface DropdownOptionWithPayload extends DropdownOption {
payload: any
name: string
}