UNPKG

@devcycle/js-client-sdk

Version:

The Javascript Client SDK for DevCycle

24 lines (23 loc) 1.07 kB
import { DevCycleUser, DVCFeatureSet, DVCVariableSet } from './types'; import { DVCVariable } from './Variable'; type EventHandler = (...args: any[]) => void; export declare class EventEmitter { handlers: Record<string, EventHandler[]>; constructor(); subscribe(key: string, handler: EventHandler): void; unsubscribe(key: string, handler?: EventHandler): void; emit(key: string, ...args: any[]): void; emitDebugUserSet(user: DevCycleUser): void; emitDebugUserReverted(user: DevCycleUser): void; emitInitialized(success: boolean): void; emitError(error: unknown): void; emitConfigUpdate(newVariableSet: DVCVariableSet): void; emitVariableEvaluated(variable: DVCVariable<any>): void; emitVariableUpdates(oldVariableSet: DVCVariableSet, newVariableSet: DVCVariableSet, variableDefaultMap: { [key: string]: { [defaultValue: string]: DVCVariable<any>; }; }): void; emitFeatureUpdates(oldFeatureSet: DVCFeatureSet, newFeatureSet: DVCFeatureSet): void; } export {};