mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
* feat: Add 'reason' field to move event There are many types of move. This addition allows one to detect what the reason for each move is. * Clang formatting. And unsaved editor tabs. * Change reason string to array.
32 lines
861 B
TypeScript
32 lines
861 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import * as goog from '../../closure/goog/goog.js';
|
|
import type {Rect} from '../utils/rect.js';
|
|
goog.declareModuleId('Blockly.IBoundedElement');
|
|
|
|
/**
|
|
* A bounded element interface.
|
|
*/
|
|
export interface IBoundedElement {
|
|
/**
|
|
* Returns the coordinates of a bounded element describing the dimensions of
|
|
* the element. Coordinate system: workspace coordinates.
|
|
*
|
|
* @returns Object with coordinates of the bounded element.
|
|
*/
|
|
getBoundingRectangle(): Rect;
|
|
|
|
/**
|
|
* Move the element by a relative offset.
|
|
*
|
|
* @param dx Horizontal offset in workspace units.
|
|
* @param dy Vertical offset in workspace units.
|
|
* @param reason Why is this move happening? 'user', 'bump', 'snap'...
|
|
*/
|
|
moveBy(dx: number, dy: number, reason?: string[]): void;
|
|
}
|