UNPKG

sprotty

Version:

A next-gen framework for graphical views

51 lines 2.51 kB
/******************************************************************************** * Copyright (c) 2021 TypeFox 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 { Projectable as ProjectableSchema, Viewport } from 'sprotty-protocol/lib/model'; import { Bounds } from 'sprotty-protocol/lib/utils/geometry'; import { SChildElementImpl, SModelRootImpl, SParentElementImpl } from '../../base/model/smodel'; /** * Model elements implementing this interface can be displayed on a projection bar. * _Note:_ If set, the projectedBounds property will be prefered over the model element bounds. * Otherwise model elements also have to be `BoundsAware` so their projections can be shown. * @deprecated Use the definition from `sprotty-protocol` instead. */ export interface Projectable { projectionCssClasses: string[]; projectedBounds?: Bounds; } export declare function isProjectable(arg: unknown): arg is ProjectableSchema; /** * A projection can be shown in a horizontal or vertical bar to display an overview of the diagram. */ export interface ViewProjection { elementId: string; projectedBounds: Bounds; cssClasses: string[]; } /** * Gather all projections of elements contained in the given parent element. */ export declare function getProjections(parent: Readonly<SParentElementImpl>): ViewProjection[] | undefined; /** * Compute the projected bounds of the given model element, that is the absolute position in the diagram. */ export declare function getProjectedBounds(model: Readonly<SChildElementImpl & ProjectableSchema>): Bounds | undefined; /** * Determine the total bounds of a model; this takes the viewport into consideration * so it can be shown in the projections. */ export declare function getModelBounds(model: SModelRootImpl & Viewport): Bounds | undefined; //# sourceMappingURL=model.d.ts.map