UNPKG

cache2

Version:

一个简单的 JavaScript 缓存管理,支持浏览器端和 node 端。

15 lines (14 loc) 661 B
import { JSON_Parse_reviver, JSON_Stringify_replacer, TStorage } from './interface'; /**缓存命名空间缓存键前缀。 */ export declare const CACHE_DEFAULT_PREFIX = "cache2_"; /**缓存默认命名空间。 */ export declare const CAHCE_DEFAULT_NAMESPACE = "default"; /** * 是否支持 storage。 * * @param storage 存储对象。 * @returns 如果支持 storage 返回 `true`,否则返回 `false`。 */ export declare function isStorageSupported(storage: TStorage): boolean; export declare function parse(value: any, reviver?: JSON_Parse_reviver): any; export declare function stringify(value: any, replacer?: JSON_Stringify_replacer): string;