mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-16 23:40:32 +00:00
Define a new event to indicate shuttle is near a stop
This commit is contained in:
@@ -4,6 +4,7 @@ import type EventEmitter from "node:events";
|
|||||||
export const ShuttleRepositoryEvent = {
|
export const ShuttleRepositoryEvent = {
|
||||||
SHUTTLE_UPDATED: "shuttleUpdated",
|
SHUTTLE_UPDATED: "shuttleUpdated",
|
||||||
SHUTTLE_REMOVED: "shuttleRemoved",
|
SHUTTLE_REMOVED: "shuttleRemoved",
|
||||||
|
SHUTTLE_IS_NEAR_NEXT_STOP: "shuttleIsNearNextStop",
|
||||||
SHUTTLE_WILL_ARRIVE_AT_STOP: "shuttleArrivedAtStop",
|
SHUTTLE_WILL_ARRIVE_AT_STOP: "shuttleArrivedAtStop",
|
||||||
SHUTTLE_WILL_LEAVE_STOP: "shuttleWillLeaveStop",
|
SHUTTLE_WILL_LEAVE_STOP: "shuttleWillLeaveStop",
|
||||||
} as const;
|
} as const;
|
||||||
@@ -18,6 +19,8 @@ export interface ShuttleWillArriveAtStopPayload {
|
|||||||
willArriveAt: ShuttleStopArrival;
|
willArriveAt: ShuttleStopArrival;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ShuttleIsNearStopPayload = ShuttleWillArriveAtStopPayload;
|
||||||
|
|
||||||
export interface ShuttleWillLeaveStopPayload {
|
export interface ShuttleWillLeaveStopPayload {
|
||||||
stopArrivalThatShuttleIsLeaving: ShuttleStopArrival;
|
stopArrivalThatShuttleIsLeaving: ShuttleStopArrival;
|
||||||
}
|
}
|
||||||
@@ -25,6 +28,7 @@ export interface ShuttleWillLeaveStopPayload {
|
|||||||
export interface ShuttleRepositoryEventPayloads {
|
export interface ShuttleRepositoryEventPayloads {
|
||||||
[ShuttleRepositoryEvent.SHUTTLE_UPDATED]: IShuttle,
|
[ShuttleRepositoryEvent.SHUTTLE_UPDATED]: IShuttle,
|
||||||
[ShuttleRepositoryEvent.SHUTTLE_REMOVED]: IShuttle,
|
[ShuttleRepositoryEvent.SHUTTLE_REMOVED]: IShuttle,
|
||||||
|
[ShuttleRepositoryEvent.SHUTTLE_IS_NEAR_NEXT_STOP]: ShuttleIsNearStopPayload,
|
||||||
[ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP]: ShuttleWillArriveAtStopPayload,
|
[ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP]: ShuttleWillArriveAtStopPayload,
|
||||||
[ShuttleRepositoryEvent.SHUTTLE_WILL_LEAVE_STOP]: ShuttleWillLeaveStopPayload,
|
[ShuttleRepositoryEvent.SHUTTLE_WILL_LEAVE_STOP]: ShuttleWillLeaveStopPayload,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user