@fboes/aerofly-custom-missions 1.2.2 → 1.3.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.
Files changed (52) hide show
  1. package/.editorconfig +1 -5
  2. package/.eslintrc.json +24 -0
  3. package/CHANGELOG.md +59 -21
  4. package/dist/dto/AeroflyLocalizedText.js +44 -0
  5. package/dist/dto/AeroflyMission.js +173 -0
  6. package/dist/dto/AeroflyMissionCheckpoint.js +127 -0
  7. package/dist/dto/AeroflyMissionConditions.js +124 -0
  8. package/dist/dto/AeroflyMissionConditionsCloud.js +90 -0
  9. package/dist/dto/AeroflyMissionTargetPlane.js +35 -0
  10. package/dist/dto/AeroflyMissionsList.js +36 -0
  11. package/dist/index.js +7 -634
  12. package/dist/index.test.js +17 -11
  13. package/dist/node/AeroflyConfigurationNode.js +82 -0
  14. package/docs/custom_missions_user.tmc +3 -6
  15. package/docs/custom_missions_user.xml +100 -0
  16. package/package.json +9 -10
  17. package/src/dto/AeroflyLocalizedText.ts +74 -0
  18. package/src/dto/AeroflyMission.ts +372 -0
  19. package/src/dto/AeroflyMissionCheckpoint.ts +234 -0
  20. package/src/dto/AeroflyMissionConditions.ts +189 -0
  21. package/src/dto/AeroflyMissionConditionsCloud.ts +111 -0
  22. package/src/dto/AeroflyMissionTargetPlane.ts +62 -0
  23. package/src/dto/AeroflyMissionsList.ts +52 -0
  24. package/src/index.test.ts +22 -25
  25. package/src/index.ts +7 -1099
  26. package/src/node/AeroflyConfigurationNode.ts +89 -0
  27. package/types/AeroflyMissionCheckpoint.d.ts +140 -0
  28. package/types/AeroflyMissionTargetPlane.d.ts +40 -0
  29. package/types/dto/AeroflyConfigFileSet.d.ts +10 -0
  30. package/types/dto/AeroflyConfigFileSet.d.ts.map +1 -0
  31. package/types/dto/AeroflyConfiguration.interface.d.ts +4 -0
  32. package/types/dto/AeroflyConfiguration.interface.d.ts.map +1 -0
  33. package/types/dto/AeroflyLocalizedText.d.ts +58 -0
  34. package/types/dto/AeroflyLocalizedText.d.ts.map +1 -0
  35. package/types/dto/AeroflyMission.d.ts +163 -0
  36. package/types/dto/AeroflyMission.d.ts.map +1 -0
  37. package/types/dto/AeroflyMissionCheckpoint.d.ts +126 -0
  38. package/types/dto/AeroflyMissionCheckpoint.d.ts.map +1 -0
  39. package/types/dto/AeroflyMissionConditions.d.ts +102 -0
  40. package/types/dto/AeroflyMissionConditions.d.ts.map +1 -0
  41. package/types/dto/AeroflyMissionConditionsCloud.d.ts +57 -0
  42. package/types/dto/AeroflyMissionConditionsCloud.d.ts.map +1 -0
  43. package/types/dto/AeroflyMissionTargetPlane.d.ts +45 -0
  44. package/types/dto/AeroflyMissionTargetPlane.d.ts.map +1 -0
  45. package/types/dto/AeroflyMissionsList.d.ts +30 -0
  46. package/types/dto/AeroflyMissionsList.d.ts.map +1 -0
  47. package/types/dto/basicTypes.d.ts +1 -0
  48. package/types/index.d.ts +7 -585
  49. package/types/index.d.ts.map +1 -1
  50. package/types/node/AeroflyConfigurationNode.d.ts +14 -0
  51. package/types/node/AeroflyConfigurationNode.d.ts.map +1 -0
  52. package/eslint.config.js +0 -29
