import { FetchFn } from "../../../worker";
export type FetchStoreRecordType = "json" | "text" | "blob" | "arrayBuffer" | "formData";
export type FetchStoreRecordTypeType<T extends FetchStoreRecordType> = Awaited<ReturnType<Response[T]>>;
type FetchStoreRequestInit = Omit<RequestInit, "body" | "method">;
interface FetchStoreBodyFn<RecordType extends FetchStoreRecordType> {
    (value: FetchStoreRecordTypeType<RecordType>): RequestInit["body"];
}
interface FetchStoreOptions<RecordType extends FetchStoreRecordType> extends FetchStoreRequestInit {
    type: RecordType;
    fetch: FetchFn;
    body?: FetchStoreBodyFn<RecordType>;
}
export declare class FetchStore<RecordType extends FetchStoreRecordType, T extends FetchStoreRecordTypeType<RecordType> = FetchStoreRecordTypeType<RecordType>> {
    readonly type: RecordType;
    private readonly fetch;
    private readonly body;
    private readonly init;
    constructor({ type, body, fetch, ...init }: FetchStoreOptions<RecordType>);
    with<Z extends T>(options: Partial<Omit<FetchStoreOptions<RecordType>, "type">>): FetchStore<RecordType, Z>;
    post(type: string | URL, value: T, init?: FetchStoreRequestInit): Promise<string>;
    put(url: string | URL, value: T, init?: FetchStoreRequestInit): Promise<void>;
    patch<Z extends T = T>(url: string | URL, value: T, init?: FetchStoreRequestInit): Promise<Z>;
    delete(url: string, init?: FetchStoreRequestInit): Promise<void>;
    get<Z extends T = T>(urlOrType?: string | URL, init?: FetchStoreRequestInit): Promise<Z>;
    head(url: string | URL, init?: FetchStoreRequestInit): Promise<Headers>;
}
export {};
