feat: generate typed frontend API contracts

This commit is contained in:
sjg
2026-08-01 11:58:09 +02:00
parent 888f793eb8
commit bbc53d56b0
16 changed files with 504 additions and 38 deletions
+1
View File
@@ -15,3 +15,4 @@ ft2 = []
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
trx-core = { path = "../trx-core" }
ts-rs = "12.0.1"
+3 -2
View File
@@ -9,13 +9,14 @@
//! their decoder knowledge from [`DECODER_REGISTRY`].
use serde::Serialize;
use ts_rs::TS;
// ============================================================================
// Types
// ============================================================================
/// How a decoder is activated.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, TS)]
#[serde(rename_all = "snake_case")]
pub enum DecoderActivation {
/// Automatically active when the rig mode matches.
@@ -25,7 +26,7 @@ pub enum DecoderActivation {
}
/// Static descriptor for a single decoder.
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone, Serialize, TS)]
pub struct DecoderDescriptor {
/// Machine identifier, e.g. `"ft8"`, `"aprs"`.
pub id: &'static str,