@eclipse-glsp/vscode-integration
Version:
Glue code to integrate GLSP diagrams in VSCode extensions (extension part)
43 lines • 2.86 kB
TypeScript
/********************************************************************************
* Copyright (c) 2021-2024 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.01
********************************************************************************/
import * as vscode from 'vscode';
import { GlspVscodeConnector } from '../glsp-vscode-connector';
/**
* An extensible base class to create a CustomEditorProvider that takes care of
* diagram initialization and custom document events.
*
* Webview setup needs to be implemented.
*/
export declare abstract class GlspEditorProvider implements vscode.CustomEditorProvider {
protected readonly glspVscodeConnector: GlspVscodeConnector;
/** The diagram type identifier the diagram server is responsible for. */
abstract diagramType: string;
/** Used to generate continuous and unique clientIds - TODO: consider replacing this with uuid. */
private viewCount;
onDidChangeCustomDocument: vscode.Event<vscode.CustomDocumentEditEvent> | vscode.Event<vscode.CustomDocumentContentChangeEvent>;
constructor(glspVscodeConnector: GlspVscodeConnector);
saveCustomDocument(document: vscode.CustomDocument, _cancellation: vscode.CancellationToken): Thenable<void>;
saveCustomDocumentAs(document: vscode.CustomDocument, destination: vscode.Uri, _cancellation: vscode.CancellationToken): Thenable<void>;
revertCustomDocument(document: vscode.CustomDocument, _cancellation: vscode.CancellationToken): Thenable<void>;
backupCustomDocument(_document: vscode.CustomDocument, context: vscode.CustomDocumentBackupContext, _cancellation: vscode.CancellationToken): Thenable<vscode.CustomDocumentBackup>;
openCustomDocument(uri: vscode.Uri, _openContext: vscode.CustomDocumentOpenContext, _token: vscode.CancellationToken): vscode.CustomDocument | Thenable<vscode.CustomDocument>;
resolveCustomEditor(document: vscode.CustomDocument, webviewPanel: vscode.WebviewPanel, token: vscode.CancellationToken): Promise<void>;
/**
* Used to set up the webview within the webview panel.
*/
abstract setUpWebview(document: vscode.CustomDocument, webviewPanel: vscode.WebviewPanel, token: vscode.CancellationToken, clientId: string): void;
}
//# sourceMappingURL=glsp-editor-provider.d.ts.map