scyllinx
Version:
A modern TypeScript ORM for ScyllaDB and SQL databases with Laravel-inspired syntax
27 lines (26 loc) • 1.03 kB
TypeScript
import { CacheConfig } from "@/types";
import { CacheStore } from "./CacheStore";
export declare class CacheManager {
private static instance;
private stores;
private defaultStore;
static getInstance(): CacheManager;
addStore(name: string, config: CacheConfig): void;
getStore(name?: string): CacheStore;
setDefaultStore(name: string): void;
get(key: string, store?: string): Promise<any>;
set(key: string, value: any, ttl?: number, store?: string): Promise<void>;
forget(key: string, store?: string): Promise<void>;
flush(store?: string): Promise<void>;
remember<T>(key: string, ttl: number, callback: () => Promise<T>, store?: string): Promise<T>;
tags(tags: string[]): TaggedCache;
}
export declare class TaggedCache {
private cacheManager;
private tags;
constructor(cacheManager: CacheManager, tags: string[]);
get(key: string): Promise<any>;
set(key: string, value: any, ttl?: number): Promise<void>;
flush(): Promise<void>;
private taggedKey;
}