configcat-common
Version:
ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.
37 lines • 1.25 kB
TypeScript
import type { OptionsBase } from "./ConfigCatClientOptions";
import type { ProjectConfig } from "./ProjectConfig";
export declare enum FetchStatus {
Fetched = 0,
NotModified = 1,
Errored = 2
}
export declare class FetchResult {
status: FetchStatus;
config: ProjectConfig;
errorMessage?: string | undefined;
errorException?: any;
private constructor();
static success(config: ProjectConfig): FetchResult;
static notModified(config: ProjectConfig): FetchResult;
static error(config: ProjectConfig, errorMessage?: string, errorException?: any): FetchResult;
}
export interface IFetchResponse {
statusCode: number;
reasonPhrase: string;
eTag?: string;
body?: string;
}
export declare type FetchErrorCauses = {
abort: [];
timeout: [timeoutMs: number];
failure: [err?: any];
};
export declare class FetchError<TCause extends keyof FetchErrorCauses = keyof FetchErrorCauses> extends Error {
cause: TCause;
args: FetchErrorCauses[TCause];
constructor(cause: TCause, ...args: FetchErrorCauses[TCause]);
}
export interface IConfigFetcher {
fetchLogic(options: OptionsBase, lastEtag: string | null): Promise<IFetchResponse>;
}
//# sourceMappingURL=ConfigFetcher.d.ts.map