flight-indicators 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -123,6 +123,87 @@ declare function vorDeviation(course: number, radial: number): {
123
123
  };
124
124
  declare function VorIndicator({ course, radial, deviation, toFrom, signal, ...props }: VorIndicatorProps): react.JSX.Element;
125
125
 
126
+ interface AdfIndicatorProps extends InstrumentProps {
127
+ /**
128
+ * Relative bearing to the station in degrees, measured clockwise from the aircraft's nose.
129
+ * `0` means the station is dead ahead, `90` off the right wing.
130
+ */
131
+ bearing?: number;
132
+ /**
133
+ * Heading set on the compass card, in degrees. Leave at `0` for a fixed-card ADF.
134
+ * Pass the aircraft heading for a rotatable-card ADF / RMI, where the needle then reads
135
+ * the magnetic bearing to the station directly.
136
+ */
137
+ heading?: number;
138
+ /** `false` parks the needle at 90° and shows the red ADF flag. Default `true`. */
139
+ signal?: boolean;
140
+ }
141
+ /** Relative bearing (0–360°, clockwise from the nose) of a station that lies on `bearingToStation` when flying `heading`. */
142
+ declare function relativeBearing(heading: number, bearingToStation: number): number;
143
+ declare function AdfIndicator({ bearing, heading, signal, ...props }: AdfIndicatorProps): react.JSX.Element;
144
+
145
+ /** Active and standby frequency of one receiver. Leave a value out to show dashes. */
146
+ interface RadioFrequency {
147
+ active?: number;
148
+ standby?: number;
149
+ }
150
+ interface RadioPanelProps extends InstrumentProps {
151
+ /** NAV (VOR/LOC) receiver frequencies in MHz, shown with two decimals. */
152
+ nav?: RadioFrequency;
153
+ /** ADF receiver frequencies in kHz. */
154
+ adf?: RadioFrequency;
155
+ /** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
156
+ dme?: number;
157
+ /** Colour of the digits. Default amber. */
158
+ color?: string;
159
+ }
160
+ /** NAV frequency in MHz as `116.80`, or dashes. */
161
+ declare const formatNav: (mhz?: number) => string;
162
+ /** ADF frequency in kHz as `362` (or `362.5`), or dashes. */
163
+ declare const formatAdf: (khz?: number) => string;
164
+ /** DME distance in NM: one decimal below 100 NM, whole miles above, or dashes. */
165
+ declare const formatDme: (nm?: number) => string;
166
+ declare function RadioPanel({ nav, adf, dme, color, ...props }: RadioPanelProps): react.JSX.Element;
167
+
168
+ interface RadioStackProps {
169
+ /** NAV (VOR/LOC) receiver, in MHz. Pass it to control the component; leave it out and it keeps its own state. */
170
+ nav?: RadioFrequency;
171
+ /** ADF receiver, in kHz. Pass it to control the component; leave it out and it keeps its own state. */
172
+ adf?: RadioFrequency;
173
+ /** Starting NAV frequencies when `nav` is not controlled. */
174
+ defaultNav?: RadioFrequency;
175
+ /** Starting ADF frequencies when `adf` is not controlled. */
176
+ defaultAdf?: RadioFrequency;
177
+ /** Called when the NAV standby frequency is entered or the frequencies are swapped. */
178
+ onNavChange?: (next: RadioFrequency) => void;
179
+ /** Called when the ADF standby frequency is entered or the frequencies are swapped. */
180
+ onAdfChange?: (next: RadioFrequency) => void;
181
+ /** Identifier of the station received on the active NAV frequency, e.g. `"KNA"`. Shown under the NAV label. */
182
+ navIdent?: string;
183
+ /** Identifier of the station received on the active ADF frequency. Shown under the ADF label. */
184
+ adfIdent?: string;
185
+ /** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
186
+ dme?: number;
187
+ /** Colour of the digits. Default amber. */
188
+ color?: string;
189
+ /** Rendered width. Number = pixels, or any CSS length (e.g. `"100%"`). Everything scales with it. Default `320`. */
190
+ width?: number | string;
191
+ className?: string;
192
+ style?: CSSProperties;
193
+ /** Accessible name of the group. Default `"Radio panel"`. */
194
+ title?: string;
195
+ }
196
+ /** NAV receivers tune 108.00–117.95 MHz. */
197
+ declare const parseNav: (text: string) => number | undefined;
198
+ /** ADF receivers tune 190–1750 kHz. */
199
+ declare const parseAdf: (text: string) => number | undefined;
200
+ /**
201
+ * An interactive navigation radio: NAV and ADF receivers with an active frequency, an editable standby
202
+ * frequency and a transfer button each, plus a DME distance readout.
203
+ * Unlike the instruments it is an HTML control, not an SVG dial.
204
+ */
205
+ declare function RadioStack({ nav, adf, defaultNav, defaultAdf, onNavChange, onAdfChange, navIdent, adfIdent, dme, color, width, className, style, title, }: RadioStackProps): react.JSX.Element;
206
+
126
207
  /** One readout on a `DataPanel`. */
