UNPKG

tfl-api-wrapper

Version:

A Node JS wrapper for the Transport for London API

49 lines (48 loc) 2.08 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var tfl_1 = require("./tfl"); var Crowding = /** @class */ (function (_super) { __extends(Crowding, _super); function Crowding(config) { return _super.call(this, config) || this; } /** * Get crowding information for Naptan * @param naptanID ID of the stop (eg. 940GZZLUASL) */ Crowding.prototype.getAllByNaptan = function (naptanID) { return this.sendRequest("/Crowding/".concat(naptanID), {}); }; /** * Get crowding information for Naptan for a specified day of week * @param naptanID ID of the stop (eg. 940GZZLUASL) * @param dayOfTheWeek The day of which you would like data to return (eg. MON, TUE) */ Crowding.prototype.getByNaptanDay = function (naptanID, dayOfTheWeek) { return this.sendRequest("/Crowding/".concat(naptanID, "/").concat(dayOfTheWeek), {}); }; /** * Get live crowding information for Naptan * @param naptanID ID of the stop (eg. 940GZZLUASL) */ Crowding.prototype.getLiveByNaptan = function (naptan) { return this.sendRequest("/Crowding/".concat(naptan, "/Live"), {}); }; return Crowding; }(tfl_1.default)); exports.default = Crowding;