/******************************************************************************** * Copyright (c) 2022-2026 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 { Action, BoundsData, EdgeRouterRegistry, ElementAndRoutingPoints, GModelElement, GModelRoot, GRoutableElement, HiddenBoundsUpdater, LayoutData, ModelIndexImpl } from '@eclipse-glsp/sprotty'; import { VNode } from 'snabbdom'; import { EditorContextService } from '../../base/editor-context-service'; import { BoundsAwareModelElement } from '../../utils/gmodel-util'; export declare class BoundsDataExt extends BoundsData { layoutData?: LayoutData; } /** * Grabs the bounds from hidden SVG DOM elements, applies layouts, collects routes and fires {@link ComputedBoundsAction}s. * * The actions will contain the bound, alignment, and routing points of elements. */ export declare class GLSPHiddenBoundsUpdater extends HiddenBoundsUpdater { protected readonly edgeRouterRegistry?: EdgeRouterRegistry; protected editorContext: EditorContextService; protected element2route: ElementAndRoutingPoints[]; /** * Ids of the routable elements of {@link element2route} that only exist as client-side feedback. * Recorded while decorating, as the routes outlive the root they were collected from. */ protected feedbackRouteIds: Set; /** * Root of the hidden rendering currently being collected, used to detect the start of the next * one. Referenced weakly, as a hidden root is a throwaway copy of the whole model. */ protected collectingForRoot?: WeakRef; protected getElement2BoundsData(): Map; decorate(vnode: VNode, element: GModelElement): VNode; /** * The route reported for the given element, or `undefined` to leave it out of the * {@link ComputedBoundsAction} of this rendering. Override to substitute or to skip a route, * which a later rendering reports again as soon as the edge can be routed. * * A route of fewer than two points, which is how a router reports an edge it cannot route, is * skipped: approximating it from the endpoint positions would overwrite the route on the server. */ protected calcElementRoute(element: GRoutableElement): ElementAndRoutingPoints | undefined; /** * Drops the data collected for the previous hidden rendering as soon as a new one starts. * {@link postUpdate} cleans up on its way out, but a failing view or vdom patch aborts the * rendering before the viewer gets there, leaving the collected bounds behind. * * Elements are decorated bottom-up, so the rendering is recognized by the root of the element * at hand rather than by the root element itself. */ protected resetOnNewRendering(element: GModelElement): void; postUpdate(cause?: Action): void; protected cleanUp(): void; protected isFeedbackElement(element: GModelElement): boolean; protected focusOnElements(elementIDs: string[]): void; protected expandElementId(id: string, index: ModelIndexImpl, elementIDs: string[]): string[]; } //# sourceMappingURL=glsp-hidden-bounds-updater.d.ts.map