Skip to main content

Module codegen

Module codegen 

Source
Expand description

TypeScript IR emitter (gen-ts). Emit TypeScript IR types from an explicit Rust IR_ELEMENTS spec (SoT with models).

Static preamble / enums / supporting / footer live in src/codegen/*.ts via include_str!. The remaining push_str calls are intentional: per-element interfaces and the WidgetElement union are generated from IR_ELEMENTS so exhaustiveness tests stay coupled to crate::models::WidgetElement.

Functionsยง

emit_widget_types_ts
Emit guest-js/generated/widget-types.ts.
emit_wire_catalog_kotlin
Wire type constants for Android Glance renderer (JSONObject path stays dynamic).
emit_wire_catalog_swift
Wire type strings + field hints for Swift (flat Codable stays in Models.swift).