export { A as ApiKey, a as ApiKeyValidator, b as AuthMode, E as EnvelopeResponse, c as ErrorBody, d as ErrorCode, F as FailResponse, H as HttpMethod, I as IssuedApiKey, O as OkResponse, e as OpenAPIObject, P as PermissionFailureDetails, R as ResponseMeta, f as RouteDefinition, g as RouteResponseSpec } from './permission_failure-BVs18ugU.js'; import 'zod'; interface SwaggerUiHtmlOptions { spec_url: string; title?: string; cdn?: 'unpkg' | 'jsdelivr' | string; version?: string; } declare function swaggerUiHtml(opts: SwaggerUiHtmlOptions): string; /** * Client-safe fetch wrapper for calling hazo_api-shaped envelope endpoints * (`{ ok, data, meta }` / `{ ok: false, error, meta }`) from browser code. * * Pure string/fetch logic — no Node-only APIs, no `server-only` import, no * dependency on any other hazo_* package. Lives in `lib/` alongside * `swagger_ui_html.ts` (same precedent: client-safe module in `lib/`, * re-exported only from `index.client.ts`, never from the server barrel). * * hazo_api deliberately does NOT depend on hazo_secure (or any CSRF package). * Consumers that need CSRF headers on mutating requests wire their own logic * in via `configureApiClient({ getExtraHeaders })` — see below. */ declare class ApiError extends Error { readonly code: string; readonly status: number; readonly details?: unknown | undefined; constructor(code: string, message: string, status: number, details?: unknown | undefined); } interface ApiClientConfig { /** * Called before every non-GET/HEAD request to obtain headers to merge in * (e.g. a CSRF token). May return synchronously or a Promise. This is the * decoupling point for hazo_secure (or any other header source) — hazo_api * never imports it directly. */ getExtraHeaders?: () => Record | Promise>; } /** * Set the module-level config used by `apiGet`/`apiPost`/`apiPatch`/ * `apiRequest`. Call once at app startup (e.g. a client providers file). * Pass `undefined` to reset to no-op defaults. */ declare function configureApiClient(config: ApiClientConfig | undefined): void; /** Read the current module-level config (mainly useful for tests). */ declare function getApiClientConfig(): ApiClientConfig; /** * Generic envelope-aware fetch. Parses the response as an * `EnvelopeResponse`; throws `ApiError` when `ok: false`, otherwise * resolves with `data`. `apiGet`/`apiPost`/`apiPatch` are thin wrappers * around this. */ declare function apiRequest(path: string, init?: RequestInit): Promise; declare function apiGet(path: string, init?: RequestInit): Promise; declare function apiPost(path: string, body?: unknown, init?: RequestInit): Promise; declare function apiPatch(path: string, body?: unknown, init?: RequestInit): Promise; export { type ApiClientConfig, ApiError, type SwaggerUiHtmlOptions, apiGet, apiPatch, apiPost, apiRequest, configureApiClient, getApiClientConfig, swaggerUiHtml };