import type { LoggerWrapper } from "./ConfigCatLogger"; import { ProjectConfig } from "./ProjectConfig"; /** Defines the interface used by the ConfigCat SDK to store and retrieve downloaded config data. */ export interface IConfigCatCache { /** * Stores a data item into the cache. * @param key A string identifying the data item. * @param value The data item to cache. */ set(key: string, value: string): Promise | void; /** * Retrieves a data item from the cache. * @param key A string identifying the value. * @returns The cached data item or `null` or `undefined` if there is none. */ get(key: string): Promise | string | null | undefined; } /** @remarks Unchanged config is returned as is, changed config is wrapped in an array so we can distinguish between the two cases. */ export declare type CacheSyncResult = ProjectConfig | [changedConfig: ProjectConfig]; export interface IConfigCache { set(key: string, config: ProjectConfig): Promise | void; get(key: string): Promise | CacheSyncResult; getInMemory(): ProjectConfig; } export declare class InMemoryConfigCache implements IConfigCache { private cachedConfig; set(_key: string, config: ProjectConfig): void; get(_key: string): ProjectConfig; getInMemory(): ProjectConfig; } export declare class ExternalConfigCache implements IConfigCache { private readonly cache; private readonly logger; private cachedConfig; private cachedSerializedConfig; constructor(cache: IConfigCatCache, logger: LoggerWrapper); set(key: string, config: ProjectConfig): Promise; private updateCachedConfig; get(key: string): Promise | CacheSyncResult; getInMemory(): ProjectConfig; } //# sourceMappingURL=ConfigCatCache.d.ts.map