rokapi
Version:
15 lines (14 loc) • 566 B
TypeScript
import type { RequestOptions } from './requestType';
export interface CacheStore {
has(key: string): Promise<boolean>;
set<T>(key: string, value: T): Promise<void>;
get<T>(key: string): Promise<T | undefined>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
}
export declare const hashRequest: (req: RequestOptions & {
url: string;
}) => string;
export declare function createMemoryStore(): CacheStore;
export declare function createStorageStore(): CacheStore;
export declare function useCacheStore(persits: boolean): CacheStore;