Files
blockly/core/interfaces/i_block_dragger.ts
Beka Westberg 455c1957b8 fix!: re-remove block and workspace drag surfaces (#7070)
* refactor: Remove BlockDragSurface.

* refactor: Remove WorkspaceDragSurfaceSvg.

* chore: Remove drag surface-related CSS.

* chore: Removed unused variable in block_dragger.ts.

* chore: Remove references to drag surfaces in comments.

* refactor: Only track icons with visible bubbles for position updates during a drag.

* fix: Remove rendundant condition.

* chore: fixup parameter from rebase

---------

Co-authored-by: Aaron Dodson <adodson@google.com>
2023-05-11 16:51:46 -07:00

55 lines
1.6 KiB
TypeScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as goog from '../../closure/goog/goog.js';
import type {Coordinate} from '../utils/coordinate.js';
import type {BlockSvg} from '../block_svg.js';
goog.declareModuleId('Blockly.IBlockDragger');
/**
* A block dragger interface.
*/
export interface IBlockDragger {
/**
* Start dragging a block.
*
* @param currentDragDeltaXY How far the pointer has moved from the position
* at mouse down, in pixel units.
* @param healStack Whether or not to heal the stack after disconnecting.
*/
startDrag(currentDragDeltaXY: Coordinate, healStack: boolean): void;
/**
* Execute a step of block dragging, based on the given event. Update the
* display accordingly.
*
* @param e The most recent move event.
* @param currentDragDeltaXY How far the pointer has moved from the position
* at the start of the drag, in pixel units.
*/
drag(e: Event, currentDragDeltaXY: Coordinate): void;
/**
* Finish a block drag and put the block back on the workspace.
*
* @param e The mouseup/touchend event.
* @param currentDragDeltaXY How far the pointer has moved from the position
* at the start of the drag, in pixel units.
*/
endDrag(e: Event, currentDragDeltaXY: Coordinate): void;
/**
* Get a list of the insertion markers that currently exist. Drags have 0, 1,
* or 2 insertion markers.
*
* @returns A possibly empty list of insertion marker blocks.
*/
getInsertionMarkers(): BlockSvg[];
/** Sever all links from this object and do any necessary cleanup. */
dispose(): void;
}