configcat-common
Version:
ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.
28 lines • 1.34 kB
TypeScript
import type { AutoPollOptions } from "./ConfigCatClientOptions";
import type { IConfigFetcher } from "./ConfigFetcher";
import type { IConfigService, RefreshResult } from "./ConfigServiceBase";
import { ClientCacheState, ConfigServiceBase } from "./ConfigServiceBase";
import type { ProjectConfig } from "./ProjectConfig";
export declare const POLL_EXPIRATION_TOLERANCE_MS = 500;
export declare class AutoPollConfigService extends ConfigServiceBase<AutoPollOptions> implements IConfigService {
private initialized;
private readonly initializationPromise;
private signalInitialization;
private stopToken;
private readonly pollIntervalMs;
private readonly pollExpirationMs;
readonly readyPromise: Promise<ClientCacheState>;
constructor(configFetcher: IConfigFetcher, options: AutoPollOptions);
private waitForInitializationAsync;
getConfig(): Promise<ProjectConfig>;
refreshConfigAsync(): Promise<[RefreshResult, ProjectConfig]>;
dispose(): void;
protected onConfigFetched(newConfig: ProjectConfig): void;
protected setOnlineCore(): void;
protected setOfflineCore(): void;
private startRefreshWorker;
private stopRefreshWorker;
private refreshWorkerLogic;
getCacheState(cachedConfig: ProjectConfig): ClientCacheState;
}
//# sourceMappingURL=AutoPollConfigService.d.ts.map