Skip to content

EventMapLike

EventMapLike<T> = { [K in keyof T]-?: K extends keyof FsmEventMap ? never : unknown }

Defined in: types.ts:355

The constraint a user-supplied event map must satisfy: every declared property is a payload type (any type, undefined for a payload-free event), and no declared name is one of the seven built-in event names. Self-mapped for the same reason as InputMapLike: a named interface has no string index signature, so a bare Record<string, unknown> bound would reject it.

A built-in name is constrained to never because the engine owns those payloads. on() is keyed by the built-in map intersected with the declared map, so a declared transitioned: { trackingId: string } would type the subscriber’s payload as carrying trackingId while the engine emits { fromState, toState } only. The wide EventMap still satisfies this: its index signature maps string, which is not a built-in literal.

T