/******************************************************************************** * 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 { SModelElement, SModelRoot } from '../model'; import { ComputedBoundsAction } from '../actions'; /** * Clone a given model. This function requires that the model is serializable, so it's * free of cycles and functions. */ export declare function cloneModel(model: T): T; /** * Apply the computed bounds to the given model. This ensures that the model has complete * information about positions and sizes derived from its actual rendering in the frontend. */ export declare function applyBounds(root: SModelRoot, action: ComputedBoundsAction): void; /** * Model element types can include a colon to separate the basic type and a sub-type. This function * extracts the basic type of a model element. */ export declare function getBasicType(element: { type: string; }): string; /** * Model element types can include a colon to separate the basic type and a sub-type. This function * extracts the sub-type of a model element. */ export declare function getSubType(schema: { type: string; }): string; /** * Find the element with the given identifier. If you need to find multiple elements, using an * `SModelIndex` might be more effective. */ export declare function findElement(parent: SModelElement, elementId: string): SModelElement | undefined; /** * Used to speed up model element lookup by id. * This index implementation is for the serializable _external model_ defined in `sprotty-protocol`. */ export declare class SModelIndex { private readonly id2element; private id2parent; add(element: SModelElement): this; remove(element: SModelElement): this; contains(element: SModelElement): boolean; getById(id: string): SModelElement | undefined; getParent(id: string): SModelElement | undefined; getRoot(element: SModelElement): SModelRoot; } //# sourceMappingURL=model-utils.d.ts.map