UNPKG

feature-toggle-client

Version:

feature-toggle-client

21 lines (20 loc) 1.02 kB
import { Application } from './types/Application'; import { LDClient, LDOptions } from 'launchdarkly-js-client-sdk'; import { UserAccount } from './types/UserAccount'; export declare class FeatureToggleClientService { private static instance; private userInstance; private applicationInstance; private requestTimeout; private constructor(); getUserInstance(): LDClient; getApplicationInstance(): LDClient; setRequestTimeouts(timeout: number): void; static getInstance(): FeatureToggleClientService; initializeUser(payload: UserAccount, ldclientSdkKey: string, options?: LDOptions): void; initializeApplication(payload: Application, ldclientSdkKey: string, options?: LDOptions): void; private solveRequestWithTimeout; isFeatureEnabled(featureKey: string, defaultValue?: boolean): Promise<any>; isUserFeatureEnabled(featureKey: string, defaultValue?: boolean): Promise<any>; isApplicationFeatureEnabled(featureKey: string, defaultValue?: boolean): Promise<any>; }