I am trying to implement nativescript-oauth2 with IdentityServer 4 so I am trying to implement a custom provider but I am getting a compilation error as follows:
Property 'providerType' in type 'TnsOaProviderMyProvider' is not assignable to the same property in base type 'TnsOaProvider'. Type '"MyProvider"' is not assignable to type 'TnsOaProviderType'
import { TnsOaProvider, TnsOaProviderOptions, OpenIdSupportFull, TnsOaProviderType } from "nativescript-oauth2/providers/providers";
import { ITnsOAuthTokenResult } from "nativescript-oauth2";
export declare type ProviderTypeMyProvider = "MyProvider";
export interface TnsOaProviderOptionsMyProvider extends TnsOaProviderMyProvider {}
export declare class TnsOaProviderMyProvider implements TnsOaProvider {
options: TnsOaProviderOptions;
openIdSupport: OpenIdSupportFull;
providerType: ProviderTypeMyProvider;
authority: string;
tokenEndpointBase: string;
authorizeEndpoint: string;
tokenEndpoint: string;
cookieDomains: string[];
constructor(options: TnsOaProviderOptionsMyProvider);
parseTokenResult(jsonData: any): ITnsOAuthTokenResult;
}
Any idea how to extend the TnsOaProviderType which is defined as follows:
export type TnsOaProviderType =
| ProviderTypeFacebook
| ProviderTypeGoogle
| ProviderTypeMicrosoft
| ProviderTypeLinkedIn;