export const DEFAULT_VARIATION = 'A'; export type VariationKey = string; export interface LoadableResult { loaded: boolean; result: T; } /** * Session persist condition * - 'alwaysNewSession': Always start a new session * - 'nullToUserId': Start a new session when userId changes from null to a value */ export type SessionPersistCondition = 'alwaysNewSession' | 'nullToUserId'; export interface SessionTimeoutCondition { /** Session timeout interval in milliseconds */ timeoutIntervalMillis?: number; /** Whether to check session timeout while the app is in foreground */ onForeground?: boolean; /** Whether to check session timeout while the app is in background */ onBackground?: boolean; /** Whether to check session timeout on application state changes */ onApplicationStateChange?: boolean; } export interface SessionPolicy { persistCondition?: SessionPersistCondition; timeoutCondition?: SessionTimeoutCondition; } /** * Evaluation mode * - 'local': Evaluates locally with the workspace configuration fetched by the client. (default) * - 'remote': Reads the evaluation results that the server has pre-evaluated. */ export type EvaluationMode = 'local' | 'remote'; export interface SdkConfig { debug?: boolean; /** @deprecated Use sessionPolicy instead */ sessionTimeoutMillis?: number; pollingIntervalMillis?: number; eventFlushIntervalMillis?: number; eventFlushThreshold?: number; exposureEventDedupIntervalMillis?: number; automaticAppLifecycleTracking?: boolean; automaticScreenTracking?: boolean; optOutTracking?: boolean; sessionPolicy?: SessionPolicy; /** Evaluation mode. Defaults to 'local'. */ evaluationMode?: EvaluationMode; [key: string]: any; } export type PropertyValue = | string | boolean | number | Array | undefined | null;