Skip to main content

Module ts_codegen

Module ts_codegen 

Source
Expand description

Generate TypeScript types from heddle’s runtime JSON-Schema introspection.

This is the source of truth for the clients/npm wrapper (#581/#584): it walks every schema verb (schema_verbs), renders the schemars-derived JSON Schema for each (schema_for_verb), and produces both the raw schemas and hand-free TypeScript declarations a Node/Electron harness can import.

The output is deterministic (everything sorted), so regenerating on an unchanged contract produces a no-op diff. The gen_ts_types example writes it to disk; tests/ts_types_in_sync.rs asserts the checked-in files match.

Structs§

Generated
The generated wrapper artifacts.

Constants§

SCHEMA_VERSION
Schema-contract version the emitted types are pinned to. Tracks the heddle-cli crate version: a contract change ships in a new CLI release, so the crate version is the coarsest-correct pin for “which heddle do these types describe”.

Functions§

generate
Render the TypeScript module and raw-schema JSON from the live catalog.