import { IHasStatsigInternal } from './StatsigClient'; import { StatsigUser } from './StatsigUser'; import Diagnostics from './utils/Diagnostics'; export declare enum StatsigEndpoint { Initialize = "initialize", Rgstr = "rgstr", LogEventBeacon = "rgstr_b" } 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 sdkInternal; private readonly retryCodes; private leakyBucket; private canUseKeepalive; constructor(sdkInternal: IHasStatsigInternal); private init; fetchValues(args: { user: StatsigUser | null; sinceTime: number | null; timeout: number; useDeltas: boolean; prefetchUsers?: Record; previousDerivedFields?: Record; hadBadDeltaChecksum?: boolean; badChecksum?: string; badMergedConfigs?: Record; badFullResponse?: Record; }): PromiseWithTimeout>; private postWithTimeout; sendLogBeacon(payload: Record): boolean; postToEndpoint(endpointName: StatsigEndpoint, body: object, options?: { retryOptions?: { retryLimit?: number; attempt?: number; backoff?: number; }; useKeepalive?: boolean; diagnostics?: typeof Diagnostics.mark.initialize.networkRequest | null; additionalHeaders?: Record; }): Promise; supportsKeepalive(): boolean; private getDiagnosticsData; private getErrorData; } export {};