Skip to content

Behavior

Behavior<TBehaviorEventType, TGuardResponse, TBehaviorEvent>: object

Type Parameters

TBehaviorEventType extends BehaviorEvent["type"] = BehaviorEvent["type"]

TGuardResponse = true

TBehaviorEvent extends BehaviorEvent = BehaviorEvent

Type declaration

actions

actions: BehaviorActionIntendSet<TBehaviorEvent, TGuardResponse>[]

Array of behavior action sets.

guard?

optional guard: BehaviorGuard<TBehaviorEvent, TGuardResponse>

Predicate function that determines if the behavior should be executed. Returning a non-nullable value from the guard will pass the value to the actions and execute them.

on

on: TBehaviorEventType

The internal editor event that triggers this behavior.

Defined in

packages/editor/src/behaviors/behavior.types.ts:261