Skip to content

BlockSuite API Documentation / @blocksuite/block-std / DropTargetOption

Type Alias: DropTargetOption<PayloadEntity, PayloadFrom, DropPayload>

DropTargetOption<PayloadEntity, PayloadFrom, DropPayload> = object & ElementDropEventMap<DragPayload<PayloadEntity, PayloadFrom>, DropPayload>

Defined in: packages/framework/block-std/src/extension/dnd/index.ts:133

Type declaration

allowDropPosition?

optional allowDropPosition: Edge[]

Allow drop position for the drop target.

canDrop()?

optional canDrop: (args) => boolean

OriginalDropTargetOption.canDrop

Parameters

args

ElementDropTargetFeedbackArgs<DragPayload<PayloadEntity, PayloadFrom>>

Returns

boolean

element

element: HTMLElement

OriginalDropTargetOption.element

getDropEffect()?

optional getDropEffect: (args) => DropTargetRecord["dropEffect"]

OriginalDropTargetOption.getDropEffect

Parameters

args

ElementDropTargetFeedbackArgs<DragPayload<PayloadEntity, PayloadFrom>>

Returns

DropTargetRecord["dropEffect"]

getIsSticky()?

optional getIsSticky: (args) => boolean

OriginalDropTargetOption.getIsSticky

Parameters

args

ElementDropTargetFeedbackArgs<DragPayload<PayloadEntity, PayloadFrom>>

Returns

boolean

setDropData()?

optional setDropData: (args) => DropPayload

OriginalDropTargetOption.getData

Parameters

args

ElementDropTargetFeedbackArgs<DragPayload<PayloadEntity, PayloadFrom>>

Returns

DropPayload

Type Parameters

PayloadEntity

PayloadEntity extends DragEntity

PayloadFrom

PayloadFrom extends DragFrom

DropPayload

DropPayload extends object