feat: generate typed frontend API contracts
This commit is contained in:
@@ -15,3 +15,4 @@ ft2 = []
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
trx-core = { path = "../trx-core" }
|
||||
ts-rs = "12.0.1"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user