mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
* chore(dragging): Rename core/interfaces/i_draggable.ts Rename core/interfaces/i_draggable.ts to core/interfaces/i_draggable.old.ts to make room for new IDraggable. Do not rename actual interface as it's not yet clear that it will be necessary for both to coexist as imports in the same file. * feat(dragging): Introduce new IDraggable interface * feat(dragging): Introduce new IDragger interface --------- Co-authored-by: Beka Westberg <bwestberg@google.com>
30 lines
945 B
TypeScript
30 lines
945 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
// Former goog.module ID: Blockly.IDeleteArea
|
|
|
|
import type {IDragTarget} from './i_drag_target.js';
|
|
import type {IDraggable} from './i_draggable.old.js';
|
|
|
|
/**
|
|
* Interface for a component that can delete a block or bubble that is dropped
|
|
* on top of it.
|
|
*/
|
|
export interface IDeleteArea extends IDragTarget {
|
|
/**
|
|
* Returns whether the provided block or bubble would be deleted if dropped on
|
|
* this area.
|
|
* This method should check if the element is deletable and is always called
|
|
* before onDragEnter/onDragOver/onDragExit.
|
|
*
|
|
* @param element The block or bubble currently being dragged.
|
|
* @param couldConnect Whether the element could could connect to another.
|
|
* @returns Whether the element provided would be deleted if dropped on this
|
|
* area.
|
|
*/
|
|
wouldDelete(element: IDraggable, couldConnect: boolean): boolean;
|
|
}
|