@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
46 lines • 2.47 kB
TypeScript
/********************************************************************************
* Copyright (c) 2020-2025 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
********************************************************************************/
import { Action, ClientMenuItem, GModelRoot, IActionDispatcher, IActionHandler, IContextMenuItemProvider, Point } from '@eclipse-glsp/sprotty';
import { EditorContextService } from '../../base/editor-context-service';
/**
* An `InvokeCopyPasteAction` is dispatched by the client to initiate a cut, copy or paste operation.
*/
export interface InvokeCopyPasteAction extends Action {
kind: typeof InvokeCopyPasteAction.KIND;
command: 'copy' | 'cut' | 'paste';
}
export declare namespace InvokeCopyPasteAction {
const KIND = "invokeCopyPaste";
function is(object: any): object is InvokeCopyPasteAction;
function create(command: 'copy' | 'cut' | 'paste'): InvokeCopyPasteAction;
}
export declare class InvokeCopyPasteActionHandler implements IActionHandler {
protected dispatcher: IActionDispatcher;
handle(action: InvokeCopyPasteAction): void;
protected notifyUserToUseShortcut(operation: string): void;
}
export declare class CopyPasteContextMenuItemProvider implements IContextMenuItemProvider {
protected editorContext: EditorContextService;
getItems(root: Readonly<GModelRoot>, _lastMousePosition?: Point): Promise<ClientMenuItem[]>;
protected createPasteMenuItem(): ClientMenuItem;
protected createCutMenuItem(hasSelectedElements: boolean): ClientMenuItem;
protected createCopyMenuItem(hasSelectedElements: boolean): ClientMenuItem;
}
export declare function supportsCopy(): boolean;
export declare function supportsCut(): boolean;
export declare function supportsPaste(): boolean;
export declare function isNative(): boolean;
//# sourceMappingURL=copy-paste-context-menu.d.ts.map