// SPDX-FileCopyrightText: 2026 Stan Grams <sjg@haxx.space>
//
// SPDX-License-Identifier: GPL-2.0-or-later

// Generated by `cargo run -p trx-frontend-http --example generate_typescript`.
// Do not edit manually.

export type Band = { low_hz: number, high_hz: number, tx_allowed: boolean, };

export type Freq = { hz: number, };

export type RigMode = "LSB" | "USB" | "CW" | "CWR" | "AM" | "SAM" | "WFM" | "FM" | "AIS" | "VDES" | "DIG" | "PKT" | { "Other": string };

export type RigAccessMethod = { "Serial": { path: string, baud: number, } } | { "Tcp": { addr: string, } };

export type RigCapabilities = { min_freq_step_hz: number, supported_bands: Array<Band>, supported_modes: Array<RigMode>, num_vfos: number, lock: boolean, lockable: boolean, attenuator: boolean, preamp: boolean, rit: boolean, rpt: boolean, split: boolean, 
/**
 * Backend supports transmit: PTT, power on/off, TX meters, TX audio.
 */
tx: boolean, 
/**
 * Backend supports get_tx_limit / set_tx_limit.
 */
tx_limit: boolean, 
/**
 * Backend supports toggle_vfo.
 */
vfo_switch: boolean, 
/**
 * Backend supports runtime filter adjustment (bandwidth).
 */
filter_controls: boolean, 
/**
 * Backend returns a meaningful RX signal strength value.
 */
signal_meter: boolean, };

export type RigInfo = { manufacturer: string, model: string, revision: string, capabilities: RigCapabilities, access: RigAccessMethod, };

export type RigVfoEntry = { name: string, freq: Freq, mode: RigMode | null, };

export type RigVfo = { entries: Array<RigVfoEntry>, 
/**
 * Index into `entries` for the active VFO, if known.
 */
active: number | null, };

export type RigTxStatus = { power: number | null, limit: number | null, swr: number | null, alc: number | null, };

export type RigRxStatus = { sig: number | null, };

export type RigStatus = { freq: Freq, mode: RigMode, tx_en: boolean, vfo: RigVfo | null, tx: RigTxStatus | null, rx: RigRxStatus | null, lock: boolean | null, };

export type DecoderConfig = { aprs_decode_enabled: boolean, hf_aprs_decode_enabled: boolean, cw_decode_enabled: boolean, ft8_decode_enabled: boolean, ft4_decode_enabled: boolean, ft2_decode_enabled: boolean, wspr_decode_enabled: boolean, lrpt_decode_enabled: boolean, wefax_decode_enabled: boolean, recorder_enabled: boolean, };

export type WfmDenoiseLevel = "off" | "auto" | "low" | "medium" | "high";

export type RigFilterState = { bandwidth_hz: number, cw_center_hz: number, sdr_gain_db?: number | null, sdr_lna_gain_db?: number | null, sdr_agc_enabled?: boolean | null, sdr_squelch_enabled?: boolean | null, sdr_squelch_threshold_db?: number | null, sdr_nb_enabled?: boolean | null, sdr_nb_threshold?: number | null, wfm_deemphasis_us: number, wfm_stereo: boolean, wfm_stereo_detected: boolean, wfm_denoise: WfmDenoiseLevel, 
/**
 * Co-Channel Interference level (0–100 scale).
 */
wfm_cci: number, 
/**
 * Adjacent Channel Interference level (0–100 scale).
 */
wfm_aci: number, 
/**
 * SAM stereo width (0.0 = mono, 1.0 = full stereo).
 */
sam_stereo_width: number, 
/**
 * SAM carrier synchronization enabled.
 */
sam_carrier_sync: boolean, };

export type RdsData = { pi?: number | null, program_service?: string | null, radio_text?: string | null, program_type_name_long?: string | null, pty?: number | null, pty_name?: string | null, traffic_program?: boolean | null, traffic_announcement?: boolean | null, music?: boolean | null, stereo?: boolean | null, artificial_head?: boolean | null, compressed?: boolean | null, dynamic_pty?: boolean | null, alternative_frequencies_hz?: Array<number> | null, };

export type SpectrumData = { 
/**
 * FFT magnitude bins in dBFS, FFT-shifted so DC (centre frequency) is at index N/2.
 */
bins: Array<number>, 
/**
 * Centre frequency of the SDR capture in Hz.
 */
center_hz: number, 
/**
 * SDR capture sample rate in Hz; the displayed span is ±sample_rate/2.
 */
sample_rate: number, 
/**
 * Decoded Radio Data System state, when available for WFM.
 */
rds?: RdsData | null, };

export type VchanRdsEntry = { 
/**
 * Virtual channel UUID.
 */
id: string, 
/**
 * Latest RDS data, if decoded.
 */
rds?: RdsData | null, 
/**
 * Channel signal level in dBFS.
 */
signal_db?: number | null, };

export type RigSnapshot = { info: RigInfo, status: RigStatus, band: string | null, enabled: boolean | null, initialized: boolean, server_callsign?: string | null, server_version?: string | null, server_build_date?: string | null, server_latitude?: number | null, server_longitude?: number | null, pskreporter_status?: string | null, aprs_is_status?: string | null, cw_auto: boolean, cw_wpm: number, cw_tone_hz: number, filter?: RigFilterState | null, spectrum?: SpectrumData | null, 
/**
 * Per-virtual-channel RDS snapshots, when available.
 */
vchan_rds?: Array<VchanRdsEntry> | null, aprs_decode_enabled: boolean, hf_aprs_decode_enabled: boolean, cw_decode_enabled: boolean, ft8_decode_enabled: boolean, ft4_decode_enabled: boolean, ft2_decode_enabled: boolean, wspr_decode_enabled: boolean, lrpt_decode_enabled: boolean, wefax_decode_enabled: boolean, recorder_enabled: boolean, };

export type RigListItem = { remote: string, display_name: string | null, manufacturer: string, model: string, supported_modes: Array<RigMode>, tx: boolean, filter_controls: boolean, initialized: boolean, latitude: number | null, longitude: number | null, };

export type RigListResponse = { active_remote: string | null, rigs: Array<RigListItem>, };

export type FrontendMeta = { clients: number, rigctl_clients: number, audio_clients: number, rigctl_addr: string | null, active_remote: string | null, remotes: Array<string>, owner_callsign: string | null, owner_website_url: string | null, owner_website_name: string | null, ais_vessel_url_base: string | null, show_sdr_gain_control: boolean, initial_map_zoom: number, spectrum_coverage_margin_hz: number, spectrum_usable_span_ratio: number, bandplan_enabled: boolean, bandplan_region: string, decode_history_retention_min: bigint, server_connected: boolean, };

export type DecoderActivation = "mode_bound" | "toggle";

export type DecoderDescriptor = { 
/**
 * Machine identifier, e.g. `"ft8"`, `"aprs"`.
 */
id: string, 
/**
 * Human-readable label, e.g. `"FT8"`, `"APRS"`.
 */
label: string, 
/**
 * How the decoder is activated.
 */
activation: DecoderActivation, 
/**
 * Rig modes where this decoder operates (upper-case).
 */
active_modes: Array<string>, 
/**
 * Whether the decoder can run on SDR virtual channels
 * (background-decode / scheduler).
 */
background_decode: boolean, 
/**
 * Whether this decoder should appear in bookmark forms.
 */
bookmark_selectable: boolean, };

