Skip to content

Commit 58b7312

Browse files
authored
Merge pull request #1 from Maroon-Rides/better-typing
2 parents 5db29c6 + c781d26 commit 58b7312

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Get the currently active routes
33
* @param {string} auth Authentication to use for the request
4-
* @returns {string[]} list of route names ("01", "04", etc.)
4+
* @returns {Route[]} list of all active routes
55
*/
66
export async function getBaseData(auth: string) {
77
var res = await fetch(`https://ridebtd.org/Services/JSONPRelay.svc/GetRoutesForMapWithScheduleWithEncodedLine?apiKey=${auth}&isDispatch=false`)
@@ -12,7 +12,7 @@ export async function getBaseData(auth: string) {
1212
/**
1313
* get a list of all locations for all buses that are active
1414
* @param {string} auth authentication to use for the request
15-
* @returns list of all locations for buses that are active
15+
* @returns {Vehicle[]} list of all locations for buses that are active
1616
*/
1717
export async function getVehicleLocations(auth: string) {
1818
var res = await fetch(`https://ridebtd.org/Services/JSONPRelay.svc/GetMapVehiclePoints?apiKey=${auth}&isPublicMap=true`)
@@ -24,7 +24,7 @@ export async function getVehicleLocations(auth: string) {
2424
* get the next stop times for a given route(s)
2525
* @param {string[]} routes route ids to get stop times for
2626
* @param {string} auth authentication to use for the request
27-
* @returns list of stop times for the given routes
27+
* @returns {RouteStop[]} list of stop times for the given routes
2828
*/
2929
export async function getNextStopTimes(routes: string[], auth: string) {
3030
var res = await fetch(`https://ridebtd.org/Services/JSONPRelay.svc/GetStopArrivalTimes?apiKey=${auth}&routeIds=${routes.join(",")}&version=2`)
@@ -34,7 +34,7 @@ export async function getNextStopTimes(routes: string[], auth: string) {
3434

3535
/**
3636
* get the announcements for route changes
37-
* @returns list of announcements
37+
* @returns {Announcement[]} list of announcements
3838
*/
3939
export async function getAnnouncements() {
4040
var res = await fetch("https://ridebtd.org/Services/JSONPRelay.svc/GetTwitterJSON")

types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,30 +125,30 @@ declare module 'brazos-transit-api' {
125125
/**
126126
* Get the currently active routes
127127
* @param {string} auth Authentication to use for the request
128-
* @returns {string[]} list of route names ("01", "04", etc.)
128+
* @returns {Route[]} list of all active routes
129129
*/
130130
export async function getBaseData(auth: string): Promise<Route[]>
131131

132132
/**
133133
* get a list of all locations for all buses that are active
134134
* @param {string} auth authentication to use for the request
135-
* @returns list of all locations for buses that are active
135+
* @returns {Vehicle[]} list of all locations for buses that are active
136136
*/
137137
export async function getVehicleLocations(auth: string): Promise<Vehicle[]>
138138

139139
/**
140140
* get the next stop times for a given route(s)
141141
* @param {string[]} routes route ids to get stop times for
142142
* @param {string} auth authentication to use for the request
143-
* @returns list of stop times for the given routes
143+
* @returns {RouteStop[]} list of stop times for the given routes
144144
*/
145145
export async function getNextStopTimes(routes: string[], auth: string): Promise<RouteStop[]>
146146

147147

148148

149149
/**
150150
* get the announcements for route changes
151-
* @returns {Announcement[]} - list of announcements
151+
* @returns {Announcement[]} list of announcements
152152
*/
153153
export async function getAnnouncements(): Promise<Announcement[]>
154154

0 commit comments

Comments
 (0)