mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Remove ETA events and add shuttle events for ShuttleGetterRepository
This commit is contained in:
@@ -2,9 +2,8 @@ import { IEta, IOrderedStop, IRoute, IShuttle, IStop } from "../../entities/Shut
|
||||
import type EventEmitter from "node:events";
|
||||
|
||||
export const ShuttleRepositoryEvent = {
|
||||
ETA_UPDATED: "etaUpdated",
|
||||
ETA_REMOVED: "etaRemoved",
|
||||
ETA_DATA_CLEARED: "etaDataCleared",
|
||||
SHUTTLE_UPDATED: "shuttleUpdated",
|
||||
SHUTTLE_REMOVED: "shuttleRemoved",
|
||||
} as const;
|
||||
|
||||
export type ShuttleRepositoryEventName = typeof ShuttleRepositoryEvent[keyof typeof ShuttleRepositoryEvent];
|
||||
@@ -13,9 +12,8 @@ export type EtaRemovedEventPayload = IEta;
|
||||
export type EtaDataClearedEventPayload = IEta[];
|
||||
|
||||
export interface ShuttleRepositoryEventPayloads {
|
||||
[ShuttleRepositoryEvent.ETA_UPDATED]: IEta;
|
||||
[ShuttleRepositoryEvent.ETA_REMOVED]: EtaRemovedEventPayload;
|
||||
[ShuttleRepositoryEvent.ETA_DATA_CLEARED]: EtaDataClearedEventPayload;
|
||||
[ShuttleRepositoryEvent.SHUTTLE_UPDATED]: IShuttle,
|
||||
[ShuttleRepositoryEvent.SHUTTLE_REMOVED]: IShuttle,
|
||||
}
|
||||
|
||||
export type ShuttleRepositoryEventListener<T extends ShuttleRepositoryEventName> = (
|
||||
|
||||
Reference in New Issue
Block a user