Expand description
§prax-typegen
Generate TypeScript interfaces and Zod schemas from Prax ORM schema files.
This crate reads .prax schema files and produces TypeScript output that
mirrors the models, enums, and composite types defined in the schema.
§Generator Block
Add a generator block to your .prax schema:
generator typescript {
provider = "prax-typegen"
output = "./src/types"
generate = env("TYPESCRIPT_GENERATE")
}When TYPESCRIPT_GENERATE is set to true, 1, or yes in the
environment, prax generate will invoke this generator.
Structs§
- Generated
Output - Generated TypeScript output.
- Interface
Generator - Generates TypeScript interfaces from a Prax schema.
- Type
Mapper - Maps Prax types to TypeScript / Zod representations.
- Typegen
- Top-level generator that produces both interfaces and Zod schemas.
- ZodGenerator
- Generates Zod schemas from a Prax schema.
Enums§
Functions§
- generator_
enabled - Check the schema for a generator named
nameand return whether it’s enabled. - resolve_
output_ dir - Resolve the output directory from the generator block, falling back to a default.
Type Aliases§
- Result
- Result type for typegen operations.