import { Context, Crypto, Encoding, LDHeaders, LDLogger, Requests, ServiceEndpoints, Storage } from '@launchdarkly/js-sdk-common'; import { InitializerEntry, SynchronizerEntry } from '../api/datasource'; import { DataSourcePaths } from './DataSourceConfig'; import { FDv2Requestor } from './fdv2/FDv2Requestor'; import { InitializerFactory, SynchronizerSlot } from './fdv2/SourceManager'; /** * Context needed to create concrete initializer/synchronizer factories * for a given identify call. Built once per identify and reused across * mode switches. */ export interface SourceFactoryContext { /** The FDv2 requestor for polling requests. */ requestor: FDv2Requestor; /** Platform request abstraction. */ requests: Requests; /** Platform encoding abstraction. */ encoding: Encoding; /** Service endpoint configuration. */ serviceEndpoints: ServiceEndpoints; /** Default HTTP headers. */ baseHeaders: LDHeaders; /** Query parameters for requests (e.g., auth, secure mode hash). */ queryParams: { key: string; value: string; }[]; /** JSON-serialized evaluation context. */ plainContextString: string; /** Logger. */ logger: LDLogger; /** Polling-specific configuration. */ polling: { /** The polling endpoint paths. */ paths: DataSourcePaths; /** Default poll interval in seconds. */ intervalSeconds: number; }; /** Streaming-specific configuration. */ streaming: { /** The streaming endpoint paths. */ paths: DataSourcePaths; /** Default initial reconnect delay in seconds. */ initialReconnectDelaySeconds: number; }; /** Platform storage for reading cached data. */ storage: Storage | undefined; /** Platform crypto for computing storage keys. */ crypto: Crypto; /** Environment namespace (hashed SDK key). */ environmentNamespace: string; /** The context being identified. */ context: Context; } /** * Converts declarative {@link InitializerEntry} and {@link SynchronizerEntry} * descriptors from the mode table into concrete {@link InitializerFactory} * and {@link SynchronizerSlot} instances that the {@link FDv2DataSource} * orchestrator can use. */ export interface SourceFactoryProvider { /** * Create an initializer factory from an initializer entry descriptor. * Returns `undefined` if the entry type is not supported. */ createInitializerFactory(entry: InitializerEntry, ctx: SourceFactoryContext): InitializerFactory | undefined; /** * Create a synchronizer slot from a synchronizer entry descriptor. * Returns `undefined` if the entry type is not supported. */ createSynchronizerSlot(entry: SynchronizerEntry, ctx: SourceFactoryContext): SynchronizerSlot | undefined; } /** * Creates a {@link SourceFactoryProvider} that handles `cache`, `polling`, * and `streaming` data source entries. */ export declare function createDefaultSourceFactoryProvider(): SourceFactoryProvider; //# sourceMappingURL=SourceFactoryProvider.d.ts.map