UNPKG

@eclipse-glsp/protocol

Version:

The protocol definition for client-server communication in GLSP

52 lines 5.31 kB
"use strict"; /******************************************************************************** * Copyright (c) 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 ********************************************************************************/ /* eslint-disable @typescript-eslint/no-shadow */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewportResult = exports.SetViewportAction = exports.SetBoundsAction = exports.SelectionResult = exports.OpenAction = exports.MoveAction = exports.HoverFeedbackAction = exports.GetViewportAction = exports.GetSelectionAction = exports.CollapseExpandAllAction = exports.CollapseExpandAction = exports.BringToFrontAction = void 0; const actions_1 = require("sprotty-protocol/lib/actions"); Object.defineProperty(exports, "BringToFrontAction", { enumerable: true, get: function () { return actions_1.BringToFrontAction; } }); Object.defineProperty(exports, "CollapseExpandAction", { enumerable: true, get: function () { return actions_1.CollapseExpandAction; } }); Object.defineProperty(exports, "CollapseExpandAllAction", { enumerable: true, get: function () { return actions_1.CollapseExpandAllAction; } }); Object.defineProperty(exports, "GetSelectionAction", { enumerable: true, get: function () { return actions_1.GetSelectionAction; } }); Object.defineProperty(exports, "GetViewportAction", { enumerable: true, get: function () { return actions_1.GetViewportAction; } }); Object.defineProperty(exports, "HoverFeedbackAction", { enumerable: true, get: function () { return actions_1.HoverFeedbackAction; } }); Object.defineProperty(exports, "MoveAction", { enumerable: true, get: function () { return actions_1.MoveAction; } }); Object.defineProperty(exports, "OpenAction", { enumerable: true, get: function () { return actions_1.OpenAction; } }); Object.defineProperty(exports, "SelectionResult", { enumerable: true, get: function () { return actions_1.SelectionResult; } }); Object.defineProperty(exports, "SetBoundsAction", { enumerable: true, get: function () { return actions_1.SetBoundsAction; } }); Object.defineProperty(exports, "SetViewportAction", { enumerable: true, get: function () { return actions_1.SetViewportAction; } }); Object.defineProperty(exports, "ViewportResult", { enumerable: true, get: function () { return actions_1.ViewportResult; } }); const base_protocol_1 = require("./action-protocol/base-protocol"); const type_util_1 = require("./utils/type-util"); actions_1.CollapseExpandAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.CollapseExpandAction.KIND) && (0, type_util_1.hasArrayProp)(object, 'expandIds') && (0, type_util_1.hasArrayProp)(object, 'collapseIds'); actions_1.CollapseExpandAllAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.CollapseExpandAllAction.KIND) && (0, type_util_1.hasBooleanProp)(object, 'expand'); actions_1.GetSelectionAction.is = (object) => base_protocol_1.RequestAction.hasKind(object, actions_1.GetSelectionAction.KIND); actions_1.GetViewportAction.is = (object) => base_protocol_1.RequestAction.hasKind(object, actions_1.GetViewportAction.KIND); actions_1.HoverFeedbackAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.HoverFeedbackAction.KIND) && (0, type_util_1.hasStringProp)(object, 'mouseoverElement') && (0, type_util_1.hasBooleanProp)(object, 'mouseIsOver'); actions_1.MoveAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.MoveAction.KIND) && (0, type_util_1.hasArrayProp)(object, 'moves') && (0, type_util_1.hasBooleanProp)(object, 'animate') && (0, type_util_1.hasBooleanProp)(object, 'finished'); actions_1.OpenAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.OpenAction.KIND) && (0, type_util_1.hasStringProp)(object, 'elementId'); actions_1.SelectionResult.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.SelectionResult.KIND) && (0, type_util_1.hasArrayProp)(object, 'selectedElementsIDs'); actions_1.SetBoundsAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.SetBoundsAction.KIND) && (0, type_util_1.hasObjectProp)(object, 'bounds'); actions_1.SetViewportAction.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.SetViewportAction.KIND) && (0, type_util_1.hasStringProp)(object, 'elementId') && (0, type_util_1.hasObjectProp)(object, 'newViewport') && (0, type_util_1.hasBooleanProp)(object, 'animate'); actions_1.ViewportResult.is = (object) => base_protocol_1.Action.hasKind(object, actions_1.ViewportResult.KIND) && (0, type_util_1.hasObjectProp)(object, 'viewport') && (0, type_util_1.hasObjectProp)(object, 'canvasBounds'); //# sourceMappingURL=sprotty-actions.js.map