Skip to content

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 ​

ParameterType
schemasRecord<string, JsonSchema>
connectionsConnectionInfo[]
skipReadonlySet<string>
schemasModulestring
channelsModulestring

Returns ​

string

MIT licensed