/** * Template literal type for action events. * Actions are dynamically named based on user-defined action names. * * @example * type MyActions = ActionEvent<'jump' | 'attack' | 'dodge'>; * // Results in: "action:jump" | "action:attack" | "action:dodge" */ export type ActionEvent = `action:${Name}`; /** * Template literal type for level events. * * @example * type MyLevelEvents = LevelEvent<'progress' | 'complete'>; * // Results in: "level:progress" | "level:complete" */ export type LevelEvent = `level:${Name}`; /** * Template literal type for input events. * * @example * type MyInputEvents = InputEvent<'changed' | 'device:connected'>; * // Results in: "input:changed" | "input:device:connected" */ export type InputEvent = `input:${Name}`; /** Library-defined level event types */ export type LibraryLevelEvent = LevelEvent<'progress' | 'complete' | 'error'>; /** Library-defined input event types */ export type LibraryInputEvent = InputEvent<'changed' | 'device:connected' | 'device:disconnected'>; /** Library-defined action event types (dynamic, based on action name) */ export type LibraryActionEvent = ActionEvent; /** All library-defined event types */ export type LibraryEventType = LibraryLevelEvent | LibraryInputEvent | LibraryActionEvent; /** * Wildcard subscription patterns for subscribing to multiple events. * These are valid for subscribe() but NOT for publish(). */ export type WildcardPattern = 'action:*' | 'level:*' | 'input:*' | 'input:device:*' | `${string}:*`;