@flybywiresim/api-client
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -20,2 +20,3 @@ export declare class MetarResponse { | ||
icao: string; | ||
iata: string; | ||
type: string; | ||
@@ -30,2 +31,20 @@ name: string; | ||
} | ||
export declare enum AtcType { | ||
UNKNOWN = 0, | ||
DELIVERY = 1, | ||
GROUND = 2, | ||
TOWER = 3, | ||
DEPARTURE = 4, | ||
APPROACH = 5, | ||
RADAR = 6 | ||
} | ||
export declare class ATCInfo { | ||
callsign: string; | ||
frequency: string; | ||
visualRange: number; | ||
textAtis: string[]; | ||
type: AtcType; | ||
latitude?: number; | ||
longitude?: number; | ||
} | ||
export declare class TelexConnection { | ||
@@ -166,2 +185,5 @@ id: string; | ||
} | ||
export declare class ATC { | ||
static getAtc(source: string): Promise<ATCInfo[]>; | ||
} | ||
export declare class GitVersions { | ||
@@ -168,0 +190,0 @@ static getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo>; |
@@ -63,3 +63,13 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Charts = exports.GitVersions = exports.Airport = exports.Telex = exports.Taf = exports.Atis = exports.Metar = exports.NXApi = exports.TelexNotConnectedError = exports.HttpError = void 0; | ||
exports.Charts = exports.GitVersions = exports.ATC = exports.Airport = exports.Telex = exports.Taf = exports.Atis = exports.Metar = exports.NXApi = exports.TelexNotConnectedError = exports.HttpError = exports.AtcType = void 0; | ||
var AtcType; | ||
(function (AtcType) { | ||
AtcType[AtcType["UNKNOWN"] = 0] = "UNKNOWN"; | ||
AtcType[AtcType["DELIVERY"] = 1] = "DELIVERY"; | ||
AtcType[AtcType["GROUND"] = 2] = "GROUND"; | ||
AtcType[AtcType["TOWER"] = 3] = "TOWER"; | ||
AtcType[AtcType["DEPARTURE"] = 4] = "DEPARTURE"; | ||
AtcType[AtcType["APPROACH"] = 5] = "APPROACH"; | ||
AtcType[AtcType["RADAR"] = 6] = "RADAR"; | ||
})(AtcType = exports.AtcType || (exports.AtcType = {})); | ||
var HttpError = /** @class */ (function (_super) { | ||
@@ -343,2 +353,12 @@ __extends(HttpError, _super); | ||
exports.Airport = Airport; | ||
var ATC = /** @class */ (function () { | ||
function ATC() { | ||
} | ||
ATC.getAtc = function (source) { | ||
var url = new URL("/api/v1/atc?source=" + source, NXApi.url); | ||
return _get(url); | ||
}; | ||
return ATC; | ||
}()); | ||
exports.ATC = ATC; | ||
var GitVersions = /** @class */ (function () { | ||
@@ -345,0 +365,0 @@ function GitVersions() { |
{ | ||
"name": "@flybywiresim/api-client", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Client library for the FlyByWire Simulations API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -94,2 +94,20 @@ # <img src="https://raw.githubusercontent.com/flybywiresim/fbw-branding/master/svg/FBW-Logo.svg" placeholder="FlyByWire" width="400"/> | ||
### Airport | ||
```ts | ||
import { Atis } from '@flybywiresim/api-client'; | ||
ATC.get(source) | ||
.then(data => { | ||
console.log(data); | ||
}).catch(err => { | ||
console.error(err); | ||
}); | ||
``` | ||
- `source` is the selected datasource for the ATC. | ||
Valid sources are: | ||
- vatsim | ||
- ivao | ||
- `icao` is a string of the the airport ICAO code to search for. | ||
@@ -96,0 +114,0 @@ |
30386
604
353