UNPKG

@launchdarkly/js-sdk-common

Version:
22 lines 1.01 kB
export declare enum DataSourceState { Valid = 0, Initializing = 1, Interrupted = 2, Closed = 3 } export interface DataSource { /** * May be called any number of times, if already started, has no effect * @param dataCallback that will be called when data arrives, may be called multiple times. * @param statusCallback that will be called when data source state changes or an unrecoverable error * has been encountered. * @param selectorGetter that can be invoked to provide the FDv2 selector/basis if one exists */ start(dataCallback: (basis: boolean, data: any) => void, statusCallback: (status: DataSourceState, err?: any) => void, selectorGetter?: () => string | undefined): void; /** * May be called any number of times, if already stopped, has no effect. Datasource will not make any additional callbacks after stop returns. */ stop(): void; } export type LDDataSourceFactory = () => DataSource; //# sourceMappingURL=DataSource.d.ts.map