@fboes/aerofly-custom-missions 1.2.2 → 1.2.3

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 (46) hide show
  1. package/.eslintrc.json +24 -0
  2. package/CHANGELOG.md +4 -0
  3. package/dist/dto/AeroflyConfigFileSet.js +43 -0
  4. package/dist/dto/AeroflyLocalizedText.js +40 -0
  5. package/dist/dto/AeroflyMission.js +171 -0
  6. package/dist/dto/AeroflyMissionCheckpoint.js +121 -0
  7. package/dist/dto/AeroflyMissionConditions.js +122 -0
  8. package/dist/dto/AeroflyMissionConditionsCloud.js +80 -0
  9. package/dist/dto/AeroflyMissionTargetPlane.js +30 -0
  10. package/dist/dto/AeroflyMissionsList.js +28 -0
  11. package/dist/index.js +7 -634
  12. package/dist/index.test.js +12 -5
  13. package/package.json +9 -10
  14. package/src/dto/AeroflyConfigFileSet.ts +35 -0
  15. package/src/dto/AeroflyLocalizedText.ts +69 -0
  16. package/src/dto/AeroflyMission.ts +377 -0
  17. package/src/dto/AeroflyMissionCheckpoint.ts +235 -0
  18. package/src/dto/AeroflyMissionConditions.ts +196 -0
  19. package/src/dto/AeroflyMissionConditionsCloud.ts +100 -0
  20. package/src/dto/AeroflyMissionTargetPlane.ts +56 -0
  21. package/src/dto/AeroflyMissionsList.ts +36 -0
  22. package/src/index.test.ts +8 -10
  23. package/src/index.ts +7 -1099
  24. package/types/AeroflyMissionCheckpoint.d.ts +140 -0
  25. package/types/AeroflyMissionTargetPlane.d.ts +40 -0
  26. package/types/dto/AeroflyConfigFileSet.d.ts +10 -0
  27. package/types/dto/AeroflyConfigFileSet.d.ts.map +1 -0
  28. package/types/dto/AeroflyLocalizedText.d.ts +54 -0
  29. package/types/dto/AeroflyLocalizedText.d.ts.map +1 -0
  30. package/types/dto/AeroflyMission.d.ts +208 -0
  31. package/types/dto/AeroflyMission.d.ts.map +1 -0
  32. package/types/dto/AeroflyMissionCheckpoint.d.ts +152 -0
  33. package/types/dto/AeroflyMissionCheckpoint.d.ts.map +1 -0
  34. package/types/dto/AeroflyMissionConditions.d.ts +116 -0
  35. package/types/dto/AeroflyMissionConditions.d.ts.map +1 -0
  36. package/types/dto/AeroflyMissionConditionsCloud.d.ts +51 -0
  37. package/types/dto/AeroflyMissionConditionsCloud.d.ts.map +1 -0
  38. package/types/dto/AeroflyMissionTargetPlane.d.ts +40 -0
  39. package/types/dto/AeroflyMissionTargetPlane.d.ts.map +1 -0
  40. package/types/dto/AeroflyMissionsList.d.ts +24 -0
  41. package/types/dto/AeroflyMissionsList.d.ts.map +1 -0
  42. package/types/dto/basicTypes.d.ts +1 -0
  43. package/types/index.d.ts +8 -586
  44. package/types/index.d.ts.map +1 -1
  45. package/types/index.test.d.ts +1 -1
  46. package/eslint.config.js +0 -29
