astro-ghostcms/.pnpm-store/v3/files/f6/6bb5a0c08bcfa072e327986190a...

17 lines
788 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
import { RequestFn, StorageAdapter, CacheResponse, CacheValue, CacheableOptions, Emitter } from './types.js';
type Func = (...args: any[]) => any;
declare class CacheableRequest {
cache: StorageAdapter;
cacheRequest: RequestFn;
hooks: Map<string, Func>;
constructor(cacheRequest: RequestFn, cacheAdapter?: StorageAdapter | string);
request: () => (options: CacheableOptions, cb?: (response: CacheResponse) => void) => Emitter;
addHook: (name: string, fn: Func) => void;
removeHook: (name: string) => boolean;
getHook: (name: string) => Func;
runHook: (name: string, ...args: any[]) => Promise<CacheValue>;
}
export default CacheableRequest;
export * from './types.js';
export declare const onResponse = "onResponse";
//# sourceMappingURL=index.d.ts.map