@snail-js/api
Version:
Http Request with Decorators Api, build on axios
16 lines (15 loc) • 594 B
TypeScript
import "reflect-metadata";
export declare const NO_CACHE_KEY: unique symbol;
export declare const CACHE_EXPIRE_SOURCE_KEY: unique symbol;
/**
* 为请求方法或API设置不启用缓存
* @returns
*/
export declare const NoCache: () => (target: any, propertyKey?: string) => void;
/**
* 为请求方法或API设置失效源,当此源请求成功时,清空被装饰的方法缓存
* 格式serverName.apiName.methodName
* @param sources 失效源,字符型数组;
* @returns
*/
export declare const HitSource: (...sources: string[]) => (target: any, propertyKey?: string) => void;