whale-plus
Version:
A Component Library for Vue 3
18 lines (17 loc) • 742 B
TypeScript
import type { AsyncCacheStore } from './asyncCacheStore';
export declare class CacheManager {
private store;
constructor(store: AsyncCacheStore);
static create(store: AsyncCacheStore): CacheManager;
get<T>(key: string): Promise<T | undefined>;
getNormal<T>(key: string): Promise<T | undefined>;
set<T>(key: string, value: T, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
has(key: string): Promise<boolean>;
}
export declare const requestCache: {
memoryCache: AsyncCacheStore;
persistCache: AsyncCacheStore;
};
export declare function injectCache(memoryCache: AsyncCacheStore, persistCache: AsyncCacheStore): void;
export declare function useCache(isPersist: boolean): CacheManager;