UNPKG

2.27 kBJavaScriptView Raw
1"use strict";
2// *****************************************************************************
3// Copyright (C) 2023 TypeFox and others.
4//
5// This program and the accompanying materials are made available under the
6// terms of the Eclipse Public License v. 2.0 which is available at
7// http://www.eclipse.org/legal/epl-2.0.
8//
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License v. 2.0 are satisfied: GNU General Public License, version 2
12// with the GNU Classpath Exception which is available at
13// https://www.gnu.org/software/classpath/license.html.
14//
15// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16// *****************************************************************************
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.DefaultFrontendApplicationContribution = exports.OnWillStopAction = exports.FrontendApplicationContribution = void 0;
19const tslib_1 = require("tslib");
20const types_1 = require("../common/types");
21const inversify_1 = require("inversify");
22/**
23 * Clients can implement to get a callback for contributing widgets to a shell on start.
24 */
25exports.FrontendApplicationContribution = Symbol('FrontendApplicationContribution');
26var OnWillStopAction;
27(function (OnWillStopAction) {
28 function is(candidate) {
29 return (0, types_1.isObject)(candidate) && 'action' in candidate && 'reason' in candidate;
30 }
31 OnWillStopAction.is = is;
32})(OnWillStopAction = exports.OnWillStopAction || (exports.OnWillStopAction = {}));
33/**
34 * Default frontend contribution that can be extended by clients if they do not want to implement any of the
35 * methods from the interface but still want to contribute to the frontend application.
36 */
37let DefaultFrontendApplicationContribution = class DefaultFrontendApplicationContribution {
38 initialize() {
39 // NOOP
40 }
41};
42DefaultFrontendApplicationContribution = (0, tslib_1.__decorate)([
43 (0, inversify_1.injectable)()
44], DefaultFrontendApplicationContribution);
45exports.DefaultFrontendApplicationContribution = DefaultFrontendApplicationContribution;
46//# sourceMappingURL=frontend-application-contribution.js.map
\No newline at end of file