tfl-api-wrapper
Version:
A Node JS wrapper for the Transport for London API
45 lines (44 loc) • 1.45 kB
TypeScript
export default class TfLAPI {
appKey: string;
private readonly host;
private readonly port;
constructor(appKey: string);
/**
* Send a request to the TfL Unified API
* @param uri URI to send request to
* @param params Parameters to send
* @param method Method to use (GET, POST, PUT, DELETE) (Default: GET)
* @ignore
*/
protected sendRequest(uri: string, params: any, method?: string): Promise<any>;
/**
* Send a request to the TrackerNet API
* @param uri URI to send request to
* @param method Method to use (GET, POST, PUT, DELETE) (Default: GET)
* @param reTag Boolean to check if the XML should be re-tagged
* @ignore
*/
protected sendRequestTrackerNet(uri: string, method: string, reTag: boolean): Promise<any>;
/**
* Convert object to query string
* @param params Object to convert
* @ignore
*/
static objectToQuery(params: any): string;
/**
* @ignore
*/
static arrayToCSV(arr: Array<string | number> | undefined): string | undefined;
/**
* Convert Date to ISO 8601 format
* @param date Date to convert
* @ignore
*/
static convertDate(date: Date | undefined): string;
/**
* Check for incidents only
* @param incidentsOnly Boolean to check
* @ignore
*/
static incidentsCheck(incidentsOnly: boolean): string;
}