import { BasaltError, type BasaltErrorOptions } from '@basaltkit/core'; import type { ErrorDetails } from './error-details.js'; export interface ValidationIssue { path: string; message: string; } /** Body/query/params validation failure — becomes a standardized 400 response. */ export declare class RequestValidationError extends BasaltError { readonly part: 'body' | 'query' | 'params'; readonly issues: ValidationIssue[]; constructor(part: 'body' | 'query' | 'params', issues: ValidationIssue[]); } /** * Fourth argument to `HttpError` — an options object rather than a positional * `details`, so later additions do not keep widening the signature. */ export interface HttpErrorOptions extends BasaltErrorOptions { /** * Machine-readable data the client is meant to act on — which checks failed, * how much quota is left, the current version behind a 409. Serialised as * `error.details`, so it is PUBLIC: plain JSON data, no secrets, no * internals, and bounded (see `sanitizeErrorDetails`). */ details?: ErrorDetails; } /** * Intentional HTTP error throwable from any layer: * `throw new HttpError(404, 'PROJECT_NOT_FOUND', 'Project not found')` * * With a structured payload for the UI to act on: * `throw new HttpError(422, 'CHECKS_FAILED', 'Checks failed.', { details: { failed: ['age'] } })` */ export declare class HttpError extends BasaltError { readonly status: number; constructor(status: number, code: string, message: string, options?: HttpErrorOptions); } /** * The neutral not-found body every adapter serves for an unmatched route * (unless the adapter plugin is given `notFound: false`). One shape across * Fastify, Express and Hono — same `{ error: { code, message } }` contract as * validation and HttpError responses, and no framework-fingerprinting HTML or * plain-text defaults. */ export declare const NOT_FOUND_RESPONSE: { readonly error: { readonly code: 'NOT_FOUND'; readonly message: 'Route not found.'; }; }; /** * A route pipeline carried guards but no container, so the guards could not run. * The pipeline used to skip them silently — a fail-open shape: the request would * reach the handler unauthorized. Guards and container are wired together in every * shipped adapter, so this can only fire on a hand-built pipeline; it fails closed. */ export declare class GuardsWithoutContainerError extends BasaltError { readonly status = 500; constructor(route: string, count: number); }