UNPKG

kinde-angular

Version:

Angular wrapper for the Kinde TypeScript SDK

36 lines (35 loc) 1.74 kB
import { OnDestroy } from '@angular/core'; import { Observable } from "rxjs"; import { KindeClient } from "./interfaces/kinde-client.interface"; import { AuthStateService } from "./auth-state.service"; import { ClaimTokenType, FlagType, GetFlagType, RegisterURLOptions, UserType } from "@kinde-oss/kinde-typescript-sdk"; import { IClaim } from "./interfaces/claim.interface"; import { Location } from "@angular/common"; import * as i0 from "@angular/core"; export declare class KindeAngularService implements OnDestroy { private kindeClient; private document; private location; private authState; private unsubscribe$; user$: Observable<UserType | null>; isAuthenticated$: Observable<boolean>; isLoading$: Observable<boolean>; accessToken$: Observable<string | null>; constructor(kindeClient: KindeClient | null, document: Document, location: Location, authState: AuthStateService); ngOnDestroy(): void; getClaim<T>(claim: string, type?: ClaimTokenType): Observable<IClaim<T> | null>; getUserOrganizations(): Observable<{ orgCodes: string[]; }>; getAccessToken(): Promise<string>; getFeatureFlag(code: string, defaultValue?: string | number | boolean | undefined, flagType?: keyof FlagType): Promise<GetFlagType>; getFeatureFlagEnabled(code: string, defaultValue?: boolean | undefined): Promise<boolean>; login(options?: RegisterURLOptions): Promise<void>; logout(): Promise<void>; register(options?: RegisterURLOptions): Promise<void>; private shouldHandleCallback; handleCallback(): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<KindeAngularService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<KindeAngularService>; }