import { internal, LDLogger } from '@launchdarkly/js-sdk-common'; import { DataSourceStatusManager } from '../DataSourceStatusManager'; import { InitializerFactory, SynchronizerSlot } from './SourceManager'; /** * Callback invoked when the orchestrator produces a changeSet payload. */ export type DataCallback = (payload: internal.Payload) => void; /** * Configuration for the {@link FDv2DataSource} orchestrator. */ export interface FDv2DataSourceConfig { /** Ordered list of initializer factories. */ initializerFactories: InitializerFactory[]; /** Ordered list of synchronizer slots with state. */ synchronizerSlots: SynchronizerSlot[]; /** Callback to deliver payloads to the consuming layer. */ dataCallback: DataCallback; /** Status manager for reporting data source state transitions. */ statusManager: DataSourceStatusManager; /** * Getter for the current selector (basis) string. The selector is managed * externally by the consuming layer — the orchestrator reads it via this * getter and passes it through to source factories. */ selectorGetter: () => string | undefined; /** Optional logger. */ logger?: LDLogger; /** Fallback condition timeout in ms (default 120s). */ fallbackTimeoutMs?: number; /** Recovery condition timeout in ms (default 300s). */ recoveryTimeoutMs?: number; } /** * The FDv2 data source orchestrator. Coordinates initializers and * synchronizers to provide a resilient flag data pipeline. */ export interface FDv2DataSource { /** * Start the orchestration loop. Returns a promise that resolves when * initialization is complete (first basis data received or all initializers * exhausted with data). The orchestration loop continues running in the * background after the promise resolves, driving synchronizers. */ start(): Promise; /** Close the orchestrator. Stops all active sources. */ close(): void; } /** * Creates an {@link FDv2DataSource} orchestrator. */ export declare function createFDv2DataSource(config: FDv2DataSourceConfig): FDv2DataSource; //# sourceMappingURL=FDv2DataSource.d.ts.map