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.
19 lines (18 loc) • 585 B
TypeScript
import type { ObjectSchema } from "jsonv-ts";
import type { MiddlewareHandler, ValidationTargets } from "hono";
import type { DescribeRouteOptions } from "./openapi/types";
export declare const $symbol: unique symbol;
export type RouteHandler = {
type: "parameters";
skip?: boolean;
value: {
target: keyof ValidationTargets;
schema: ObjectSchema;
};
} | {
type: "route-doc";
value: DescribeRouteOptions;
};
export declare const symbolize: (handler: MiddlewareHandler, opts: RouteHandler) => MiddlewareHandler & {
[$symbol]: RouteHandler;
};