metar-taf-parser 0.0.1 → 0.0.2

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 (57) hide show
  1. package/README.md +8 -2
  2. package/dist/{lib/command → command}/common.d.ts +1 -1
  3. package/dist/{lib/command → command}/common.js +4 -4
  4. package/dist/{lib/command → command}/metar.d.ts +5 -1
  5. package/dist/{lib/command → command}/metar.js +6 -5
  6. package/dist/{lib/command → command}/remark.d.ts +5 -1
  7. package/dist/{lib/command → command}/remark.js +130 -148
  8. package/dist/{lib/commons → commons}/converter.d.ts +0 -0
  9. package/dist/{lib/commons → commons}/converter.js +2 -2
  10. package/dist/{lib/commons → commons}/errors.d.ts +7 -2
  11. package/dist/{lib/commons → commons}/errors.js +8 -3
  12. package/dist/commons/i18n.d.ts +12 -0
  13. package/dist/{lib/commons → commons}/i18n.js +12 -4
  14. package/dist/{lib/helpers → helpers}/helpers.d.ts +0 -1
  15. package/dist/helpers/helpers.js +23 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.js +38 -0
  18. package/dist/locale/de.d.ts +321 -0
  19. package/dist/locale/de.js +322 -0
  20. package/dist/locale/en.d.ts +387 -0
  21. package/dist/locale/en.js +398 -0
  22. package/dist/locale/fr.d.ts +365 -0
  23. package/dist/locale/fr.js +376 -0
  24. package/dist/locale/it.d.ts +337 -0
  25. package/dist/locale/it.js +338 -0
  26. package/dist/locale/pl.d.ts +98 -0
  27. package/dist/locale/pl.js +99 -0
  28. package/dist/locale/zh-CN.d.ts +111 -0
  29. package/dist/locale/zh-CN.js +112 -0
  30. package/dist/model/enum.d.ts +221 -0
  31. package/dist/model/enum.js +231 -0
  32. package/dist/{lib/model → model}/model.d.ts +14 -7
  33. package/dist/{lib/model → model}/model.js +1 -1
  34. package/dist/parser/parser.d.ts +66 -0
  35. package/dist/parser/parser.js +322 -0
  36. package/package.json +8 -3
  37. package/dist/lib/commons/i18n.d.ts +0 -3
  38. package/dist/lib/helpers/helpers.js +0 -28
  39. package/dist/lib/index.d.ts +0 -1
  40. package/dist/lib/index.js +0 -3
  41. package/dist/lib/locale/en.json +0 -396
  42. package/dist/lib/model/enum.d.ts +0 -122
  43. package/dist/lib/model/enum.js +0 -132
  44. package/dist/lib/parser/parser.d.ts +0 -26
  45. package/dist/lib/parser/parser.js +0 -198
  46. package/dist/tests/command/common.test.d.ts +0 -1
  47. package/dist/tests/command/common.test.js +0 -102
  48. package/dist/tests/command/metar.test.d.ts +0 -1
  49. package/dist/tests/command/metar.test.js +0 -52
  50. package/dist/tests/command/remark.test.d.ts +0 -1
  51. package/dist/tests/command/remark.test.js +0 -689
  52. package/dist/tests/common/converter.test.d.ts +0 -1
  53. package/dist/tests/common/converter.test.js +0 -78
  54. package/dist/tests/helpers/helpers.test.d.ts +0 -1
  55. package/dist/tests/helpers/helpers.test.js +0 -17
  56. package/dist/tests/parser/parser.test.d.ts +0 -1
  57. package/dist/tests/parser/parser.test.js +0 -96
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ CloudQuantity: {
5
+ BKN: "碎云",
6
+ FEW: "少量",
7
+ NSC: "没有明显的云。",
8
+ OVC: "多云",
9
+ SCT: "散云",
10
+ SKC: "天空晴朗",
11
+ },
12
+ CloudType: {
13
+ AC: "高积云",
14
+ AS: "高层云",
15
+ CB: "积雨云",
16
+ CC: "卷积云",
17
+ CI: "Cirrus",
18
+ CS: "卷层云",
19
+ CU: "积云",
20
+ NS: "雨层云",
21
+ SC: "层积云",
22
+ ST: "层云",
23
+ TCU: "高耸积云",
24
+ },
25
+ Descriptive: {
26
+ BC: "补丁",
27
+ BL: "吹",
28
+ DR: "低漂",
29
+ FZ: "冰冻",
30
+ MI: "浅",
31
+ PR: "部分的",
32
+ SH: "阵雨",
33
+ TS: "雷雨",
34
+ },
35
+ Error: {
36
+ prefix: "发生错误。 错误代码 n°",
37
+ },
38
+ ErrorCode: {
39
+ AirportNotFound: "找不到此消息的机场。",
40
+ InvalidMessage: "输入的消息无效。",
41
+ },
42
+ Intensity: {
43
+ "-": "光",
44
+ VC: "在附近",
45
+ },
46
+ "intensity-plus": "重的",
47
+ Phenomenon: {
48
+ BR: "薄雾",
49
+ DS: "沙尘暴",
50
+ DU: "弥漫的灰尘",
51
+ DZ: "细雨",
52
+ FC: "漏斗云",
53
+ FG: "雾",
54
+ FU: "烟",
55
+ GR: "冰雹",
56
+ GS: "小冰雹和/或雪粒",
57
+ HZ: "雾霾",
58
+ IC: "冰晶",
59
+ PL: "冰粒",
60
+ PO: "尘土或沙尘旋风",
61
+ PY: "喷",
62
+ RA: "雨",
63
+ SA: "沙",
64
+ SG: "雪粒",
65
+ SN: "雪",
66
+ SQ: "狂风",
67
+ SS: "沙暴",
68
+ UP: "未知降水",
69
+ VA: "火山灰",
70
+ TS: "雷雨",
71
+ },
72
+ Remark: {
73
+ AO1: "没有降水鉴别器的自动化站",
74
+ AO2: "带有降水鉴别器的自动化站",
75
+ BASED: "基于",
76
+ Ceiling: {
77
+ Height: "上限在 {0} 到 {1} 英尺之间变化",
78
+ Second: {
79
+ Location: "由位于 {1} 处的第二个传感器测量的 {0} 英尺的上限",
80
+ },
81
+ },
82
+ FCST: "预报",
83
+ FUNNELCLOUD: "漏斗云 ",
84
+ },
85
+ MetarFacade: {
86
+ InvalidIcao: "ICAO 代码无效。",
87
+ },
88
+ Converter: {
89
+ D: "减少",
90
+ E: "东",
91
+ N: "北",
92
+ NE: "东北",
93
+ NSC: "无明显变化",
94
+ NW: "西北",
95
+ S: "南",
96
+ SE: "东南",
97
+ SW: "西南",
98
+ U: "上升",
99
+ VRB: "多变的",
100
+ W: "西",
101
+ },
102
+ WeatherChangeType: {
103
+ FM: "从",
104
+ BECMG: "变得",
105
+ TEMPO: "暂时的",
106
+ PROB: "可能性",
107
+ },
108
+ TimeIndicator: {
109
+ AT: "在",
110
+ TL: "直到",
111
+ },
112
+ };
@@ -0,0 +1,221 @@
1
+ export declare enum CloudQuantity {
2
+ /**
3
+ * Sky clear
4
+ */
5
+ SKC = "SKC",
6
+ /**
7
+ * Few
8
+ */
9
+ FEW = "FEW",
10
+ /**
11
+ * Broken
12
+ */
13
+ BKN = "BKN",
14
+ /**
15
+ * Scattered
16
+ */
17
+ SCT = "SCT",
18
+ /**
19
+ * Overcast
20
+ */
21
+ OVC = "OVC",
22
+ /**
23
+ * No significant cloud
24
+ */
25
+ NSC = "NSC"
26
+ }
27
+ export declare enum CloudType {
28
+ /**
29
+ * Cumulonimbus
30
+ */
31
+ CB = "CB",
32
+ /**
33
+ * Towering cumulus, cumulus congestus
34
+ */
35
+ TCU = "TCU",
36
+ /**
37
+ * Cirrus
38
+ */
39
+ CI = "CI",
40
+ /**
41
+ * Cirrocumulus
42
+ */
43
+ CC = "CC",
44
+ /**
45
+ * Cirrostratus
46
+ */
47
+ CS = "CS",
48
+ /**
49
+ * Altocumulus
50
+ */
51
+ AC = "AC",
52
+ /**
53
+ * Stratus
54
+ */
55
+ ST = "ST",
56
+ /**
57
+ * Cumulus
58
+ */
59
+ CU = "CU",
60
+ /**
61
+ * Astrostratus
62
+ */
63
+ AS = "AS",
64
+ /**
65
+ * Nimbostratus
66
+ */
67
+ NS = "NS",
68
+ /**
69
+ * Stratocumulus
70
+ */
71
+ SC = "SC"
72
+ }
73
+ /**
74
+ * Moderate has no qualifier.
75
+ */
76
+ export declare enum Intensity {
77
+ LIGHT = "-",
78
+ /**
79
+ * Heavy or well-developed
80
+ */
81
+ HEAVY = "+",
82
+ IN_VICINITY = "VC"
83
+ }
84
+ export declare enum Descriptive {
85
+ SHOWERS = "SH",
86
+ SHALLOW = "MI",
87
+ PATCHES = "BC",
88
+ PARTIAL = "PR",
89
+ DRIFTING = "DR",
90
+ THUNDERSTORM = "TS",
91
+ BLOWING = "BL",
92
+ FREEZING = "FZ"
93
+ }
94
+ export declare enum Phenomenon {
95
+ RAIN = "RA",
96
+ DRIZZLE = "DZ",
97
+ SNOW = "SN",
98
+ SNOW_GRAINS = "SG",
99
+ ICE_PELLETS = "PL",
100
+ ICE_CRYSTALS = "IC",
101
+ HAIL = "GR",
102
+ SMALL_HAIL = "GS",
103
+ UNKNOW_PRECIPITATION = "UP",
104
+ FOG = "FG",
105
+ VOLCANIC_ASH = "VA",
106
+ MIST = "BR",
107
+ HAZE = "HZ",
108
+ WIDESPREAD_DUST = "DU",
109
+ SMOKE = "FU",
110
+ SAND = "SA",
111
+ SPRAY = "PY",
112
+ SQUALL = "SQ",
113
+ SAND_WHIRLS = "PO",
114
+ DUSTSTORM = "DS",
115
+ SANDSTORM = "SS",
116
+ FUNNEL_CLOUD = "FC"
117
+ }
118
+ export declare enum TimeIndicator {
119
+ AT = "AT",
120
+ FM = "FM",
121
+ TL = "TL"
122
+ }
123
+ /**
124
+ * https://www.aviationweather.gov/taf/decoder
125
+ */
126
+ export declare enum WeatherChangeType {
127
+ /**
128
+ * FROM Group
129
+ *
130
+ * ie. `FM1600`
131
+ *
132
+ * The FM group is used when a rapid change, usually occuring in less than one
133
+ * hour, in prevailing conditions is expected. Typically, a rapid change of
134
+ * prevailing conditions to more or less a completely new set of prevailing
135
+ * conditions is associated with a synoptic feature passing through the
136
+ * terminal area (cold or warm frontal passage). Appended to the FM indicator
137
+ * is the four-digit hour and minute the change is expected to begin and
138
+ * continues until the next change group or until the end of the current
139
+ * forecast.
140
+ *
141
+ * A FM group will mark the beginning of a new line in a TAF report. Each FM
142
+ * group contains all the required elements -- wind, visibility, weather, and
143
+ * sky condition. Weather will be omitted in FM groups when it is not
144
+ * significant to aviation. FM groups will not include the contraction NSW.
145
+ *
146
+ * Examples:
147
+ *
148
+ * 1. `FM0100 SKC` - After 0100Z sky clear
149
+ * 2. `FM1430 OVC020` - After 1430Z ceiling two thousand overcast
150
+ */
151
+ FM = "FM",
152
+ /**
153
+ * BECOMING Group
154
+ *
155
+ * ie. `BECMG 2224`
156
+ *
157
+ * The BECMG group is used when a gradual change in conditions is expected
158
+ * over a longer time period, usually two hours. The time period when the
159
+ * change is expected is a four-digit group with the beginning hour and ending
160
+ * hour of the change period which follows the BECMG indicator. The gradual
161
+ * change will occur at an unspecified time within this time period. Only the
162
+ * conditions are carried over from the previous time group.
163
+ *
164
+ * Example:
165
+ *
166
+ * 1. `OVC012 BECMG 1416 BKN020` - Ceiling one thousand two hundred overcast.
167
+ * Then a gradual change to ceiling two thousand broken between 1400Z and
168
+ * 1600Z.
169
+ */
170
+ BECMG = "BECMG",
171
+ /**
172
+ * TEMPORARY Group
173
+ *
174
+ * ie. `TEMPO 1316`
175
+ *
176
+ * The TEMPO group is used for any conditions in wind, visibility, weather, or
177
+ * sky condition which are expected to last for generally less than an hour at
178
+ * a time (occasional), and are expected to occur during less than half the
179
+ * time period. The TEMPO indicator is followed by a four-digit group giving
180
+ * the beginning hour and ending hour of the time period during which the
181
+ * temporary conditions are expected. Only the changing forecast
182
+ * meteorological conditions are included in TEMPO groups. The omitted
183
+ * conditions are carried over from the previous time group.
184
+ *
185
+ * Examples:
186
+ *
187
+ * 1. `SCT030 TEMPO 1923 BKN030` - Three thousand scattered with occasional
188
+ * ceilings three thousand broken between 1900Z and 2300Z.
189
+ * 2. `4SM HZ TEMPO 0006 2SM BR HZ` - Visibility four in haze with occasional
190
+ * visibility two in mist and haze between 0000Z and 0600Z.
191
+ */
192
+ TEMPO = "TEMPO",
193
+ /**
194
+ * Probability Forecast
195
+ *
196
+ * ie. `PROB40 0006`
197
+ *
198
+ * The probability or chance of thunderstorms or other precipitation events
199
+ * occuring, along with associated weather conditions (wind, visibility, and
200
+ * sky conditions).
201
+ *
202
+ * The PROB40 group is used when the occurrence of thunderstorms or
203
+ * precipitation is in the 30% to less than 50% range, thus the probability
204
+ * value 40 is appended to the PROB contraction. This is followed by a
205
+ * four-digit group giving the beginning hour and ending hour of the time
206
+ * period during which the thunderstorms or precipitation is expected.
207
+ *
208
+ * Note: PROB40 will not be shown during the first six hours of a forecast.
209
+ *
210
+ * Examples:
211
+ *
212
+ * 1. `PROB40 2102 1/2SM +TSRA` - Chance between 2100Z and 0200Z of
213
+ * visibility one-half thunderstorm, heavy rain.
214
+ * 2. `PROB40 1014 1SM RASN` - Chance between 1000Z and 1400Z of visibility
215
+ * one rain and snow.
216
+ * 3. `PROB40 2024 2SM FZRA` - Chance between 2000Z and 0000Z of visibility
217
+ * two freezing rain.
218
+
219
+ */
220
+ PROB = "PROB"
221
+ }
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WeatherChangeType = exports.TimeIndicator = exports.Phenomenon = exports.Descriptive = exports.Intensity = exports.CloudType = exports.CloudQuantity = void 0;
4
+ var CloudQuantity;
5
+ (function (CloudQuantity) {
6
+ /**
7
+ * Sky clear
8
+ */
9
+ CloudQuantity["SKC"] = "SKC";
10
+ /**
11
+ * Few
12
+ */
13
+ CloudQuantity["FEW"] = "FEW";
14
+ /**
15
+ * Broken
16
+ */
17
+ CloudQuantity["BKN"] = "BKN";
18
+ /**
19
+ * Scattered
20
+ */
21
+ CloudQuantity["SCT"] = "SCT";
22
+ /**
23
+ * Overcast
24
+ */
25
+ CloudQuantity["OVC"] = "OVC";
26
+ /**
27
+ * No significant cloud
28
+ */
29
+ CloudQuantity["NSC"] = "NSC";
30
+ })(CloudQuantity = exports.CloudQuantity || (exports.CloudQuantity = {}));
31
+ var CloudType;
32
+ (function (CloudType) {
33
+ /**
34
+ * Cumulonimbus
35
+ */
36
+ CloudType["CB"] = "CB";
37
+ /**
38
+ * Towering cumulus, cumulus congestus
39
+ */
40
+ CloudType["TCU"] = "TCU";
41
+ /**
42
+ * Cirrus
43
+ */
44
+ CloudType["CI"] = "CI";
45
+ /**
46
+ * Cirrocumulus
47
+ */
48
+ CloudType["CC"] = "CC";
49
+ /**
50
+ * Cirrostratus
51
+ */
52
+ CloudType["CS"] = "CS";
53
+ /**
54
+ * Altocumulus
55
+ */
56
+ CloudType["AC"] = "AC";
57
+ /**
58
+ * Stratus
59
+ */
60
+ CloudType["ST"] = "ST";
61
+ /**
62
+ * Cumulus
63
+ */
64
+ CloudType["CU"] = "CU";
65
+ /**
66
+ * Astrostratus
67
+ */
68
+ CloudType["AS"] = "AS";
69
+ /**
70
+ * Nimbostratus
71
+ */
72
+ CloudType["NS"] = "NS";
73
+ /**
74
+ * Stratocumulus
75
+ */
76
+ CloudType["SC"] = "SC";
77
+ })(CloudType = exports.CloudType || (exports.CloudType = {}));
78
+ /**
79
+ * Moderate has no qualifier.
80
+ */
81
+ var Intensity;
82
+ (function (Intensity) {
83
+ Intensity["LIGHT"] = "-";
84
+ /**
85
+ * Heavy or well-developed
86
+ */
87
+ Intensity["HEAVY"] = "+";
88
+ Intensity["IN_VICINITY"] = "VC";
89
+ })(Intensity = exports.Intensity || (exports.Intensity = {}));
90
+ var Descriptive;
91
+ (function (Descriptive) {
92
+ Descriptive["SHOWERS"] = "SH";
93
+ Descriptive["SHALLOW"] = "MI";
94
+ Descriptive["PATCHES"] = "BC";
95
+ Descriptive["PARTIAL"] = "PR";
96
+ Descriptive["DRIFTING"] = "DR";
97
+ Descriptive["THUNDERSTORM"] = "TS";
98
+ Descriptive["BLOWING"] = "BL";
99
+ Descriptive["FREEZING"] = "FZ";
100
+ })(Descriptive = exports.Descriptive || (exports.Descriptive = {}));
101
+ var Phenomenon;
102
+ (function (Phenomenon) {
103
+ Phenomenon["RAIN"] = "RA";
104
+ Phenomenon["DRIZZLE"] = "DZ";
105
+ Phenomenon["SNOW"] = "SN";
106
+ Phenomenon["SNOW_GRAINS"] = "SG";
107
+ Phenomenon["ICE_PELLETS"] = "PL";
108
+ Phenomenon["ICE_CRYSTALS"] = "IC";
109
+ Phenomenon["HAIL"] = "GR";
110
+ Phenomenon["SMALL_HAIL"] = "GS";
111
+ Phenomenon["UNKNOW_PRECIPITATION"] = "UP";
112
+ Phenomenon["FOG"] = "FG";
113
+ Phenomenon["VOLCANIC_ASH"] = "VA";
114
+ Phenomenon["MIST"] = "BR";
115
+ Phenomenon["HAZE"] = "HZ";
116
+ Phenomenon["WIDESPREAD_DUST"] = "DU";
117
+ Phenomenon["SMOKE"] = "FU";
118
+ Phenomenon["SAND"] = "SA";
119
+ Phenomenon["SPRAY"] = "PY";
120
+ Phenomenon["SQUALL"] = "SQ";
121
+ Phenomenon["SAND_WHIRLS"] = "PO";
122
+ Phenomenon["DUSTSTORM"] = "DS";
123
+ Phenomenon["SANDSTORM"] = "SS";
124
+ Phenomenon["FUNNEL_CLOUD"] = "FC";
125
+ })(Phenomenon = exports.Phenomenon || (exports.Phenomenon = {}));
126
+ var TimeIndicator;
127
+ (function (TimeIndicator) {
128
+ TimeIndicator["AT"] = "AT";
129
+ TimeIndicator["FM"] = "FM";
130
+ TimeIndicator["TL"] = "TL";
131
+ })(TimeIndicator = exports.TimeIndicator || (exports.TimeIndicator = {}));
132
+ /**
133
+ * https://www.aviationweather.gov/taf/decoder
134
+ */
135
+ var WeatherChangeType;
136
+ (function (WeatherChangeType) {
137
+ /**
138
+ * FROM Group
139
+ *
140
+ * ie. `FM1600`
141
+ *
142
+ * The FM group is used when a rapid change, usually occuring in less than one
143
+ * hour, in prevailing conditions is expected. Typically, a rapid change of
144
+ * prevailing conditions to more or less a completely new set of prevailing
145
+ * conditions is associated with a synoptic feature passing through the
146
+ * terminal area (cold or warm frontal passage). Appended to the FM indicator
147
+ * is the four-digit hour and minute the change is expected to begin and
148
+ * continues until the next change group or until the end of the current
149
+ * forecast.
150
+ *
151
+ * A FM group will mark the beginning of a new line in a TAF report. Each FM
152
+ * group contains all the required elements -- wind, visibility, weather, and
153
+ * sky condition. Weather will be omitted in FM groups when it is not
154
+ * significant to aviation. FM groups will not include the contraction NSW.
155
+ *
156
+ * Examples:
157
+ *
158
+ * 1. `FM0100 SKC` - After 0100Z sky clear
159
+ * 2. `FM1430 OVC020` - After 1430Z ceiling two thousand overcast
160
+ */
161
+ WeatherChangeType["FM"] = "FM";
162
+ /**
163
+ * BECOMING Group
164
+ *
165
+ * ie. `BECMG 2224`
166
+ *
167
+ * The BECMG group is used when a gradual change in conditions is expected
168
+ * over a longer time period, usually two hours. The time period when the
169
+ * change is expected is a four-digit group with the beginning hour and ending
170
+ * hour of the change period which follows the BECMG indicator. The gradual
171
+ * change will occur at an unspecified time within this time period. Only the
172
+ * conditions are carried over from the previous time group.
173
+ *
174
+ * Example:
175
+ *
176
+ * 1. `OVC012 BECMG 1416 BKN020` - Ceiling one thousand two hundred overcast.
177
+ * Then a gradual change to ceiling two thousand broken between 1400Z and
178
+ * 1600Z.
179
+ */
180
+ WeatherChangeType["BECMG"] = "BECMG";
181
+ /**
182
+ * TEMPORARY Group
183
+ *
184
+ * ie. `TEMPO 1316`
185
+ *
186
+ * The TEMPO group is used for any conditions in wind, visibility, weather, or
187
+ * sky condition which are expected to last for generally less than an hour at
188
+ * a time (occasional), and are expected to occur during less than half the
189
+ * time period. The TEMPO indicator is followed by a four-digit group giving
190
+ * the beginning hour and ending hour of the time period during which the
191
+ * temporary conditions are expected. Only the changing forecast
192
+ * meteorological conditions are included in TEMPO groups. The omitted
193
+ * conditions are carried over from the previous time group.
194
+ *
195
+ * Examples:
196
+ *
197
+ * 1. `SCT030 TEMPO 1923 BKN030` - Three thousand scattered with occasional
198
+ * ceilings three thousand broken between 1900Z and 2300Z.
199
+ * 2. `4SM HZ TEMPO 0006 2SM BR HZ` - Visibility four in haze with occasional
200
+ * visibility two in mist and haze between 0000Z and 0600Z.
201
+ */
202
+ WeatherChangeType["TEMPO"] = "TEMPO";
203
+ /**
204
+ * Probability Forecast
205
+ *
206
+ * ie. `PROB40 0006`
207
+ *
208
+ * The probability or chance of thunderstorms or other precipitation events
209
+ * occuring, along with associated weather conditions (wind, visibility, and
210
+ * sky conditions).
211
+ *
212
+ * The PROB40 group is used when the occurrence of thunderstorms or
213
+ * precipitation is in the 30% to less than 50% range, thus the probability
214
+ * value 40 is appended to the PROB contraction. This is followed by a
215
+ * four-digit group giving the beginning hour and ending hour of the time
216
+ * period during which the thunderstorms or precipitation is expected.
217
+ *
218
+ * Note: PROB40 will not be shown during the first six hours of a forecast.
219
+ *
220
+ * Examples:
221
+ *
222
+ * 1. `PROB40 2102 1/2SM +TSRA` - Chance between 2100Z and 0200Z of
223
+ * visibility one-half thunderstorm, heavy rain.
224
+ * 2. `PROB40 1014 1SM RASN` - Chance between 1000Z and 1400Z of visibility
225
+ * one rain and snow.
226
+ * 3. `PROB40 2024 2SM FZRA` - Chance between 2000Z and 0000Z of visibility
227
+ * two freezing rain.
228
+
229
+ */
230
+ WeatherChangeType["PROB"] = "PROB";
231
+ })(WeatherChangeType = exports.WeatherChangeType || (exports.WeatherChangeType = {}));
@@ -1,4 +1,4 @@
1
- import { CloudQuantity, CloudType, Descriptive, Phenomenon, TimeIndicator, WeatherChangeType } from "model/enum";
1
+ import { CloudQuantity, CloudType, Descriptive, Phenomenon, TimeIndicator, WeatherChangeType } from "../model/enum";
2
2
  export interface ICountry {
3
3
  name: string;
4
4
  }
