UNPKG

@eclipse-emfcloud/modelserver-theia

Version:
66 lines 4.21 kB
/// <reference types="ws" /> /******************************************************************************** * Copyright (c) 2019-2022 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 * https://www.eclipse.org/legal/epl-2.0, or the MIT License which is * available at https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: EPL-2.0 OR MIT *******************************************************************************/ import { AnyObject, CloseNotification, DirtyStateNotification, ErrorNotification, FullUpdateNotification, IncrementalUpdateNotification, IncrementalUpdateNotificationV2, ModelServerNotification, UnknownNotification, ValidationNotification } from '@eclipse-emfcloud/modelserver-client'; import { Emitter, Event } from '@theia/core'; import WebSocket from 'isomorphic-ws'; import URI from 'urijs'; import { ModelServerFrontendClient } from '../common'; export declare const ModelServerSubscriptionService: unique symbol; export interface ModelServerSubscriptionService { readonly onOpenListener: Event<ModelServerNotification>; readonly onClosedListener: Event<CloseNotification>; readonly onErrorListener: Event<ErrorNotification>; readonly onDirtyStateListener: Event<DirtyStateNotification>; readonly onIncrementalUpdateListener: Event<IncrementalUpdateNotification>; readonly onFullUpdateListener: Event<FullUpdateNotification>; readonly onSuccessListener: Event<ModelServerNotification>; readonly onUnknownMessageListener: Event<UnknownNotification>; readonly onValidationResultListener: Event<ValidationNotification>; } export declare const ModelServerSubscriptionServiceV2: unique symbol; export interface ModelServerSubscriptionServiceV2 extends ModelServerSubscriptionService { readonly onIncrementalUpdateListenerV2: Event<IncrementalUpdateNotificationV2>; } export declare class ModelServerSubscriptionClient implements ModelServerFrontendClient, ModelServerSubscriptionService { onOpen(modeluri: URI, _event: WebSocket.Event): void; onClose(modeluri: URI, event: WebSocket.CloseEvent): void; onError(modeluri: URI, event: WebSocket.ErrorEvent): void; onMessage(modeluri: URI, event: WebSocket.MessageEvent): void; protected onOpenEmitter: Emitter<Readonly<ModelServerNotification>>; get onOpenListener(): Event<ModelServerNotification>; protected onClosedEmitter: Emitter<Readonly<CloseNotification>>; get onClosedListener(): Event<CloseNotification>; protected onErrorEmitter: Emitter<Readonly<ErrorNotification>>; get onErrorListener(): Event<ErrorNotification>; protected onDirtyStateEmitter: Emitter<Readonly<DirtyStateNotification>>; get onDirtyStateListener(): Event<DirtyStateNotification>; protected onIncrementalUpdateEmitter: Emitter<Readonly<IncrementalUpdateNotification>>; get onIncrementalUpdateListener(): Event<IncrementalUpdateNotification>; protected onFullUpdateEmitter: Emitter<Readonly<FullUpdateNotification<AnyObject>>>; get onFullUpdateListener(): Event<FullUpdateNotification>; protected onSuccessEmitter: Emitter<Readonly<ModelServerNotification>>; get onSuccessListener(): Event<ModelServerNotification>; protected onUnknownMessageEmitter: Emitter<Readonly<UnknownNotification>>; get onUnknownMessageListener(): Event<UnknownNotification>; protected onValidationResultEmitter: Emitter<Readonly<ValidationNotification>>; get onValidationResultListener(): Event<ValidationNotification>; } /** * Implementation of {@link ModelServerSubscriptionClient} compatible with API V2 Notifications, * supporting Json Patch for incremental updates. */ export declare class ModelServerSubscriptionClientV2 extends ModelServerSubscriptionClient implements ModelServerSubscriptionServiceV2 { protected onIncrementalUpdateEmitterV2: Emitter<Readonly<IncrementalUpdateNotificationV2>>; get onIncrementalUpdateListenerV2(): Event<IncrementalUpdateNotificationV2>; onMessage(modeluri: URI, event: WebSocket.MessageEvent): void; } //# sourceMappingURL=model-server-subscription-client.d.ts.map