Skip to content

Commit

Permalink
IAirSigmet
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanroleplay committed Sep 8, 2021
1 parent 81374da commit dfc0e03
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aviationweather",
"version": "1.2.4",
"version": "1.2.5",
"description": "Node.js wrapper for aviation weather, written in TypeScript",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
32 changes: 21 additions & 11 deletions src/types/responses/AW/IAirSigmet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ export interface IAirSigmet {
*/
valid_time_to: string;

/**
* Minimum altitude, in feet (MSL).
*/
min_ft_msl: number;
altitude: {
/**
* Minimum altitude, in feet (MSL).
*/
min_ft_msl: number;

/**
* Maximum altitude, in feet (MSL).
*/
max_ft_msl: number;
/**
* Maximum altitude, in feet (MSL).
*/
max_ft_msl: number;
};

/**
* Movement direction of the AIRSIGMET condition.
Expand All @@ -39,18 +41,26 @@ export interface IAirSigmet {
* Hazard types can be one of the following: MTN OBSCN | IFR | TURB | ICE | CONVECTIVE | ASH
* The severity is one of the following: NONE | LT-MOD | MOD | MOD-SEV | SEV
*/
hazard: string;
hazard: {
type: "MTN OBSCN" | "IFR" | "TURB" | "ICE" | "CONVECTIVE" | "ASH";
severity?: "NONE" | "LT-MOD" | "MOD" | "MOD-SEV";
};

/**
* The type of report: OUTLOOK, AIRMET or SIGMET
*/
airsigmet_type: string;
airsigmet_type: "OUTLOOK" | "AIRMET" | "SIGMET";

/**
* An array of points defining the polygon
*/
area: string;
area: {
num_points: number;
point: IPoint[];
};
}

interface IPoint {
/**
* Latitude of a point comprising the AIRSIGMET region
*/
Expand Down
5 changes: 2 additions & 3 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ const myc = new Client({ debug: true });

myc
.AW({
datasource: "TAFS",
stationString: "YMML",
datasource: "AIRSIGMETS",
hoursBeforeNow: 1,
})
.then((res) => {
console.log(res[0]?.forecast[1]?.sky_condition);
console.log(res[0]);
});

// myc.AVT7("ZJQH").then((res) => {
Expand Down

0 comments on commit dfc0e03

Please sign in to comment.