UNPKG

jsonv-ts

Version:

JSON Schema builder and validator for TypeScript with static type inference, Hono middleware for OpenAPI generation and validation, and MCP server/client implementation. Lightweight, dependency-free, and built on Web Standards.

18 lines (17 loc) 714 B
import { type Schema } from "../"; export type ToSchemaOptions = { indent?: string; currentIndent?: number; fallback?: string; generateChild?: (schema: Schema, opts?: ToSchemaOptions) => string; }; export type ToTypesOptions = ToSchemaOptions & { type?: "type" | "interface"; export?: boolean; }; export type ToDefinitionOptions = ToTypesOptions & { generateName?: (schema: Schema) => string; }; export declare function toDefinition(schema: Schema, _name?: string, opts?: ToDefinitionOptions): string; export declare function toTypes(schema: Schema, _name?: string, opts?: ToTypesOptions): string; export declare function schemaToTypes(schema: Schema, _opts?: ToSchemaOptions): string;