Skip to content

Commit

Permalink
IDef
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanroleplay committed Sep 6, 2021
1 parent ffed2de commit c8293dc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
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.1.5",
"version": "1.1.6",
"description": "Node.js wrapper for aviation weather, written in TypeScript",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/Identifiers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const skyConditions: { code: string; meaning: string }[] = [
import { IDef } from ".";

export const skyConditions: IDef[] = [
{ code: "BKN", meaning: "Broken cloud layer 5/8ths to 7/8ths" },
{ code: "CB", meaning: "Cumulonimbus" },
{ code: "CLR", meaning: "Sky clear at or below 12,000AGL" },
Expand Down
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IAircraftReportsOptions,
IClientOptions,
IDatasourceType,
IDef,
IGAirMet,
IGAirmetOptions,
IMetar,
Expand All @@ -31,7 +32,7 @@ export class Client {
this.options = options;
}

private getDef(identifier: string) {
getDef(identifier: string): IDef {
const search = skyConditions.find((s) => s.code === identifier);
if (!search) return { code: identifier, meaning: "unknown" };
return search;
Expand Down
4 changes: 4 additions & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface IDef {
code: string;
meaning: string;
}
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./options";
export * from "./responses";
export * from "./client";
export * from "./common";

0 comments on commit c8293dc

Please sign in to comment.