cache2
Version:
一个简单的 JavaScript 缓存管理,支持浏览器端和 node 端。
10 lines (9 loc) • 332 B
TypeScript
export type TStorage<T = any> = {
getItem(key: string): T | null;
removeItem(key: string): void;
setItem(key: string, value: T): void;
clear?: () => void;
[x: string]: any;
};
export type JSON_Parse_reviver = (this: any, key: string, value: any) => any;
export type JSON_Stringify_replacer = JSON_Parse_reviver;