import { StatusCode } from '@purista/core'; import type { SchemaObject } from 'openapi3-ts/oas31'; /** * RFC 9457-style problem details response returned by generated Hono endpoints. */ export type ProblemDetails = { /** Problem type URI or `about:blank` when no custom base URI is configured. */ type: string; /** Human-readable status title. */ title: string; /** HTTP status code. */ status: number; /** Occurrence-specific error detail safe for the selected error class. */ detail: string; /** Request path or URI where the problem occurred. */ instance?: string; /** Application trace identifier propagated through the HTTP request. */ traceId?: string; /** Validation issues, when available. */ errors?: unknown[]; /** Additional safe details for handled errors or explicitly allowed internal details. */ details?: unknown; }; /** * Controls generated problem type URIs. */ export type ProblemTypeConfig = { /** Base URI used for known problem type slugs. */ typeBaseUri?: string; }; /** * Resolves the problem type URI for an HTTP status and optional validation data. */ export declare const getProblemTypeUri: (status: number, data?: unknown, config?: ProblemTypeConfig) => string; /** * Converts PURISTA errors and unknown thrown values into HTTP problem details. * * Server errors are intentionally minimized unless `safeInternalDetails` is set. */ export declare const toProblemDetails: (error: unknown, input?: { statusCode?: number; traceId?: string; instance?: string; safeInternalDetails?: boolean; problemTypeConfig?: ProblemTypeConfig; }) => ProblemDetails; /** * Renders problem details as Markdown for clients that prefer `text/markdown`. */ export declare const renderProblemDetailsMarkdown: (problem: ProblemDetails) => string; /** * Chooses the problem details response representation from an HTTP `Accept` header. */ export declare const negotiateProblemRepresentation: (acceptHeader?: string) => 'json' | 'markdown'; /** * Builds an OpenAPI schema for problem details responses. */ export declare const getProblemDetailsSchema: (code: StatusCode, message: string, schema?: SchemaObject, problemTypeConfig?: ProblemTypeConfig) => SchemaObject; //# sourceMappingURL=problemDetails.d.ts.map