/** * Generic event handler function type. */ export type EventHandler = (data: T) => void | Promise; /** * Synchronous event handler. */ export type SyncEventHandler = (data: T) => void; /** * Async event handler. */ export type AsyncEventHandler = (data: T) => Promise; /** * Unsubscribe function returned by event subscriptions. */ export type Unsubscribe = () => void; /** * Event middleware function. */ export type EventMiddleware = (data: T, next: (data: T) => void | Promise) => void | Promise;