@@ -0,0 +1,116 @@
1
+ import { AeroflyMissionConditionsCloud } from "./AeroflyMissionConditionsCloud.js";
2
+ /**
3
+ * Weather data for wind
4
+ * @property direction in degree
5
+ * @property speed in kts
6
+ * @property gusts in kts
7
+ */
8
+ export type AeroflyMissionConditionsWind = {
9
+ direction: number;
10
+ speed: number;
11
+ gusts: number;
12
+ };
13
+ /**
14
+ * @class
15
+ * Time and weather data for the given flight plan
16
+ *
17
+ * The purpose of this class is to collect data needed for Aerofly FS4's
18
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
19
+ * for this file via the `toString()` method.
20
+ */
21
+ export declare class AeroflyMissionConditions {
22
+ /**
23
+ * @property {Date} time of flight plan. Relevant is the UTC part, so
24
+ * consider setting this date in UTC.
25
+ */
26
+ time: Date;
27
+ /**
28
+ * @property {object} wind state
29
+ */
30
+ wind: AeroflyMissionConditionsWind;
31
+ /**
32
+ * @property {number} 0..1, percentage
33
+ */
34
+ turbulenceStrength: number;
35
+ /**
36
+ * @property {number} 0..1, percentage
37
+ */
38
+ thermalStrength: number;
39
+ /**
40
+ * @property {number} visibility in meters
41
+ */
42
+ visibility: number;
43
+ /**
44
+ * @property {AeroflyMissionConditionsCloud[]} clouds for the whole flight
45
+ */
46
+ clouds: AeroflyMissionConditionsCloud[];
47
+ /**
48
+ * @param {object} additionalAttributes allows to set additional attributes on creation
49
+ * @param {Date} [additionalAttributes.time] of flight plan. Relevant is the UTC part, so
50
+ * consider setting this date in UTC.
51
+ * @param {{direction: number, speed: number, gusts: number}} [additionalAttributes.wind] state
52
+ * @param {number} [additionalAttributes.turbulenceStrength] 0..1, percentage
53
+ * @param {number} [additionalAttributes.thermalStrength] 0..1, percentage
54
+ * @param {number} [additionalAttributes.visibility] in meters
55
+ * @param {?number} [additionalAttributes.visibility_sm] in statute miles, will overwrite visibility
56
+ * @param {?number} [additionalAttributes.temperature] in °C, will overwrite thermalStrength
57
+ * @param {AeroflyMissionConditionsCloud[]} [additionalAttributes.clouds] for the whole flight
58
+ */
59
+ constructor({
60
+ time,
61
+ wind,
62
+ turbulenceStrength,
63
+ thermalStrength,
64
+ visibility,
65
+ visibility_sm,
66
+ temperature,
67
+ clouds,
68
+ }?: {
69
+ time?: Date;
70
+ wind?: {
71
+ direction: number;
72
+ speed: number;
73
+ gusts: number;
74
+ };
75
+ turbulenceStrength?: number;
76
+ thermalStrength?: number;
77
+ visibility?: number;
78
+ visibility_sm?: number | null;
79
+ temperature?: number | null;
80
+ clouds?: AeroflyMissionConditionsCloud[];
81
+ });
82
+ /**
83
+ * @returns {number} the Aerofly value for UTC hours + minutes/60 + seconds/3600. Ignores milliseconds ;)
84
+ */
85
+ get time_hours(): number;
86
+ /**
87
+ * @returns {string} Time representation like "20:15:00"
88
+ */
89
+ get time_presentational(): string;
90
+ /**
91
+ * @param {number} visibility_sm `this.visibility` in statute miles instead of meters
92
+ */
93
+ set visibility_sm(visibility_sm: number);
94
+ /**
95
+ * @returns {number} `this.visibility` in statute miles instead of meters
96
+ */
97
+ get visibility_sm(): number;
98
+ /**
99
+ * Will set `this.thermalStrength`
100
+ * @param {number} temperature in °C
101
+ */
102
+ set temperature(temperature: number);
103
+ /**
104
+ * @returns {number} in °C
105
+ */
106
+ get temperature(): number;
107
+ /**
108
+ * @returns {string}
109
+ */
110
+ getCloudsString(): string;
111
+ /**
112
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
113
+ */
114
+ toString(): string;
115
+ }
116
+ //# sourceMappingURL=AeroflyMissionConditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionConditions.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditions.ts"],"names":[],"mappings":"AAEA,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,aAAoB,EACpB,WAAkB,EAClB,MAAW,GACd,GAAE;QACC,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,IAAI,CAAC,EAAE;YACH,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,MAAM,CAAC,EAAE,6BAA6B,EAAE,CAAC;KACvC;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,eAAe,IAAI,MAAM;IAQzB;;OAEG;IACH,QAAQ,IAAI,MAAM;CAuBrB"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Cloud coverage codes
3
+ */
4
+ export type AeroflyMissionConditionsCloudCoverCode = "CLR" | "FEW" | "SCT" | "BKN" | "OVC";
5
+ /**
6
+ * @class
7
+ * A cloud layer for the current flight plan's weather data
8
+ *
9
+ * The purpose of this class is to collect data needed for Aerofly FS4's
10
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
11
+ * for this file via the `toString()` method.
12
+ */
13
+ export declare class AeroflyMissionConditionsCloud {
14
+ /**
15
+ * @property {number} cover 0..1, percentage
16
+ */
17
+ cover: number;
18
+ /**
19
+ * @property {number} base altitude in meters AGL
20
+ */
21
+ base: number;
22
+ /**
23
+ * @param {number} cover 0..1, percentage
24
+ * @param {number} base altitude in meters AGL
25
+ */
26
+ constructor(cover: number, base: number);
27
+ /**
28
+ * @param {number} cover 0..1, percentage
29
+ * @param {number} base_feet altitude, but in feet AGL instead of meters AGL
30
+ * @returns {AeroflyMissionConditionsCloud}
31
+ */
32
+ static createInFeet(cover: number, base_feet: number): AeroflyMissionConditionsCloud;
33
+ /**
34
+ * @param {number} base_feet `this.base` in feet instead of meters
35
+ */
36
+ set base_feet(base_feet: number);
37
+ /**
38
+ * @returns {number} `this.base` in feet instead of meters
39
+ */
40
+ get base_feet(): number;
41
+ /**
42
+ * @returns {string} Cloud coverage as text representation like "OVC" for `this.cover`
43
+ */
44
+ get cover_code(): AeroflyMissionConditionsCloudCoverCode;
45
+ /**
46
+ * @param {number} index if used in an array will se the array index
47
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
48
+ */
49
+ toString(index?: number): string;
50
+ }
51
+ //# sourceMappingURL=AeroflyMissionConditionsCloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AeroflyMissionConditionsCloud.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditionsCloud.ts"],"names":[],"mappings":"AAEA;;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,QAAQ,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;CAqBtC"}
@@ -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 @@
1
+ {"version":3,"file":"AeroflyMissionTargetPlane.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionTargetPlane.ts"],"names":[],"mappings":"AAEA;;;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,QAAQ,IAAI,MAAM;CAMrB"}
@@ -0,0 +1,24 @@
1
+ import { AeroflyMission } from "./AeroflyMission.js";
2
+ /**
3
+ * @class
4
+ * A list of flight plans.
5
+ *
6
+ * The purpose of this class is to collect data needed for Aerofly FS4's
7
+ * `custom_missions_user.tmc` flight plan file format, and export the structure
8
+ * for this file via the `toString()` method.
9
+ */
10
+ export declare class AeroflyMissionsList {
11
+ /**
12
+ * @property {AeroflyMission[]} missions in this mission list
13
+ */
14
+ missions: AeroflyMission[];
15
+ /**
16
+ * @param {AeroflyMission[]} missions in this mission list
17
+ */
18
+ constructor(missions?: AeroflyMission[]);
19
+ /**
20
+ * @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
21
+ */
22
+ toString(): string;
23
+ }
24
+ //# 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,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;;OAEG;IACH,QAAQ,IAAI,MAAM;CASrB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=basicTypes.d.ts.map