Documentation / @zerotal/flow / index / FlowEvents
Interface: FlowEvents
Defined in: flow/src/events.ts:44
The realtime event contract: maps each event name to its payload type. Empty by default; apps
augment it via TypeScript module augmentation so every dispatch site and @on handler is
type-checked end-to-end, with no codegen. keyof FlowEvents drives dispatch/@on
autocomplete.
Remarks
Payloads are object shapes or void (for events with no payload). Unknown event names still
compile (a string fallback keeps echo:… broadcasts and gradual adoption working); they are
simply untyped.
Example
// app/flow-events.d.ts
declare module "@zerotal/flow" {
interface FlowEvents {
"post-created": { id: number; title: string };
"cart-cleared": void; // no payload
}
}