@@ -69,13 +69,19 @@ export interface IAbstractValidity {
69
69
  startDay: number;
70
70
  startHour: number;
71
71
  }
72
- export interface IAbstractWeatherCode extends IAbstractWeatherContainer {
72
+ /**
73
+ * Exclusive for the TS port (because python has `time()` and js does not)
74
+ */
75
+ export interface ITime {
76
+ hour: number;
77
+ minute: number;
78
+ }
79
+ export interface IAbstractWeatherCode extends IAbstractWeatherContainer, ITime {
73
80
  day: number;
74
- time: string;
75
81
  airport: IAirport;
76
82
  message: string;
77
83
  station: string;
78
- trends: unknown[];
84
+ trends: IAbstractTrend[];
79
85
  }
80
86
  export interface IMetar extends IAbstractWeatherCode {
81
87
  temperature: number;
@@ -84,21 +90,22 @@ export interface IMetar extends IAbstractWeatherCode {
84
90
  nosig: boolean;
85
91
  auto: boolean;
86
92
  runwaysInfo: IRunwayInfo[];
93
+ trends: IMetarTrend[];
87
94
  }
88
95
  export interface ITAF extends IAbstractWeatherCode {
89
96
  validity: IAbstractValidity;
90
97
  maxTemperature: number;
91
98
  minTemperature: number;
92
99
  amendment: boolean;
100
+ trends: ITAFTrend[];
93
101
  }
94
102
  export interface IAbstractTrend extends IAbstractWeatherContainer {
95
103
  type: WeatherChangeType;
96
104
  }
97
- export interface IMetarTrendTime {
105
+ export interface IMetarTrendTime extends ITime {
98
106
  type: TimeIndicator;
99
- time: string;
100
107
  }
101
- export interface MetarTrend extends IAbstractTrend {
108
+ export interface IMetarTrend extends IAbstractTrend {
102
109
  times: IMetarTrendTime[];
103
110
  }
104
111
  export interface ITAFTrend extends IAbstractTrend {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isWeatherConditionValid = void 0;
4
- const enum_1 = require("model/enum");
4
+ const enum_1 = require("../model/enum");
5
5
  function isWeatherConditionValid(weather) {
6
6
  return (weather.phenomenons.length !== 0 ||
7
7
  weather.descriptive == enum_1.Descriptive.THUNDERSTORM);
@@ -0,0 +1,66 @@
1
+ import { IAbstractWeatherContainer, IMetar, IMetarTrend, ITemperatureDated, IValidity, IWeatherCondition } from "../model/model";
2
+ import { Locale } from "../commons/i18n";
3
+ /**
4
+ * Parses the temperature in a TAF
5
+ * @param input the string containing the temperature
6
+ * @returns TemperatureDated object
7
+ */
8
+ export declare function parseTemperature(input: string): ITemperatureDated;
9
+ /**
10
+ * Parses validity of a TAF or a TAFTrend
11
+ * @param input the string containing the validity
12
+ * @returns Validity object
13
+ */
14
+ export declare function parseValidity(input: string): IValidity;
15
+ /**
16
+ * Abstract class.
17
+ * Base parser.
18
+ */
19
+ export declare abstract class AbstractParser {
20
+ #private;
21
+ FM: string;
22
+ TEMPO: string;
23
+ BECMG: string;
24
+ RMK: string;
25
+ parseWeatherCondition(input: string): IWeatherCondition;
26
+ /**
27
+ * Parses the message into different tokens
28
+ * @param input The metar or TAF as string
29
+ * @returns List of tokens
30
+ */
31
+ tokenize(input: string): string[];
32
+ /**
33
+ * Common parse method for METAR, TAF and trends object
34
+ * @param abstractWeatherCode the object to update
35
+ * @param input The token to parse
36
+ * @returns True if the token was parsed false otherwise
37
+ */
38
+ generalParse(abstractWeatherContainer: IAbstractWeatherContainer, input: string): boolean;
39
+ }
40
+ export declare class MetarParser extends AbstractParser {
41
+ #private;
42
+ private locale;
43
+ AT: string;
44
+ TL: string;
45
+ constructor(locale: Locale);
46
+ /**
47
+ * Parses a trend of a metar
48
+ * @param index the index starting the trend in the list
49
+ * @param trend The trend to update
50
+ * @param trendParts array of tokens
51
+ * @returns the last index of the token that was last parsed
52
+ */
53
+ parseTrend(index: number, trend: IMetarTrend, trendParts: string[]): number;
54
+ /**
55
+ * Parses an message and returns a METAR
56
+ * @param input The message to parse
57
+ * @returns METAR
58
+ */
59
+ parse(input: string): IMetar;
60
+ }
61
+ export declare class RemarkParser {
62
+ #private;
63
+ private locale;
64
+ constructor(locale: Locale);
65
+ parse(code: string): string[];
66
+ }