37 lines
813 B
TypeScript
37 lines
813 B
TypeScript
/**
|
|
* Events Module
|
|
*
|
|
* Centralized event system for component event handling.
|
|
*
|
|
* Usage:
|
|
* 1. Import the eventExecutor singleton:
|
|
* import { eventExecutor } from './events';
|
|
*
|
|
* 2. Set context when runtime initializes:
|
|
* eventExecutor.setContext({ setStateValue, navigateToPage, pages });
|
|
*
|
|
* 3. Execute handlers:
|
|
* await eventExecutor.execute(handlers);
|
|
*
|
|
* 4. Register custom action executors:
|
|
* registerActionExecutor('customAction', async (handler, context) => { ... });
|
|
*/
|
|
|
|
export {
|
|
EventExecutor,
|
|
eventExecutor,
|
|
registerActionExecutor,
|
|
getActionExecutor,
|
|
validateHandlers,
|
|
executeEventHandlers,
|
|
} from './EventExecutor';
|
|
|
|
export type {
|
|
EventType,
|
|
ActionType,
|
|
ActionContext,
|
|
ActionExecutor,
|
|
WorkflowConfig,
|
|
EventExecutorConfig,
|
|
} from './EventExecutor';
|