UNPKG

@pisell/pisellos

Version:

一个可扩展的前端模块化SDK框架,支持插件系统

47 lines (46 loc) 1.19 kB
import { CacheProps } from './type'; export type CacheType = 'memory' | 'storage' | 'indexDB'; /** * @title: 设置缓存 * @description: * @return {*} * @Author: zhiwei.Wang */ export declare const setCache: (key: string, data: any, cache: CacheProps) => Promise<void>; /** * @title: 删除缓存数据 * @description: * @return {*} * @Author: zhiwei.Wang */ export declare const removeCache: (key: string, cache: CacheProps) => void; /** * @title: 获取数据 * @description: * @param {any} url * @param {any} data * @return {*} * @Author: zhiwei.Wang */ export declare const getCacheData: (url: string, data: any, cache: CacheProps) => Promise<any>; /** * @title: 设置缓存 * @description: * @param {any} url 路径 * @param {any} data 参数 * @param {any} res 数据 * @return {*} * @Author: zhiwei.Wang */ export declare const setCacheData: (url: string, data: any, res: any, cache: CacheProps) => any | null; /** * @title: 缓存函数包装器 * @description: * @param {any} url * @param {any} data * @param {any} config * @param {any} fn * @return {*} * @Author: zhiwei.Wang */ export declare const cacheFn: (props: any, fn: any) => Promise<any>;