API reference / @chanx-js/codegen / emitZodDeclaration
Function: emitZodDeclaration()
ts
function emitZodDeclaration(
schemas,
connections,
skip,
schemasModule,
channelsModule
): string;Defined in: emit-zod.ts:119
The .d.ts companion to a JavaScript schemas.zod.js.
Each validator is declared as z.ZodType<T>, which is what parse needs to return the right type; reproducing the precise zod class by hand buys nothing.
Parameters
| Parameter | Type |
|---|---|
schemas | Record<string, JsonSchema> |
connections | ConnectionInfo[] |
skip | ReadonlySet<string> |
schemasModule | string |
channelsModule | string |
Returns
string