import { adapter } from './adapter.ts'; type Fn = (opts: { url?: string; headers?: Record; body?: Record; [key: string]: any; timeout?: number; }) => Promise>; type QueryOpts = { url?: string; adapter?: typeof adapter; headers?: Record; timeout?: number; }; type Data = { path?: string; key?: string; payload?: Record; [key: string]: any; }; type Result = { code: number; data?: S; message?: string; success: boolean; }; type DataOpts = Partial & { beforeRequest?: Fn; afterResponse?: (result: Result) => Promise; }; /** * const query = new Query(); * const res = await query.post({ * path: 'demo', * key: '1', * }); */ export declare class Query { adapter: typeof adapter; url: string; beforeRequest?: Fn; afterResponse?: (result: Result) => Promise; headers?: Record; timeout?: number; constructor(opts: QueryOpts); get(params: Record & Data & T, options?: DataOpts): Promise>; post(body: Record & Data & T, options?: DataOpts): Promise>; before(fn: Fn): void; after(fn: (result: Result) => Promise): void; } export { adapter };