StateNode
Table of contents
- Properties
- _currentToolIdMask
- _path
- children
- children
- editor
- enter
- exit
- handleEvent
- id
- id
- initial
- initial
- onCancel
- onComplete
- onDoubleClick
- onEnter
- onExit
- onInterrupt
- onKeyDown
- onKeyRepeat
- onKeyUp
- onMiddleClick
- onPointerDown
- onPointerMove
- onPointerUp
- onQuadrupleClick
- onRightClick
- onTick
- onTripleClick
- onWheel
- parent
- shapeType
- transition
- type
- Methods
Public class
abstract class StateNode implements Partial<TLEventHandlers> {}
packages/editor/src/lib/editor/tools/StateNode.ts
Constructor
Public constructor
Constructs a new instance of the StateNode
class
Name | Description |
---|---|
|
|
|
|
Properties
children
Public property
children?: Record<string, StateNode>
children
Public static property
static children?: () => TLStateNodeConstructor[]
editor
Public property
editor: Editor
enter
Public property
enter: (info: any, from: string) => void
exit
Public property
exit: (info: any, from: string) => void
handleEvent
Public property
handleEvent: (info: Exclude<TLEventInfo, TLPinchEventInfo>) => void
id
Public property
id: string
id
Public static property
static id: string
initial
Public property
initial?: string
initial
Public static property
static initial?: string
onCancel
Public property
onCancel?: TLEventHandlers['onCancel']
onComplete
Public property
onComplete?: TLEventHandlers['onComplete']
onDoubleClick
Public property
onDoubleClick?: TLEventHandlers['onDoubleClick']
onEnter
Public property
onEnter?: TLEnterEventHandler
onExit
Public property
onExit?: TLExitEventHandler
onInterrupt
Public property
onInterrupt?: TLEventHandlers['onInterrupt']
onKeyDown
Public property
onKeyDown?: TLEventHandlers['onKeyDown']
onKeyRepeat
Public property
onKeyRepeat?: TLEventHandlers['onKeyRepeat']
onKeyUp
Public property
onKeyUp?: TLEventHandlers['onKeyUp']
onMiddleClick
Public property
onMiddleClick?: TLEventHandlers['onMiddleClick']
onPointerDown
Public property
onPointerDown?: TLEventHandlers['onPointerDown']
onPointerMove
Public property
onPointerMove?: TLEventHandlers['onPointerMove']
onPointerUp
Public property
onPointerUp?: TLEventHandlers['onPointerUp']
onQuadrupleClick
Public property
onQuadrupleClick?: TLEventHandlers['onQuadrupleClick']
onRightClick
Public property
onRightClick?: TLEventHandlers['onRightClick']
onTick
Public property
onTick?: TLTickEventHandler
onTripleClick
Public property
onTripleClick?: TLEventHandlers['onTripleClick']
onWheel
Public property
onWheel?: TLEventHandlers['onWheel']
parent
Public property
parent: StateNode
shapeType
Public property
shapeType?: string
transition
Public property
Transition to a new active child state node.
Example
parentState.transition('childStateA')
parentState.transition('childStateB', { myData: 4 })
transition: (id: string, info?: any) => this
Name | Description |
---|---|
| The id of the child state node to transition to. |
| Any data to pass to the |
type
Public property
type: TLStateNodeType
Methods
getCurrent()
Public method
This node's current active child node, if any.
getCurrent(): StateNode | undefined
getCurrentToolIdMask()
Public method
getCurrentToolIdMask(): string | undefined
getIsActive()
Public method
Whether this node is active.
getIsActive(): boolean
getPath()
Public method
This node's path of active state nodes
getPath(): string
setCurrentToolIdMask()
Public method
setCurrentToolIdMask(id: string | undefined): void
Name | Description |
---|---|
|
|
void