Preparing search index...
The search index is not available
@niuee/board
@niuee/board
TemplateStateMachine
Class TemplateStateMachine<EventPayloadMapping, Context, States>
Abstract
Type Parameters
EventPayloadMapping
Context
States
extends
string
=
"IDLE"
Hierarchy (
View Summary
)
TemplateStateMachine
PanControlStateMachine
ZoomControlStateMachine
UserInputStateMachine
TouchSM
Implements
StateMachine
<
EventPayloadMapping
,
Context
,
States
>
Index
Constructors
constructor
Properties
_context
_current
State
_happens
Callbacks
_state
Change
Callbacks
_states
_states
Array
Accessors
current
State
possible
States
states
Methods
happens
on
Happens
on
State
Change
set
Context
switch
To
Constructors
constructor
new
TemplateStateMachine
<
EventPayloadMapping
,
Context
,
States
extends
string
=
"IDLE"
,
>
(
states
:
Record
<
States
,
State
<
EventPayloadMapping
,
Context
,
States
>
>
,
initialState
:
States
,
context
:
Context
,
)
:
TemplateStateMachine
<
EventPayloadMapping
,
Context
,
States
>
Type Parameters
EventPayloadMapping
Context
States
extends
string
=
"IDLE"
Parameters
states
:
Record
<
States
,
State
<
EventPayloadMapping
,
Context
,
States
>
>
initialState
:
States
context
:
Context
Returns
TemplateStateMachine
<
EventPayloadMapping
,
Context
,
States
>
Properties
Protected
_context
_context
:
Context
Protected
_current
State
_currentState
:
States
Protected
_happens
Callbacks
_happensCallbacks
:
(
event
:
keyof
EventPayloadMapping
,
payload
:
EventPayloadMapping
[
keyof
EventPayloadMapping
]
,
context
:
Context
,
)
=>
void
[]
Protected
_state
Change
Callbacks
_stateChangeCallbacks
:
StateChangeCallback
<
EventPayloadMapping
,
Context
,
States
>
[]
Protected
_states
_states
:
Record
<
States
,
State
<
EventPayloadMapping
,
Context
,
States
>
>
Protected
_states
Array
_statesArray
:
States
[]
Accessors
current
State
get
currentState
()
:
States
Returns
States
possible
States
get
possibleStates
()
:
States
[]
Returns
States
[]
states
get
states
()
:
Record
<
States
,
State
<
EventPayloadMapping
,
Context
,
States
>
>
Returns
Record
<
States
,
State
<
EventPayloadMapping
,
Context
,
States
>
>
Methods
happens
happens
<
K
extends
string
|
number
|
symbol
>
(
event
:
K
,
payload
:
EventPayloadMapping
[
K
]
,
context
:
Context
,
)
:
States
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
event
:
K
payload
:
EventPayloadMapping
[
K
]
context
:
Context
Returns
States
on
Happens
onHappens
(
callback
:
(
event
:
keyof
EventPayloadMapping
,
payload
:
EventPayloadMapping
[
keyof
EventPayloadMapping
]
,
context
:
Context
,
)
=>
void
,
)
:
void
Parameters
callback
:
(
event
:
keyof
EventPayloadMapping
,
payload
:
EventPayloadMapping
[
keyof
EventPayloadMapping
]
,
context
:
Context
,
)
=>
void
Returns
void
on
State
Change
onStateChange
(
callback
:
StateChangeCallback
<
EventPayloadMapping
,
Context
,
States
>
,
)
:
void
Parameters
callback
:
StateChangeCallback
<
EventPayloadMapping
,
Context
,
States
>
Returns
void
set
Context
setContext
(
context
:
Context
)
:
void
Parameters
context
:
Context
Returns
void
switch
To
switchTo
(
state
:
States
)
:
void
Parameters
state
:
States
Returns
void
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_context
_current
State
_happens
Callbacks
_state
Change
Callbacks
_states
_states
Array
Accessors
current
State
possible
States
states
Methods
happens
on
Happens
on
State
Change
set
Context
switch
To
@niuee/board
Loading...