import { type ZodTypeAny } from 'zod'; type JsonSchema = Record; /** * Zod → JSON Schema (OpenAPI 3.0 dialect), delegating to Zod's own converter. * * Until zod 4 became the requirement this function also carried a hand-rolled * `switch` over `_def.typeName` for zod 3, which the native converter replaces * outright. Unknown types still degrade to `{}` rather than throwing: an * OpenAPI document missing a constraint is far better than a boot that fails. */ export declare function zodToJsonSchema(schema: ZodTypeAny): JsonSchema; export interface OpenApiInfo { title: string; version: string; description?: string; } /** A top-level OpenAPI tag: a group name and an optional human description. */ export interface OpenApiTag { name: string; description?: string; } export interface RouteLike { method: string; url: string; meta?: Record; body?: ZodTypeAny; query?: ZodTypeAny; params?: ZodTypeAny; response?: Record; } /** * Builds an OpenAPI 3.0 document from Basalt route definitions. * * Per-operation tags come from `route.meta.tags`; pass `tags` to add a top-level * `tags` array (names + descriptions) that tools like Swagger UI use to order * and describe the groups. Any tag used on an operation but missing from `tags` * is still listed (name only), so groups are never dropped. */ export declare function generateOpenApi(routes: RouteLike[], info: OpenApiInfo, tags?: OpenApiTag[]): JsonSchema; export interface OpenApiPluginOptions { info: OpenApiInfo; path?: string; routes?: RouteLike[]; /** Top-level tag list (names + descriptions) for grouping in the docs UI. */ tags?: OpenApiTag[]; } /** Serves an OpenAPI 3.0 document from the registered routes (any adapter). */ export declare function openapiPlugin(options: OpenApiPluginOptions): import("@basaltkit/core").BasaltPlugin; export {};