UNPKG

miniprogram-network

Version:

Redefine the network API of Wechat MiniProgram

39 lines 970 B
import { Downloader } from 'miniprogram-downloader'; import { Configuration } from 'miniprogram-network-cache'; import { Http } from 'miniprogram-request'; /** 缓存配置 */ export declare const config: Configuration & { /** 不缓存方法 */ excludeMethod: MethodParam['method'][]; }; interface CacheOptions { /** * 缓存时间,单位毫秒 */ expire?: number; } /** * 网络缓存 */ export declare const cacheHttp: Http<CacheOptions>; /** * 下载缓存 */ export declare const cacheDownloader: Downloader<CacheOptions>; /** * request 缓存 */ export declare const request: typeof cacheHttp['request']; /** * GET 缓存 */ export declare const get: typeof cacheHttp['get']; /** * 下载缓存 */ export declare const download: typeof cacheDownloader['download']; interface MethodParam { method?: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'CONNECT'; } export {}; //# sourceMappingURL=cache.d.ts.map