@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
95 lines • 3.22 kB
JavaScript
// *****************************************************************************
// Copyright (C) 2019 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-only WITH Classpath-exception-2.0
// *****************************************************************************
import { __decorate } from "tslib";
import { injectable } from 'inversify';
import { Emitter } from '../common/event.js';
export var ContextKey;
(function (ContextKey) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ContextKey.None = Object.freeze({
set: () => { },
reset: () => { },
get: () => undefined
});
})(ContextKey || (ContextKey = {}));
export const ContextKeyService = Symbol('ContextKeyService');
let ContextKeyServiceDummyImpl = class ContextKeyServiceDummyImpl {
constructor() {
this.onDidChangeEmitter = new Emitter();
this.onDidChange = this.onDidChangeEmitter.event;
this.onDidChangeContext = this.onDidChangeEmitter.event;
}
fireDidChange(event) {
this.onDidChangeEmitter.fire(event);
}
createKey(key, defaultValue) {
return ContextKey.None;
}
/**
* It should be implemented by an extension, e.g. by the monaco extension.
*/
match(expression, context) {
return true;
}
/**
* It should be implemented by an extension, e.g. by the monaco extension.
*/
parseKeys(expression) {
return new Set();
}
/**
* Details should be implemented by an extension, e.g. by the monaco extension.
* Callback must be synchronous.
*/
with(values, callback) {
return callback();
}
/**
* Details should be implemented by an extension, e.g. by the monaco extension.
* Callback must be synchronous.
*/
withContext(context, callback) {
return callback();
}
/**
* Details should implemented by an extension, e.g. by the monaco extension.
*/
createScoped(target) {
return this;
}
/**
* Details should be implemented by an extension, e.g. the monaco extension.
*/
createOverlay(overlay) {
return this;
}
/**
* Details should be implemented by an extension, e.g. by the monaco extension.
*/
setContext(key, value) { }
/**
* It should be implemented by an extension, e.g. by the monaco extension.
*/
getLocalContextKeys(element) {
return new Set();
}
dispose() { }
};
ContextKeyServiceDummyImpl = __decorate([
injectable()
], ContextKeyServiceDummyImpl);
export { ContextKeyServiceDummyImpl };
//# sourceMappingURL=context-key-service.js.map