mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
Unify the new ETA functionality across all shuttle repositories
This commit is contained in:
@@ -22,6 +22,22 @@ export type ShuttleRepositoryEventListener<T extends ShuttleRepositoryEventName>
|
||||
payload: ShuttleRepositoryEventPayloads[T],
|
||||
) => void;
|
||||
|
||||
export interface ShuttleStopArrival {
|
||||
stopId: string;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export interface ShuttleTravelTimeDataIdentifier {
|
||||
routeId: string;
|
||||
fromStopId: string;
|
||||
toStopId: string;
|
||||
}
|
||||
|
||||
export interface ShuttleTravelTimeDateFilterArguments {
|
||||
from: Date;
|
||||
to: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuttle getter repository to be linked to a system.
|
||||
*/
|
||||
@@ -61,4 +77,19 @@ export interface ShuttleGetterRepository extends EventEmitter {
|
||||
* @param routeId
|
||||
*/
|
||||
getOrderedStopsByRouteId(routeId: string): Promise<IOrderedStop[]>;
|
||||
|
||||
/**
|
||||
* Get the last stop arrival for a shuttle.
|
||||
* Returns undefined if no last stop arrival has been recorded.
|
||||
* @param shuttleId
|
||||
*/
|
||||
getShuttleLastStopArrival(shuttleId: string): Promise<ShuttleStopArrival | undefined>;
|
||||
|
||||
/**
|
||||
* Check if a shuttle has arrived at a stop within the given delta.
|
||||
* Returns the stop if the shuttle is at a stop, otherwise undefined.
|
||||
* @param shuttle
|
||||
* @param delta - The coordinate delta tolerance (default 0.001)
|
||||
*/
|
||||
getArrivedStopIfExists(shuttle: IShuttle, delta?: number): Promise<IStop | undefined>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user