@onesy/cache
Version:
29 lines (28 loc) • 754 B
TypeScript
export interface ICacheItem {
value: any;
added_at?: number;
updated_at?: number;
}
interface IOptionsValue {
copy?: boolean;
}
interface IOptionsAdd {
override?: boolean;
}
export interface IOptions {
value?: IOptionsValue;
add?: IOptionsAdd;
}
declare class OnesyCache {
static caches: Record<string, ICacheItem>;
private static options_;
static get options(): IOptions;
static set options(value: IOptions);
static add(value: any, ...args: any[]): void;
static update(value: any, ...args: any[]): any | undefined;
static get(...args: any[]): undefined | any;
static has(...args: any[]): boolean;
static remove(...args: any[]): void;
static reset(): void;
}
export default OnesyCache;