new SceneContext()
- Source
Members
ctx :OpengramContext
Type:
- Source
current
- Source
leaving :boolean
Type:
- boolean
- Source
options :StageOptions
Type:
- StageOptions
- Source
scenes :Map.<string, (Scenes.WizardScene|Scenes.BaseScene)>
Type:
- Map.<string, (Scenes.WizardScene|Scenes.BaseScene)>
- Source
session
Getter returns current scene session object
- Source
state
Getter returns state of current scene
- Source
state
Setter sets state of current scene
- Source
Methods
(async) enter(sceneId, initialStateopt, silentopt) → {Promise}
Enter to scene by name
Use initialState
to pass some initial data of ctx.scene.state
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sceneId | string | Scene name | |
initialState | object | <optional> | Scene initial state |
silent | boolean | <optional> | If true, enters to given scene without calling |
- Source
Throws:
Error
Returns:
- Type:
- Promise
(async) leave() → {Promise.<void>}
Used to exit the current scene
- Source
Returns:
- Type:
- Promise.<void>
reenter() → {Promise}
Used for re-entering to current scene without destroying ctx.scene.state
- Source
Throws:
Error
Returns:
- Type:
- Promise
reset() → {void}
Resets scenes data
- Source
Returns:
- Type:
- void