import type { z } from "zod"; /** * Fetcher signature — compatible with the Fetch API, `cross-fetch`, or any * custom wrapper. Consumers may pass their own to bake in authentication, * tracing, or base URL rewriting. */ export type VoyantFetcher = (url: string, init?: RequestInit) => Promise; /** * Default fetcher — uses the global `fetch` with `credentials: "include"` so * session cookies are sent for same-origin deployments. */ export declare const defaultFetcher: VoyantFetcher; /** * Typed error thrown by `fetchWithValidation` when the API returns a non-2xx * response or when the body fails Zod validation. */ export declare class VoyantApiError extends Error { readonly status: number; readonly body: unknown; constructor(message: string, status: number, body: unknown); } export interface FetchWithValidationOptions { baseUrl: string; fetcher: VoyantFetcher; } /** * Wraps a fetcher call, reads the JSON response, and validates it against a * Zod schema. Throws `VoyantApiError` on transport, status, or parse failures. */ export declare function fetchWithValidation(path: string, schema: z.ZodType, options: FetchWithValidationOptions, init?: RequestInit): Promise;