NiGhMa
NiGhMa

Reputation: 121

Typescript const name and interface - how to implements?

export declare const TerminalWidgetOptions; unique synbol;
export interface TerminalWidgetOptions {
    endpoint: Endpoint.Options,
    id: string,
    caption: string,
    label: string
    destroyTermOnClose: boolean
}

With this code when I create a class implementing this interface, I get an error : error TS2507: Type 'unique symbol' is not a constructor function type.

I don't understand why TypeScript doesn't see the interface.

Is someone could explain me ?

Upvotes: 0

Views: 1087

Answers (1)

glavigno
glavigno

Reputation: 503

Did you try to declare it before defining and exporting it ?

declare const TerminalWidgetOptions: unique symbol;

export interface TerminalWidgetOptions {
    endpoint: Endpoint.Options;
    id: string;
    caption: string;
    label: string;
    destroyTermOnClose: boolean;
}

I referred to the official documentation.

Upvotes: 1

Related Questions