Skip to content

DragDropOptions

Defined in: src/modules/drag-drop/drag-drop.ts:31

Options for DragDrop.

TPayload

TTarget

accepts: (target, payload) => boolean

Defined in: src/modules/drag-drop/drag-drop.ts:41

Whether target takes payload — the game’s move rule.

TTarget

TPayload

boolean


contains: (target, point) => boolean

Defined in: src/modules/drag-drop/drag-drop.ts:43

Whether point is over target.

TTarget

Vec2

boolean


optional probe?: DragProbe<TPayload>

Defined in: src/modules/drag-drop/drag-drop.ts:33

Where the drop is tested. Default 'pointer'.


targets: () => Iterable<TTarget>

Defined in: src/modules/drag-drop/drag-drop.ts:45

Candidate drop targets, highest priority first. Called on every lookup, so it may reflect live state.

Iterable<TTarget>


optional threshold?: number

Defined in: src/modules/drag-drop/drag-drop.ts:39

How far, in the points’ units, the pointer must move from the press before the drag starts. Below it, releasing is a click: DragDrop.end returns null. Default 0 — the drag starts at the press.