1 | /// <reference types="node" />
|
2 | import { ContributionProvider, MaybePromise } from '../../common';
|
3 | import { Socket } from 'socket.io';
|
4 | import * as http from 'http';
|
5 | /**
|
6 | * Bind components to this symbol to subscribe to WebSocket events.
|
7 | */
|
8 | export declare const MessagingListenerContribution: unique symbol;
|
9 | export interface MessagingListenerContribution {
|
10 | /**
|
11 | * Function invoked when a HTTP connection is upgraded to a websocket.
|
12 | *
|
13 | * @param request The HTTP connection upgrade request received by the server.
|
14 | * @param socket The WebSocket that the connection was upgraded to.
|
15 | */
|
16 | onDidWebSocketUpgrade(request: http.IncomingMessage, socket: Socket): MaybePromise<void>;
|
17 | }
|
18 | /**
|
19 | * Handler of Theia messaging system events, dispatching to MessagingListenerContribution instances.
|
20 | */
|
21 | export declare class MessagingListener {
|
22 | protected readonly messagingListenerContributions: ContributionProvider<MessagingListenerContribution>;
|
23 | /**
|
24 | * Notify all the subscribed `MessagingListenerContribution`s that the Websocket was upgraded.
|
25 | */
|
26 | onDidWebSocketUpgrade(request: http.IncomingMessage, socket: Socket): Promise<void>;
|
27 | }
|
28 | //# sourceMappingURL=messaging-listeners.d.ts.map |
\ | No newline at end of file |