@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
67 lines • 3.26 kB
TypeScript
/********************************************************************************
* Copyright (c) 2019-2024 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Bounds, Direction, GChildElement, GModelElement, GParentElement, Hoverable, Point } from '@eclipse-glsp/sprotty';
import { BoundsAwareModelElement, MoveableElement, ResizableModelElement } from '../../utils/gmodel-util';
export declare const resizeFeature: unique symbol;
export declare function isResizable(element: GModelElement): element is ResizableModelElement;
export declare enum ResizeHandleLocation {
TopLeft = "top-left",
Top = "top",
TopRight = "top-right",
Right = "right",
BottomRight = "bottom-right",
Bottom = "bottom",
BottomLeft = "bottom-left",
Left = "left"
}
export declare namespace ResizeHandleLocation {
const CORNERS: ResizeHandleLocation[];
const CROSS: ResizeHandleLocation[];
const ALL: ResizeHandleLocation[];
function opposite(location: ResizeHandleLocation): ResizeHandleLocation;
function direction(location: ResizeHandleLocation): Direction[];
}
export declare function isBoundsAwareMoveable(element: GModelElement): element is BoundsAwareModelElement & MoveableElement;
export declare class GResizeHandle extends GChildElement implements Hoverable {
readonly location: ResizeHandleLocation;
readonly type: string;
readonly hoverFeedback: boolean;
static readonly TYPE = "resize-handle";
readonly parent: ResizableModelElement;
constructor(location: ResizeHandleLocation, type?: string, hoverFeedback?: boolean);
hasFeature(feature: symbol): boolean;
isNwResize(): boolean;
isNResize(): boolean;
isNeResize(): boolean;
isEResize(): boolean;
isSeResize(): boolean;
isSResize(): boolean;
isSwResize(): boolean;
isWResize(): boolean;
isNwSeResize(): boolean;
isNeSwResize(): boolean;
static getHandlePosition(handle: GResizeHandle): Point;
static getHandlePosition(parent: ResizableModelElement, location: ResizeHandleLocation): Point;
static getHandlePosition(bounds: Bounds, location: ResizeHandleLocation): Point;
static getCursorCss(handle: GResizeHandle): string;
static is(handle: unknown): handle is GResizeHandle;
}
export declare function addResizeHandles(element: ResizableModelElement, locations?: ResizeHandleLocation[]): void;
export declare function removeResizeHandles(element: GParentElement): void;
export {
/** @deprecated Use {@link GResizeHandle} instead */
GResizeHandle as SResizeHandle };
//# sourceMappingURL=model.d.ts.map