Refactor event system to support returnable events

Added support for validating and managing return values in events. Implemented `validate` and `clone` methods in the event base class for event mutation and return handling. Additionally, enhanced error handling, introduced "once" listeners, and improved async execution management in the `EventManager`.
This commit is contained in:
dswbx
2025-01-15 17:21:28 +01:00
parent 7b0a41b297
commit 6625c9bc48
6 changed files with 227 additions and 185 deletions

View File

@@ -1,8 +1,8 @@
export { Event, NoParamEvent } from "./Event";
export { Event, NoParamEvent, InvalidEventReturn } from "./Event";
export {
EventListener,
ListenerModes,
type ListenerMode,
type ListenerHandler,
type ListenerHandler
} from "./EventListener";
export { EventManager, type EmitsEvents, type EventClass } from "./EventManager";