import type { AxiosError } from "axios"; /** * Shape of the error payload returned by the CompanyCam API. * Mirrors the `components.schemas.Error` object in the OpenAPI document. */ export interface APIProblem { errors?: string[]; [key: string]: unknown; } /** * Options for constructing an {@link APIError}. */ export interface APIErrorOptions { status?: number; code?: string; problem?: APIProblem | unknown; headers?: Record; requestId?: string; method?: string; url?: string; cause?: unknown; } /** * Rich error type thrown whenever the CompanyCam API responds with a non-success status. * Mirrors the problem document defined by the OpenAPI specification and carries request metadata. */ export declare class APIError extends Error { readonly status?: number; readonly code?: string; readonly problem?: APIProblem | unknown; readonly headers?: Record; readonly requestId?: string; readonly method?: string; readonly url?: string; /** * Represent a failed API request with structured metadata. */ constructor(message: string, options?: APIErrorOptions); /** * Convert an {@link AxiosError} instance into an {@link APIError}, preserving request metadata * and the spec-defined problem payload when available. * * @param error Axios error raised by the underlying HTTP client. * @returns Structured {@link APIError} ready to surface to SDK consumers. */ static fromAxios(error: AxiosError): APIError; } //# sourceMappingURL=Errors.d.ts.map