import { DataSourceErrorKind } from '@launchdarkly/js-sdk-common'; import LDEmitter from '../LDEmitter'; import DataSourceStatus, { type DataSourceState } from './DataSourceStatus'; /** * Tracks the current data source status and emits updates when the status changes. */ export interface DataSourceStatusManager { readonly status: DataSourceStatus; /** * Requests the manager move to the provided state. This request may be ignored * if the current state cannot transition to the requested state. * @param state that is requested */ requestStateUpdate(state: DataSourceState): void; /** * Reports a datasource error to this manager. Since the {@link DataSourceStatus} includes error * information, it is possible that that a {@link DataSourceStatus} update is emitted with * the same {@link DataSourceState}. * * @param kind of the error * @param message for the error * @param statusCode of the error if there was one * @param recoverable to indicate that the error is anticipated to be recoverable */ reportError(kind: DataSourceErrorKind, message: string, statusCode?: number, recoverable?: boolean): void; } export declare function createDataSourceStatusManager(emitter: LDEmitter, timeStamper?: () => number): DataSourceStatusManager; export default DataSourceStatusManager; //# sourceMappingURL=DataSourceStatusManager.d.ts.map