@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,102 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ import { AeroflyMissionConditionsCloud } from "./AeroflyMissionConditionsCloud.js";
3
+ /**
4
+ * Weather data for wind
5
+ * @property {number} direction in degree
6
+ * @property {number} speed in kts
7
+ * @property {number} gusts in kts
8
+ */
9
+ export type AeroflyMissionConditionsWind = {
10
+ direction: number;
11
+ speed: number;
12
+ gusts: number;
13
+ };
14
+ /**
15
+ * @class
16
+ * Time and weather data for the given flight plan
17
+ *
18
+ * The purpose of this class is to collect data needed for Aerofly FS4's
19
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
20
+ * for this file via the `toString()` method.
21
+ */
22
+ export declare class AeroflyMissionConditions {
23
+ /**
24
+ * @property {Date} time of flight plan. Relevant is the UTC part, so
25
+ * consider setting this date in UTC.
26
+ */
27
+ time: Date;
28
+ /**
29
+ * @property {object} wind state
30
+ */
31
+ wind: AeroflyMissionConditionsWind;
32
+ /**
33
+ * @property {number} turbulenceStrength 0..1, percentage
34
+ */
35
+ turbulenceStrength: number;
36
+ /**
37
+ * @property {number} thermalStrength 0..1, percentage
38
+ */
39
+ thermalStrength: number;
40
+ /**
41
+ * @property {number} visibility in meters
42
+ */
43
+ visibility: number;
44
+ /**
45
+ * @property {AeroflyMissionConditionsCloud[]} clouds for the whole flight
46
+ */
47
+ clouds: AeroflyMissionConditionsCloud[];
48
+ /**
49
+ * @param {object} additionalAttributes allows to set additional attributes on creation
50
+ * @param {Date} [additionalAttributes.time] of flight plan. Relevant is the UTC part, so
51
+ * consider setting this date in UTC.
52
+ * @param {{direction: number, speed: number, gusts: number}} [additionalAttributes.wind] state
53
+ * @param {number} [additionalAttributes.turbulenceStrength] 0..1, percentage
54
+ * @param {number} [additionalAttributes.thermalStrength] 0..1, percentage
55
+ * @param {number} [additionalAttributes.visibility] in meters
56
+ * @param {?number} [additionalAttributes.visibility_sm] in statute miles, will overwrite visibility
57
+ * @param {?number} [additionalAttributes.temperature] in °C, will overwrite thermalStrength
58
+ * @param {AeroflyMissionConditionsCloud[]} [additionalAttributes.clouds] for the whole flight
59
+ */
60
+ constructor({ time, wind, turbulenceStrength, thermalStrength, visibility, visibility_sm, temperature, clouds, }?: Partial<AeroflyMissionConditions> & {
61
+ visibility_sm?: number;
62
+ temperature?: number;
63
+ });
64
+ /**
65
+ * @returns {number} the Aerofly value for UTC hours + minutes/60 + seconds/3600. Ignores milliseconds ;)
66
+ */
67
+ get time_hours(): number;
68
+ /**
69
+ * @returns {string} Time representation like "20:15:00"
70
+ */
71
+ get time_presentational(): string;
72
+ /**
73
+ * @param {number} visibility_sm `this.visibility` in statute miles instead of meters
74
+ */
75
+ set visibility_sm(visibility_sm: number);
76
+ /**
77
+ * @returns {number} `this.visibility` in statute miles instead of meters
78
+ */
79
+ get visibility_sm(): number;
80
+ /**
81
+ * Will set `this.thermalStrength`
82
+ * @param {number} temperature in °C
83
+ */
84
+ set temperature(temperature: number);
85
+ /**
86
+ * @returns {number} in °C
87
+ */
88
+ get temperature(): number;
89
+ /**
90
+ * @returns {AeroflyConfigurationNode[]} cloud elements
91
+ */
92
+ getCloudElements(): AeroflyConfigurationNode[];
93
+ /**
94
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
95
+ */
96
+ getElement(): AeroflyConfigurationNode;
97
+ /**
98
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
99
+ */
100
+ toString(): string;
101
+ }
102
+ //# sourceMappingURL=AeroflyMissionConditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionConditions.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,wBAAwB;IACjC;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,4BAA4B,CAAC;IAEnC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,6BAA6B,EAAE,CAAM;IAE7C;;;;;;;;;;;OAWG;gBACS,EACR,IAAiB,EACjB,IAIC,EACD,kBAAsB,EACtB,eAAmB,EACnB,UAAmB,EACnB,aAAiB,EACjB,WAAe,EACf,MAAW,GACd,GAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;KACnB;IAgBN;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAMhC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,aAAa,EAAE,MAAM,EAEtC;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAGlC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,gBAAgB,IAAI,wBAAwB,EAAE;IAM9C;;OAEG;IACH,UAAU,IAAI,wBAAwB;IAsBtC;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,57 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ /**
3
+ * Cloud coverage codes
4
+ */
5
+ export type AeroflyMissionConditionsCloudCoverCode = "CLR" | "FEW" | "SCT" | "BKN" | "OVC";
6
+ /**
7
+ * @class
8
+ * A cloud layer for the current flight plan's weather data
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 AeroflyMissionConditionsCloud {
15
+ /**
16
+ * @property {number} cover 0..1, percentage
17
+ */
18
+ cover: number;
19
+ /**
20
+ * @property {number} base altitude in meters AGL
21
+ */
22
+ base: number;
23
+ /**
24
+ * @param {number} cover 0..1, percentage
25
+ * @param {number} base altitude in meters AGL
26
+ */
27
+ constructor(cover: number, base: number);
28
+ /**
29
+ * @param {number} cover 0..1, percentage
30
+ * @param {number} base_feet altitude, but in feet AGL instead of meters AGL
31
+ * @returns {AeroflyMissionConditionsCloud} self
32
+ */
33
+ static createInFeet(cover: number, base_feet: number): AeroflyMissionConditionsCloud;
34
+ /**
35
+ * @param {number} base_feet `this.base` in feet instead of meters
36
+ */
37
+ set base_feet(base_feet: number);
38
+ /**
39
+ * @returns {number} `this.base` in feet instead of meters
40
+ */
41
+ get base_feet(): number;
42
+ /**
43
+ * @returns {string} Cloud coverage as text representation like "OVC" for `this.cover`
44
+ */
45
+ get cover_code(): AeroflyMissionConditionsCloudCoverCode;
46
+ /**
47
+ * @param {number} index if used in an array will set the array index
48
+ * @returns {AeroflyConfigurationNode[]} to use in Aerofly FS4's `custom_missions_user.tmc`
49
+ */
50
+ getElements(index?: number): AeroflyConfigurationNode[];
51
+ /**
52
+ * @param {number} index if used in an array will set the array index
53
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
54
+ */
55
+ toString(index?: number): string;
56
+ }
57
+ //# sourceMappingURL=AeroflyMissionConditionsCloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionConditionsCloud.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditionsCloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3F;;;;;;;GAOG;AACH,qBAAa,6BAA6B;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;gBACS,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAKvC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,6BAA6B;IAIpF;;OAEG;IACH,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,EAE9B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,sCAAsC,CAWvD;IAED;;;OAGG;IACH,WAAW,CAAC,KAAK,GAAE,MAAU,GAAG,wBAAwB,EAAE;IAsB1D;;;OAGG;IACH,QAAQ,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;CAKtC"}
@@ -0,0 +1,45 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ /**
3
+ * @class
4
+ * A target plane which the aircraft needs to cross.
5
+ */
6
+ export declare class AeroflyMissionTargetPlane {
7
+ /**
8
+ * @property {number} longitude easting, using the World Geodetic
9
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
10
+ * of decimal degrees; -180..180
11
+ */
12
+ longitude: number;
13
+ /**
14
+ * @property {number} latitude northing, using the World Geodetic
15
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
16
+ * of decimal degrees; -90..90
17
+ */
18
+ latitude: number;
19
+ /**
20
+ * @property {number} dir in degree
21
+ */
22
+ dir: number;
23
+ /**
24
+ * @property {string} name of property
25
+ */
26
+ name: string;
27
+ /**
28
+ *
29
+ * @param {number} longitude easting, using the World Geodetic
30
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
31
+ * of decimal degrees; -180..180
32
+ * @param {number}latitude northing, using the World Geodetic
33
+ * System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
34
+ * of decimal degrees; -90..90
35
+ * @param {number} dir in degree
36
+ * @param {string} name of property
37
+ */
38
+ constructor(longitude: number, latitude: number, dir: number, name?: string);
39
+ getElement(): AeroflyConfigurationNode;
40
+ /**
41
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
42
+ */
43
+ toString(): string;
44
+ }
45
+ //# sourceMappingURL=AeroflyMissionTargetPlane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionTargetPlane.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionTargetPlane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;GAGG;AACH,qBAAa,yBAAyB;IAClC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;OAUG;gBACS,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiB;IAOrF,UAAU,IAAI,wBAAwB;IAMtC;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,30 @@
1
+ import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
2
+ import { AeroflyMission } from "./AeroflyMission.js";
3
+ /**
4
+ * @class
5
+ * A list of flight plans.
6
+ *
7
+ * The purpose of this class is to collect data needed for Aerofly FS4's
8
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
9
+ * for this file via the `toString()` method.
10
+ */
11
+ export declare class AeroflyMissionsList {
12
+ /**
13
+ * @property {AeroflyMission[]} missions in this mission list
14
+ */
15
+ missions: AeroflyMission[];
16
+ /**
17
+ * @param {AeroflyMission[]} missions in this mission list
18
+ */
19
+ constructor(missions?: AeroflyMission[]);
20
+ getElement(): AeroflyConfigurationNode;
21
+ /**
22
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
23
+ */
24
+ toString(): string;
25
+ /**
26
+ * @returns {string} XML represenation of this mission list
27
+ */
28
+ toXmlString(): string;
29
+ }
30
+ //# sourceMappingURL=AeroflyMissionsList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionsList.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAC5B;;OAEG;IACH,QAAQ,EAAE,cAAc,EAAE,CAAC;IAE3B;;OAEG;gBACS,QAAQ,GAAE,cAAc,EAAO;IAI3C,UAAU,IAAI,wBAAwB;IActC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,WAAW,IAAI,MAAM;CAGxB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=basicTypes.d.ts.map