UNPKG

@eclipse-glsp/protocol

Version:

The protocol definition for client-server communication in GLSP

53 lines 2.47 kB
"use strict"; /******************************************************************************** * Copyright (c) 2021-2023 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 ********************************************************************************/ Object.defineProperty(exports, "__esModule", { value: true }); exports.ChangeContainerOperation = exports.ChangeBoundsOperation = void 0; const type_util_1 = require("../utils/type-util"); const base_protocol_1 = require("./base-protocol"); var ChangeBoundsOperation; (function (ChangeBoundsOperation) { ChangeBoundsOperation.KIND = 'changeBounds'; function is(object) { return base_protocol_1.Operation.hasKind(object, ChangeBoundsOperation.KIND) && (0, type_util_1.hasArrayProp)(object, 'newBounds'); } ChangeBoundsOperation.is = is; function create(newBounds) { return { kind: ChangeBoundsOperation.KIND, isOperation: true, newBounds }; } ChangeBoundsOperation.create = create; })(ChangeBoundsOperation || (exports.ChangeBoundsOperation = ChangeBoundsOperation = {})); var ChangeContainerOperation; (function (ChangeContainerOperation) { ChangeContainerOperation.KIND = 'changeContainer'; function is(object) { return base_protocol_1.Operation.hasKind(object, ChangeContainerOperation.KIND) && (0, type_util_1.hasStringProp)(object, 'elementId') && (0, type_util_1.hasStringProp)(object, 'targetContainerId'); } ChangeContainerOperation.is = is; function create(options) { return { kind: ChangeContainerOperation.KIND, isOperation: true, ...options }; } ChangeContainerOperation.create = create; })(ChangeContainerOperation || (exports.ChangeContainerOperation = ChangeContainerOperation = {})); //# sourceMappingURL=node-modification.js.map