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.
9 lines (8 loc) • 594 B
TypeScript
import { Schema, symbol, type StrictOptions } from "../schema";
import type { Merge } from "../static";
import type { IUnionOptions } from "./union";
export type StaticUnionAllOf<T extends Schema[]> = T extends [
infer U,
...infer Rest
] ? U extends Schema ? Rest extends Schema[] ? Merge<U[typeof symbol]["static"] & StaticUnionAllOf<Rest>> : U[typeof symbol]["static"] : never : {};
export declare const allOf: <const T extends Schema[], const O extends IUnionOptions>(schemas: T, options?: StrictOptions<IUnionOptions, O>) => Schema<O, StaticUnionAllOf<T>, StaticUnionAllOf<T>> & O;