File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,16 @@ export async function getMapVehicles(auth: string) {
2020 return await res . json ( )
2121}
2222
23+ /**
24+ * get a list of the capacity information for all active buses
25+ * @returns {VehicleCapacity[] } list of all capacity information for active buses
26+ */
27+ export async function getVehicleCapacities ( ) {
28+ var res = await fetch ( 'https://ridebtd.org/Services/JSONPRelay.svc/GetVehicleCapacities' )
29+
30+ return await res . json ( )
31+ }
32+
2333/**
2434 * get the next stop times for a given route(s)
2535 * @param {string[] } routes route ids to get stop times for
Original file line number Diff line number Diff line change 55export {
66 getRoutes ,
77 getMapVehicles ,
8+ getVehicleCapacities ,
89 getStopArrivalTimes ,
910 getAnnouncements
1011} from "./api.js"
Original file line number Diff line number Diff line change @@ -83,6 +83,13 @@ declare module 'brazos-transit-api' {
8383 VehicleID : number ;
8484 }
8585
86+ export interface VehicleCapacity {
87+ Capacity : number ;
88+ CurrentOccupation : number ;
89+ Percentage : number ;
90+ VehicleID : number ;
91+ }
92+
8693 interface TimeEstimate {
8794 EstimateTime : string ;
8895 IsArriving : boolean ;
@@ -136,6 +143,12 @@ declare module 'brazos-transit-api' {
136143 */
137144 export async function getMapVehicles ( auth : string ) : Promise < Vehicle [ ] >
138145
146+ /**
147+ * get a list of the capacity information for all active buses
148+ * @returns {VehicleCapacity[] } list of all capacity information for active buses
149+ */
150+ export async function getVehicleCapacities ( ) : Promise < VehicleCapacity [ ] >
151+
139152 /**
140153 * get the next stop times for a given route(s)
141154 * @param {string[] } routes route ids to get stop times for
You can’t perform that action at this time.
0 commit comments