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.

Enums§

WireTypeschema
Wire type of one schema property (nullability dropped: every field is optional).

Functions§

element_fieldsschema
Union of every element’s properties (style included) → wire type, from the schema the host validates with. Panics on a name used with two different types.
emit_widget_element_swiftschema
swift/Sources/TauriWidgets/Generated/WidgetElement.swift: the flat Codable element every SwiftUI renderer decodes, generated from the Rust IR so no field can drift.
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).
emit_wire_fields_kotlinschema
android/src/main/java/render/WireFields.kt: every field name as a constant, plus the fields each element type accepts (renderers read JSONObject keys through these).