@@ -0,0 +1,89 @@
1
+ export class AeroflyConfigurationNode {
2
+ #children: AeroflyConfigurationNode[] = [];
3
+
4
+ constructor(
5
+ public type: string,
6
+ public name: string,
7
+ public value: string | number | string[] | number[] | boolean = "",
8
+ public _comment: string = "",
9
+ ) {}
10
+
11
+ append(...nodes: AeroflyConfigurationNode[]): AeroflyConfigurationNode {
12
+ this.#children.push(...nodes);
13
+ return this;
14
+ }
15
+
16
+ appendChild(
17
+ type: string,
18
+ name: string,
19
+ value: string | number | string[] | number[] | boolean = "",
20
+ _comment: string = "",
21
+ ) {
22
+ this.append(new AeroflyConfigurationNode(type, name, value, _comment));
23
+ return this;
24
+ }
25
+
26
+ get valueAsString(): string {
27
+ let value: string | number = "";
28
+ if (this.value instanceof Array) {
29
+ value = this.value.join(" ");
30
+ } else if (typeof value === "boolean") {
31
+ value = this.value ? "true" : "false";
32
+ } else {
33
+ value = this.value.toString();
34
+ }
35
+ return value;
36
+ }
37
+
38
+ toString(indent: number = 0): string {
39
+ const indentation = " ".repeat(4 * indent);
40
+
41
+ let tag = `${indentation}<[${this.type}][${this.name}][${this.#aeroflyEscape(this.valueAsString)}]`;
42
+ if (this.#children.length > 0) {
43
+ tag += "\n";
44
+ tag += this.#children.map((child) => child.toString(indent + 1)).join("\n");
45
+ tag += `\n${indentation}>`;
46
+ } else {
47
+ tag += ">";
48
+ }
49
+
50
+ if (this._comment) {
51
+ tag += ` // ${this._comment.replace(/[\n\r]/g, " ")}`;
52
+ }
53
+ return tag;
54
+ }
55
+
56
+ #aeroflyEscape(text: string): string {
57
+ return text.replace(/\[/g, "(").replace(/\]/g, ")");
58
+ }
59
+
60
+ toXmlString(indent: number = 0): string {
61
+ const indentation = " ".repeat(4 * indent);
62
+ const name = this.name || this.type;
63
+
64
+ let tag = indentation;
65
+ if (this.#children.length > 0) {
66
+ const index = this.valueAsString ? ` index="${this.#xmlEscape(this.valueAsString)}"` : "";
67
+ tag += `<${name} type="${this.type}"${index}>`;
68
+ tag += "\n";
69
+ tag += this.#children.map((child) => child.toXmlString(indent + 1)).join("\n");
70
+ tag += `\n${indentation}</${name}>`;
71
+ } else {
72
+ tag += `<${name} type="${this.type}">${this.#xmlEscape(this.valueAsString)}</${name}>`;
73
+ }
74
+
75
+ if (this._comment) {
76
+ tag += ` <!-- ${this.#xmlEscape(this._comment)} -->`;
77
+ }
78
+ return tag;
79
+ }
80
+
81
+ #xmlEscape(text: string): string {
82
+ return text
83
+ .replace(/&/g, "&amp;")
84
+ .replace(/</g, "&lt;")
85
+ .replace(/>/g, "&gt;")
86
+ .replace(/"/g, "&quot;")
87
+ .replace(/'/g, "&#039;");
88
+ }
89
+ }
@@ -0,0 +1,140 @@
1
+ /**
2
+ * @class
3
+ * A single way point for the given flight plan
4
+ *
5
+ * The purpose of this class is to collect data needed for Aerofly FS4's
6
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
7
+ * for this file via the `toString()` method.
8
+ */
9
+ export declare class AeroflyMissionCheckpoint {
10
+ /**
11
+ * @property {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type of checkpoint, like "departure_runway"
12
+ */
13
+ type: AeroflyMissionCheckpointType;
14
+ /**
15
+ * @property {string} name ICAO code for airport, runway designator, navaid
16
+ * designator, fix name, or custom name
17
+ */
18
+ name: string;
19
+ /**
20
+ * @property {number} longitude easting, using the World Geodetic
21
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
22
+ * of decimal degrees; -180..180
23
+ */
24
+ longitude: number;
25
+ /**
26
+ * @property {number} latitude northing, using the World Geodetic
27
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
28
+ * of decimal degrees; -90..90
29
+ */
30
+ latitude: number;
31
+ /**
32
+ * @property {number} altitude The height in meters above or below the WGS
33
+ * 84 reference ellipsoid
34
+ */
35
+ altitude: number;
36
+ /**
37
+ * @property {?boolean} altitudeConstraint The altitude given in `altitude`
38
+ * will be interpreted as mandatory flight plan altitude instead of
39
+ * suggestion.
40
+ */
41
+ altitudeConstraint: boolean | null;
42
+ /**
43
+ * @property {?number} direction of runway, in degree
44
+ */
45
+ direction: number | null;
46
+ /**
47
+ * @property {?number} slope of runway
48
+ */
49
+ slope: number | null;
50
+ /**
51
+ * @property {?number} length of runway, in meters
52
+ */
53
+ length: number | null;
54
+ /**
55
+ * @property {?number} frequency of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
56
+ */
57
+ frequency: number | null;
58
+ /**
59
+ * @property {?boolean} flyOver if waypoint is meant to be flown over
60
+ */
61
+ flyOver: boolean | null;
62
+ /**
63
+ * @param {string} name ICAO code for airport, runway designator, navaid
64
+ * designator, fix name, or custom name
65
+ * @param {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type Type of checkpoint, like "departure_runway"
66
+ * @param {number} longitude easting, using the World Geodetic
67
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
68
+ * of decimal degrees; -180..180
69
+ * @param {number} latitude northing, using the World Geodetic
70
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
71
+ * of decimal degrees; -90..90
72
+ * @param {object} additionalAttributes allows to set additional attributes on creation
73
+ * @param {number} [additionalAttributes.altitude] The height in meters above or below the WGS
74
+ * 84 reference ellipsoid
75
+ * @param {?number} [additionalAttributes.altitude_feet] The height in feet above or below the WGS
76
+ * 84 reference ellipsoid. Will overwrite altitude
77
+ * @param {number} [additionalAttributes.altitudeConstraint] The altitude given in `altitude`
78
+ * will be interpreted as mandatory flight plan altitude instead of
79
+ * suggestion.
80
+ * @param {boolean} [additionalAttributes.direction] of runway, in degree
81
+ * @param {?number} [additionalAttributes.slope] of runway
82
+ * @param {?number} [additionalAttributes.length] of runway, in meters
83
+ * @param {?number} [additionalAttributes.length_feet] of runway, in feet. Will overwrite length
84
+ * @param {?number} [additionalAttributes.frequency] of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
85
+ * @param {?boolean} [additionalAttributes.flyOver] if waypoint is meant to be flown over
86
+ */
87
+ constructor(
88
+ name: string,
89
+ type: AeroflyMissionCheckpointType,
90
+ longitude: number,
91
+ latitude: number,
92
+ {
93
+ altitude,
94
+ altitude_feet,
95
+ altitudeConstraint,
96
+ direction,
97
+ slope,
98
+ length,
99
+ length_feet,
100
+ frequency,
101
+ flyOver,
102
+ }?: {
103
+ altitude?: number;
104
+ altitude_feet?: number | null;
105
+ altitudeConstraint?: boolean | null;
106
+ direction?: number | null;
107
+ slope?: number | null;
108
+ length?: number | null;
109
+ length_feet?: number | null;
110
+ frequency?: number | null;
111
+ flyOver?: boolean | null;
112
+ },
113
+ );
114
+ /**
115
+ * @param {number} altitude_feet
116
+ */
117
+ set altitude_feet(altitude_feet: number);
118
+ /**
119
+ * @returns {number} altitude_feet
120
+ */
121
+ get altitude_feet(): number;
122
+ /**
123
+ * @param {number} length_feet
124
+ */
125
+ set length_feet(length_feet: number);
126
+ /**
127
+ * @returns {number} length_feet
128
+ */
129
+ get length_feet(): number;
130
+ /**
131
+ * @returns {string}
132
+ */
133
+ get frequency_string(): string;
134
+ /**
135
+ * @param {number} index if used in an array will se the array index
136
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
137
+ */
138
+ toString(index?: number): string;
139
+ }
140
+ //# sourceMappingURL=AeroflyMissionCheckpoint.d.ts.map
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @class
3
+ * A target plane which the aircraft needs to cross.
4
+ */
5
+ export declare class AeroflyMissionTargetPlane {
6
+ /**
7
+ * @property {number} longitude easting, using the World Geodetic
8
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
9
+ * of decimal degrees; -180..180
10
+ */
11
+ longitude: number;
12
+ /**
13
+ * @property {number} latitude northing, using the World Geodetic
14
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
15
+ * of decimal degrees; -90..90
16
+ */
17
+ latitude: number;
18
+ /**
19
+ * @property {number} dir in degree
20
+ */
21
+ dir: number;
22
+ /**
23
+ * @property {string} name of property
24
+ */
25
+ name: string;
26
+ /**
27
+ *
28
+ * @param {number} longitude easting, using the World Geodetic
29
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
30
+ * of decimal degrees; -180..180
31
+ * @param {number}latitude northing, using the World Geodetic
32
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
33
+ * of decimal degrees; -90..90
34
+ * @param {number} dir in degree
35
+ * @param {string} name of property
36
+ */
37
+ constructor(longitude: number, latitude: number, dir: number, name?: string);
38
+ toString(): string;
39
+ }
40
+ //# sourceMappingURL=AeroflyMissionTargetPlane.d.ts.map
@@ -0,0 +1,10 @@
1
+ export declare class AeroflyConfigFileSet {
2
+ #private;
3
+ elements: string[];
4
+ constructor(indent: number, type: string, name: string, value?: string);
5
+ get indent(): string;
6
+ push(type: string, name: string, value: string | number | string[] | number[] | boolean, comment?: string): this;
7
+ pushRaw(s: string): this;
8
+ toString(): string;
9
+ }
10
+ //# sourceMappingURL=AeroflyConfigFileSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyConfigFileSet.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyConfigFileSet.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;;IAE7B,QAAQ,EAAE,MAAM,EAAE,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;IAK1E,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,GAAE,MAAW;IAa7G,OAAO,CAAC,CAAC,EAAE,MAAM;IAKjB,QAAQ;CAGX"}
@@ -0,0 +1,4 @@
1
+ interface AeroflyConfigurationInterface {
2
+ get element(): AeroflyConfigurationNode;
3
+ }
4
+ //# sourceMappingURL=AeroflyConfiguration.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyConfiguration.interface.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyConfiguration.interface.ts"],"names":[],"mappings":"AAAA,UAAU,6BAA6B;IACnC,IAAI,OAAO,IAAI,wBAAwB,CAAC;CAC3C"}
@@ -0,0 +1,58 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ /**
3
+ * @class
4
+ * A translation for the mission title and description.
5
+ */
6
+ export declare class AeroflyLocalizedText {
7
+ /**
8
+ * @property {string} language ISO 639-1 like
9
+ * - br
10
+ * - cn
11
+ * - de
12
+ * - es
13
+ * - fr
14
+ * - id
15
+ * - it
16
+ * - jp
17
+ * - kr
18
+ * - pl
19
+ * - sv
20
+ * - tr
21
+ */
22
+ language: string;
23
+ /**
24
+ * @property {string} title of this flight plan
25
+ */
26
+ title: string;
27
+ /**
28
+ * @property {string} description text, mission briefing, etc
29
+ */
30
+ description: string;
31
+ /**
32
+ * @param {string} language ISO 639-1 like
33
+ * - br
34
+ * - cn
35
+ * - de
36
+ * - es
37
+ * - fr
38
+ * - id
39
+ * - it
40
+ * - jp
41
+ * - kr
42
+ * - pl
43
+ * - sv
44
+ * - tr
45
+ * @param {string} title of this flight plan
46
+ * @param {string} description text, mission briefing, etc
47
+ */
48
+ constructor(language: string, title: string, description: string);
49
+ /**
50
+ * @returns {AeroflyConfigurationNode} to use in Aerofly FS4's `custom_missions_user.tmc`
51
+ */
52
+ getElement(): AeroflyConfigurationNode;
53
+ /**
54
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
55
+ */
56
+ toString(): string;
57
+ }
58
+ //# sourceMappingURL=AeroflyLocalizedText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyLocalizedText.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyLocalizedText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;GAGG;AACH,qBAAa,oBAAoB;IAC7B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;;;;;;;;OAgBG;gBACS,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAMhE;;OAEG;IACH,UAAU,IAAI,wBAAwB;IAOtC;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,163 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ import { AeroflyLocalizedText } from "./AeroflyLocalizedText.js";
3
+ import { AeroflyMissionCheckpoint } from "./AeroflyMissionCheckpoint.js";
4
+ import { AeroflyMissionConditions } from "./AeroflyMissionConditions.js";
5
+ import { AeroflyMissionTargetPlane } from "./AeroflyMissionTargetPlane.js";
6
+ export declare const feetPerMeter = 3.28084;
7
+ export declare const meterPerStatuteMile = 1609.344;
8
+ /**
9
+ * Data for the aircraft to use on this mission
10
+ * @property {string} name lowercase Aerofly aircraft ID
11
+ * @property {string} icao ICAO aircraft code
12
+ * @property {string} livery (not used yet)
13
+ */
14
+ export type AeroflyMissionAircraft = {
15
+ name: string;
16
+ icao: string;
17
+ livery: string;
18
+ };
19
+ /**
20
+ * State of aircraft systems. Configures power settings, flap positions etc
21
+ */
22
+ export type AeroflyMissionSetting = "cold_and_dark" | "before_start" | "taxi" | "takeoff" | "cruise" | "approach" | "landing" | "winch_launch" | "aerotow" | "pushback";
23
+ /**
24
+ * Represents origin or destination conditions for flight
25
+ * @property {string} icao uppercase ICAO airport ID
26
+ * @property {number} longitude easting, using the World Geodetic
27
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
28
+ * of decimal degrees; -180..180
29
+ * @property {number} latitude northing, using the World Geodetic
30
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
31
+ * of decimal degrees; -90..90
32
+ * @property {number} dir in degree
33
+ * @property {number} alt the height in meters above or below the WGS
34
+ * 84 reference ellipsoid
35
+ */
36
+ export type AeroflyMissionPosition = {
37
+ icao: string;
38
+ longitude: number;
39
+ latitude: number;
40
+ dir: number;
41
+ alt: number;
42
+ };
43
+ /**
44
+ * @class
45
+ * A single flighplan, containing aircraft and weather data as well.
46
+ *
47
+ * The purpose of this class is to collect data needed for Aerofly FS4's
48
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
49
+ * for this file via the `toString()` method.
50
+ */
51
+ export declare class AeroflyMission {
52
+ /**
53
+ * @property {?string} tutorialName will create a link to a tutorial page at https://www.aerofly.com/aircraft-tutorials/
54
+ */
55
+ tutorialName: string | null;
56
+ /**
57
+ * @property {string} title of this flight plan
58
+ */
59
+ title: string;
60
+ /**
61
+ * @property {string} description text, mission briefing, etc
62
+ */
63
+ description: string;
64
+ /**
65
+ * @property {AeroflyLocalizedText[]} localizedTexts for title and description
66
+ */
67
+ localizedTexts: AeroflyLocalizedText[];
68
+ /**
69
+ * @property {string[]} tags free-text tags
70
+ */
71
+ tags: string[];
72
+ /**
73
+ * @property {?boolean} isFeatured makes this mission pop up in "Challenges"
74
+ */
75
+ isFeatured: boolean | null;
76
+ /**
77
+ * @property {?number} difficulty values between 0.00 and 2.00 have been encountered, but they seem to be without limit
78
+ */
79
+ difficulty: number | null;
80
+ /**
81
+ * @property {"cold_and_dark"|"before_start"|"taxi"|"takeoff"|"cruise"|"approach"|"landing"|"winch_launch"|"aerotow"|"pushback"} flightSetting of aircraft, like "taxi", "cruise"
82
+ */
83
+ flightSetting: AeroflyMissionSetting;
84
+ /**
85
+ * @property {object} aircraft for this mission
86
+ */
87
+ aircraft: AeroflyMissionAircraft;
88
+ /**
89
+ * @property {string} callsign of aircraft, uppercased
90
+ */
91
+ callsign: string;
92
+ /**
93
+ * @property {object} origin position of aircraft, as well as name of starting airport. Position does not have match airport.
94
+ */
95
+ origin: AeroflyMissionPosition;
96
+ /**
97
+ * @property {object} destination position of aircraft, as well as name of destination airport. Position does not have match airport.
98
+ */
99
+ destination: AeroflyMissionPosition;
100
+ /**
101
+ * @property {?number} distance in meters
102
+ */
103
+ distance: number | null;
104
+ /**
105
+ * @property {?number} duration in seconds
106
+ */
107
+ duration: number | null;
108
+ /**
109
+ * @property {?boolean} isScheduled marks this flight as "Scheduled flight".
110
+ */
111
+ isScheduled: boolean | null;
112
+ /**
113
+ * @property {?AeroflyMissionTargetPlane} finish as finish condition
114
+ */
115
+ finish: AeroflyMissionTargetPlane | null;
116
+ /**
117
+ * @property {AeroflyMissionConditions} conditions like time and weather for mission
118
+ */
119
+ conditions: AeroflyMissionConditions;
120
+ /**
121
+ * @property {AeroflyMissionConditions} checkpoints form the actual flight plan
122
+ */
123
+ checkpoints: AeroflyMissionCheckpoint[];
124
+ /**
125
+ * @param {string} title of this flight plan
126
+ * @param {object} [additionalAttributes] allows to set additional attributes on creation
127
+ * @param {string} [additionalAttributes.description] text, mission briefing, etc
128
+ * @param {AeroflyLocalizedText[]} [additionalAttributes.localizedTexts] translations for title and description
129
+ * @param {?string} [additionalAttributes.tutorialName] will create a link to a tutorial page at https://www.aerofly.com/aircraft-tutorials/
130
+ * @param {string[]} [additionalAttributes.tags] free-text tags
131
+ * @param {?boolean} [additionalAttributes.isFeatured] makes this mission pop up in "Challenges"
132
+ * @param {?number} [additionalAttributes.difficulty] values between 0.00 and 2.00 have been encountered, but they seem to be without limit
133
+ * @param {"cold_and_dark"|"before_start"|"taxi"|"takeoff"|"cruise"|"approach"|"landing"|"winch_launch"|"aerotow"|"pushback"} [additionalAttributes.flightSetting] of aircraft, like "taxi", "cruise"
134
+ * @param {{name:string,livery:string,icao:string}} [additionalAttributes.aircraft] for this mission
135
+ * @param {string} [additionalAttributes.callsign] of aircraft, uppercased
136
+ * @param {object} [additionalAttributes.origin] position of aircraft, as well as name of starting airport. Position does not have match airport.
137
+ * @param {object} [additionalAttributes.destination] position of aircraft, as well as name of destination airport. Position does not have match airport.
138
+ * @param {?number} [additionalAttributes.distance] in meters
139
+ * @param {?number} [additionalAttributes.duration] in seconds
140
+ * @param {?boolean} [additionalAttributes.isScheduled] marks this flight as "Scheduled flight".
141
+ * @param {?AeroflyMissionTargetPlane} [additionalAttributes.finish] as finish condition
142
+ * @param {AeroflyMissionConditions} [additionalAttributes.conditions] like time and weather for mission
143
+ * @param {AeroflyMissionCheckpoint[]} [additionalAttributes.checkpoints] form the actual flight plan
144
+ */
145
+ constructor(title: string, { tutorialName, description, localizedTexts, tags, isFeatured, difficulty, flightSetting, aircraft, callsign, origin, destination, distance, duration, isScheduled, finish, conditions, checkpoints, }?: Partial<AeroflyMission>);
146
+ /**
147
+ * @returns {AeroflyConfigurationNode[]} indexed checkpoints
148
+ */
149
+ getCheckpointElements(): AeroflyConfigurationNode[];
150
+ /**
151
+ * @returns {AeroflyConfigurationNode[]} indexed checkpoints
152
+ */
153
+ getLocalizedTextElements(): AeroflyConfigurationNode[];
154
+ /**
155
+ * @returns {AeroflyConfigurationNode} for this mission
156
+ */
157
+ getElement(): AeroflyConfigurationNode;
158
+ /**
159
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
160
+ */
161
+ toString(): string;
162
+ }
163
+ //# sourceMappingURL=AeroflyMission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMission.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,eAAO,MAAM,YAAY,UAAU,CAAC;AACpC,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC3B,eAAe,GACf,cAAc,GACd,MAAM,GACN,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,cAAc,GACd,SAAS,GACT,UAAU,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,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,EACb,MAMC,EACD,WAMC,EACD,QAAe,EACf,QAAe,EACf,WAAkB,EAClB,MAAa,EACb,UAA2C,EAC3C,WAAgB,GACnB,GAAE,OAAO,CAAC,cAAc,CAAM;IAsBnC;;OAEG;IACH,qBAAqB,IAAI,wBAAwB,EAAE;IAMnD;;OAEG;IACH,wBAAwB,IAAI,wBAAwB,EAAE;IAQtD;;OAEG;IACH,UAAU,IAAI,wBAAwB;IA2GtC;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,126 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ /**
3
+ * Types of checkpoints. Required are usually "origin", "departure_runway" at the start and "destination_runway", "destination" at the end.
4
+ */
5
+ export type AeroflyMissionCheckpointType = "origin" | "departure_runway" | "departure" | "waypoint" | "arrival" | "approach" | "destination_runway" | "destination";
6
+ /**
7
+ * @class
8
+ * A single way point for the given flight plan
9
+ *
10
+ * The purpose of this class is to collect data needed for Aerofly FS4's
11
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
12
+ * for this file via the `toString()` method.
13
+ */
14
+ export declare class AeroflyMissionCheckpoint {
15
+ /**
16
+ * @property {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type of checkpoint, like "departure_runway"
17
+ */
18
+ type: AeroflyMissionCheckpointType;
19
+ /**
20
+ * @property {string} name ICAO code for airport, runway designator, navaid
21
+ * designator, fix name, or custom name
22
+ */
23
+ name: string;
24
+ /**
25
+ * @property {number} longitude easting, using the World Geodetic
26
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
27
+ * of decimal degrees; -180..180
28
+ */
29
+ longitude: number;
30
+ /**
31
+ * @property {number} latitude northing, using the World Geodetic
32
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
33
+ * of decimal degrees; -90..90
34
+ */
35
+ latitude: number;
36
+ /**
37
+ * @property {number} altitude The height in meters above or below the WGS
38
+ * 84 reference ellipsoid
39
+ */
40
+ altitude: number;
41
+ /**
42
+ * @property {?boolean} altitudeConstraint The altitude given in `altitude`
43
+ * will be interpreted as mandatory flight plan altitude instead of
44
+ * suggestion.
45
+ */
46
+ altitudeConstraint: boolean | null;
47
+ /**
48
+ * @property {?number} direction of runway, in degree
49
+ */
50
+ direction: number | null;
51
+ /**
52
+ * @property {?number} slope of runway
53
+ */
54
+ slope: number | null;
55
+ /**
56
+ * @property {?number} length of runway, in meters
57
+ */
58
+ length: number | null;
59
+ /**
60
+ * @property {?number} frequency of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
61
+ */
62
+ frequency: number | null;
63
+ /**
64
+ * @property {?boolean} flyOver if waypoint is meant to be flown over
65
+ */
66
+ flyOver: boolean | null;
67
+ /**
68
+ * @param {string} name ICAO code for airport, runway designator, navaid
69
+ * designator, fix name, or custom name
70
+ * @param {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type Type of checkpoint, like "departure_runway"
71
+ * @param {number} longitude easting, using the World Geodetic
72
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
73
+ * of decimal degrees; -180..180
74
+ * @param {number} latitude northing, using the World Geodetic
75
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
76
+ * of decimal degrees; -90..90
77
+ * @param {object} additionalAttributes allows to set additional attributes on creation
78
+ * @param {number} [additionalAttributes.altitude] The height in meters above or below the WGS
79
+ * 84 reference ellipsoid
80
+ * @param {?number} [additionalAttributes.altitude_feet] The height in feet above or below the WGS
81
+ * 84 reference ellipsoid. Will overwrite altitude
82
+ * @param {number} [additionalAttributes.altitudeConstraint] The altitude given in `altitude`
83
+ * will be interpreted as mandatory flight plan altitude instead of
84
+ * suggestion.
85
+ * @param {boolean} [additionalAttributes.direction] of runway, in degree
86
+ * @param {?number} [additionalAttributes.slope] of runway
87
+ * @param {?number} [additionalAttributes.length] of runway, in meters
88
+ * @param {?number} [additionalAttributes.length_feet] of runway, in feet. Will overwrite length
89
+ * @param {?number} [additionalAttributes.frequency] of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
90
+ * @param {?boolean} [additionalAttributes.flyOver] if waypoint is meant to be flown over
91
+ */
92
+ constructor(name: string, type: AeroflyMissionCheckpointType, longitude: number, latitude: number, { altitude, altitude_feet, altitudeConstraint, direction, slope, length, length_feet, frequency, flyOver, }?: Partial<AeroflyMissionCheckpoint> & {
93
+ altitude_feet?: number;
94
+ length_feet?: number;
95
+ });
96
+ /**
97
+ * @param {number} altitude_feet in feet
98
+ */
99
+ set altitude_feet(altitude_feet: number);
100
+ /**
101
+ * @returns {number} altitude_feet
102
+ */
103
+ get altitude_feet(): number;
104
+ /**
105
+ * @param {number} length_feet in feet
106
+ */
107
+ set length_feet(length_feet: number);
108
+ /**
109
+ * @returns {number} length_feet
110
+ */
111
+ get length_feet(): number;
112
+ /**
113
+ * @returns {string} with MHz / kHz attached
114
+ */
115
+ get frequency_string(): string;
116
+ /**
117
+ * @param {number} index default: 0
118
+ * @returns {AeroflyConfigurationNode} to use in Aerofly FS4's `custom_missions_user.tmc`
119
+ */
120
+ getElement(index?: number): AeroflyConfigurationNode;
121
+ /**
122
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
123
+ */
124
+ toString(): string;
125
+ }
126
+ //# sourceMappingURL=AeroflyMissionCheckpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionCheckpoint.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAClC,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,aAAa,CAAC;AAEpB;;;;;;;GAOG;AACH,qBAAa,wBAAwB;I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