feature-toggle-client
Version:
feature-toggle-client
30 lines (29 loc) • 1.42 kB
TypeScript
import { Application } from './types/Application';
import { LDClient, LDOptions } from 'launchdarkly-js-client-sdk';
import { UserAccount } from './types/UserAccount';
import { Contract } from './types/Contract';
export declare class FeatureToggleClientService {
private static instance;
private userInstance;
private applicationInstance;
private multiContextInstance?;
private requestTimeout;
private constructor();
getUserInstance(): LDClient;
getApplicationInstance(): LDClient;
getMultiContextInstance(): LDClient;
setRequestTimeouts(timeout: number): void;
static getInstance(): FeatureToggleClientService;
initializeUser(payload: UserAccount, ldclientSdkKey: string, options?: LDOptions): void;
initializeApplication(payload: Application, ldclientSdkKey: string, options?: LDOptions): void;
initializeWithContext(ldclientSdkKey: string, contexts: {
user?: UserAccount;
application?: Application;
contract?: Contract;
}, 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>;
isMultiContextFeatureEnabled(featureKey: string, defaultValue?: boolean): Promise<any>;
}