flight-indicators 1.1.0 → 1.2.1
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/README.md +77 -4
- package/dist/index.cjs +595 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -2
- package/dist/index.d.ts +91 -2
- package/dist/index.js +587 -161
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/index.d.cts
CHANGED
|
@@ -98,6 +98,8 @@ interface WindIndicatorProps extends InstrumentProps {
|
|
|
98
98
|
declare function WindIndicator({ runway, runwaySide, windDirection, windSpeed, windGust, crosswindLimit, ...props }: WindIndicatorProps): react.JSX.Element;
|
|
99
99
|
|
|
100
100
|
type ToFrom = 'TO' | 'FROM' | 'OFF';
|
|
101
|
+
/** How the course deviation needle moves: sliding sideways, or swinging from a hinge under the top index. */
|
|
102
|
+
type VorNeedle = 'slide' | 'swing';
|
|
101
103
|
interface VorIndicatorProps extends InstrumentProps {
|
|
102
104
|
/** Selected course (OBS) in degrees. The compass card turns so this course sits under the top index. */
|
|
103
105
|
course?: number;
|
|
@@ -115,13 +117,100 @@ interface VorIndicatorProps extends InstrumentProps {
|
|
|
115
117
|
toFrom?: ToFrom;
|
|
116
118
|
/** `false` shows the red NAV flag, centres the needle and hides TO/FROM. Default `true`. */
|
|
117
119
|
signal?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* `"slide"` (default) moves a vertical bar sideways across a straight row of dots.
|
|
122
|
+
* `"swing"` hinges the needle just below the top index so it swings like a pendulum over a curved row of dots,
|
|
123
|
+
* as on older VOR heads.
|
|
124
|
+
*/
|
|
125
|
+
needle?: VorNeedle;
|
|
118
126
|
}
|
|
119
127
|
/** Needle deflection (°, positive = course to the right) and flag for an aircraft on `radial` with `course` selected. */
|
|
120
128
|
declare function vorDeviation(course: number, radial: number): {
|
|
121
129
|
deviation: number;
|
|
122
130
|
toFrom: ToFrom;
|
|
123
131
|
};
|
|
124
|
-
declare function VorIndicator({ course, radial, deviation, toFrom, signal, ...props }: VorIndicatorProps): react.JSX.Element;
|
|
132
|
+
declare function VorIndicator({ course, radial, deviation, toFrom, signal, needle, ...props }: VorIndicatorProps): react.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface AdfIndicatorProps extends InstrumentProps {
|
|
135
|
+
/**
|
|
136
|
+
* Relative bearing to the station in degrees, measured clockwise from the aircraft's nose.
|
|
137
|
+
* `0` means the station is dead ahead, `90` off the right wing.
|
|
138
|
+
*/
|
|
139
|
+
bearing?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Heading set on the compass card, in degrees. Leave at `0` for a fixed-card ADF.
|
|
142
|
+
* Pass the aircraft heading for a rotatable-card ADF / RMI, where the needle then reads
|
|
143
|
+
* the magnetic bearing to the station directly.
|
|
144
|
+
*/
|
|
145
|
+
heading?: number;
|
|
146
|
+
/** `false` parks the needle at 90° and shows the red ADF flag. Default `true`. */
|
|
147
|
+
signal?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/** Relative bearing (0–360°, clockwise from the nose) of a station that lies on `bearingToStation` when flying `heading`. */
|
|
150
|
+
declare function relativeBearing(heading: number, bearingToStation: number): number;
|
|
151
|
+
declare function AdfIndicator({ bearing, heading, signal, ...props }: AdfIndicatorProps): react.JSX.Element;
|
|
152
|
+
|
|
153
|
+
/** Active and standby frequency of one receiver. Leave a value out to show dashes. */
|
|
154
|
+
interface RadioFrequency {
|
|
155
|
+
active?: number;
|
|
156
|
+
standby?: number;
|
|
157
|
+
}
|
|
158
|
+
interface RadioPanelProps extends InstrumentProps {
|
|
159
|
+
/** NAV (VOR/LOC) receiver frequencies in MHz, shown with two decimals. */
|
|
160
|
+
nav?: RadioFrequency;
|
|
161
|
+
/** ADF receiver frequencies in kHz. */
|
|
162
|
+
adf?: RadioFrequency;
|
|
163
|
+
/** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
|
|
164
|
+
dme?: number;
|
|
165
|
+
/** Colour of the digits. Default amber. */
|
|
166
|
+
color?: string;
|
|
167
|
+
}
|
|
168
|
+
/** NAV frequency in MHz as `116.80`, or dashes. */
|
|
169
|
+
declare const formatNav: (mhz?: number) => string;
|
|
170
|
+
/** ADF frequency in kHz as `362` (or `362.5`), or dashes. */
|
|
171
|
+
declare const formatAdf: (khz?: number) => string;
|
|
172
|
+
/** DME distance in NM: one decimal below 100 NM, whole miles above, or dashes. */
|
|
173
|
+
declare const formatDme: (nm?: number) => string;
|
|
174
|
+
declare function RadioPanel({ nav, adf, dme, color, ...props }: RadioPanelProps): react.JSX.Element;
|
|
175
|
+
|
|
176
|
+
interface RadioStackProps {
|
|
177
|
+
/** NAV (VOR/LOC) receiver, in MHz. Pass it to control the component; leave it out and it keeps its own state. */
|
|
178
|
+
nav?: RadioFrequency;
|
|
179
|
+
/** ADF receiver, in kHz. Pass it to control the component; leave it out and it keeps its own state. */
|
|
180
|
+
adf?: RadioFrequency;
|
|
181
|
+
/** Starting NAV frequencies when `nav` is not controlled. */
|
|
182
|
+
defaultNav?: RadioFrequency;
|
|
183
|
+
/** Starting ADF frequencies when `adf` is not controlled. */
|
|
184
|
+
defaultAdf?: RadioFrequency;
|
|
185
|
+
/** Called when the NAV standby frequency is entered or the frequencies are swapped. */
|
|
186
|
+
onNavChange?: (next: RadioFrequency) => void;
|
|
187
|
+
/** Called when the ADF standby frequency is entered or the frequencies are swapped. */
|
|
188
|
+
onAdfChange?: (next: RadioFrequency) => void;
|
|
189
|
+
/** Identifier of the station received on the active NAV frequency, e.g. `"KNA"`. Shown under the NAV label. */
|
|
190
|
+
navIdent?: string;
|
|
191
|
+
/** Identifier of the station received on the active ADF frequency. Shown under the ADF label. */
|
|
192
|
+
adfIdent?: string;
|
|
193
|
+
/** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
|
|
194
|
+
dme?: number;
|
|
195
|
+
/** Colour of the digits. Default amber. */
|
|
196
|
+
color?: string;
|
|
197
|
+
/** Rendered width. Number = pixels, or any CSS length (e.g. `"100%"`). Everything scales with it. Default `320`. */
|
|
198
|
+
width?: number | string;
|
|
199
|
+
className?: string;
|
|
200
|
+
style?: CSSProperties;
|
|
201
|
+
/** Accessible name of the group. Default `"Radio panel"`. */
|
|
202
|
+
title?: string;
|
|
203
|
+
}
|
|
204
|
+
/** NAV receivers tune 108.00–117.95 MHz. */
|
|
205
|
+
declare const parseNav: (text: string) => number | undefined;
|
|
206
|
+
/** ADF receivers tune 190–1750 kHz. */
|
|
207
|
+
declare const parseAdf: (text: string) => number | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* An interactive navigation radio: NAV and ADF receivers with an active frequency, an editable standby
|
|
210
|
+
* frequency and a transfer button each, plus a DME distance readout.
|
|
211
|
+
* Unlike the instruments it is an HTML control, not an SVG dial.
|
|
212
|
+
*/
|
|
213
|
+
declare function RadioStack({ nav, adf, defaultNav, defaultAdf, onNavChange, onAdfChange, navIdent, adfIdent, dme, color, width, className, style, title, }: RadioStackProps): react.JSX.Element;
|
|
125
214
|
|
|
126
215
|
/** One readout on a `DataPanel`. */
|
|
127
216
|
interface DataField {
|
|
@@ -283,4 +372,4 @@ interface AoaIndicatorProps extends InstrumentProps {
|
|
|
283
372
|
}
|
|
284
373
|
declare function AoaIndicator({ aoa, min, optimum, max, showValue, label, ...props }: AoaIndicatorProps): react.JSX.Element;
|
|
285
374
|
|
|
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 };
|
|
375
|
+
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, type VorNeedle, WindIndicator, type WindIndicatorProps, formatAdf, formatDme, formatNav, formatValue, parseAdf, parseNav, relativeBearing, vorDeviation };
|
package/dist/index.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ interface WindIndicatorProps extends InstrumentProps {
|
|
|
98
98
|
declare function WindIndicator({ runway, runwaySide, windDirection, windSpeed, windGust, crosswindLimit, ...props }: WindIndicatorProps): react.JSX.Element;
|
|
99
99
|
|
|
100
100
|
type ToFrom = 'TO' | 'FROM' | 'OFF';
|
|
101
|
+
/** How the course deviation needle moves: sliding sideways, or swinging from a hinge under the top index. */
|
|
102
|
+
type VorNeedle = 'slide' | 'swing';
|
|
101
103
|
interface VorIndicatorProps extends InstrumentProps {
|
|
102
104
|
/** Selected course (OBS) in degrees. The compass card turns so this course sits under the top index. */
|
|
103
105
|
course?: number;
|
|
@@ -115,13 +117,100 @@ interface VorIndicatorProps extends InstrumentProps {
|
|
|
115
117
|
toFrom?: ToFrom;
|
|
116
118
|
/** `false` shows the red NAV flag, centres the needle and hides TO/FROM. Default `true`. */
|
|
117
119
|
signal?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* `"slide"` (default) moves a vertical bar sideways across a straight row of dots.
|
|
122
|
+
* `"swing"` hinges the needle just below the top index so it swings like a pendulum over a curved row of dots,
|
|
123
|
+
* as on older VOR heads.
|
|
124
|
+
*/
|
|
125
|
+
needle?: VorNeedle;
|
|
118
126
|
}
|
|
119
127
|
/** Needle deflection (°, positive = course to the right) and flag for an aircraft on `radial` with `course` selected. */
|
|
120
128
|
declare function vorDeviation(course: number, radial: number): {
|
|
121
129
|
deviation: number;
|
|
122
130
|
toFrom: ToFrom;
|
|
123
131
|
};
|
|
124
|
-
declare function VorIndicator({ course, radial, deviation, toFrom, signal, ...props }: VorIndicatorProps): react.JSX.Element;
|
|
132
|
+
declare function VorIndicator({ course, radial, deviation, toFrom, signal, needle, ...props }: VorIndicatorProps): react.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface AdfIndicatorProps extends InstrumentProps {
|
|
135
|
+
/**
|
|
136
|
+
* Relative bearing to the station in degrees, measured clockwise from the aircraft's nose.
|
|
137
|
+
* `0` means the station is dead ahead, `90` off the right wing.
|
|
138
|
+
*/
|
|
139
|
+
bearing?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Heading set on the compass card, in degrees. Leave at `0` for a fixed-card ADF.
|
|
142
|
+
* Pass the aircraft heading for a rotatable-card ADF / RMI, where the needle then reads
|
|
143
|
+
* the magnetic bearing to the station directly.
|
|
144
|
+
*/
|
|
145
|
+
heading?: number;
|
|
146
|
+
/** `false` parks the needle at 90° and shows the red ADF flag. Default `true`. */
|
|
147
|
+
signal?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/** Relative bearing (0–360°, clockwise from the nose) of a station that lies on `bearingToStation` when flying `heading`. */
|
|
150
|
+
declare function relativeBearing(heading: number, bearingToStation: number): number;
|
|
151
|
+
declare function AdfIndicator({ bearing, heading, signal, ...props }: AdfIndicatorProps): react.JSX.Element;
|
|
152
|
+
|
|
153
|
+
/** Active and standby frequency of one receiver. Leave a value out to show dashes. */
|
|
154
|
+
interface RadioFrequency {
|
|
155
|
+
active?: number;
|
|
156
|
+
standby?: number;
|
|
157
|
+
}
|
|
158
|
+
interface RadioPanelProps extends InstrumentProps {
|
|
159
|
+
/** NAV (VOR/LOC) receiver frequencies in MHz, shown with two decimals. */
|
|
160
|
+
nav?: RadioFrequency;
|
|
161
|
+
/** ADF receiver frequencies in kHz. */
|
|
162
|
+
adf?: RadioFrequency;
|
|
163
|
+
/** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
|
|
164
|
+
dme?: number;
|
|
165
|
+
/** Colour of the digits. Default amber. */
|
|
166
|
+
color?: string;
|
|
167
|
+
}
|
|
168
|
+
/** NAV frequency in MHz as `116.80`, or dashes. */
|
|
169
|
+
declare const formatNav: (mhz?: number) => string;
|
|
170
|
+
/** ADF frequency in kHz as `362` (or `362.5`), or dashes. */
|
|
171
|
+
declare const formatAdf: (khz?: number) => string;
|
|
172
|
+
/** DME distance in NM: one decimal below 100 NM, whole miles above, or dashes. */
|
|
173
|
+
declare const formatDme: (nm?: number) => string;
|
|
174
|
+
declare function RadioPanel({ nav, adf, dme, color, ...props }: RadioPanelProps): react.JSX.Element;
|
|
175
|
+
|
|
176
|
+
interface RadioStackProps {
|
|
177
|
+
/** NAV (VOR/LOC) receiver, in MHz. Pass it to control the component; leave it out and it keeps its own state. */
|
|
178
|
+
nav?: RadioFrequency;
|
|
179
|
+
/** ADF receiver, in kHz. Pass it to control the component; leave it out and it keeps its own state. */
|
|
180
|
+
adf?: RadioFrequency;
|
|
181
|
+
/** Starting NAV frequencies when `nav` is not controlled. */
|
|
182
|
+
defaultNav?: RadioFrequency;
|
|
183
|
+
/** Starting ADF frequencies when `adf` is not controlled. */
|
|
184
|
+
defaultAdf?: RadioFrequency;
|
|
185
|
+
/** Called when the NAV standby frequency is entered or the frequencies are swapped. */
|
|
186
|
+
onNavChange?: (next: RadioFrequency) => void;
|
|
187
|
+
/** Called when the ADF standby frequency is entered or the frequencies are swapped. */
|
|
188
|
+
onAdfChange?: (next: RadioFrequency) => void;
|
|
189
|
+
/** Identifier of the station received on the active NAV frequency, e.g. `"KNA"`. Shown under the NAV label. */
|
|
190
|
+
navIdent?: string;
|
|
191
|
+
/** Identifier of the station received on the active ADF frequency. Shown under the ADF label. */
|
|
192
|
+
adfIdent?: string;
|
|
193
|
+
/** DME distance to the station in nautical miles. Leave out (or pass `NaN`) to show dashes. */
|
|
194
|
+
dme?: number;
|
|
195
|
+
/** Colour of the digits. Default amber. */
|
|
196
|
+
color?: string;
|
|
197
|
+
/** Rendered width. Number = pixels, or any CSS length (e.g. `"100%"`). Everything scales with it. Default `320`. */
|
|
198
|
+
width?: number | string;
|
|
199
|
+
className?: string;
|
|
200
|
+
style?: CSSProperties;
|
|
201
|
+
/** Accessible name of the group. Default `"Radio panel"`. */
|
|
202
|
+
title?: string;
|
|
203
|
+
}
|
|
204
|
+
/** NAV receivers tune 108.00–117.95 MHz. */
|
|
205
|
+
declare const parseNav: (text: string) => number | undefined;
|
|
206
|
+
/** ADF receivers tune 190–1750 kHz. */
|
|
207
|
+
declare const parseAdf: (text: string) => number | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* An interactive navigation radio: NAV and ADF receivers with an active frequency, an editable standby
|
|
210
|
+
* frequency and a transfer button each, plus a DME distance readout.
|
|
211
|
+
* Unlike the instruments it is an HTML control, not an SVG dial.
|
|
212
|
+
*/
|
|
213
|
+
declare function RadioStack({ nav, adf, defaultNav, defaultAdf, onNavChange, onAdfChange, navIdent, adfIdent, dme, color, width, className, style, title, }: RadioStackProps): react.JSX.Element;
|
|
125
214
|
|
|
126
215
|
/** One readout on a `DataPanel`. */
|
|
127
216
|
interface DataField {
|
|
@@ -283,4 +372,4 @@ interface AoaIndicatorProps extends InstrumentProps {
|
|
|
283
372
|
}
|
|
284
373
|
declare function AoaIndicator({ aoa, min, optimum, max, showValue, label, ...props }: AoaIndicatorProps): react.JSX.Element;
|
|
285
374
|
|
|
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 };
|
|
375
|
+
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, type VorNeedle, WindIndicator, type WindIndicatorProps, formatAdf, formatDme, formatNav, formatValue, parseAdf, parseNav, relativeBearing, vorDeviation };
|