1 | import { IDisposable } from '@lumino/disposable';
|
2 | import { ISignal } from '@lumino/signaling';
|
3 | import { ServerConnection } from '../serverconnection';
|
4 |
|
5 |
|
6 |
|
7 | export declare class EventManager implements IDisposable {
|
8 | |
9 |
|
10 |
|
11 | constructor(options?: EventManager.IOptions);
|
12 | /**
|
13 | * The server settings used to make API requests.
|
14 | */
|
15 | readonly serverSettings: ServerConnection.ISettings;
|
16 | /**
|
17 | * Whether the event manager is disposed.
|
18 | */
|
19 | get isDisposed(): boolean;
|
20 | /**
|
21 | * An event stream that emits and yields each new event.
|
22 | */
|
23 | get stream(): Event.Stream;
|
24 | /**
|
25 | * Dispose the event manager.
|
26 | */
|
27 | dispose(): void;
|
28 | /**
|
29 | * Post an event request to be emitted by the event bus.
|
30 | */
|
31 | emit(event: Event.Request): Promise<void>;
|
32 | /**
|
33 | * Subscribe to event bus emissions.
|
34 | */
|
35 | private _subscribe;
|
36 | private _isDisabled;
|
37 | private _isDisposed;
|
38 | private _poll;
|
39 | private _socket;
|
40 | private _stream;
|
41 | }
|
42 | /**
|
43 | * A namespace for `EventManager` statics.
|
44 | */
|
45 | export declare namespace EventManager {
|
46 | |
47 |
|
48 |
|
49 | interface IOptions {
|
50 | |
51 |
|
52 |
|
53 | serverSettings?: ServerConnection.ISettings;
|
54 | }
|
55 | }
|
56 |
|
57 |
|
58 |
|
59 | export declare namespace Event {
|
60 | |
61 |
|
62 |
|
63 | type Emission = {
|
64 | [key: string]: any;
|
65 | schema_id: string;
|
66 | };
|
67 | |
68 |
|
69 |
|
70 | type Request = {
|
71 | data: {
|
72 | [key: string]: any;
|
73 | };
|
74 | schema_id: string;
|
75 | version: string;
|
76 | };
|
77 | |
78 |
|
79 |
|
80 | type Stream = IStream<IManager, Emission>;
|
81 | |
82 |
|
83 |
|
84 | interface IManager extends EventManager {
|
85 | }
|
86 | |
87 |
|
88 |
|
89 | interface IStream<T, U> extends ISignal<T, U>, AsyncIterable<U> {
|
90 | }
|
91 | }
|