type HttpErrorMetadataValue = string | number | boolean | bigint | null | undefined; type HttpErrorProblemFields = { type?: string; title?: string; instance?: string; }; type HttpErrorOptions = ErrorOptions & HttpErrorProblemFields & { status?: string; reason?: string; domain?: string; metadata?: Record; details?: unknown[]; errors?: unknown; }; type HttpErrorShape = HttpErrorProblemFields & { statusCode: number; status?: string; message: string; reason?: string; domain?: string; metadata?: Record; details?: unknown[]; errors?: unknown; }; type Aip193ErrorInfoDetail = { type: 'error_info'; reason: string; domain: string; metadata?: Record; }; type Aip193ErrorPayload = { error: { code: number; status: string; message: string; details?: unknown[]; }; }; type Rfc9457ErrorPayload = { type?: string; title?: string; status?: number; detail?: string; instance?: string; errors?: TError[]; }; type Rfc9457ValidationError = { detail: string; pointer?: string; parameter?: string; header?: string; }; declare const canonicalStatusByHttpStatus: { readonly 400: "INVALID_ARGUMENT"; readonly 401: "UNAUTHENTICATED"; readonly 403: "PERMISSION_DENIED"; readonly 404: "NOT_FOUND"; readonly 409: "ABORTED"; readonly 412: "FAILED_PRECONDITION"; readonly 429: "RESOURCE_EXHAUSTED"; readonly 500: "INTERNAL"; readonly 501: "UNIMPLEMENTED"; readonly 503: "UNAVAILABLE"; readonly 504: "DEADLINE_EXCEEDED"; }; declare const getCanonicalStatus: (statusCode: number) => string; declare const getStatusTitle: (statusCode: number) => string; declare const createAip193ErrorInfoDetail: (reason: string, domain: string, metadata?: Record) => Aip193ErrorInfoDetail; declare const toAip193ErrorPayload: (error: HttpErrorShape, fallbackDomain?: string) => Aip193ErrorPayload; declare const toRfc9457ErrorPayload: (error: HttpErrorShape) => Rfc9457ErrorPayload; declare const toRfc9457ValidationErrorPayload: (error: HttpErrorShape) => Rfc9457ErrorPayload; /** * Base typed HTTP error with a numeric `statusCode` and machine-readable metadata. * * @example * throw new HttpError(503, 'please try again later'); */ declare class HttpError extends Error { readonly statusCode: number; readonly status: string; readonly date: Date; readonly reason?: string; readonly domain?: string; readonly metadata?: Record; readonly details?: unknown[]; readonly errors?: unknown; readonly type?: string; readonly title?: string; readonly instance?: string; constructor(statusCode?: number, message?: string, options?: HttpErrorOptions); } declare class ClientError extends HttpError { constructor(statusCode?: number, message?: string, options?: HttpErrorOptions); } declare class ServerError extends HttpError { constructor(statusCode?: number, message?: string, options?: HttpErrorOptions); } declare class BadRequestError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UnauthorizedError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class ForbiddenError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class NotFoundError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class MethodNotAllowedError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class NotAcceptableError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class ProxyAuthRequiredError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class RequestTimeoutError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class ConflictError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class GoneError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class LengthRequiredError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class PreconditionFailedError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class PayloadTooLargeError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UriTooLongError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UnsupportedMediaTypeError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class RequestedRangeNotSatisfiableError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class ExpectationFailedError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class TeapotError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class MisdirectedRequestError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UnprocessableEntityError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class LockedError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class FailedDependencyError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UpgradeRequiredError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class PreconditionRequiredError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class TooManyRequestsError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class RequestHeaderFieldsTooLargeError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class UnavailableForLegalReasonsError extends ClientError { constructor(message?: string, options?: HttpErrorOptions); } declare class InternalServerError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class NotImplementedError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class BadGatewayError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class ServiceUnavailableError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class GatewayTimeoutError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class HttpVersionNotSupportedError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class VariantAlsoNegotiatesError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class InsufficientStorageError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class LoopDetectedError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class NotExtendedError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } declare class NetworkAuthenticationRequiredError extends ServerError { constructor(message?: string, options?: HttpErrorOptions); } export { type Aip193ErrorInfoDetail, type Aip193ErrorPayload, BadGatewayError, BadRequestError, ClientError, ConflictError, ExpectationFailedError, FailedDependencyError, ForbiddenError, GatewayTimeoutError, GoneError, HttpError, type HttpErrorMetadataValue, type HttpErrorOptions, type HttpErrorProblemFields, type HttpErrorShape, HttpVersionNotSupportedError, InsufficientStorageError, InternalServerError, LengthRequiredError, LockedError, LoopDetectedError, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, PayloadTooLargeError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthRequiredError, RequestHeaderFieldsTooLargeError, RequestTimeoutError, RequestedRangeNotSatisfiableError, type Rfc9457ErrorPayload, type Rfc9457ValidationError, ServerError, ServiceUnavailableError, TeapotError, TooManyRequestsError, UnauthorizedError, UnavailableForLegalReasonsError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, UriTooLongError, VariantAlsoNegotiatesError, canonicalStatusByHttpStatus, createAip193ErrorInfoDetail, getCanonicalStatus, getStatusTitle, toAip193ErrorPayload, toRfc9457ErrorPayload, toRfc9457ValidationErrorPayload };