import { RetryOptions } from './lib/handleRetry'; export declare type DefaultGretchResponse = any; export declare type DefaultGretchError = any; export declare type MergeableObject = { [k: string]: MergeableObject; } | Partial | any[]; export declare type GretchResponse = { url: string; status: number; data: undefined; error: A; response: Response; } | { url: string; status: number; data: T; error: undefined; response: Response; }; export declare type GretchBeforeHook = (request: Request, opts: GretchOptions) => void; export declare type GretchAfterHook = (response: GretchResponse, opts: GretchOptions) => void; export declare type GretchHooks = { before?: GretchBeforeHook | GretchBeforeHook[]; after?: GretchAfterHook | GretchAfterHook[]; }; export declare type GretchOptions = { baseURL?: string; json?: { [key: string]: any; }; retry?: RetryOptions | boolean; timeout?: number; onException?: (e: Error) => void; hooks?: GretchHooks; headers?: { [key: string]: any; } & RequestInit['headers']; [key: string]: any; } & RequestInit; export declare type GretchInstance = { flush(): Promise<{ url: string; status: number; response: Response; }>; arrayBuffer: () => Promise>; blob: () => Promise>; formData: () => Promise>; json: () => Promise>; text: () => Promise>; }; export declare function gretch(url: string, opts?: GretchOptions): GretchInstance; export declare function create(defaultOpts?: GretchOptions): (url: string, opts?: GretchOptions) => GretchInstance;