SelectTool
Table of contents
- id
- initial
- isLockable
- _currentToolIdMask
- _path
- children
- editor
- parent
- performanceTracker
- reactor
- shapeType
- type
- useCoalescedEvents
- Properties
- Methods
- children
- addChild
- cleanUpDuplicateProps
- enter
- exit
- getCurrent
- getCurrentToolIdMask
- getIsActive
- getPath
- handleEvent
- onCancel
- onComplete
- onDoubleClick
- onEnter
- onExit
- onInterrupt
- onKeyDown
- onKeyRepeat
- onKeyUp
- onLongPress
- onMiddleClick
- onPointerDown
- onPointerMove
- onPointerUp
- onQuadrupleClick
- onRightClick
- onTick
- onTripleClick
- onWheel
- setCurrentToolIdMask
- transition
Extends StateNode.
class SelectTool extends StateNode {}Constructor
from StateNode
Constructs a new instance of the StateNode class
Parameters
Properties
id
static
static id: string;initial
static
static initial: string;isLockable
static
static isLockable: boolean;children
optional
from StateNode
children?: Record<string, StateNode>;editor
from StateNode
editor: Editor;parent
from StateNode
parent: StateNode;performanceTracker
from StateNode
performanceTracker: PerformanceTracker;reactor
reactor: (() => void) | undefined;shapeType
optional
from StateNode
shapeType?: string;type
from StateNode
type: "branch" | "leaf" | "root";useCoalescedEvents
from StateNode
useCoalescedEvents: boolean;Methods
children( )
static
static children(): TLStateNodeConstructor[];addChild( )
from StateNode
Add a child node to this state node.
addChild(childConstructor: TLStateNodeConstructor): this;Parameters
| Name | Description |
|---|---|
|
Returns
this;cleanUpDuplicateProps( )
cleanUpDuplicateProps(): void;enter( )
from StateNode
enter(info: any, from: string): void;Parameters
| Name | Description |
|---|---|
| |
| |
Returns
void;exit( )
from StateNode
exit(info: any, to: string): void;Parameters
| Name | Description |
|---|---|
| |
| |
Returns
void;getCurrent( )
from StateNode
This node's current active child node, if any.
getCurrent(): StateNode | undefined;getCurrentToolIdMask( )
from StateNode
getCurrentToolIdMask(): string | undefined;getIsActive( )
from StateNode
Whether this node is active.
getIsActive(): boolean;getPath( )
from StateNode
This node's path of active state nodes
getPath(): string;handleEvent( )
from StateNode
handleEvent(info: Exclude<TLEventInfo, TLPinchEventInfo>): void;Parameters
| Name | Description |
|---|---|
| |
Returns
void;onCancel( )
optional
from StateNode
onCancel?(info: TLCancelEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onComplete( )
optional
from StateNode
onComplete?(info: TLCompleteEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onDoubleClick( )
optional
from StateNode
onDoubleClick?(info: TLClickEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onEnter( )
onEnter(): void;onExit( )
onExit(): void;onInterrupt( )
optional
from StateNode
onInterrupt?(info: TLInterruptEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onKeyDown( )
optional
from StateNode
onKeyDown?(info: TLKeyboardEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onKeyRepeat( )
optional
from StateNode
onKeyRepeat?(info: TLKeyboardEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onKeyUp( )
optional
from StateNode
onKeyUp?(info: TLKeyboardEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onLongPress( )
optional
from StateNode
onLongPress?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onMiddleClick( )
optional
from StateNode
onMiddleClick?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onPointerDown( )
optional
from StateNode
onPointerDown?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onPointerMove( )
optional
from StateNode
onPointerMove?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onPointerUp( )
optional
from StateNode
onPointerUp?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onQuadrupleClick( )
optional
from StateNode
onQuadrupleClick?(info: TLClickEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onRightClick( )
optional
from StateNode
onRightClick?(info: TLPointerEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onTick( )
optional
from StateNode
onTick?(info: TLTickEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onTripleClick( )
optional
from StateNode
onTripleClick?(info: TLClickEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;onWheel( )
optional
from StateNode
onWheel?(info: TLWheelEventInfo): void;Parameters
| Name | Description |
|---|---|
|
Returns
void;setCurrentToolIdMask( )
from StateNode
setCurrentToolIdMask(id: string | undefined): void;Parameters
| Name | Description |
|---|---|
| |
Returns
void;transition( )
from StateNode
Transition to a new active child state node.
transition(id: string, info?: any): this;Example
parentState.transition("childStateA");
parentState.transition("childStateB", { myData: 4 });Parameters
| Name | Description |
|---|---|
| The id of the child state node to transition to. |
| Any data to pass to the |
Returns
this;Prev
PathBuilderGeometry2dNext
TextShapeTool