UNPKG

@eclipse-glsp/theia-integration

Version:

Glue code to integrate GLSP clients into Eclipse Theia

45 lines 2.26 kB
/******************************************************************************** * Copyright (c) 2022-2024 STMicroelectronics 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 { Channel, Disposable, DisposableCollection, Emitter, MessageProvider } from '@theia/core'; import { AbstractMessageReader, AbstractMessageWriter, DataCallback, Logger, Message, MessageConnection, MessageReader, MessageWriter } from 'vscode-jsonrpc'; /** * A `vscode-jsonrpc` {@link MessageReader} that reads messages from an underlying {@link Channel}. */ export declare class ChannelMessageReader extends AbstractMessageReader implements MessageReader { protected readonly channel: Channel; protected onMessageEmitter: Emitter<Message>; protected toDispose: DisposableCollection; constructor(channel: Channel); protected handleMessage(msgProvider: MessageProvider): void; dispose(): void; listen(callback: DataCallback): Disposable; } /** * A `vscode-jsonrpc` {@link MessageWriter} that writes messages to an underlying {@link Channel}. */ export declare class ChannelMessageWriter extends AbstractMessageWriter implements MessageWriter { protected readonly channel: Channel; protected toDispose: Disposable; constructor(channel: Channel); write(msg: Message): Promise<void>; end(): void; dispose(): void; } /** * Create a `vscode-jsonrpc` {@link MessageConnection} on top of a given {@link Channel}. */ export declare function createChannelConnection(channel: Channel, logger?: Logger): MessageConnection; //# sourceMappingURL=channel-connection.d.ts.map