API reference / @chanx-js/codegen / GenerateOptions
Interface: GenerateOptions
Defined in: generate.ts:18
Extends
Properties
alias?
optional alias?: Record<string, string>;Defined in: reuse.ts:14
Path prefix rewrites applied to import specifiers, e.g. { "src/": "@/" }.
Inherited from
ambient?
optional ambient?: boolean;Defined in: reuse.ts:12
Treat found types as ambient globals and emit no imports, matching a setup where generated files are non-module scripts merged into the global scope.
Inherited from
emit?
optional emit?: "ts" | "js";Defined in: generate.ts:29
ts writes one typed module per concern. js splits each into a runtime .js and a .d.ts, so a plain JavaScript project can import the descriptors and still get narrowing from its editor.
format?
optional format?: boolean;Defined in: generate.ts:30
outDir
outDir: string;Defined in: generate.ts:19
reuseFrom?
optional reuseFrom?: string[];Defined in: reuse.ts:5
Globs scanned for types that already exist, e.g. src/types/backend/**/*.ts.
Inherited from
reuseMap?
optional reuseMap?: Record<string, string>;Defined in: reuse.ts:7
Explicit overrides: type name to module specifier. Wins over the scan.
Inherited from
reuseStrict?
optional reuseStrict?: boolean;Defined in: generate.ts:23
Emit a file asserting reused types still match the schema.
validation?
optional validation?: "none" | "zod";Defined in: generate.ts:21
Also emit zod schemas and wire them into the descriptors' validators.