mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +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";
|
import type EventEmitter from "node:events";
|
||||||
|
|
||||||
export const ShuttleRepositoryEvent = {
|
export const ShuttleRepositoryEvent = {
|
||||||
ETA_UPDATED: "etaUpdated",
|
SHUTTLE_UPDATED: "shuttleUpdated",
|
||||||
ETA_REMOVED: "etaRemoved",
|
SHUTTLE_REMOVED: "shuttleRemoved",
|
||||||
ETA_DATA_CLEARED: "etaDataCleared",
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type ShuttleRepositoryEventName = typeof ShuttleRepositoryEvent[keyof typeof ShuttleRepositoryEvent];
|
export type ShuttleRepositoryEventName = typeof ShuttleRepositoryEvent[keyof typeof ShuttleRepositoryEvent];
|
||||||
@@ -13,9 +12,8 @@ export type EtaRemovedEventPayload = IEta;
|
|||||||
export type EtaDataClearedEventPayload = IEta[];
|
export type EtaDataClearedEventPayload = IEta[];
|
||||||
|
|
||||||
export interface ShuttleRepositoryEventPayloads {
|
export interface ShuttleRepositoryEventPayloads {
|
||||||
[ShuttleRepositoryEvent.ETA_UPDATED]: IEta;
|
[ShuttleRepositoryEvent.SHUTTLE_UPDATED]: IShuttle,
|
||||||
[ShuttleRepositoryEvent.ETA_REMOVED]: EtaRemovedEventPayload;
|
[ShuttleRepositoryEvent.SHUTTLE_REMOVED]: IShuttle,
|
||||||
[ShuttleRepositoryEvent.ETA_DATA_CLEARED]: EtaDataClearedEventPayload;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ShuttleRepositoryEventListener<T extends ShuttleRepositoryEventName> = (
|
export type ShuttleRepositoryEventListener<T extends ShuttleRepositoryEventName> = (
|
||||||
|
|||||||
Reference in New Issue
Block a user