@devcycle/js-client-sdk
Version:
The Javascript Client SDK for DevCycle
27 lines (26 loc) • 1.13 kB
TypeScript
import { BucketedUserConfig, DVCLogger } from '@devcycle/types';
import { DVCStorage } from './types';
import { DVCPopulatedUser } from './User';
export declare class CacheStore {
store: DVCStorage;
logger: DVCLogger;
private configCacheTTL;
constructor(storage: DVCStorage, logger: DVCLogger, configCacheTTL?: number);
private getConfigKey;
private getConfigExpiryKey;
private loadConfigExpiryDate;
saveConfig(data: BucketedUserConfig, user: DVCPopulatedUser): Promise<void>;
private isBucketedUserConfig;
loadConfig(user: DVCPopulatedUser): Promise<BucketedUserConfig | null>;
saveAnonUserId(userId: string): Promise<void>;
loadAnonUserId(): Promise<string | undefined>;
removeAnonUserId(): Promise<void>;
migrateLegacyConfigs(): Promise<void>;
migrateLegacyConfigType(legacyKey: string, isAnonymous: boolean): Promise<void>;
/**
* Clean up expired config entries from storage.
* This removes configs for any user that have passed their expiry date.
*/
cleanupExpiredConfigs(): Promise<void>;
}
export default CacheStore;