import { type AuthTokenResolver, type HeaderResolver } from './auth.js';
import { type HttpRetryPolicy } from './retry.js';
import { type TransportPaths } from './paths.js';
export type { HttpRetryPolicy } from './retry.js';
export type JsonValue = string | number | boolean | null | {
    readonly [key: string]: JsonValue;
} | readonly JsonValue[];
export type JsonObject = {
    readonly [key: string]: JsonValue;
};
export interface HttpJsonTransportOptions {
    readonly baseUrl: string;
    readonly authToken?: string | null;
    readonly getAuthToken?: AuthTokenResolver;
    readonly fetch?: typeof fetch;
    readonly fetchImpl?: typeof fetch;
    readonly headers?: HeadersInit;
    readonly getHeaders?: HeaderResolver;
    readonly retry?: HttpRetryPolicy;
}
export interface HttpJsonRequestOptions {
    readonly method?: string;
    readonly body?: unknown;
    readonly headers?: HeadersInit;
    readonly signal?: AbortSignal;
    readonly retry?: false | HttpRetryPolicy;
}
export interface ResolvedContractRequest {
    readonly url: string;
    readonly method: string;
    readonly body?: Record<string, unknown>;
}
export interface TransportJsonError {
    readonly status: number;
    readonly body: unknown;
    readonly url: string;
    readonly method: string;
}
export interface HttpJsonTransport {
    readonly baseUrl: string;
    readonly authToken?: string | null;
    readonly fetchImpl: typeof fetch;
    readonly paths: TransportPaths;
    buildUrl(path: string): string;
    getAuthToken(): Promise<string | null>;
    requestJson<T>(pathOrUrl: string, options?: HttpJsonRequestOptions): Promise<T>;
    resolveContractRequest(method: string, path: string, input?: Record<string, unknown>): ResolvedContractRequest;
}
export declare function createJsonRequestInit(token: string | null | undefined, body?: unknown, method?: string, headers?: HeadersInit, signal?: AbortSignal, defaultHeaders?: HeadersInit): RequestInit;
export declare const createJsonInit: typeof createJsonRequestInit;
export declare function createFetch(fetchImpl?: typeof fetch, fallbackFetch?: typeof fetch): typeof fetch;
export declare function readJsonBody(response: Response): Promise<unknown>;
export declare function requestJson<T>(fetchImpl: typeof fetch, url: string, init?: RequestInit): Promise<T>;
export declare function createHttpJsonTransport(options: HttpJsonTransportOptions): HttpJsonTransport;
//# sourceMappingURL=http-core.d.ts.map