import { z } from '@hono/zod-openapi'; import type { TIdSchemaType } from './constants.js'; /** * The error RESPONSE for OpenAPI docs - here, beside the REST layer that already needs `@hono/zod-openapi`. * Named, so every route's `4XX` and `5XX` reference one `ErrorResponse` component. */ export declare const ErrorSchema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; export type TErrorResponse = z.infer; /** OpenAPI schema builders for the parts of a route that every controller repeats. */ export declare class OpenApiSchemas { static idParams(opts?: { idType: TIdSchemaType; }): z.ZodObject<{ id: z.ZodNumber; }, z.core.$strip> | z.ZodObject<{ id: z.ZodString; }, z.core.$strip>; static requiredString(opts?: { min?: number; max?: number; fixed?: number; }): z.ZodString; } /** OpenAPI Header Object format */ type THeaderObject = { description?: string; schema: { type: string; examples?: Array; }; }; /** Map of header names to Header Objects */ type TResponseHeaders = Record; type TJsonResponseOpts = { schema: T; description?: string; required?: boolean; headers?: H; }; /** OpenAPI response builders: the JSON and HTML bodies of a route, and the error bodies every route shares. */ export declare class OpenApiResponses { /** Creates HTML content configuration for OpenAPI documentation. */ static htmlContent(opts: { description: string; required?: boolean; }): { description: string; content: { 'text/html': { schema: z.ZodString; }; }; required: boolean; }; /** Creates HTML response configuration for OpenAPI documentation. */ static htmlResponse(opts: { description: string; required?: boolean; }): { '4XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; '5XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; 200: { description: string; content: { 'text/html': { schema: z.ZodString; }; }; required: boolean; }; }; static jsonContent(opts: { schema: T; description: string; required?: boolean; }): { description: string; content: { 'application/json': { schema: T; }; }; required: boolean | undefined; }; /** The JSON error body of a route, under `4XX` and `5XX` - the range keys OpenAPI accepts. */ static errorResponses(): { '4XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; '5XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; }; static jsonResponse(opts: TJsonResponseOpts): { '4XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; '5XX': { description: string; content: { 'application/json': { schema: z.ZodObject<{ statusCode: z.ZodOptional; message: z.ZodString; normalized: z.ZodOptional; }, z.core.$strip>>; extra: z.ZodOptional>; requestId: z.ZodOptional; details: z.ZodOptional>; }, z.core.$strip>; }; }; required: boolean | undefined; }; 200: { description: string; content: { 'application/json': { schema: ContentSchema; }; }; required: boolean | undefined; } | { headers: NonNullable; description: string; content: { 'application/json': { schema: ContentSchema; }; }; required: boolean | undefined; }; }; } export {}; //# sourceMappingURL=schemas.d.ts.map