Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ export declare class ATCInfo {
longitude?: number;
}

export declare class PilotInfo {
callsign: string;
name: string;
latitude?: number;
longitude?: number;
altitude:number;
heading:number;
groundspeed:number;
departure: string;
arrival: string;
aircraft: string;
}

export declare class TelexConnection {
id: string;
isActive: boolean;
Expand Down Expand Up @@ -233,7 +246,7 @@ function _put<T>(url: URL, body: any, headers?: any): Promise<T> {

export class NXApi {
public static url = new URL("https://api.flybywiresim.com");
//public static url = new URL("http://localhost:3000");
// public static url = new URL("http://localhost:3000");
}

export class Metar {
Expand Down Expand Up @@ -481,6 +494,13 @@ export class ATC {
}
}

export class Pilot {
public static getPilots(source: string) : Promise<PilotInfo[]>{
const url = new URL(`/api/v1/pilot?source=${source}`, NXApi.url);
return _get<PilotInfo[]>(url);
}
}

export class GitVersions {
public static getNewestCommit(user: string, repo: string, branch: string): Promise<CommitInfo> {
if (!user || !repo || !branch) {
Expand Down