declare type CacheId = string; interface RequestOptions { /** * 调用方法 * @param e * @returns */ apiRequest: (...e: any) => Promise; /** * 缓存id */ cacheId: CacheId; /** * 这个可不添加 */ urlParams?: string; /** * 暂时只考虑params 后续需要再做添加 */ params?: Record; } /** * 用来对服务进行缓存 * 默认缓存1分钟 */ declare class CacheApi { timeout: number; private apiMap; static instance: CacheApi; static getInstance(): CacheApi; private getDiffTime; private getCacheItem; /** * 是否需要发送请求 */ private shouldSendRequest; request(opts: RequestOptions): Promise; } declare const _default: CacheApi; export default _default;