//#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ParamStoreTypes.d.ts type ParamType = 'string' | 'boolean' | 'number' | 'array' | 'object'; type RefType = 'gate' | 'gated_value' | 'static' | 'layer' | 'dynamic_config' | 'experiment'; type StaticParam = { ref_type: 'static'; } & ({ param_type: 'boolean'; value: boolean; } | { param_type: 'number'; value: number; } | { param_type: 'string'; value: string; } | { param_type: 'object'; value: object; } | { param_type: 'array'; value: unknown[]; }); type GateParam = { ref_type: 'gate'; gate_name: string; } & ({ param_type: 'boolean'; pass_value: boolean; fail_value: boolean; } | { param_type: 'number'; pass_value: number; fail_value: number; } | { param_type: 'string'; pass_value: string; fail_value: string; } | { param_type: 'object'; pass_value: object; fail_value: object; } | { param_type: 'array'; pass_value: unknown[]; fail_value: unknown[]; }); type Param = { ref_type: R; param_type: T; }; type LayerParam = Param<'layer', ParamType> & { layer_name: string; param_name: string; }; type DynamicConfigParam = Param<'dynamic_config', ParamType> & { config_name: string; param_name: string; }; type ExperimentParam = Param<'experiment', ParamType> & { experiment_name: string; param_name: string; }; type AnyParam = GateParam | StaticParam | LayerParam | DynamicConfigParam | ExperimentParam; type ParamStoreConfig = { [param_name: string]: AnyParam | undefined; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/TypingUtils.d.ts type Flatten = { [K in keyof T]: T[K]; } & {}; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigTypes.d.ts type TypedGet = (key: string, fallback?: T) => TypedReturn; type TypedReturn = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Array ? Array : T extends object ? object : unknown; type FeatureGate = Flatten<{ readonly name: string; readonly ruleID: string; readonly details: EvaluationDetails; readonly value: boolean; readonly idType: string | null; readonly __evaluation: GateEvaluation | null; }>; type Experiment = Flatten<{ readonly name: string; readonly ruleID: string; readonly details: EvaluationDetails; readonly value: Record; readonly groupName: string | null; readonly idType: string | null; readonly __evaluation: ExperimentEvaluation | null; readonly get: TypedGet; }>; type DynamicConfig = Flatten>; type Layer = Flatten<{ readonly name: string; readonly ruleID: string; readonly details: EvaluationDetails; readonly groupName: string | null; readonly __value: Record; readonly __evaluation: LayerEvaluation | null; get: TypedGet; }>; type ParameterStore = Flatten<{ readonly name: string; readonly details: EvaluationDetails; readonly get: TypedGet; readonly __configuration: ParamStoreConfig | null; }>; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/Log.d.ts declare const LogLevel: { readonly None: 0; readonly Error: 1; readonly Warn: 2; readonly Info: 3; readonly Debug: 4; }; type LogLevel = (typeof LogLevel)[keyof typeof LogLevel]; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/NetworkConfig.d.ts declare const Endpoint: { readonly _initialize: "initialize"; readonly _rgstr: "rgstr"; readonly _download_config_specs: "download_config_specs"; }; type Endpoint = (typeof Endpoint)[keyof typeof Endpoint]; type NetworkPriority = 'high' | 'low' | 'auto'; type NetworkArgs = RequestInit & { priority?: NetworkPriority; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationOptions.d.ts type EvaluationOptionsCommon = { /** * Prevents an exposure log being created for this check. * * default: `false` */ disableExposureLog?: boolean; }; type FeatureGateEvaluationOptions = EvaluationOptionsCommon & {}; type DynamicConfigEvaluationOptions = EvaluationOptionsCommon & {}; type ExperimentEvaluationOptions = EvaluationOptionsCommon & { /** * Provide a map of values to be used across checks * * @requires {@link @statsig/js-user-persisted-storage} * @see {@link https://docs.statsig.com/client/concepts/persistent_assignment#example-usage} */ userPersistedValues?: unknown; }; type LayerEvaluationOptions = EvaluationOptionsCommon & { /** * Provide a map of values to be used across checks * * @requires {@link @statsig/js-user-persisted-storage} * @see {@link https://docs.statsig.com/client/concepts/persistent_assignment#example-usage} */ userPersistedValues?: unknown; }; type ParameterStoreEvaluationOptions = EvaluationOptionsCommon & {}; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/OverrideAdapter.d.ts type OverrideAdapter = { getGateOverride?(current: FeatureGate, user: StatsigUser, options?: FeatureGateEvaluationOptions): FeatureGate | null; getDynamicConfigOverride?(current: DynamicConfig, user: StatsigUser, options?: DynamicConfigEvaluationOptions): DynamicConfig | null; getExperimentOverride?(current: Experiment, user: StatsigUser, options?: ExperimentEvaluationOptions): Experiment | null; getLayerOverride?(current: Layer, user: StatsigUser, options?: LayerEvaluationOptions): Layer | null; getParamStoreOverride?(current: ParameterStore, options?: ParameterStoreEvaluationOptions): { config: ParamStoreConfig; details: EvaluationDetails; } | null; loadFromStorage?(): void | Promise; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StorageProvider.d.ts type StorageProvider = { isReady: () => boolean; isReadyResolver: () => Promise | null; getProviderName: () => string; getItem: (key: string) => string | null; setItem: (key: string, value: string) => void; removeItem: (key: string) => void; getAllKeys: () => readonly string[]; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigOptionsCommon.d.ts /** Options that can be set at init and updated during runtime. */ type StatsigRuntimeMutableOptions = { /** * Prevents sending any events over the network. * @deprecated Set {@link StatsigRuntimeMutableOptions.loggingEnabled} to "disabled" instead */ disableLogging?: boolean; /** * Controls when to enable or disable logging: * - "disabled": Prevents sending any events over the network. * - "browser-only": Only sends events in browser environments. * - "always": Skip browser checks and always logs events * * @default "browser-only" */ loggingEnabled?: LoggingEnabledOption; /** * Prevents writing anything to storage. * * Note: caching will not work if storage is disabled */ disableStorage?: boolean; /** * @deprecated Use `logEventCompressionMode` instead. * Whether or not Statsig should compress JSON bodies for network requests where possible. * * default: `false` */ disableCompression?: boolean; /** * Opt in cookie usage. */ enableCookies?: boolean; /** * Controls JSON body compression for network requests. * - `disabled`: Never compress * - `enabled`: Compress unless using a proxy * - `forced`: Always compress, even with a proxy * * default: `enabled` */ logEventCompressionMode?: LogEventCompressionMode; }; type NetworkConfigCommon = { /** * The API to use for all SDK network requests. You should not need to override this * unless you have a custom API that implements the Statsig endpoints. */ api?: string; /** * The URL used to flush queued events via a POST request. Takes precedence over {@link StatsigOptionsCommon.api}. * * default: `https://prodregistryv2.org/v1/rgstr` */ logEventUrl?: string; /** * The URL used to report SDK exceptions via a POST request. * * default: `https://statsigapi.net/v1/sdk_exception` */ sdkExceptionUrl?: string; /** * A list of URLs to try if the primary logEventUrl fails. */ logEventFallbackUrls?: string[]; /** * Overrides the default networking layer used by the Statsig client. * By default, the client use `fetch`, but overriding this * you could use `axios` or raw `XMLHttpRequest` * * default: `Fetch API` * * @param {string} url Where the request is going. * @param {NetworkArgs} args Configuration for the network request. * @returns {Response} */ networkOverrideFunc?: (url: string, args: NetworkArgs) => Promise; /** * The maximum amount of time (in milliseconds) that any network request can take * before timing out. * * default: `10,000 ms` (10 seconds) */ networkTimeoutMs?: number; /** * Intended for testing purposes. Prevents any network requests being made. */ preventAllNetworkTraffic?: boolean; }; /** Options for configuring a Statsig client. */ type StatsigOptionsCommon = StatsigRuntimeMutableOptions & { /** * When true, the SDK will not generate a stableID for the user. Useful when bootstrapping from a server without a StableID. * * default: `false` */ disableStableID?: boolean; /** * Whether or not Statsig should use raw JSON for network requests where possible. * * default: `false` */ disableStatsigEncoding?: boolean; /** * An object you can use to set environment variables that apply to all of your users * in the same session. */ environment?: StatsigEnvironment; /** * (Web only) Should the 'current page' url be included with logged events. * * default: true */ includeCurrentPageUrlWithEvents?: boolean; /** * How much information is allowed to be printed to the console. * * default: {@link LogLevel.Warn} */ logLevel?: LogLevel; /** * The maximum number of events to batch before flushing logs to Statsig. * * default: `100` */ loggingBufferMaxSize?: number; /** * @deprecated The event logger now has built in flush timing. */ loggingIntervalMs?: number; /** * Allows for fine grained control over which api or urls are hit for specific Statsig network requests. * * For defaults see {@link StatsigClientUrlOverrideOptions} */ networkConfig?: NetworkConfig; /** * An implementor of {@link OverrideAdapter}, used to alter evaluations before its * returned to the caller of a check api (checkGate/getExperiment etc). */ overrideAdapter?: OverrideAdapter; /** * Overrides the auto-generated SessionID with the provided string. * * Note: Sessions still expire and will be replaced with an auto-generated SessionID. */ initialSessionID?: string; /** * Swaps out the storage layer used by the SDK. * * default: `window.localStorage` on Web. `@react-native-async-storage/async-storage` on Mobile. */ storageProvider?: StorageProvider; /** * Disables all memoization of the core evaluation functions. * * default: `false` */ disableEvaluationMemoization?: boolean; }; type AnyStatsigOptions = StatsigOptionsCommon; type StatsigEnvironment = { tier?: string; [key: string]: string | undefined; }; declare const LogEventCompressionMode: { /** Do not compress request bodies */ readonly Disabled: "d"; /** Compress request bodies unless a network proxy is configured */ readonly Enabled: "e"; /** Always compress request bodies, even when a proxy is configured */ readonly Forced: "f"; }; type LogEventCompressionMode = (typeof LogEventCompressionMode)[keyof typeof LogEventCompressionMode]; declare const LoggingEnabledOption: { readonly disabled: "disabled"; readonly browserOnly: "browser-only"; readonly always: "always"; }; type LoggingEnabledOption = (typeof LoggingEnabledOption)[keyof typeof LoggingEnabledOption]; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigUser.d.ts type StatsigUserPrimitives = string | number | boolean | Array | undefined; type StatsigUser = { userID?: string; customIDs?: { [key: string]: string | undefined; stableID?: string; }; email?: string; ip?: string; userAgent?: string; country?: string; locale?: string; appVersion?: string; custom?: Record; privateAttributes?: Record | null; analyticsOnlyMetadata?: Record; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigEvent.d.ts type StatsigEvent = { eventName: string; value?: string | number | null; metadata?: { [key: string]: string | undefined; } | null; }; type BootstrapMetadata = { generatorSDKInfo?: Record; lcut?: number; user?: Record; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationTypes.d.ts type EvaluationBase = { id_type: string; name: string; rule_id: string; secondary_exposures: SecondaryExposure[] | string[]; value: T; version?: string; }; type SecondaryExposure = { gate: string; gateValue: string; ruleID: string; }; type GateEvaluation = EvaluationBase; type ExperimentEvaluation = Flatten> & { group_name?: string; group: string; id_type: string; is_device_based: boolean; is_experiment_active?: boolean; is_user_in_experiment?: boolean; passed?: boolean; is_in_layer?: boolean; explicit_parameters?: string[]; }>; type DynamicConfigEvaluation = ExperimentEvaluation; type LayerEvaluation = Flatten & { allocated_experiment_name: string; explicit_parameters: string[]; undelegated_secondary_exposures?: SecondaryExposure[] | string[]; parameter_rule_ids?: Record; }>; type EvaluationDetails = { reason: string; lcut?: number; receivedAt?: number; warnings?: StatsigWarnings[]; bootstrapMetadata?: BootstrapMetadata; }; type StatsigWarnings = 'PartialUserMatch' | 'StableIDMismatch' | 'MultipleInitializations' | 'NoCachedValues'; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationTypesV2.d.ts type GateEvaluationV2 = { v?: true; r?: string | null; i?: string; s?: string[]; }; type ExperimentEvaluationV2 = { r: string; v: string; gn?: string | null; i?: string; s?: string[]; ue?: true; ea?: true; p?: true; }; type DynamicConfigEvaluationV2 = ExperimentEvaluationV2; type LayerEvaluationV2 = { r: string; v: string; gn?: string | null; i?: string; s?: string[]; us?: string[]; ue?: true; ea?: true; ep?: string[]; ae?: string; pr?: Record; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/InitializeResponse.d.ts type SessionReplayFields = { can_record_session?: boolean; recording_blocked?: boolean; session_recording_rate?: number; passes_session_recording_targeting?: boolean; session_recording_event_triggers?: Record; session_recording_exposure_triggers?: Record; session_recording_privacy_settings?: SessionReplayPrivacySettings; }; type SessionReplayTrigger = { values?: string[]; passes_sampling?: boolean; }; type SessionReplayPrivacySettings = { privacy_mode?: 'min' | 'input' | 'max'; unmasked_elements?: string[]; masked_elements?: string[]; blocked_elements?: string[]; }; type AutoCaptureFields = { auto_capture_settings?: { disabled_events: Record; }; }; type InitResponseCommon = SessionReplayFields & AutoCaptureFields & { param_stores?: Record; time: number; has_updates: true; hash_used: 'none' | 'sha256' | 'djb2'; user: StatsigUser; sdkInfo?: Record; sdkParams?: Record; generator?: string; evaluated_keys?: Record; pa_hash?: string; derived_fields?: Record; sdk_flags?: Record; full_checksum?: string; exposures?: Record; }; type InitializeResponseV1WithUpdates = InitResponseCommon & { feature_gates: Record; dynamic_configs: Record; layer_configs: Record; response_format?: 'init-v1' | null | undefined; }; type InitializeResponseV2 = InitResponseCommon & { feature_gates: Record; dynamic_configs: Record; layer_configs: Record; values: Record>; response_format: 'init-v2'; }; type ClientInitializeResponseOptions = { hash?: 'none' | 'sha256' | 'djb2'; clientSDKKey?: string; }; type AnyInitializeResponse = InitializeResponseV1WithUpdates | InitializeResponseV2; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/DownloadConfigSpecsResponse.d.ts type SessionReplayTriggerSpec = { values?: string[]; sampling_rate?: number; }; type SessionReplayInfoSpec = { recording_blocked?: boolean; sampling_rate?: number; targeting_gate?: string; session_recording_event_triggers?: Record; session_recording_exposure_triggers?: Record; session_recording_privacy_settings?: SessionReplayPrivacySettings; }; type SpecCondition = { type: string; targetValue: unknown; operator: string | null; field: string | null; additionalValues: Record | null; idType: string; }; type SpecRule = { name: string; passPercentage: number; conditions: SpecCondition[]; returnValue: unknown; id: string; salt: string; idType: string; configDelegate: string | null; isExperimentGroup?: boolean; groupName?: string; }; type Spec = { name: string; type: string; salt: string; defaultValue: unknown; enabled: boolean; idType: string; rules: SpecRule[]; entity: string; explicitParameters: string[] | null; hasSharedParams: boolean; isActive?: boolean; targetAppIDs?: string[]; version?: number; }; type ParamStore = { targetAppIDs?: string[]; parameters: ParamStoreConfig; }; type DownloadConfigSpecsResponse = { feature_gates: Spec[]; dynamic_configs: Spec[]; layer_configs: Spec[]; param_stores?: Record; layers?: Record; time: number; has_updates: boolean; sdkInfo?: Record; user?: StatsigUser; default_environment?: string; sdk_keys_to_app_ids?: Record; hashed_sdk_keys_to_app_ids?: Record; hashed_sdk_keys_to_entities?: Record; app_id?: string; session_replay_info?: SessionReplayInfoSpec; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/UrlConfiguration.d.ts type EndpointDnsKey = 'i' | 'e' | 'd'; declare class UrlConfiguration { readonly endpoint: Endpoint; readonly endpointDnsKey: EndpointDnsKey; readonly defaultUrl: string; readonly customUrl: string | null; readonly fallbackUrls: string[] | null; constructor(endpoint: Endpoint, customUrl: string | undefined | null, customApi: string | undefined | null, fallbackUrls: string[] | undefined | null); getUrl(): string; getChecksum(): string; } //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/NetworkCore.d.ts type RequestArgs = { sdkKey: string; urlConfig: UrlConfiguration; priority?: NetworkPriority; retries?: number; attempt?: number; preserveFailedStatusCode?: boolean; params?: Record; headers?: Record; credentials?: RequestCredentials; }; type DataFlags = { isStatsigEncodable?: boolean; isCompressable?: boolean; }; type RequestArgsWithData = Flatten; } & DataFlags>; type RequestFailureInfo = { path?: string; errorMessage?: string; diagnosticBucket?: string; diagnosticMetadata?: Record; }; type BeaconRequestArgs = Pick; type NetworkResponse = { body: string | null; code: number; }; declare class NetworkCore { private _emitter?; protected _errorBoundary: ErrorBoundary | null; private readonly _timeout; private readonly _netConfig; private readonly _options; private readonly _fallbackResolver; private _leakyBucket; private _lastUsedInitUrl; constructor(options: AnyStatsigOptions | null, _emitter?: StatsigClientEmitEventFunc | undefined); setLogEventCompressionMode(mode: LogEventCompressionMode): void; setErrorBoundary(errorBoundary: ErrorBoundary): void; isBeaconSupported(): boolean; getLastUsedInitUrlAndReset(): string | null; beacon(args: BeaconRequestArgs, failureInfo?: RequestFailureInfo): boolean; post(args: RequestArgsWithData, failureInfo?: RequestFailureInfo): Promise; get(args: RequestArgs): Promise; private _sendRequest; private _getLogEventCompressionMode; private _isRateLimited; private _getPopulatedURL; private _tryEncodeBody; private _tryToCompressBody; private _getInternalRequestArgs; } //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigDataAdapter.d.ts type DataSource = 'Uninitialized' | 'Loading' | 'NoValues' | 'Cache' | 'Network' | 'NetworkNotModified' | 'Bootstrap' | 'Prefetch'; type DataAdapterResult = { readonly source: DataSource; readonly data: string; readonly receivedAt: number; readonly stableID: string | null; readonly fullUserHash: string | null; }; type DataAdapterAsyncOptions = { /** * The maximum amount of time (in milliseconds) this operation is permitted to run. * If the timeout is hit, null is returned but any in-flight requests are kept alive with results going to cache for future updates. * * Note: If no timeout is given, the {@link NetworkConfigCommon.networkTimeoutMs|StatsigOptions.networkConfig.networkTimeoutMs} is used. */ readonly timeoutMs?: NetworkConfigCommon['networkTimeoutMs']; /** * The priority that should be applied to the Http request that is fired. * * @see https://developer.mozilla.org/en-US/docs/Web/API/fetch#priority * * default: 'auto' */ readonly priority?: NetworkPriority; }; /** * Describes a type that is used during intialize/update operations of a Statsig client. * * See below to find the default adapters, but know that it is possible to create your * own StatsigDataAdapter and provide it via `StatsigOptions.dataAdapter`. * * defaults: * * - {@link StatsigClient} uses {@link EvaluationsDataAdapter} * * - {@link StatsigOnDeviceEvalClient} uses {@link SpecsDataAdapter} */ type DataAdapterCommon = { /** * Called when the StatsigDataAdapter is attached to the Statsig client instance during construction. * @param {string} sdkKey The SDK key being used by the Statsig client. * @param {StatsigOptionsCommon | null} options The StatsigOptions being used by the Statsig client. */ readonly attach: (sdkKey: string, options: AnyStatsigOptions | null, network: NetworkCore) => void; }; type EvaluationsDataAdapter = DataAdapterCommon & { /** * Synchronously get evaluation data for the given user. Called during initializeSync and/or updateUserSync. * * It is also called during async update operations before StatsigDataAdapter.getDataAsync is called. * @param {StatsigUser} user The StatsigUser to get data for. * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser. */ readonly getDataSync: (user: StatsigUser) => DataAdapterResult | null; /** * Asynchronously get evaluation data for the given user. Called during initializeAsync and/or updateUserAsync. * * @param {DataAdapterResult | null} current The data that was found synchronously (Cache). Will be used as fallback if getDataAsync fails * @param {StatsigUser} user The StatsigUser to get data for. * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser. */ readonly getDataAsync: (current: DataAdapterResult | null, user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise; /** * Manually trigger a fetch for new evaluations data for the given user. * * @param {StatsigUser} user The StatsigUser to get data for. */ readonly prefetchData: (user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise; /** * Manually set the evaluations data from a JSON string. * * Statsig Server SDKs supported: * - node-js-server-sdk\@5.20.0 * - java-server-sdk\@1.18.0 * - python-sdk\@0.32.0 * - ruby-sdk\@1.34.0 * - dotnet-sdk\@1.25.0 * - php-sdk\@3.2.0 * * Note: You can use {@link EvaluationsDataAdapter.setDataLegacy} if your server is running an older Statsig Server SDK. */ readonly setData: (data: string) => void; /** * Manually set evaluations data for the given user. * * @param {StatsigUser} user The StatsigUser this data is for. * * @deprecated This method is provided only to support older versions of Statsig server SDKs. * Newer SDKs include the StatsigUser as part of the data string, and can be used with the {@link EvaluationsDataAdapter.setData} method instead. */ readonly setDataLegacy: (data: string, user: StatsigUser) => void; }; type SpecsDataAdapter = DataAdapterCommon & { /** * Synchronously get specs data. Called during initializeSync and/or updateUserSync. * It is also called during async update operations before StatsigDataAdapter.getDataAsync is called. * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser. */ readonly getDataSync: () => DataAdapterResult | null; /** * Asynchronously get specs data. Called during initializeAsync and/or updateUserAsync. * * @param {DataAdapterResult | null} current The data that was found synchronously (Cache). Will be used as fallback if getDataAsync fails * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser. */ readonly getDataAsync: (current: DataAdapterResult | null, options?: DataAdapterAsyncOptions) => Promise; /** * Manually trigger a fetch for new specs data. */ readonly prefetchData: (options?: DataAdapterAsyncOptions) => Promise; /** * Manually set specs data (Bootstrap). */ readonly setData: (data: string) => void; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigClientEventEmitter.d.ts type StatsigLoadingStatus = 'Uninitialized' | 'Loading' | 'Ready'; declare const ErrorTag: { readonly NetworkError: "NetworkError"; }; type ErrorTag = (typeof ErrorTag)[keyof typeof ErrorTag]; type ErrorEventData = { error: unknown; tag: ErrorTag | string; } | { error: unknown; tag: 'NetworkError'; requestArgs: Record; }; type EventNameToEventDataMap = { values_updated: { status: StatsigLoadingStatus; values: DataAdapterResult | null; }; session_expired: object; error: ErrorEventData; pre_logs_flushed: { events: Record[]; }; logs_flushed: { events: Record[]; }; pre_shutdown: object; initialization_failure: object; gate_evaluation: { gate: FeatureGate; }; dynamic_config_evaluation: { dynamicConfig: DynamicConfig; }; experiment_evaluation: { experiment: Experiment; }; layer_evaluation: { layer: Layer; }; log_event_called: { event: StatsigEvent; }; }; /** * Type representing various events emitted by a Statsig client. * * `values_updated` - When the Statsig clients internal values change as the result of an initialize/update operation. * * `session_expired` - When the current session has expired. * * `error` - When an unexpected error occurs within the Statsig client. * * `pre_logs_flushed` - Fired just before queued StatsigEvents are flushed to Statsig servers. * * `logs_flushed` - When queued StatsigEvents are flushed to Statsig servers. * * `pre_shutdown` - Fired just before the SDK is shutdown * * `initialization_failure` - Fired when the client fails to initialize. * * `gate_evaluation` - Fired when any gate is checked from the Statsig client. * * `dynamic_config_evaluation` - Fired when any dyanamic config is checked from the Statsig client. * * `experiment_evaluation` - Fired when any experiment is checked from the Statsig client. * * `layer_evaluation` - Fired when any layer is checked from the Statsig client. * * `log_event_called` - Fired when log event is called. */ type AnyStatsigClientEvent = Flatten<{ [K in keyof EventNameToEventDataMap]: { name: K; } & EventNameToEventDataMap[K]; }[keyof EventNameToEventDataMap]>; type StatsigClientEvent = Extract; type StatsigClientEventName = AnyStatsigClientEvent['name'] | '*'; type StatsigClientEventCallback = (event: T extends '*' ? AnyStatsigClientEvent : StatsigClientEvent) => void; interface StatsigClientEventEmitterInterface { readonly loadingStatus: StatsigLoadingStatus; on(event: T, listener: StatsigClientEventCallback): void; off(event: T, listener: StatsigClientEventCallback): void; /** * (Statsig Use Only) - Same as .on() but logs errors to sdk_exception */ $on(event: T, listener: StatsigClientEventCallback): void; /** * (Statsig Use Only) - Emit StatsigClientEvents */ $emt(event: AnyStatsigClientEvent): void; } //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigUpdateDetails.d.ts type StatsigUpdateDetails = { duration: number; source: DataSource; success: boolean; error: Error | null; sourceUrl: string | null; warnings?: StatsigWarnings[]; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigClientBase.d.ts type StatsigClientEmitEventFunc = (event: AnyStatsigClientEvent) => void; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ErrorBoundary.d.ts declare class ErrorBoundary { private _sdkKey; private _options; private _emitter?; private _lastSeenError?; private _seen; constructor(_sdkKey: string, _options: AnyStatsigOptions | null, _emitter?: StatsigClientEmitEventFunc | undefined, _lastSeenError?: Error | undefined); wrap(instance: unknown, namePrefix?: string): void; logError(tag: string, error: unknown): void; logDroppedEvents(count: number, reason: string, metadata?: Record): void; logEventRequestFailure(count: number, reason: string, flushType: string, statusCode: number, retries: number, failurePath?: string, failureErrorMessage?: string, failureDiagnosticBucket?: string, failureDiagnosticMetadata?: Record): void; getLastSeenErrorAndReset(): Error | null; attachErrorIfNoneExists(error: unknown): void; private _capture; private _onError; } //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/SessionID.d.ts type SessionData = { sessionID: string; startTime: number; lastUpdate: number; }; type StatsigSession = { data: SessionData; sdkKey: string; lastPersistedAt: number; storageKey: string; }; declare const StatsigSession: { get: (sdkKey: string, bumpSession?: boolean) => StatsigSession; overrideInitialSessionID: (override: string, sdkKey: string) => void; checkForIdleSession: (sdkKey: string) => void; }; //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ClientInterfaces.d.ts interface StatsigClientCommonInterface extends StatsigClientEventEmitterInterface { initializeSync(): StatsigUpdateDetails; initializeAsync(): Promise; shutdown(): Promise; flush(): Promise; updateRuntimeOptions(options: StatsigRuntimeMutableOptions): void; } type CommonContext = { sdkKey: string; options: AnyStatsigOptions; errorBoundary: ErrorBoundary; session: StatsigSession; stableID: string | null; sdkInstanceID: string; }; type OnDeviceEvaluationsContext = CommonContext & { values: DownloadConfigSpecsResponse | null; }; interface OnDeviceEvaluationsInterface extends StatsigClientCommonInterface { readonly dataAdapter: SpecsDataAdapter; getContext(): OnDeviceEvaluationsContext; checkGate(name: string, user: StatsigUser, options?: FeatureGateEvaluationOptions): boolean; getFeatureGate(name: string, user: StatsigUser, options?: FeatureGateEvaluationOptions): FeatureGate; getDynamicConfig(name: string, user: StatsigUser, options?: DynamicConfigEvaluationOptions): DynamicConfig; getExperiment(name: string, user: StatsigUser, options?: ExperimentEvaluationOptions): Experiment; getLayer(name: string, user: StatsigUser, options?: LayerEvaluationOptions): Layer; logEvent(event: StatsigEvent, user: StatsigUser): void; logEvent(eventName: string, user: StatsigUser, value?: string | number, metadata?: Record): void; getClientInitializeResponse(user: StatsigUser, options?: ClientInitializeResponseOptions): AnyInitializeResponse | null; } type PrecomputedEvaluationsContext = Flatten; interface PrecomputedEvaluationsInterface extends StatsigClientCommonInterface { readonly dataAdapter: EvaluationsDataAdapter; getContext(): PrecomputedEvaluationsContext; getContextHandle(): PrecomputedEvaluationsContextHandle; updateUserSync(user: StatsigUser): StatsigUpdateDetails; updateUserAsync(user: StatsigUser): Promise; checkGate(name: string, options?: FeatureGateEvaluationOptions): boolean; getFeatureGate(name: string, options?: FeatureGateEvaluationOptions): FeatureGate; getDynamicConfig(name: string, options?: DynamicConfigEvaluationOptions): DynamicConfig; getExperiment(name: string, options?: ExperimentEvaluationOptions): Experiment; getLayer(name: string, options?: LayerEvaluationOptions): Layer; getParameterStore(name: string, options?: ParameterStoreEvaluationOptions): ParameterStore; logEvent(event: StatsigEvent): void; logEvent(eventName: string, value?: string | number, metadata?: Record): void; } type StatsigClientInterface = OnDeviceEvaluationsInterface | PrecomputedEvaluationsInterface; /** * A handle to the PrecomputedEvaluationsContext that computes fields lazily on access. * This avoids unnecessary computation (e.g., cloning the user) when only certain fields are needed. * The handle is created once and reused; individual getters fetch current values on each access. */ declare class PrecomputedEvaluationsContextHandle { private _sdkKey; private _getOptions; private _getErrorBoundary; private _getValues; private _getUser; private _getSdkInstanceID; constructor(sdkKey: string, getOptions: () => AnyStatsigOptions, getErrorBoundary: () => ErrorBoundary, getValues: () => AnyInitializeResponse | null, getUser: () => StatsigUser, getSdkInstanceID: () => string); get sdkKey(): string; get options(): AnyStatsigOptions; get errorBoundary(): ErrorBoundary; get values(): AnyInitializeResponse | null; get user(): StatsigUser; /** * Gets the current session. * @param {boolean} [bumpSession=true] - Whether to bump/update the session timing. Set to false to read without affecting session state. */ getSession(bumpSession?: boolean): StatsigSession; get stableID(): string | null; get sdkInstanceID(): string; /** * Returns the full PrecomputedEvaluationsContext object. * Use this when you need all fields at once. * @param {boolean} [bumpSession=true] - Whether to bump the session when building the context. */ toContext(bumpSession?: boolean): PrecomputedEvaluationsContext; } //#endregion //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/$_StatsigGlobal.d.ts type StatsigGlobal = { [key: string]: unknown; instances?: Record; firstInstance?: StatsigClientInterface; acInstances?: Record; srInstances?: Record; firstSRInstance?: unknown; instance: (sdkKey?: string) => StatsigClientInterface | undefined; }; declare global { let __STATSIG__: StatsigGlobal | undefined; interface Window { __STATSIG__: StatsigGlobal | undefined; } } //#endregion //#region ../infra/src/capabilities/IFeatureManagementCapability.d.ts /** * Custom randomization-unit IDs merged into the FeatureManagement user object. * `undefined` values are treated as "not yet known" and are dropped before * being sent to the provider (never overwrite a known ID with `undefined`). */ type FeatureManagementCustomIDs = Record; /** * Which auto-collected feature-management user fields to blank out before * sending them to the provider. Mirrors every `StatsigUser` field except the * caller-owned `custom` / `customIDs` / `privateAttributes`. Each flag * defaults to `false` (sent as-is) except `ip` and `country`, which default * to `true` (redacted) — see {@link FeatureManagementProvider}'s resolved * defaults. */ type FeatureManagementRedactedUserInfo = { [K in keyof Omit]?: boolean; }; /** * Incremental identity enrichment passed to * {@link IFeatureManagementCapability.updateUser} as more randomization * units become known during the session lifecycle (e.g. `hashed_onboarding_id` * once the session is initialized, `flow_id` from the flow response, and * `workflow_id` from the workflow configuration). */ type FeatureManagementUserUpdate = { customIDs?: FeatureManagementCustomIDs; custom?: Record; /** See {@link FeatureManagementConfig.appVersion}. */ appVersion?: string; }; type FeatureManagementEventMetadataValue = boolean | number | string | Record; type FeatureManagementEventMetadata = Record; /** * Provenance of a synchronous feature-management read: whether the value * reflects a real evaluation (`'initialized'`), is a default because the * capability was never initialized (`'uninitialized'`), or is a default * because evaluation itself threw despite being initialized (`'error'`). * * This is a snapshot of *this read* only — it says nothing about whether a * later read might succeed (e.g. `'uninitialized'` covers both "still * booting" and "permanently opted out"; callers that need to distinguish * those must combine this with {@link IFeatureManagementCapability.initialized} * or wait on the readiness signal exposed by core). */ type FeatureManagementReadStatus = 'initialized' | 'uninitialized' | 'error'; /** * Read-only view of an experiment evaluation for the current user. */ type FeatureManagementExperiment = { /** Typed parameter lookup; returns `fallback` if the param/experiment is unknown or the provider was never initialized. */ get(paramName: string, fallback: T): T; /** The evaluated group/arm name, or `null` before initialization or if the user is not in the experiment. */ groupName: string | null; /** Provenance of this read — see {@link FeatureManagementReadStatus}. */ status: FeatureManagementReadStatus; }; type FeatureManagementLayer = { /** Typed parameter lookup; logs a native per-parameter layer exposure on call. Returns `fallback` if unknown or uninitialized. */ get(paramName: string, fallback: T): T; groupName: string | null; status: FeatureManagementReadStatus; }; /** Options forwarded to the underlying Statsig parameter-store evaluation. */ type FeatureManagementParameterStoreEvaluationOptions = { disableExposureLog?: boolean; }; /** * Read-only view of a parameter store evaluation for the current user. Each * parameter key can be remapped in the Statsig console — to a static value, * a feature gate, an experiment param, or a layer param — without an SDK * release; this type has no `groupName` because a store is a router over * whichever entity its params are currently mapped to, not an entity with * its own arm/group. */ type FeatureManagementParameterStore = { /** Typed parameter lookup; logs a native exposure for the mapped source (experiment/gate/layer) on call. Returns `fallback` if unknown or uninitialized. */ get(paramName: string, fallback: T): T; /** Provenance of this read — see {@link FeatureManagementReadStatus}. */ status: FeatureManagementReadStatus; }; /** * Read-only view of a feature gate evaluation for the current user. */ type FeatureManagementGate = { /** The evaluated gate value, or `false` before initialization or on any evaluation error. */ enabled: boolean; /** Provenance of this read — see {@link FeatureManagementReadStatus}. */ status: FeatureManagementReadStatus; }; //#endregion export { FeatureManagementParameterStore as a, FeatureManagementRedactedUserInfo as c, FeatureManagementLayer as i, FeatureManagementUserUpdate as l, FeatureManagementExperiment as n, FeatureManagementParameterStoreEvaluationOptions as o, FeatureManagementGate as r, FeatureManagementReadStatus as s, FeatureManagementEventMetadata as t };