import Context from '../Context'; export interface CacheConfig { /** @description 设置缓存有效时间 */ maxAge?: number; /** @description 设置缓存失效条件 */ expire?: (ctx?: Context) => CacheStore['expireValue']; } export type CacheStore = { data: any; expireValue: any; activeTime: number; state: 'init' | 'pending' | 'done'; waits: Array<(data: any) => void>; };