import type { AsyncStorage, DeviceInfo, ExpoConstants, ExpoDevice, NativeModules, Platform, UUID, CheckGateOptions as GetGateOptions } from 'statsig-js'; import StatsigJS, { DynamicConfig, EvaluationDetails, FeatureGate, Layer, StatsigOptions, StatsigOverrides, StatsigUser, _SDKPackageInfo } from 'statsig-js'; declare global { interface Window { __STATSIG_SDK__: Statsig; __STATSIG_JS_SDK__: StatsigJS; __STATSIG_RERENDER_OVERRIDE__: () => void; } } export type CheckGateOptions = { ignoreOverrides?: boolean; }; export { CheckGateOptions as GetFeatureGateOptions } from 'statsig-js'; export type GetConfigOptions = { ignoreOverrides?: boolean; }; export type GetExperimentOptions = { keepDeviceValue?: boolean; ignoreOverrides?: boolean; }; export type GetLayerOptions = { keepDeviceValue?: boolean; }; export type StatsigReactContextUpdater = () => void; export default class Statsig { private static readonly MAX_QUEUED_EVENTS; private static instance; private static eventQueue; private static sdkPackageInfo?; private static appState?; private static nativeModules?; private static platform?; private static deviceInfo?; private static onCacheLoadedCallback?; private static expoConstants?; private static expoDevice?; private static uuid?; private static reactContextUpdater; static initialize(sdkKey: string, user?: StatsigUser | null, options?: StatsigOptions | null): Promise; static bootstrap(sdkKey: string, initializeValues: Record, user?: StatsigUser | null, options?: StatsigOptions | null): void; static flushEvents(): void | undefined; static reenableAllLogging(): void | undefined; static prefetchUsers(users: StatsigUser[]): Promise; static setInitializeValues(initializeValues: Record): void; static getCurrentUser(): StatsigUser | null; static checkGate(gateName: string, ignoreOverrides?: boolean): boolean; static getFeatureGate(gateName: string, options?: GetGateOptions): FeatureGate; static checkGateWithExposureLoggingDisabled(gateName: string, options?: CheckGateOptions): boolean; static manuallyLogGateExposure(gateName: string): void; static getConfig(configName: string, ignoreOverrides?: boolean): DynamicConfig; static getConfigWithExposureLoggingDisabled(configName: string, options?: GetConfigOptions): DynamicConfig; static manuallyLogConfigExposure(configName: string): void; static getExperiment(experimentName: string, keepDeviceValue?: boolean, ignoreOverrides?: boolean): DynamicConfig; static getExperimentWithExposureLoggingDisabled(experimentName: string, options?: GetExperimentOptions): DynamicConfig; static manuallyLogExperimentExposure(experimentName: string, keepDeviceValue: boolean): void; static getLayer(layerName: string, keepDeviceValue?: boolean): Layer; static getLayerWithExposureLoggingDisabled(layerName: string, options?: GetLayerOptions): Layer; static manuallyLogLayerParameterExposure(layerName: string, parameterName: string, keepDeviceValue?: boolean): void; static logEvent(eventName: string, value?: string | number | null, metadata?: Record | null): void; static updateUser(user: StatsigUser | null): Promise; static updateUserWithValues(user: StatsigUser | null, values: Record): boolean; static shutdown(): void; /** * Overrides the given gate locally with the given value * @param gateName - name of the gate to override * @param value - value to assign to the gate */ static overrideGate(gateName: string, value: boolean): void; /** * Overrides the given config locally with the given value * @param configName - name of the config to override * @param value - value to assign to the config */ static overrideConfig(configName: string, value: object): void; /** * Overrides the given layer locally with the given value * @param layerName - name of the layer to override * @param value - value to assign to the layer */ static overrideLayer(layerName: string, value: object): void; /** * @param name the gate override to remove */ static removeGateOverride(name?: string): void; /** * @param name the config override to remove */ static removeConfigOverride(name?: string): void; /** * @param name the config override to remove */ static removeLayerOverride(name?: string): void; /** * @returns The local gate and config overrides */ static getAllOverrides(): StatsigOverrides; static getEvaluationDetails(): EvaluationDetails; /** * @returns The Statsig stable ID used for device level experiments */ static getStableID(): string; static initializeCalled(): boolean; static setAppState(appState?: unknown | null): void; static setSDKPackageInfo(sdkPackageInfo: _SDKPackageInfo): void; static setReactNativeUUID(uuid?: UUID | null): void; static setAsyncStorage(asyncStorage?: AsyncStorage | null): void; static setNativeModules(nativeModules?: NativeModules | null): void; static setPlatform(platform?: Platform | null): void; static setRNDeviceInfo(deviceInfo?: DeviceInfo | null): void; static setExpoConstants(expoConstants?: ExpoConstants | null): void; static setExpoDevice(expoDevice?: ExpoDevice | null): void; static setReactContextUpdater(fn: (() => void) | null): void; static setOnCacheLoadedCallback(fn: () => void): void; private static processEventQueue; private static getClientX; private static capture; constructor(sdkKey: string, user?: StatsigUser | null, options?: StatsigOptions | null); private static updateContext; private static canThrow; }