Skip to content

API reference / @chanx-js/codegen / GenerateOptions

Interface: GenerateOptions ​

Defined in: generate.ts:18

Extends ​

Properties ​

alias? ​

ts
optional alias?: Record<string, string>;

Defined in: reuse.ts:14

Path prefix rewrites applied to import specifiers, e.g. { "src/": "@/" }.

Inherited from ​

ReuseOptions.alias


ambient? ​

ts
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 ​

ReuseOptions.ambient


emit? ​

ts
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? ​

ts
optional format?: boolean;

Defined in: generate.ts:30


outDir ​

ts
outDir: string;

Defined in: generate.ts:19


reuseFrom? ​

ts
optional reuseFrom?: string[];

Defined in: reuse.ts:5

Globs scanned for types that already exist, e.g. src/types/backend/**/*.ts.

Inherited from ​

ReuseOptions.reuseFrom


reuseMap? ​

ts
optional reuseMap?: Record<string, string>;

Defined in: reuse.ts:7

Explicit overrides: type name to module specifier. Wins over the scan.

Inherited from ​

ReuseOptions.reuseMap


reuseStrict? ​

ts
optional reuseStrict?: boolean;

Defined in: generate.ts:23

Emit a file asserting reused types still match the schema.


validation? ​

ts
optional validation?: "none" | "zod";

Defined in: generate.ts:21

Also emit zod schemas and wire them into the descriptors' validators.

MIT licensed