import { HttpError, type HandlerEnv, type HandlerFs, type HttpErrorRequest, type HttpErrorResponse, type RuntimeLogger } from "../../toolcraft/dist/index.js"; import type { TokenSource } from "./auth/types.js"; export { HttpError }; export type { HttpErrorRequest, HttpErrorResponse }; type QueryScalar = string | number | boolean | null | undefined; type QueryObject = { readonly [key: string]: QueryValue; }; type HeaderScalar = string | number | boolean | undefined; export type QueryValue = QueryScalar | QueryValue[] | QueryObject; export interface HttpRequestOptions { baseUrl: string; path: string; method: string; tokenSource: TokenSource; auth: "required" | "none"; fetch?: typeof globalThis.fetch; pathParams?: Record; query?: Record; headers?: Record; body?: unknown; bodyMode?: "json" | "form" | "raw" | "base64" | "multipart"; contentType?: string; multipartBinaryFields?: readonly string[]; responseMode?: "json" | "text" | "binary"; accept?: string; diagnostics?: RuntimeLogger; signal?: AbortSignal; rawResponse?: boolean; retries?: { max: number; backoff: "exponential"; retryOn: number[]; sleep?: (ms: number) => Promise; random?: () => number; }; idempotency?: { header: string; enabled: boolean; key?: string; createKey?: () => string; }; } export interface BinaryHttpResponse { contentType: string; encoding: "base64"; byteLength: number; data: string; } type RuntimeFileSystem = Pick; type RuntimeEnvironment = Pick; type RequestShape = Partial>; export declare function requestJson(options: HttpRequestOptions): Promise; export declare function prepareMultipartFileInputs(requestShape: RequestShape, options: { bodyMode?: HttpRequestOptions["bodyMode"]; multipartBinaryFields?: readonly string[]; fs?: RuntimeFileSystem; env?: RuntimeEnvironment; fetch?: typeof globalThis.fetch; signal?: AbortSignal; }): Promise; export declare function writeBinaryResponseOutput(result: unknown, outputPath: unknown, runtime: { fs?: RuntimeFileSystem; env?: RuntimeEnvironment; }): Promise;