clik-engine API
GitHub
Preparing search index...
StateMachine
Class StateMachine<TContext>
Type Parameters
TContext
=
unknown
Index
Constructors
constructor
Methods
add
State
add
Transition
get
Current
get
Debug
State
get
History
get
Previous
is
is
Any
start
transition
To
update
Constructors
constructor
new
StateMachine
<
TContext
=
unknown
>
(
context
:
TContext
,
debugLabel
?:
string
,
)
:
StateMachine
<
TContext
>
Type Parameters
TContext
=
unknown
Parameters
context
:
TContext
debugLabel
:
string
= 'fsm'
Returns
StateMachine
<
TContext
>
Methods
add
State
addState
(
name
:
string
,
hooks
:
StateHooks
<
TContext
>
)
:
this
Parameters
name
:
string
hooks
:
StateHooks
<
TContext
>
Returns
this
add
Transition
addTransition
(
from
:
string
,
to
:
string
,
condition
:
(
ctx
:
TContext
)
=>
boolean
,
guard
?:
(
ctx
:
TContext
)
=>
boolean
,
)
:
this
Parameters
from
:
string
to
:
string
condition
:
(
ctx
:
TContext
)
=>
boolean
Optional
guard
:
(
ctx
:
TContext
)
=>
boolean
Returns
this
get
Current
getCurrent
()
:
string
|
null
Returns
string
|
null
get
Debug
State
getDebugState
()
:
Record
<
string
,
unknown
>
Get debug info for StateInspector
Returns
Record
<
string
,
unknown
>
get
History
getHistory
()
:
readonly
string
[]
Returns
readonly
string
[]
get
Previous
getPrevious
()
:
string
|
null
Returns
string
|
null
is
is
(
state
:
string
)
:
boolean
Parameters
state
:
string
Returns
boolean
is
Any
isAny
(
...
states
:
string
[]
)
:
boolean
Parameters
...
states
:
string
[]
Returns
boolean
start
start
(
initialState
:
string
)
:
this
Parameters
initialState
:
string
Returns
this
transition
To
transitionTo
(
newState
:
string
)
:
boolean
Parameters
newState
:
string
Returns
boolean
update
update
(
delta
:
number
)
:
void
Parameters
delta
:
number
Returns
void
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
add
State
add
Transition
get
Current
get
Debug
State
get
History
get
Previous
is
is
Any
start
transition
To
update
GitHub
clik-engine API
Loading...
Get debug info for StateInspector