Class: TypeStateHandler

states.TypeStateHandler(context)

Handler for the Type state

Constructor

new TypeStateHandler(context)

Create a type state handler

Parameters:
Name Type Description
context OwenAnimationContext

The animation context

Source:

Extends

  • StateHandler

Members

emotion :string

Current emotional state

Type:
  • string
Source:

isTyping :boolean

Whether currently typing

Type:
  • boolean
Source:

Methods

(async) enter(_fromStateopt, emotionopt) → {Promise.<void>}

Enter the type state

Parameters:
Name Type Attributes Default Description
_fromState string | null <optional>
null

The previous state (unused)

emotion string <optional>
Emotions.NEUTRAL

The emotion to enter with

Source:
Returns:
Type
Promise.<void>

(async) exit(toStateopt, _emotionopt) → {Promise.<void>}

Exit the type state

Parameters:
Name Type Attributes Default Description
toState string | null <optional>
null

The next state

_emotion string <optional>
Emotions.NEUTRAL

The emotion to exit with (unused)

Source:
Returns:
Type
Promise.<void>

(async) finishTyping() → {Promise.<void>}

Finish typing and prepare to transition

Source:
Returns:
Type
Promise.<void>

getAvailableTransitions() → {Array.<string>}

Get available transitions from type state

Source:
Returns:

Array of available state transitions

Type
Array.<string>

getIsTyping() → {boolean}

Check if currently typing

Source:
Returns:

True if typing, false otherwise

Type
boolean

setTyping(typing) → {void}

Set typing state

Parameters:
Name Type Description
typing boolean

Whether currently typing

Source:
Returns:
Type
void