Documentation
¶
Overview ¶
Package typescript implements the TypeScript client code generator for melange.
This generator produces type-safe TypeScript code from authorization schemas, including object type constants, relation constants, and factory functions.
Generated code uses the @pthm/melange runtime package for type definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct{}
Generator implements clientgen.Generator for TypeScript.
func (*Generator) DefaultConfig ¶
DefaultConfig returns default configuration for TypeScript code generation.
func (*Generator) Generate ¶
func (g *Generator) Generate(types []schema.TypeDefinition, cfg *clientgen.Config) (map[string][]byte, error)
Generate produces TypeScript client code from the given type definitions.
Returns a multi-file map with keys: "types.ts", "schema.ts", "index.ts".
Generated code includes:
- types.ts: ObjectType/Relation constants and union types
- schema.ts: Factory functions and wildcard constructors
- index.ts: Re-exports for clean imports
Click to show internal directories.
Click to hide internal directories.