Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 2x 1x 1x 1x | import { arrivalsFixtureData } from "./fixture";
import { ArrivalData } from "./interfaces/arrivals";
import { TrimetClientOptions } from "./options";
import { getTrimetData } from "./util";
export async function getArrivals(
stopLocationIds: string, // should be an ',' joined string of stop location ids like 123,456,789
minutes: number,
{ baseUrl, appId, useFixtures }: TrimetClientOptions
): Promise<ArrivalData> {
if (useFixtures) {
return arrivalsFixtureData();
}
const request = `${baseUrl}V2/arrivals/json/true/locIDs/${stopLocationIds}/arrivals/4/showPosition/true/minutes/${minutes}/appID/${appId}`;
return getTrimetData<ArrivalData>(request);
}
|