import { ConfigSpec } from './ConfigSpec'; import { EvaluationReason } from './EvaluationReason'; import { ExplicitStatsigOptions } from './StatsigOptions'; import { IDList } from './utils/IDListUtil'; import { InitializeContext } from './utils/StatsigContext'; import StatsigFetcher from './utils/StatsigFetcher'; export type ConfigStore = { gates: Record; configs: Record; idLists: Record; layers: Record; experimentToLayer: Record; promptConfigs?: Record; }; export type AIConfig = { promptVersionIds: string[]; targetAppIDs: string[]; }; export type APIEntityNames = { gates: string[]; configs: string[]; }; type SessionReplayTrigger = { sampling_rate?: number; values?: string[]; }; type SessionReplayInfo = { sampling_rate?: number; targeting_gate?: string; recording_blocked?: boolean; session_recording_event_triggers?: Record; session_recording_exposure_triggers?: Record; }; export default class SpecStore { private initReason; private rulesUpdatedCallback; private initialUpdateTime; private lastUpdateTime; private store; private rulesetsSyncInterval; private idListsSyncInterval; private disableRulesetsSync; private disableIdListsSync; private initialized; private hashedSDKKey; private rulesetsSyncTimer; private idListsSyncTimer; private rulesetsSyncTimerLastActiveTime; private idListsSyncTimerLastActiveTime; private rulesetsSyncPromise; private idListsSyncPromise; private fetcher; private dataAdapter; private rulesetsSyncFailureCount; private idListsSyncFailureCount; private getIDListCallCount; private bootstrapValues; private initStrategyForIDLists; private clientSDKKeyToAppMap; private hashedClientSDKKeyToAppMap; private hashedSDKKeysToEntities; private primaryTargetAppID; private networkOverrideFunc; private defaultEnvironemnt; private sessionReplayInfo; constructor(secretKey: string, fetcher: StatsigFetcher, options: ExplicitStatsigOptions); getInitReason(): EvaluationReason; getInitialUpdateTime(): number; getLastUpdateTime(): number; getGate(gateName: string): ConfigSpec | null; getConfig(configName: string): ConfigSpec | null; getLayer(layerName: string): ConfigSpec | null; getExperimentLayer(experimentName: string): string | null; getPromptSet(aiConfigName: string): Record[] | null; getIDList(listName: string): IDList | null; getAllGates(): Record; getAllConfigs(): Record; getAllLayers(): Record; getClientKeyToAppMap(): Record; getHashedClientKeyToAppMap(): Record; getHashedSDKKeysToEntities(): Record; getPrimaryTargetAppID(): string | null; getDefaultEnvironment(): string | null; getSessionReplayInfo(): SessionReplayInfo | null; init(ctx: InitializeContext): Promise; private _initIDLists; resetSyncTimerIfExited(): Error | null; isServingChecks(): boolean; private _fetchConfigSpecsFromServer; private _fetchConfigSpecsFromAdapter; private _saveConfigSpecsToAdapter; private pollForUpdates; private logDiagnostics; syncConfigSpecs(): Promise; syncIdLists(): Promise; private _process; /** * Returns a reverse mapping of layers to experiment (or vice versa) */ private _reverseLayerExperimentMapping; private syncIdListsFromDataAdapter; private syncIdListsFromNetwork; private genFetchIDList; shutdown(): void; shutdownAsync(): Promise; private clearRulesetsSyncTimer; private clearIdListsSyncTimer; private clearTimers; private setInitialUpdateTime; } export {};