export type AppApiHost = Readonly<{ /** Absolute API origin and prefix, or "" for same-origin. */ apiBaseUrl: string; /** An authenticated JSON request to an API path (`/v1/...`). */ request: (path: string, init?: RequestInit) => Promise; /** The same request, returning the raw response. */ requestResponse: (path: string, init?: RequestInit) => Promise; /** * Prepares a client for live voice. `sessionHref` is the page a call belongs * to; the web app reloads onto a newer build before starting one. */ voiceRealtimeClient: Promise; }>(client: C, sessionHref: () => string) => C; }>; export declare function useAppApi(): AppApiHost; export declare class ApiError extends Error { readonly status: number; readonly body: string; constructor(status: number, body: string, options?: { code?: string | undefined; retryable?: boolean | undefined; outcomeUnknown?: boolean | undefined; details?: Record | undefined; message?: string | undefined; }); readonly code: string | undefined; readonly retryable: boolean; readonly outcomeUnknown: boolean; readonly details: Record | undefined; } export declare function apiErrorFromResponseBody(status: number, body: string): ApiError; export declare function isApiErrorStatus(error: unknown, status: number): boolean;