Table of contents

Public class

Signature
abstract class StateNode implements Partial<TLEventHandlers> {}
References

TLEventHandlers

Source

packages/editor/src/lib/editor/tools/StateNode.ts


Constructor

Public constructor

Constructs a new instance of the StateNode class

Parameters
NameDescription

editor

Editor

parent

StateNode
References

Editor, StateNode


Properties



children

Public property

Signature
children?: Record<string, StateNode>
References

StateNode


children

Public static property

Signature
static children?: () => TLStateNodeConstructor[]
References

TLStateNodeConstructor


editor

Public property

Signature
editor: Editor
References

Editor


enter

Public property

Signature
enter: (info: any, from: string) => void

exit

Public property

Signature
exit: (info: any, from: string) => void

handleEvent

Public property

Signature
handleEvent: (info: Exclude<TLEventInfo, TLPinchEventInfo>) => void
References

TLEventInfo, TLPinchEventInfo


id

Public property

Signature
id: string

id

Public static property

Signature
static id: string

initial

Public property

Signature
initial?: string

initial

Public static property

Signature
static initial?: string

onCancel

Public property

Signature
onCancel?: TLEventHandlers['onCancel']
References

TLEventHandlers


onComplete

Public property

Signature
onComplete?: TLEventHandlers['onComplete']
References

TLEventHandlers


onDoubleClick

Public property

Signature
onDoubleClick?: TLEventHandlers['onDoubleClick']
References

TLEventHandlers


onEnter

Public property

Signature
onEnter?: TLEnterEventHandler
References

TLEnterEventHandler


onExit

Public property

Signature
onExit?: TLExitEventHandler
References

TLExitEventHandler


onInterrupt

Public property

Signature
onInterrupt?: TLEventHandlers['onInterrupt']
References

TLEventHandlers


onKeyDown

Public property

Signature
onKeyDown?: TLEventHandlers['onKeyDown']
References

TLEventHandlers


onKeyRepeat

Public property

Signature
onKeyRepeat?: TLEventHandlers['onKeyRepeat']
References

TLEventHandlers


onKeyUp

Public property

Signature
onKeyUp?: TLEventHandlers['onKeyUp']
References

TLEventHandlers


onLongPress

Public property

Signature
onLongPress?: TLEventHandlers['onLongPress']
References

TLEventHandlers


onMiddleClick

Public property

Signature
onMiddleClick?: TLEventHandlers['onMiddleClick']
References

TLEventHandlers


onPointerDown

Public property

Signature
onPointerDown?: TLEventHandlers['onPointerDown']
References

TLEventHandlers


onPointerMove

Public property

Signature
onPointerMove?: TLEventHandlers['onPointerMove']
References

TLEventHandlers


onPointerUp

Public property

Signature
onPointerUp?: TLEventHandlers['onPointerUp']
References

TLEventHandlers


onQuadrupleClick

Public property

Signature
onQuadrupleClick?: TLEventHandlers['onQuadrupleClick']
References

TLEventHandlers


onRightClick

Public property

Signature
onRightClick?: TLEventHandlers['onRightClick']
References

TLEventHandlers


onTick

Public property

Signature
onTick?: TLEventHandlers['onTick']
References

TLEventHandlers


onTripleClick

Public property

Signature
onTripleClick?: TLEventHandlers['onTripleClick']
References

TLEventHandlers


onWheel

Public property

Signature
onWheel?: TLEventHandlers['onWheel']
References

TLEventHandlers


parent

Public property

Signature
parent: StateNode
References

StateNode


shapeType

Public property

Signature
shapeType?: string

transition

Public property

Transition to a new active child state node.

Example
parentState.transition('childStateA')
parentState.transition('childStateB', { myData: 4 })
Signature
transition: (id: string, info?: any) => this
Parameters
NameDescription

id

The id of the child state node to transition to.

info

Any data to pass to the onEnter and onExit handlers.


type

Public property

Signature
type: TLStateNodeType

Methods

getCurrent()

Public method

This node's current active child node, if any.

Signature
getCurrent(): StateNode | undefined
References

StateNode


getCurrentToolIdMask()

Public method

Signature
getCurrentToolIdMask(): string | undefined

getIsActive()

Public method

Whether this node is active.

Signature
getIsActive(): boolean

getPath()

Public method

This node's path of active state nodes

Signature
getPath(): string

setCurrentToolIdMask()

Public method

Signature
setCurrentToolIdMask(id: string | undefined): void
Parameters
NameDescription

id

string | undefined
Returns
void

Stadium2dstopEventPropagation