Files
blockly/core/interfaces/i_block_dragger.ts
Aaron Dodson f70f82327b refactor: Remove some uses of AnyDuringMigration (#6307)
* refactor: Remove uses of AnyDuringMigration from trashcan.ts.

* refactor: Remove uses of AnyDuringMigration in bubble.ts.

* refactor: Remove uses of AnyDuringMigration from connection_checker.ts.

* refactor: Remove uses of AnyDuringMigration from connection_db.ts.

* refactor: Remove uses of AnyDuringMigration in contextmenu_items.ts.

* refactor: Remove uses of AnyDuringMigration from grid.ts.

* refactor: Remove uses of AnyDuringMigration from i_drag_target.ts.

* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_svg.ts.

* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_with_block.ts.

* refactor: Remove uses of AnyDuringMigration from i_autohideable.ts.

* refactor: Remove uses of AnyDuringMigration from i_block_dragger.ts.

* refactor: Remove uses of AnyDuringMigration from i_bounded_element.ts.

* refactor: Remove uses of AnyDuringMigration from i_bubble.ts.

* refactor: Remove uses of AnyDuringMigration from i_collapsible_toolbox_item.ts.

* refactor: Remove uses of AnyDuringMigration from i_connection_checker.ts.

* refactor: Remove uses of AnyDuringMigration from i_contextmenu.ts.

* refactor: Remove uses of AnyDuringMigration in i_copyable.ts.

* refactor: Remove uses of AnyDuringMigration from i_deleteable.ts.

* refactor: Remove uses of AnyDuringMigration from i_delete_area.ts.

* refactor: Remove uses of AnyDuringMigration in i_flyout.ts.

* refactor: Remove uses of AnyDuringMigration in i_keyboard_accessible.ts.

* refactor: Remove uses of AnyDuringMigration in i_metrics_manager.ts.

* refactor: Remove uses of AnyDuringMigration from i_movable.ts.

* refactor: Remove uses of AnyDuringMigration in i_positionable.ts.

* refactor: Remove uses of AnyDuringMigration in i_selectable_toolbox_item.ts.

* refactor: Remove uses of AnyDuringMigration from i_selectable.ts.

* refactor: Remove uses of AnyDuringMigration in i_serializer.ts.

* refactor: Remove uses of AnyDuringMigration from i_styleable.ts.

* refactor: Remove uses of AnyDuringMigration in i_toolbox.ts.

* refactor: Make non-null checks explicit.
2022-08-04 10:09:24 -07:00

68 lines
2.1 KiB
TypeScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview The interface for a block dragger.
*/
/**
* The interface for a block dragger.
* @namespace Blockly.IBlockDragger
*/
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');
/* eslint-disable-next-line no-unused-vars */
// Unused import preserved for side-effects. Remove if unneeded.
// import '../block_svg.js';
/* eslint-disable-next-line no-unused-vars */
// Unused import preserved for side-effects. Remove if unneeded.
// import '../utils/coordinate.js';
/**
* A block dragger interface.
* @alias Blockly.IBlockDragger
*/
export interface IBlockDragger {
/**
* Start dragging a block. This includes moving it to the drag surface.
* @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.
* @return A possibly empty list of insertion marker blocks.
*/
getInsertionMarkers(): BlockSvg[];
/** Sever all links from this object and do any necessary cleanup. */
dispose(): void;
}