Today, I tried to do this in my angular 6 application:
export interface AuthConfig {}
export interface BasicAuthConfig extends AuthConfig {
username: string;
password: string;
}
export interface OAuth2AuthConfig extends AuthConfig {
tokenName: string;
url: string;
callbackUrl: string;
clientId: string;
scope: string[];
grantType: grantTypes;
}
And got a lint error:
An empty interface is equivalent to `{}`. (no-empty-interface)
I wanted to do this with my Endpoint interface:
Export interface Endpoint {
…
authConfig: AuthConfig;
…
}
But was reduced to doing this:
Export interface Endpoint {
…
authConfig: BasicAuthConfig | OAuth2AuthConfig;
…
}
The different types of authorization could get lengthy so I don’t want to keep tacking on the types to the authConfig property of the Endpoint interface. Is there any way to declare an empty interface for the purpose of extending it without lint yelling at me?
Thanks.