127
208
  interface DataField {
128
209
  /** Short caption printed above the value, e.g. `"COM1"`. */
@@ -283,4 +364,4 @@ interface AoaIndicatorProps extends InstrumentProps {
283
364
  }
284
365
  declare function AoaIndicator({ aoa, min, optimum, max, showValue, label, ...props }: AoaIndicatorProps): react.JSX.Element;
285
366
 
286
- export { Airspeed, type AirspeedArcs, type AirspeedProps, Altimeter, type AltimeterProps, AoaIndicator, type AoaIndicatorProps, AttitudeIndicator, type AttitudeIndicatorProps, DEFAULT_BAR_GAUGES, DEFAULT_MANIFOLD, DEFAULT_RPM, type DataField, DataPanel, type DataPanelProps, type EngineBarGauge, type EngineGauge, EngineIndicator, type EngineIndicatorProps, FlapIndicator, type FlapIndicatorProps, type FlapSpeedLimit, FuelIndicator, type FuelIndicatorProps, type FuelTank, HeadingIndicator, type HeadingIndicatorProps, type InstrumentProps, MAX_BAR_GAUGES, MAX_CYLINDERS, MAX_FIELDS, MAX_TANKS, type PressureUnit, type RunwaySide, type ToFrom, TurnCoordinator, type TurnCoordinatorProps, VerticalSpeed, type VerticalSpeedProps, VorIndicator, type VorIndicatorProps, WindIndicator, type WindIndicatorProps, formatValue, vorDeviation };
367
+ export { AdfIndicator, type AdfIndicatorProps, Airspeed, type AirspeedArcs, type AirspeedProps, Altimeter, type AltimeterProps, AoaIndicator, type AoaIndicatorProps, AttitudeIndicator, type AttitudeIndicatorProps, DEFAULT_BAR_GAUGES, DEFAULT_MANIFOLD, DEFAULT_RPM, type DataField, DataPanel, type DataPanelProps, type EngineBarGauge, type EngineGauge, EngineIndicator, type EngineIndicatorProps, FlapIndicator, type FlapIndicatorProps, type FlapSpeedLimit, FuelIndicator, type FuelIndicatorProps, type FuelTank, HeadingIndicator, type HeadingIndicatorProps, type InstrumentProps, MAX_BAR_GAUGES, MAX_CYLINDERS, MAX_FIELDS, MAX_TANKS, type PressureUnit, type RadioFrequency, RadioPanel, type RadioPanelProps, RadioStack, type RadioStackProps, type RunwaySide, type ToFrom, TurnCoordinator, type TurnCoordinatorProps, VerticalSpeed, type VerticalSpeedProps, VorIndicator, type VorIndicatorProps, WindIndicator, type WindIndicatorProps, formatAdf, formatDme, formatNav, formatValue, parseAdf, parseNav, relativeBearing, vorDeviation };
package/dist/index.d.ts CHANGED
@@ -123,6 +123,87 @@ declare function vorDeviation(course: number, radial: number): {
123
123
  };
124
124
  declare function VorIndicator({ course, radial, deviation, toFrom, signal, ...props }: VorIndicatorProps): react.JSX.Element;
125
125
 
126
+ interface AdfIndicatorProps extends InstrumentProps {
127
+ /**
128
+ * Relative bearing to the station in degrees, measured clockwise from the aircraft's nose.
129
+ * `0` means the station is dead ahead, `90` off the right wing.
130
+ */
131
+ bearing?: number;
132
+ /**
133
+ * Heading set on the compass card, in degrees. Leave at `0` for a fixed-card ADF.
134
+ * Pass the aircraft heading for a rotatable-card ADF / RMI, where the needle then reads
135
+ * the magnetic bearing to the station directly.
136
+ */
137
+ heading?: number;
138
+ /** `false` parks the needle at 90° and shows the red ADF flag. Default `true`. */
139
+ signal?: boolean;
140
+ }
141
+ /** Relative bearing (0–360°, clockwise from the nose) of a station that lies on `bearingToStation` when flying `heading`. */
142
+ declare function relativeBearing(heading: number, bearingToStation: number): number;
143
+ declare function AdfIndicator({ bearing, heading, signal, ...props }: AdfIndicatorProps): react.JSX.Element;
144
+
145
+ /** Active and standby frequency of one receiver. Leave a value out to show dashes. */
146
+ interface RadioFrequency {
147
+ active?: number;
148
+ standby?: number;
149
+ }
150
+ interface RadioPanelProps extends InstrumentProps {
151
+ /** NAV (VOR/LOC) receiver frequencies in MHz, shown with two decimals. */
152
+ nav?: RadioFrequency;
153
+ /** ADF receiver frequencies in kHz. */
154
+ adf?: RadioFrequency;
155
+ /** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
156
+ dme?: number;
157
+ /** Colour of the digits. Default amber. */
158
+ color?: string;
159
+ }
160
+ /** NAV frequency in MHz as `116.80`, or dashes. */
161
+ declare const formatNav: (mhz?: number) => string;
162
+ /** ADF frequency in kHz as `362` (or `362.5`), or dashes. */
163
+ declare const formatAdf: (khz?: number) => string;
164
+ /** DME distance in NM: one decimal below 100 NM, whole miles above, or dashes. */
165
+ declare const formatDme: (nm?: number) => string;
166
+ declare function RadioPanel({ nav, adf, dme, color, ...props }: RadioPanelProps): react.JSX.Element;
167
+
168
+ interface RadioStackProps {
169
+ /** NAV (VOR/LOC) receiver, in MHz. Pass it to control the component; leave it out and it keeps its own state. */
170
+ nav?: RadioFrequency;
171
+ /** ADF receiver, in kHz. Pass it to control the component; leave it out and it keeps its own state. */
172
+ adf?: RadioFrequency;
173
+ /** Starting NAV frequencies when `nav` is not controlled. */
174
+ defaultNav?: RadioFrequency;
175
+ /** Starting ADF frequencies when `adf` is not controlled. */
176
+ defaultAdf?: RadioFrequency;
177
+ /** Called when the NAV standby frequency is entered or the frequencies are swapped. */
178
+ onNavChange?: (next: RadioFrequency) => void;
179
+ /** Called when the ADF standby frequency is entered or the frequencies are swapped. */
180
+ onAdfChange?: (next: RadioFrequency) => void;
181
+ /** Identifier of the station received on the active NAV frequency, e.g. `"KNA"`. Shown under the NAV label. */
182
+ navIdent?: string;
183
+ /** Identifier of the station received on the active ADF frequency. Shown under the ADF label. */
184
+ adfIdent?: string;
185
+ /** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
186
+ dme?: number;
187
+ /** Colour of the digits. Default amber. */
188
+ color?: string;
189
+ /** Rendered width. Number = pixels, or any CSS length (e.g. `"100%"`). Everything scales with it. Default `320`. */
190
+ width?: number | string;
191
+ className?: string;
192
+ style?: CSSProperties;
193
+ /** Accessible name of the group. Default `"Radio panel"`. */
194
+ title?: string;
195
+ }
196
+ /** NAV receivers tune 108.00–117.95 MHz. */
197
+ declare const parseNav: (text: string) => number | undefined;
198
+ /** ADF receivers tune 190–1750 kHz. */
199
+ declare const parseAdf: (text: string) => number | undefined;
200
+ /**
201
+ * An interactive navigation radio: NAV and ADF receivers with an active frequency, an editable standby
202
+ * frequency and a transfer button each, plus a DME distance readout.
203
+ * Unlike the instruments it is an HTML control, not an SVG dial.
204
+ */
205
+ declare function RadioStack({ nav, adf, defaultNav, defaultAdf, onNavChange, onAdfChange, navIdent, adfIdent, dme, color, width, className, style, title, }: RadioStackProps): react.JSX.Element;
206
+
126
207
  /** One readout on a `DataPanel`. */
127
208
  interface DataField {
128
209
  /** Short caption printed above the value, e.g. `"COM1"`. */
@@ -283,4 +364,4 @@ interface AoaIndicatorProps extends InstrumentProps {
283
364
  }
284
365
  declare function AoaIndicator({ aoa, min, optimum, max, showValue, label, ...props }: AoaIndicatorProps): react.JSX.Element;
285
366
 
286
- export { Airspeed, type AirspeedArcs, type AirspeedProps, Altimeter, type AltimeterProps, AoaIndicator, type AoaIndicatorProps, AttitudeIndicator, type AttitudeIndicatorProps, DEFAULT_BAR_GAUGES, DEFAULT_MANIFOLD, DEFAULT_RPM, type DataField, DataPanel, type DataPanelProps, type EngineBarGauge, type EngineGauge, EngineIndicator, type EngineIndicatorProps, FlapIndicator, type FlapIndicatorProps, type FlapSpeedLimit, FuelIndicator, type FuelIndicatorProps, type FuelTank, HeadingIndicator, type HeadingIndicatorProps, type InstrumentProps, MAX_BAR_GAUGES, MAX_CYLINDERS, MAX_FIELDS, MAX_TANKS, type PressureUnit, type RunwaySide, type ToFrom, TurnCoordinator, type TurnCoordinatorProps, VerticalSpeed, type VerticalSpeedProps, VorIndicator, type VorIndicatorProps, WindIndicator, type WindIndicatorProps, formatValue, vorDeviation };
367
+ export { AdfIndicator, type AdfIndicatorProps, Airspeed, type AirspeedArcs, type AirspeedProps, Altimeter, type AltimeterProps, AoaIndicator, type AoaIndicatorProps, AttitudeIndicator, type AttitudeIndicatorProps, DEFAULT_BAR_GAUGES, DEFAULT_MANIFOLD, DEFAULT_RPM, type DataField, DataPanel, type DataPanelProps, type EngineBarGauge, type EngineGauge, EngineIndicator, type EngineIndicatorProps, FlapIndicator, type FlapIndicatorProps, type FlapSpeedLimit, FuelIndicator, type FuelIndicatorProps, type FuelTank, HeadingIndicator, type HeadingIndicatorProps, type InstrumentProps, MAX_BAR_GAUGES, MAX_CYLINDERS, MAX_FIELDS, MAX_TANKS, type PressureUnit, type RadioFrequency, RadioPanel, type RadioPanelProps, RadioStack, type RadioStackProps, type RunwaySide, type ToFrom, TurnCoordinator, type TurnCoordinatorProps, VerticalSpeed, type VerticalSpeedProps, VorIndicator, type VorIndicatorProps, WindIndicator, type WindIndicatorProps, formatAdf, formatDme, formatNav, formatValue, parseAdf, parseNav, relativeBearing, vorDeviation };