@amirmarmul/waba-common
Version:

26 lines (25 loc) • 1.11 kB
TypeScript
import { Repo as Cache } from '../../../core/domain/cache/Repo';
import { Store } from '../../../core/domain/cache/Store';
export declare class Repo implements Cache {
protected store: Store;
protected ttl: number;
constructor(store: Store);
has(key: string): Promise<boolean>;
missing(key: string): Promise<boolean>;
get<T>(key: string, _default?: any): Promise<T | null>;
pull<T>(key: string, _default?: any): Promise<T | null>;
put(key: string, value: any, ttl?: number): Promise<boolean>;
add(key: string, value: any, ttl?: number): Promise<boolean>;
forever(key: string, value: unknown): Promise<boolean>;
remember<T>(key: string, callback: Function, ttl?: number): Promise<T>;
rememberForever<T>(key: string, callback: Function): Promise<T>;
forget(key: string): Promise<boolean>;
flush(): Promise<boolean>;
getDefaultCacheTime(): number;
setDefaultCacheTime(ttl: number): Repo;
getStore(): Store;
setStore(store: Store): Repo;
protected itemKey(key: string): string;
protected getSeconds(ttl: any): number;
private value;
}