UNPKG

@tsed/schema

Version:
21 lines (20 loc) 631 B
import { JsonSchema } from "../domain/JsonSchema.js"; /** * Declare a new object model. * * See @@JsonSchema@@ to discover available methods. * * ### Example * * ```typescript * const userSchema = object({ * name: string(), * age: number() * }); * ``` * * @param properties - An object containing property definitions where each value is a JsonSchema * @returns A new object model with the specified properties * @schemaFunctional */ export declare function object<P extends Record<string, JsonSchema<any>> = Record<string, JsonSchema<any>>>(properties?: P): JsonSchema<import("../index.js").PropsToShape<P>>;