import { LDLogger } from '@launchdarkly/js-sdk-common'; type FlagChangeKey = `change:${string}`; /** * Type for name of emitted events. 'change' is used for all flag changes. 'change:flag-name-here' is used * for specific flag changes. */ export type EventName = 'change' | FlagChangeKey | 'dataSourceStatus' | 'error' | 'initialized' | 'ready'; /** * Implementation Note: There should not be any default listeners for change events in a client * implementation. Default listeners mean a client cannot determine when there are actual * application developer provided listeners. If we require default listeners, then we should add * a system to allow listeners which have counts independent of the primary listener counts. */ export default class LDEmitter { private _logger?; private _listeners; constructor(_logger?: LDLogger | undefined); on(name: EventName, listener: Function): void; /** * Unsubscribe one or all events. * * @param name * @param listener Optional. If unspecified, all listeners for the event will be removed. */ off(name: EventName, listener?: Function): void; private _invokeListener; emit(name: EventName, ...detail: any[]): void; eventNames(): string[]; listenerCount(name: EventName): number; } export {}; //# sourceMappingURL=LDEmitter.d.ts.map