UNPKG

@devcycle/js-client-sdk

Version:

The Javascript Client SDK for DevCycle

22 lines (21 loc) 928 B
import { 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; 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 {};