@socket-mesh/client 17.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ SocketCluster JavaScript client
2
+ ======
3
+
4
+ Client module for SocketCluster.
5
+
6
+ ## Setting up
7
+
8
+ You will need to install both ```socketcluster-client``` and ```socketcluster-server``` (https://github.com/SocketCluster/socketcluster-server).
9
+
10
+ To install this module:
11
+ ```bash
12
+ npm install socketcluster-client
13
+ ```
14
+
15
+ ## How to use
16
+
17
+ The socketcluster-client script is called `socketcluster-client.js` (located in the main socketcluster-client directory).
18
+ Embed it in your HTML page like this:
19
+ ```html
20
+ <script type="text/javascript" src="/socketcluster-client.js"></script>
21
+ ```
22
+ \* Note that the src attribute may be different depending on how you setup your HTTP server.
23
+
24
+ Once you have embedded the client `socketcluster-client.js` into your page, you will gain access to a global `socketClusterClient` object.
25
+ You may also use CommonJS `require` or ES6 module imports.
26
+
27
+ ### Connect to a server
28
+
29
+ ```js
30
+ let socket = socketClusterClient.create({
31
+ hostname: 'localhost',
32
+ port: 8000
33
+ });
34
+ ```
35
+
36
+ ### Transmit data
37
+
38
+ ```js
39
+ // Transmit some data to the server.
40
+ // It does not expect a response from the server.
41
+ // From the server socket, it can be handled using either:
42
+ // - for await (let data of socket.receiver('foo')) {}
43
+ // - let data = await socket.receiver('foo').once()
44
+ socket.transmit('foo', 123);
45
+ ```
46
+
47
+ ### Invoke an RPC
48
+
49
+ ```js
50
+ (async () => {
51
+
52
+ // Invoke an RPC on the server.
53
+ // It expects a response from the server.
54
+ // From the server socket, it can be handled using either:
55
+ // - for await (let req of socket.procedure('myProc')) {}
56
+ // - let req = await socket.procedure('myProc').once()
57
+ let result = await socket.invoke('myProc', 123);
58
+
59
+ })();
60
+ ```
61
+
62
+ ### Subscribe to a channel
63
+
64
+ ```js
65
+ (async () => {
66
+
67
+ // Subscribe to a channel.
68
+ let myChannel = socket.subscribe('myChannel');
69
+
70
+ await myChannel.listener('subscribe').once();
71
+ // myChannel.state is now 'subscribed'.
72
+
73
+ })();
74
+ ```
75
+
76
+ ### Get a channel without subscribing
77
+
78
+ ```js
79
+ (async () => {
80
+
81
+ let myChannel = socket.channel('myChannel');
82
+
83
+ // Can subscribe to the channel later as a separate step.
84
+ myChannel.subscribe();
85
+ await myChannel.listener('subscribe').once();
86
+ // myChannel.state is now 'subscribed'.
87
+
88
+ })();
89
+ ```
90
+
91
+ ### Publish data to a channel
92
+
93
+ ```js
94
+ // Publish data to the channel.
95
+ myChannel.transmitPublish('This is a message');
96
+
97
+ // Publish data to the channel from the socket.
98
+ socket.transmitPublish('myChannel', 'This is a message');
99
+
100
+ (async () => {
101
+ // Publish data to the channel and await for the message
102
+ // to reach the server.
103
+ try {
104
+ await myChannel.invokePublish('This is a message');
105
+ } catch (error) {
106
+ // Handle error.
107
+ }
108
+
109
+ // Publish data to the channel from the socket and await for
110
+ // the message to reach the server.
111
+ try {
112
+ await socket.invokePublish('myChannel', 'This is a message');
113
+ } catch (error) {
114
+ // Handle error.
115
+ }
116
+ })();
117
+ ```
118
+
119
+ ### Consume data from a channel
120
+
121
+ ```js
122
+ (async () => {
123
+
124
+ for await (let data of myChannel) {
125
+ // ...
126
+ }
127
+
128
+ })();
129
+ ```
130
+
131
+ ### Connect over HTTPS:
132
+
133
+ ```js
134
+ let options = {
135
+ hostname: 'securedomain.com',
136
+ secure: true,
137
+ port: 443,
138
+ rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate
139
+ };
140
+ // Initiate the connection to the server
141
+ let socket = socketClusterClient.create(options);
142
+ ```
143
+
144
+ For more detailed examples of how to use SocketCluster, see `test/integration.js`.
145
+ Also, see tests from the `socketcluster-server` module.
146
+
147
+ ### Connect Options
148
+
149
+ See all available options: https://socketcluster.io/
150
+
151
+ ```js
152
+ let options = {
153
+ path: '/socketcluster/',
154
+ port: 8000,
155
+ hostname: '127.0.0.1',
156
+ autoConnect: true,
157
+ secure: false,
158
+ rejectUnauthorized: false,
159
+ connectTimeout: 10000, //milliseconds
160
+ ackTimeout: 10000, //milliseconds
161
+ channelPrefix: null,
162
+ disconnectOnUnload: true,
163
+ autoReconnectOptions: {
164
+ initialDelay: 10000, //milliseconds
165
+ randomness: 10000, //milliseconds
166
+ multiplier: 1.5, //decimal
167
+ maxDelay: 60000 //milliseconds
168
+ },
169
+ authEngine: null,
170
+ codecEngine: null,
171
+ subscriptionRetryOptions: {},
172
+ query: {
173
+ yourparam: 'hello'
174
+ }
175
+ };
176
+ ```
177
+
178
+ ## Running the tests
179
+
180
+ - Clone this repo: `git clone git@github.com:SocketCluster/socketcluster-client.git`
181
+ - Navigate to project directory: `cd socketcluster-client`
182
+ - Install all dependencies: `npm install`
183
+ - Run the tests: `npm test`
184
+
185
+ ## Compatibility mode
186
+
187
+ For compatibility with an existing SocketCluster server, set the `protocolVersion` to `1` and make sure that the `path` matches your old server path:
188
+
189
+ ```js
190
+ let socket = socketClusterClient.create({
191
+ protocolVersion: 1,
192
+ path: '/socketcluster/'
193
+ });
194
+ ```
195
+
196
+ ## Developing
197
+
198
+ ### Install all dependencies
199
+
200
+ ```bash
201
+ cd socketcluster-client
202
+
203
+ npm install -g gulp gulp-cli browserify uglify-es
204
+
205
+ npm install
206
+ ```
207
+
208
+ ### Building
209
+
210
+ To build the SocketCluster client:
211
+
212
+ ```bash
213
+ npm run build
214
+ ```
215
+
216
+ ## Change log
217
+
218
+ See the 'releases' section for changes: https://github.com/SocketCluster/socketcluster-client/releases
219
+
220
+ ## License
221
+
222
+ (The MIT License)
223
+
224
+ Copyright (c) 2013-2023 SocketCluster.io
225
+
226
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
227
+
228
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
229
+
230
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/auth.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { AuthState, AuthToken, SignedAuthToken } from "@socket-mesh/auth";
2
+ export interface AuthStatus {
3
+ isAuthenticated?: AuthState;
4
+ authError: any;
5
+ }
6
+ export interface AuthEngine {
7
+ saveToken(name: string, token: SignedAuthToken, options?: {
8
+ [key: string]: any;
9
+ }): Promise<SignedAuthToken>;
10
+ removeToken(name: string): Promise<AuthToken | SignedAuthToken | null>;
11
+ loadToken(name: string): Promise<SignedAuthToken | null>;
12
+ }
13
+ export declare class LocalStorageAuthEngine implements AuthEngine {
14
+ private readonly _internalStorage;
15
+ readonly isLocalStorageEnabled: boolean;
16
+ constructor();
17
+ private _checkLocalStorageEnabled;
18
+ saveToken(name: string, token: string): Promise<SignedAuthToken>;
19
+ removeToken(name: string): Promise<SignedAuthToken>;
20
+ loadToken(name: string): Promise<SignedAuthToken>;
21
+ }
package/auth.js ADDED
@@ -0,0 +1,66 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ export class LocalStorageAuthEngine {
11
+ constructor() {
12
+ this._internalStorage = {};
13
+ this.isLocalStorageEnabled = this._checkLocalStorageEnabled();
14
+ }
15
+ _checkLocalStorageEnabled() {
16
+ let err;
17
+ try {
18
+ // Some browsers will throw an error here if localStorage is disabled.
19
+ global.localStorage;
20
+ // Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem
21
+ // throw QuotaExceededError. We're going to detect this and avoid hard to debug edge cases.
22
+ global.localStorage.setItem('__scLocalStorageTest', "1");
23
+ global.localStorage.removeItem('__scLocalStorageTest');
24
+ }
25
+ catch (e) {
26
+ err = e;
27
+ }
28
+ return !err;
29
+ }
30
+ saveToken(name, token) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ if (this.isLocalStorageEnabled && global.localStorage) {
33
+ global.localStorage.setItem(name, token);
34
+ }
35
+ else {
36
+ this._internalStorage[name] = token;
37
+ }
38
+ return token;
39
+ });
40
+ }
41
+ removeToken(name) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ let loadPromise = this.loadToken(name);
44
+ if (this.isLocalStorageEnabled && global.localStorage) {
45
+ global.localStorage.removeItem(name);
46
+ }
47
+ else {
48
+ delete this._internalStorage[name];
49
+ }
50
+ return loadPromise;
51
+ });
52
+ }
53
+ loadToken(name) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ let token;
56
+ if (this.isLocalStorageEnabled && global.localStorage) {
57
+ token = global.localStorage.getItem(name);
58
+ }
59
+ else {
60
+ token = this._internalStorage[name] || null;
61
+ }
62
+ return token;
63
+ });
64
+ }
65
+ }
66
+ //# sourceMappingURL=auth.js.map
package/auth.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;AAmBA,MAAM,OAAO,sBAAsB;IAIlC;QACC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;IAC/D,CAAC;IAEO,yBAAyB;QAChC,IAAI,GAAG,CAAC;QAER,IAAI;YACH,sEAAsE;YACtE,MAAM,CAAC,YAAY,CAAC;YAEpB,iGAAiG;YACjG,2FAA2F;YAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;YACzD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;SACvD;QAAC,OAAO,CAAC,EAAE;YACX,GAAG,GAAG,CAAC,CAAC;SACR;QAED,OAAO,CAAC,GAAG,CAAC;IACb,CAAC;IAEK,SAAS,CAAC,IAAY,EAAE,KAAa;;YAC1C,IAAI,IAAI,CAAC,qBAAqB,IAAI,MAAM,CAAC,YAAY,EAAE;gBACtD,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACzC;iBAAM;gBACN,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;aACpC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;KAAA;IAEK,WAAW,CAAC,IAAY;;YAC7B,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAEvC,IAAI,IAAI,CAAC,qBAAqB,IAAI,MAAM,CAAC,YAAY,EAAE;gBACtD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;aACrC;iBAAM;gBACN,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;aACnC;YAED,OAAO,WAAW,CAAC;QACpB,CAAC;KAAA;IAEK,SAAS,CAAC,IAAY;;YAC3B,IAAI,KAAK,CAAC;YAEV,IAAI,IAAI,CAAC,qBAAqB,IAAI,MAAM,CAAC,YAAY,EAAE;gBACtD,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAC1C;iBAAM;gBACN,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;aAC5C;YAED,OAAO,KAAK,CAAC;QACd,CAAC;KAAA;CACD"}
@@ -0,0 +1,53 @@
1
+ import { AuthEngine } from "./auth";
2
+ import { CodecEngine } from "@socket-mesh/formatter";
3
+ import * as ws from "ws";
4
+ export type ProtocolVersions = 1 | 2;
5
+ export type CallIdGenerator = () => number;
6
+ export interface AutoReconnectOptions {
7
+ initialDelay?: number;
8
+ randomness?: number;
9
+ multiplier?: number;
10
+ maxDelay?: number;
11
+ }
12
+ export interface ClientOptions {
13
+ socketPath?: string;
14
+ host?: string;
15
+ hostname?: string;
16
+ secure?: boolean;
17
+ port?: number;
18
+ path?: string;
19
+ protocolScheme?: string;
20
+ query?: string | {
21
+ [key: string]: string | string[];
22
+ };
23
+ ackTimeout?: number;
24
+ connectTimeout?: number;
25
+ autoConnect?: boolean;
26
+ autoReconnect?: boolean;
27
+ autoReconnectOptions?: AutoReconnectOptions;
28
+ disconnectOnUnload?: boolean;
29
+ timestampRequests?: boolean;
30
+ timestampParam?: string;
31
+ authEngine?: AuthEngine | null;
32
+ authTokenName?: string;
33
+ binaryType?: "nodebuffer" | "arraybuffer" | "fragments";
34
+ cloneData?: boolean;
35
+ autoSubscribeOnConnect?: boolean;
36
+ codecEngine?: CodecEngine | null;
37
+ channelPrefix?: string | null;
38
+ subscriptionRetryOptions?: object | null;
39
+ batchOnHandshake?: boolean;
40
+ batchOnHandshakeDuration?: number;
41
+ batchInterval?: number;
42
+ /**
43
+ * @deprecated The "protocol" option does not affect socketcluster-client - If you want to utilize SSL/TLS, use "secure" option instead
44
+ */
45
+ protocol?: string;
46
+ protocolVersion?: ProtocolVersions;
47
+ wsOptions?: ws.ClientOptions;
48
+ version?: string;
49
+ clientId?: string;
50
+ pingTimeout?: number;
51
+ pingTimeoutDisabled?: boolean;
52
+ callIdGenerator?: CallIdGenerator;
53
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-options.js","sourceRoot":"","sources":["../src/client-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,134 @@
1
+ import { ClientOptions, ProtocolVersions } from "./client-options";
2
+ import { DemuxedConsumableStream, StreamDemuxWrapper } from "@socket-mesh/stream-demux";
3
+ import { AuthEngine, AuthStatus } from "./auth";
4
+ import { AuthState, AuthToken, SignedAuthToken } from "@socket-mesh/auth";
5
+ import { CodecEngine } from "@socket-mesh/formatter";
6
+ import { Transport } from "./transport";
7
+ import * as ws from "ws";
8
+ import { Client, ChannelDetails } from "@socket-mesh/channel";
9
+ import { SocketState } from "./socket-state";
10
+ import { AuthStateChanged, AuthTokenRemoved, Authenticated, Closed, Connected, Connecting, Deauthenticated, ErrorOccured, KickedOut, SubscribeFailed, SubscribeStateChanged, Subscribed, Unsubscribed } from "./events";
11
+ export declare class ClientSocket extends Client<any> {
12
+ auth: AuthEngine;
13
+ authTokenName?: string;
14
+ authToken?: AuthToken | null;
15
+ authState: AuthState;
16
+ codec: CodecEngine;
17
+ transport: Transport;
18
+ isBatching: boolean;
19
+ batchOnHandshake: boolean;
20
+ batchOnHandshakeDuration: number;
21
+ clientId?: string;
22
+ id: string | null;
23
+ disconnectOnUnload: boolean;
24
+ pendingReconnect: boolean;
25
+ pendingReconnectTimeout: number;
26
+ preparingPendingSubscriptions: boolean;
27
+ protocolVersion: ProtocolVersions;
28
+ channelPrefix: string | null;
29
+ connectAttempts: number;
30
+ options: ClientOptions;
31
+ connectTimeout: number;
32
+ ackTimeout: number;
33
+ pingTimeout: number;
34
+ pingTimeoutDisabled: boolean;
35
+ state: SocketState;
36
+ signedAuthToken: SignedAuthToken | null;
37
+ wsOptions?: ws.ClientOptions;
38
+ version?: string | null;
39
+ readonly receiver: StreamDemuxWrapper<any>;
40
+ readonly procedure: StreamDemuxWrapper<any>;
41
+ private _cid;
42
+ private _batchingIntervalId;
43
+ private _receiverDemux;
44
+ private _procedureDemux;
45
+ private _reconnectTimeoutRef?;
46
+ private readonly _outboundBuffer;
47
+ constructor(socketOptions: ClientOptions);
48
+ getBackpressure(): number;
49
+ private _handleBrowserUnload;
50
+ private _setAuthToken;
51
+ private _removeAuthToken;
52
+ getState(): SocketState;
53
+ getBytesReceived(): unknown;
54
+ deauthenticate(): Promise<void>;
55
+ connect(): void;
56
+ reconnect(code?: number, reason?: string): void;
57
+ disconnect(code?: number, reason?: string): void;
58
+ private _changeToUnauthenticatedStateAndClearTokens;
59
+ private _changeToAuthenticatedState;
60
+ decodeBase64(encodedString: string): string;
61
+ encodeBase64(decodedString: string): string;
62
+ private _extractAuthTokenData;
63
+ getAuthToken(): AuthToken;
64
+ getSignedAuthToken(): SignedAuthToken;
65
+ authenticate(signedAuthToken: SignedAuthToken): Promise<AuthStatus>;
66
+ private _tryReconnect;
67
+ private _onOpen;
68
+ private _onError;
69
+ private _suspendSubscriptions;
70
+ private _abortAllPendingEventsDueToBadConnection;
71
+ private _destroy;
72
+ private _onInboundTransmit;
73
+ private _onInboundInvoke;
74
+ decode(message: any): any;
75
+ encode(object: any): string;
76
+ private _flushOutboundBuffer;
77
+ private _handleEventAckTimeout;
78
+ private _processOutboundEvent;
79
+ send(data: string): void;
80
+ transmit(event: string, data?: any, options?: {
81
+ ackTimeout?: number;
82
+ }): Promise<void>;
83
+ invoke<T>(event: string, data: any, options?: {
84
+ ackTimeout?: number;
85
+ }): Promise<T>;
86
+ transmitPublish(channelName: string, data: any): Promise<void>;
87
+ invokePublish<T>(channelName: string, data: any): Promise<T>;
88
+ private _triggerChannelSubscribe;
89
+ private _triggerChannelSubscribeFail;
90
+ private _cancelPendingSubscribeCallback;
91
+ private _decorateChannelName;
92
+ private _undecorateChannelName;
93
+ startBatch(): void;
94
+ flushBatch(): void;
95
+ cancelBatch(): void;
96
+ private _startBatching;
97
+ startBatching(): void;
98
+ private _stopBatching;
99
+ stopBatching(): void;
100
+ private _cancelBatching;
101
+ cancelBatching(): void;
102
+ protected _trySubscribe(channel: ChannelDetails): void;
103
+ emit(eventName: 'removeAuthToken', data: AuthTokenRemoved): void;
104
+ emit(eventName: 'connect', data: Connected): void;
105
+ emit(eventName: 'connecting', data: Connecting): void;
106
+ emit(eventName: 'authStateChange', data: AuthStateChanged): void;
107
+ emit(eventName: 'authenticate', data: Authenticated): void;
108
+ emit(eventName: 'deauthenticate', data: Deauthenticated): void;
109
+ emit(eventName: 'error', data: ErrorOccured): void;
110
+ emit(eventName: 'connectAbort' | 'disconnect' | 'close', data: Closed): void;
111
+ emit(eventName: 'subscribeStateChange', data: SubscribeStateChanged): void;
112
+ emit(eventName: 'subscribe' | 'subscribeRequest', data: Subscribed): void;
113
+ emit(eventName: 'subscribeFail', data: SubscribeFailed): void;
114
+ emit(eventName: 'unsubscribe', data: Unsubscribed): void;
115
+ emit(eventName: 'kickOut', data: KickedOut): void;
116
+ emit(eventName: string, data: any): void;
117
+ listen(eventName: 'removeAuthToken'): DemuxedConsumableStream<AuthTokenRemoved>;
118
+ listen(eventName: 'connect'): DemuxedConsumableStream<Connected>;
119
+ listen(eventName: 'connecting'): DemuxedConsumableStream<Connecting>;
120
+ listen(eventName: 'authStateChange'): DemuxedConsumableStream<AuthStateChanged>;
121
+ listen(eventName: 'authenticate'): DemuxedConsumableStream<Authenticated>;
122
+ listen(eventName: 'deauthenticate'): DemuxedConsumableStream<Deauthenticated>;
123
+ listen(eventName: 'error'): DemuxedConsumableStream<ErrorOccured>;
124
+ listen(eventName: 'connectAbort' | 'disconnect' | 'close'): DemuxedConsumableStream<Closed>;
125
+ listen(eventName: 'subscribeStateChange'): DemuxedConsumableStream<SubscribeStateChanged>;
126
+ listen(eventName: 'subscribe' | 'subscribeRequest'): DemuxedConsumableStream<Subscribed>;
127
+ listen(eventName: 'subscribeFail'): DemuxedConsumableStream<SubscribeFailed>;
128
+ listen(eventName: 'unsubscribe'): DemuxedConsumableStream<Unsubscribed>;
129
+ listen(eventName: 'kickOut'): DemuxedConsumableStream<KickedOut>;
130
+ private _triggerChannelUnsubscribe;
131
+ protected _tryUnsubscribe(channel: ChannelDetails): void;
132
+ processPendingSubscriptions(): void;
133
+ get isBufferingBatch(): boolean;
134
+ }