@ue-too/board / index / expandTouchInputStateMachine
関数: expandTouchInputStateMachine()
expandTouchInputStateMachine<
E,C,S,O>(context,define,initialState):TemplateStateMachine<E,C,S,O>
定義: packages/board/src/input-interpretation/input-state-machine/touch-input-state-machine.ts:493
Builds a touch input state machine with more events, states, context or outputs than the stock one, reusing every built-in state.
型パラメーター
E
E extends TouchEventMapping
C
C extends TouchContext
S
S extends string
O
O extends TouchInputEventOutputMapping & Partial<Record<keyof E, unknown>>
パラメータ
context
C
The expanded context; must satisfy TouchContext
define
[TouchStates] extends [S] ? TouchInputStateMachineExpansion<E, C, S, O> : object
Receives the stock states and an extend helper, returns the expanded state map. See TouchInputStateMachineExpansion.
initialState
S = ...
Defaults to 'IDLE'
戻り値
TemplateStateMachine<E, C, S, O>
A machine over the expanded generics
Remarks
Same rules as expandKmtInputStateMachine: every generic must be a superset of the stock one, S must include every TouchStates member, and shared events keep the stock payload.