metar-taf-parser 3.1.2 → 4.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.
- package/README.md +1 -1
- package/{dist/locale → locale}/de.d.ts +0 -0
- package/{dist/locale → locale}/de.js +3 -3
- package/{dist/locale → locale}/en.d.ts +0 -0
- package/{dist/locale → locale}/en.js +3 -3
- package/{dist/locale → locale}/fr.d.ts +0 -0
- package/{dist/locale → locale}/fr.js +3 -3
- package/{dist/locale → locale}/it.d.ts +0 -0
- package/{dist/locale → locale}/it.js +3 -3
- package/{dist/locale → locale}/pl.d.ts +0 -0
- package/{dist/locale → locale}/pl.js +3 -3
- package/{dist/locale → locale}/zh-CN.d.ts +0 -0
- package/{dist/locale → locale}/zh-CN.js +3 -3
- package/metar-taf-parser.d.ts +1325 -0
- package/metar-taf-parser.js +2703 -0
- package/package.json +23 -16
- package/dist/command/common.d.ts +0 -54
- package/dist/command/common.js +0 -243
- package/dist/command/metar/AltimeterCommand.d.ts +0 -7
- package/dist/command/metar/AltimeterCommand.js +0 -26
- package/dist/command/metar/AltimeterMercuryCommand.d.ts +0 -7
- package/dist/command/metar/AltimeterMercuryCommand.js +0 -51
- package/dist/command/metar/RunwayCommand.d.ts +0 -7
- package/dist/command/metar/RunwayCommand.js +0 -60
- package/dist/command/metar/TemperatureCommand.d.ts +0 -7
- package/dist/command/metar/TemperatureCommand.js +0 -51
- package/dist/command/metar.d.ts +0 -9
- package/dist/command/metar.js +0 -31
- package/dist/command/remark/CeilingHeightCommand.d.ts +0 -18
- package/dist/command/remark/CeilingHeightCommand.js +0 -40
- package/dist/command/remark/CeilingSecondLocationCommand.d.ts +0 -12
- package/dist/command/remark/CeilingSecondLocationCommand.js +0 -40
- package/dist/command/remark/Command.d.ts +0 -8
- package/dist/command/remark/Command.js +0 -9
- package/dist/command/remark/DefaultCommand.d.ts +0 -11
- package/dist/command/remark/DefaultCommand.js +0 -38
- package/dist/command/remark/HailSizeCommand.d.ts +0 -11
- package/dist/command/remark/HailSizeCommand.js +0 -38
- package/dist/command/remark/HourlyMaximumMinimumTemperatureCommand.d.ts +0 -18
- package/dist/command/remark/HourlyMaximumMinimumTemperatureCommand.js +0 -39
- package/dist/command/remark/HourlyMaximumTemperatureCommand.d.ts +0 -14
- package/dist/command/remark/HourlyMaximumTemperatureCommand.js +0 -38
- package/dist/command/remark/HourlyMinimumTemperatureCommand.d.ts +0 -14
- package/dist/command/remark/HourlyMinimumTemperatureCommand.js +0 -38
- package/dist/command/remark/HourlyPrecipitationAmountCommand.d.ts +0 -14
- package/dist/command/remark/HourlyPrecipitationAmountCommand.js +0 -38
- package/dist/command/remark/HourlyPressureCommand.d.ts +0 -32
- package/dist/command/remark/HourlyPressureCommand.js +0 -40
- package/dist/command/remark/HourlyTemperatureDewPointCommand.d.ts +0 -18
- package/dist/command/remark/HourlyTemperatureDewPointCommand.js +0 -52
- package/dist/command/remark/IceAccretionCommand.d.ts +0 -15
- package/dist/command/remark/IceAccretionCommand.js +0 -38
- package/dist/command/remark/ObscurationCommand.d.ts +0 -14
- package/dist/command/remark/ObscurationCommand.js +0 -44
- package/dist/command/remark/PrecipitationAmount24HourCommand.d.ts +0 -14
- package/dist/command/remark/PrecipitationAmount24HourCommand.js +0 -39
- package/dist/command/remark/PrecipitationAmount36HourCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationAmount36HourCommand.js +0 -41
- package/dist/command/remark/PrecipitationBegCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationBegCommand.js +0 -45
- package/dist/command/remark/PrecipitationBegEndCommand.d.ts +0 -17
- package/dist/command/remark/PrecipitationBegEndCommand.js +0 -46
- package/dist/command/remark/PrecipitationEndCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationEndCommand.js +0 -45
- package/dist/command/remark/PrevailingVisibilityCommand.d.ts +0 -12
- package/dist/command/remark/PrevailingVisibilityCommand.js +0 -41
- package/dist/command/remark/SeaLevelPressureCommand.d.ts +0 -11
- package/dist/command/remark/SeaLevelPressureCommand.js +0 -39
- package/dist/command/remark/SecondLocationVisibilityCommand.d.ts +0 -12
- package/dist/command/remark/SecondLocationVisibilityCommand.js +0 -41
- package/dist/command/remark/SectorVisibilityCommand.d.ts +0 -13
- package/dist/command/remark/SectorVisibilityCommand.js +0 -42
- package/dist/command/remark/SmallHailSizeCommand.d.ts +0 -11
- package/dist/command/remark/SmallHailSizeCommand.js +0 -38
- package/dist/command/remark/SnowDepthCommand.d.ts +0 -11
- package/dist/command/remark/SnowDepthCommand.js +0 -38
- package/dist/command/remark/SnowIncreaseCommand.d.ts +0 -12
- package/dist/command/remark/SnowIncreaseCommand.js +0 -40
- package/dist/command/remark/SnowPelletsCommand.d.ts +0 -11
- package/dist/command/remark/SnowPelletsCommand.js +0 -37
- package/dist/command/remark/SunshineDurationCommand.d.ts +0 -11
- package/dist/command/remark/SunshineDurationCommand.js +0 -38
- package/dist/command/remark/SurfaceVisibilityCommand.d.ts +0 -11
- package/dist/command/remark/SurfaceVisibilityCommand.js +0 -39
- package/dist/command/remark/ThunderStormLocationCommand.d.ts +0 -12
- package/dist/command/remark/ThunderStormLocationCommand.js +0 -40
- package/dist/command/remark/ThunderStormLocationMovingCommand.d.ts +0 -19
- package/dist/command/remark/ThunderStormLocationMovingCommand.js +0 -42
- package/dist/command/remark/TornadicActivityBegCommand.d.ts +0 -16
- package/dist/command/remark/TornadicActivityBegCommand.js +0 -44
- package/dist/command/remark/TornadicActivityBegEndCommand.d.ts +0 -18
- package/dist/command/remark/TornadicActivityBegEndCommand.js +0 -46
- package/dist/command/remark/TornadicActivityEndCommand.d.ts +0 -16
- package/dist/command/remark/TornadicActivityEndCommand.js +0 -44
- package/dist/command/remark/TowerVisibilityCommand.d.ts +0 -11
- package/dist/command/remark/TowerVisibilityCommand.js +0 -39
- package/dist/command/remark/VariableSkyCommand.d.ts +0 -12
- package/dist/command/remark/VariableSkyCommand.js +0 -41
- package/dist/command/remark/VariableSkyHeightCommand.d.ts +0 -13
- package/dist/command/remark/VariableSkyHeightCommand.js +0 -43
- package/dist/command/remark/VirgaDirectionCommand.d.ts +0 -12
- package/dist/command/remark/VirgaDirectionCommand.js +0 -40
- package/dist/command/remark/WaterEquivalentSnowCommand.d.ts +0 -11
- package/dist/command/remark/WaterEquivalentSnowCommand.js +0 -38
- package/dist/command/remark/WindPeakCommandCommand.d.ts +0 -17
- package/dist/command/remark/WindPeakCommandCommand.js +0 -42
- package/dist/command/remark/WindShiftCommand.d.ts +0 -12
- package/dist/command/remark/WindShiftCommand.js +0 -38
- package/dist/command/remark/WindShiftFropaCommand.d.ts +0 -12
- package/dist/command/remark/WindShiftFropaCommand.js +0 -38
- package/dist/command/remark.d.ts +0 -109
- package/dist/command/remark.js +0 -152
- package/dist/commons/converter.d.ts +0 -21
- package/dist/commons/converter.js +0 -108
- package/dist/commons/errors.d.ts +0 -24
- package/dist/commons/errors.js +0 -46
- package/dist/commons/i18n.d.ts +0 -12
- package/dist/commons/i18n.js +0 -30
- package/dist/dates/metar.d.ts +0 -5
- package/dist/dates/metar.js +0 -8
- package/dist/dates/taf.d.ts +0 -28
- package/dist/dates/taf.js +0 -17
- package/dist/forecast/forecast.d.ts +0 -36
- package/dist/forecast/forecast.js +0 -72
- package/dist/helpers/date.d.ts +0 -11
- package/dist/helpers/date.js +0 -56
- package/dist/helpers/helpers.d.ts +0 -17
- package/dist/helpers/helpers.js +0 -46
- package/dist/index.d.ts +0 -32
- package/dist/index.js +0 -62
- package/dist/model/enum.d.ts +0 -265
- package/dist/model/enum.js +0 -280
- package/dist/model/model.d.ts +0 -188
- package/dist/model/model.js +0 -11
- package/dist/parser/parser.d.ts +0 -111
- package/dist/parser/parser.js +0 -480
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISnowDepthRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SnowDepth;
|
|
5
|
-
depth: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SnowDepthCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SnowDepthCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SnowDepthCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
class SnowDepthCommand extends Command_1.Command {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
_SnowDepthCommand_regex.set(this, /^4\/(\d{3})/);
|
|
18
|
-
}
|
|
19
|
-
canParse(code) {
|
|
20
|
-
return __classPrivateFieldGet(this, _SnowDepthCommand_regex, "f").test(code);
|
|
21
|
-
}
|
|
22
|
-
execute(code, remark) {
|
|
23
|
-
const matches = code.match(__classPrivateFieldGet(this, _SnowDepthCommand_regex, "f"));
|
|
24
|
-
if (!matches)
|
|
25
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
26
|
-
const depth = +matches[1];
|
|
27
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Depth", this.locale), depth);
|
|
28
|
-
remark.push({
|
|
29
|
-
type: remark_1.RemarkType.SnowDepth,
|
|
30
|
-
description,
|
|
31
|
-
raw: matches[0],
|
|
32
|
-
depth,
|
|
33
|
-
});
|
|
34
|
-
return [code.replace(__classPrivateFieldGet(this, _SnowDepthCommand_regex, "f"), "").trim(), remark];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.SnowDepthCommand = SnowDepthCommand;
|
|
38
|
-
_SnowDepthCommand_regex = new WeakMap();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISnowIncreaseRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SnowIncrease;
|
|
5
|
-
inchesLastHour: number;
|
|
6
|
-
totalDepth: number;
|
|
7
|
-
}
|
|
8
|
-
export declare class SnowIncreaseCommand extends Command {
|
|
9
|
-
#private;
|
|
10
|
-
canParse(code: string): boolean;
|
|
11
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
12
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SnowIncreaseCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SnowIncreaseCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
class SnowIncreaseCommand extends Command_1.Command {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
_SnowIncreaseCommand_regex.set(this, /^SNINCR (\d+)\/(\d+)/);
|
|
18
|
-
}
|
|
19
|
-
canParse(code) {
|
|
20
|
-
return __classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f").test(code);
|
|
21
|
-
}
|
|
22
|
-
execute(code, remark) {
|
|
23
|
-
const matches = code.match(__classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f"));
|
|
24
|
-
if (!matches)
|
|
25
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
26
|
-
const inchesLastHour = +matches[1];
|
|
27
|
-
const totalDepth = +matches[2];
|
|
28
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Increasing.Rapidly", this.locale), inchesLastHour, totalDepth);
|
|
29
|
-
remark.push({
|
|
30
|
-
type: remark_1.RemarkType.SnowIncrease,
|
|
31
|
-
description,
|
|
32
|
-
raw: matches[0],
|
|
33
|
-
inchesLastHour,
|
|
34
|
-
totalDepth,
|
|
35
|
-
});
|
|
36
|
-
return [code.replace(__classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f"), "").trim(), remark];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.SnowIncreaseCommand = SnowIncreaseCommand;
|
|
40
|
-
_SnowIncreaseCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISnowPelletsRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SnowPellets;
|
|
5
|
-
amount: "LGT" | "MOD" | "HVY";
|
|
6
|
-
}
|
|
7
|
-
export declare class SnowPelletsCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SnowPelletsCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SnowPelletsCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
class SnowPelletsCommand extends Command_1.Command {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
_SnowPelletsCommand_regex.set(this, /^GS (LGT|MOD|HVY)/);
|
|
18
|
-
}
|
|
19
|
-
canParse(code) {
|
|
20
|
-
return __classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f").test(code);
|
|
21
|
-
}
|
|
22
|
-
execute(code, remark) {
|
|
23
|
-
const matches = code.match(__classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f"));
|
|
24
|
-
if (!matches)
|
|
25
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
26
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Pellets", this.locale), (0, i18n_1._)(`Remark.${matches[1]}`, this.locale));
|
|
27
|
-
remark.push({
|
|
28
|
-
type: remark_1.RemarkType.SnowPellets,
|
|
29
|
-
description,
|
|
30
|
-
raw: matches[0],
|
|
31
|
-
amount: matches[1],
|
|
32
|
-
});
|
|
33
|
-
return [code.replace(__classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f"), "").trim(), remark];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.SnowPelletsCommand = SnowPelletsCommand;
|
|
37
|
-
_SnowPelletsCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISunshineDurationRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SunshineDuration;
|
|
5
|
-
duration: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SunshineDurationCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SunshineDurationCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SunshineDurationCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
class SunshineDurationCommand extends Command_1.Command {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
_SunshineDurationCommand_regex.set(this, /^98(\d{3})/);
|
|
18
|
-
}
|
|
19
|
-
canParse(code) {
|
|
20
|
-
return __classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f").test(code);
|
|
21
|
-
}
|
|
22
|
-
execute(code, remark) {
|
|
23
|
-
const matches = code.match(__classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f"));
|
|
24
|
-
if (!matches)
|
|
25
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
26
|
-
const duration = +matches[1];
|
|
27
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Sunshine.Duration", this.locale), duration);
|
|
28
|
-
remark.push({
|
|
29
|
-
type: remark_1.RemarkType.SunshineDuration,
|
|
30
|
-
description,
|
|
31
|
-
raw: matches[0],
|
|
32
|
-
duration,
|
|
33
|
-
});
|
|
34
|
-
return [code.replace(__classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f"), "").trim(), remark];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.SunshineDurationCommand = SunshineDurationCommand;
|
|
38
|
-
_SunshineDurationCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISurfaceVisibilityRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SurfaceVisibility;
|
|
5
|
-
distance: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SurfaceVisibilityCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SurfaceVisibilityCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SurfaceVisibilityCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
const converter_1 = require("../../commons/converter");
|
|
15
|
-
class SurfaceVisibilityCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_SurfaceVisibilityCommand_regex.set(this, /^SFC VIS ((\d)*( )?(\d?\/?\d))/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const distance = matches[1];
|
|
28
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Surface.Visibility", this.locale), distance);
|
|
29
|
-
remark.push({
|
|
30
|
-
type: remark_1.RemarkType.SurfaceVisibility,
|
|
31
|
-
description,
|
|
32
|
-
raw: matches[0],
|
|
33
|
-
distance: (0, converter_1.convertFractionalAmount)(distance),
|
|
34
|
-
});
|
|
35
|
-
return [code.replace(__classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f"), "").trim(), remark];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.SurfaceVisibilityCommand = SurfaceVisibilityCommand;
|
|
39
|
-
_SurfaceVisibilityCommand_regex = new WeakMap();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IThunderStormLocationRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.ThunderStormLocation;
|
|
6
|
-
location: Direction;
|
|
7
|
-
}
|
|
8
|
-
export declare class ThunderStormLocationCommand extends Command {
|
|
9
|
-
#private;
|
|
10
|
-
canParse(code: string): boolean;
|
|
11
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
12
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _ThunderStormLocationCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ThunderStormLocationCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class ThunderStormLocationCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_ThunderStormLocationCommand_regex.set(this, /^TS ([A-Z]{2})/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const location = (0, helpers_1.as)(matches[1], enum_1.Direction);
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Thunderstorm.Location.0", this.locale), (0, i18n_1._)(`Converter.${location}`, this.locale));
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.ThunderStormLocation,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
location,
|
|
35
|
-
});
|
|
36
|
-
return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f"), "").trim(), remark];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.ThunderStormLocationCommand = ThunderStormLocationCommand;
|
|
40
|
-
_ThunderStormLocationCommand_regex = new WeakMap();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IThunderStormLocationMovingRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.ThunderStormLocationMoving;
|
|
6
|
-
/**
|
|
7
|
-
* Current location is relative of the station
|
|
8
|
-
*/
|
|
9
|
-
location: Direction;
|
|
10
|
-
/**
|
|
11
|
-
* Direction moving (eg. "SW")
|
|
12
|
-
*/
|
|
13
|
-
moving: Direction;
|
|
14
|
-
}
|
|
15
|
-
export declare class ThunderStormLocationMovingCommand extends Command {
|
|
16
|
-
#private;
|
|
17
|
-
canParse(code: string): boolean;
|
|
18
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
19
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _ThunderStormLocationMovingCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ThunderStormLocationMovingCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class ThunderStormLocationMovingCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_ThunderStormLocationMovingCommand_regex.set(this, /^TS ([A-Z]{2}) MOV ([A-Z]{2})/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const location = (0, helpers_1.as)(matches[1], enum_1.Direction);
|
|
29
|
-
const moving = (0, helpers_1.as)(matches[2], enum_1.Direction);
|
|
30
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Thunderstorm.Location.Moving", this.locale), (0, i18n_1._)(`Converter.${location}`, this.locale), (0, i18n_1._)(`Converter.${moving}`, this.locale));
|
|
31
|
-
remark.push({
|
|
32
|
-
type: remark_1.RemarkType.ThunderStormLocationMoving,
|
|
33
|
-
description,
|
|
34
|
-
raw: matches[0],
|
|
35
|
-
location,
|
|
36
|
-
moving,
|
|
37
|
-
});
|
|
38
|
-
return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f"), "").trim(), remark];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ThunderStormLocationMovingCommand = ThunderStormLocationMovingCommand;
|
|
42
|
-
_ThunderStormLocationMovingCommand_regex = new WeakMap();
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface ITornadicActivityBegRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.TornadicActivityBeg;
|
|
6
|
-
tornadicType: "TORNADO" | "FUNNEL CLOUD" | "WATERSPOUT";
|
|
7
|
-
startHour?: number;
|
|
8
|
-
startMinute: number;
|
|
9
|
-
distance: number;
|
|
10
|
-
direction: Direction;
|
|
11
|
-
}
|
|
12
|
-
export declare class TornadicActivityBegCommand extends Command {
|
|
13
|
-
#private;
|
|
14
|
-
canParse(code: string): boolean;
|
|
15
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
16
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _TornadicActivityBegCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TornadicActivityBegCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class TornadicActivityBegCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_TornadicActivityBegCommand_regex.set(this, /^(TORNADO|FUNNEL CLOUD|WATERSPOUT) (B(\d{2})?(\d{2}))( (\d+)? ([A-Z]{1,2})?)?/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const direction = (0, helpers_1.as)(matches[7], enum_1.Direction);
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.Beginning", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6], (0, i18n_1._)(`Converter.${direction}`, this.locale));
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.TornadicActivityBeg,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
tornadicType: matches[1],
|
|
35
|
-
startHour: matches[3] ? +matches[3] : undefined,
|
|
36
|
-
startMinute: +matches[4],
|
|
37
|
-
distance: +matches[6],
|
|
38
|
-
direction,
|
|
39
|
-
});
|
|
40
|
-
return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f"), "").trim(), remark];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.TornadicActivityBegCommand = TornadicActivityBegCommand;
|
|
44
|
-
_TornadicActivityBegCommand_regex = new WeakMap();
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface ITornadicActivityBegEndRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.TornadicActivityBegEnd;
|
|
6
|
-
tornadicType: "TORNADO" | "FUNNEL CLOUD" | "WATERSPOUT";
|
|
7
|
-
startHour?: number;
|
|
8
|
-
startMinute: number;
|
|
9
|
-
endHour?: number;
|
|
10
|
-
endMinute: number;
|
|
11
|
-
distance: number;
|
|
12
|
-
direction: Direction;
|
|
13
|
-
}
|
|
14
|
-
export declare class TornadicActivityBegEndCommand extends Command {
|
|
15
|
-
#private;
|
|
16
|
-
canParse(code: string): boolean;
|
|
17
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
18
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _TornadicActivityBegEndCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TornadicActivityBegEndCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class TornadicActivityBegEndCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_TornadicActivityBegEndCommand_regex.set(this, /^(TORNADO|FUNNEL CLOUD|WATERSPOUT) (B(\d{2})?(\d{2}))(E(\d{2})?(\d{2}))( (\d+)? ([A-Z]{1,2})?)?/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const direction = (0, helpers_1.as)(matches[10], enum_1.Direction);
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.BegEnd", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6] || "", matches[7], matches[9], (0, i18n_1._)(`Converter.${direction}`, this.locale));
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.TornadicActivityBegEnd,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
tornadicType: matches[1],
|
|
35
|
-
startHour: matches[3] ? +matches[3] : undefined,
|
|
36
|
-
startMinute: +matches[4],
|
|
37
|
-
endHour: matches[6] ? +matches[6] : undefined,
|
|
38
|
-
endMinute: +matches[7],
|
|
39
|
-
distance: +matches[9],
|
|
40
|
-
direction,
|
|
41
|
-
});
|
|
42
|
-
return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f"), "").trim(), remark];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.TornadicActivityBegEndCommand = TornadicActivityBegEndCommand;
|
|
46
|
-
_TornadicActivityBegEndCommand_regex = new WeakMap();
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface ITornadicActivityEndRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.TornadicActivityEnd;
|
|
6
|
-
tornadicType: "TORNADO" | "FUNNEL CLOUD" | "WATERSPOUT";
|
|
7
|
-
endHour?: number;
|
|
8
|
-
endMinute: number;
|
|
9
|
-
distance: number;
|
|
10
|
-
direction: Direction;
|
|
11
|
-
}
|
|
12
|
-
export declare class TornadicActivityEndCommand extends Command {
|
|
13
|
-
#private;
|
|
14
|
-
canParse(code: string): boolean;
|
|
15
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
16
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _TornadicActivityEndCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TornadicActivityEndCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class TornadicActivityEndCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_TornadicActivityEndCommand_regex.set(this, /^(TORNADO|FUNNEL CLOUD|WATERSPOUT) (E(\d{2})?(\d{2}))( (\d+)? ([A-Z]{1,2})?)?/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const direction = (0, helpers_1.as)(matches[7], enum_1.Direction);
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.Ending", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6], (0, i18n_1._)(`Converter.${direction}`, this.locale));
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.TornadicActivityEnd,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
tornadicType: matches[1],
|
|
35
|
-
endHour: matches[3] ? +matches[3] : undefined,
|
|
36
|
-
endMinute: +matches[4],
|
|
37
|
-
distance: +matches[6],
|
|
38
|
-
direction,
|
|
39
|
-
});
|
|
40
|
-
return [code.replace(__classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f"), "").trim(), remark];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.TornadicActivityEndCommand = TornadicActivityEndCommand;
|
|
44
|
-
_TornadicActivityEndCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ITowerVisibilityRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.TowerVisibility;
|
|
5
|
-
distance: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class TowerVisibilityCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _TowerVisibilityCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TowerVisibilityCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
const converter_1 = require("../../commons/converter");
|
|
15
|
-
class TowerVisibilityCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_TowerVisibilityCommand_regex.set(this, /^TWR VIS ((\d)*( )?(\d?\/?\d))/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const distance = matches[1];
|
|
28
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Tower.Visibility", this.locale), distance);
|
|
29
|
-
remark.push({
|
|
30
|
-
type: remark_1.RemarkType.TowerVisibility,
|
|
31
|
-
description,
|
|
32
|
-
raw: matches[0],
|
|
33
|
-
distance: (0, converter_1.convertFractionalAmount)(distance),
|
|
34
|
-
});
|
|
35
|
-
return [code.replace(__classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f"), "").trim(), remark];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.TowerVisibilityCommand = TowerVisibilityCommand;
|
|
39
|
-
_TowerVisibilityCommand_regex = new WeakMap();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CloudQuantity } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IVariableSkyRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.VariableSky;
|
|
6
|
-
cloudQuantityRange: [CloudQuantity, CloudQuantity];
|
|
7
|
-
}
|
|
8
|
-
export declare class VariableSkyCommand extends Command {
|
|
9
|
-
#private;
|
|
10
|
-
canParse(code: string): boolean;
|
|
11
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
12
|
-
}
|