import ErrorBoundary from './ErrorBoundary'; import Identity from './StatsigIdentity'; import StatsigSDKOptions from './StatsigSDKOptions'; export declare enum StatsigEndpoint { DownloadConfigSpecs = "download_config_specs", Rgstr = "rgstr", LogEventBeacon = "log_event_beacon" } type NetworkResponse = Response & { data?: Record; }; /** * An extension of the promise type, it adds a * function `eventually`. In the event that the provided timeout * is reached, the function will still be called regardless. * * This function WILL NOT BE CALLED if the promise resolves normally. */ type PromiseWithTimeout = Promise & { eventually: (fn: (t: T) => void) => PromiseWithTimeout; }; export default class StatsigNetwork { private readonly _options; private readonly _identity; private readonly _errorBoundary; private readonly retryCodes; private leakyBucket; private canUseKeepalive; constructor(options: StatsigSDKOptions, identity: Identity, errorBoundary: ErrorBoundary); fetchValues(timeout: number): PromiseWithTimeout>; sendLogBeacon(payload: Record): boolean; requestToEndpoint(endpointName: StatsigEndpoint, body: object | null, retries?: number, backoff?: number, useKeepalive?: boolean): Promise; supportsKeepalive(): boolean; private _init; private _postWithTimeout; private _getErrorData; private getUrl; } export {};