@stomp/stompjs 6.1.1 → 7.0.0-beta1
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/bundles/stomp.umd.js +325 -308
- package/bundles/stomp.umd.min.js +1 -2
- package/esm6/augment-websocket.js +4 -3
- package/esm6/augment-websocket.js.map +1 -0
- package/esm6/byte.js.map +1 -0
- package/esm6/client.d.ts +29 -13
- package/esm6/client.js +75 -16
- package/esm6/client.js.map +1 -0
- package/esm6/compatibility/compat-client.d.ts +26 -20
- package/esm6/compatibility/compat-client.js.map +1 -0
- package/esm6/compatibility/heartbeat-info.d.ts +4 -2
- package/esm6/compatibility/heartbeat-info.js.map +1 -0
- package/esm6/compatibility/stomp.js.map +1 -0
- package/esm6/frame-impl.d.ts +2 -2
- package/esm6/frame-impl.js +2 -1
- package/esm6/frame-impl.js.map +1 -0
- package/esm6/i-frame.js +1 -0
- package/esm6/i-frame.js.map +1 -0
- package/esm6/i-message.js +1 -0
- package/esm6/i-message.js.map +1 -0
- package/esm6/i-transaction.js +1 -0
- package/esm6/i-transaction.js.map +1 -0
- package/esm6/index.js +3 -0
- package/esm6/index.js.map +1 -0
- package/esm6/parser.js +10 -2
- package/esm6/parser.js.map +1 -0
- package/esm6/stomp-config.js.map +1 -0
- package/esm6/stomp-handler.d.ts +5 -8
- package/esm6/stomp-handler.js +33 -15
- package/esm6/stomp-handler.js.map +1 -0
- package/esm6/stomp-headers.js.map +1 -0
- package/esm6/stomp-subscription.d.ts +1 -1
- package/esm6/stomp-subscription.js +1 -7
- package/esm6/stomp-subscription.js.map +1 -0
- package/esm6/types.d.ts +28 -2
- package/esm6/types.js.map +1 -0
- package/esm6/versions.js +2 -2
- package/esm6/versions.js.map +1 -0
- package/package.json +26 -24
- package/src/augment-websocket.ts +39 -0
- package/src/byte.ts +13 -0
- package/src/client.ts +858 -0
- package/src/compatibility/compat-client.ts +269 -0
- package/src/compatibility/heartbeat-info.ts +26 -0
- package/src/compatibility/stomp.ts +118 -0
- package/src/frame-impl.ts +254 -0
- package/src/i-frame.ts +41 -0
- package/src/i-message.ts +35 -0
- package/src/i-transaction.ts +23 -0
- package/src/index.ts +15 -0
- package/src/parser.ts +267 -0
- package/src/stomp-config.ts +152 -0
- package/src/stomp-handler.ts +555 -0
- package/src/stomp-headers.ts +12 -0
- package/src/stomp-subscription.ts +18 -0
- package/src/types.ts +183 -0
- package/src/versions.ts +50 -0
package/src/i-message.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IFrame } from './i-frame';
|
|
2
|
+
import { StompHeaders } from './stomp-headers';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Instance of Message will be passed to [subscription callback]{@link Client#subscribe}
|
|
6
|
+
* and [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
|
|
7
|
+
* Since it is an extended {@link FrameImpl}, you can access [headers]{@link FrameImpl#headers}
|
|
8
|
+
* and [body]{@link FrameImpl#body} as properties.
|
|
9
|
+
*
|
|
10
|
+
* Part of `@stomp/stompjs`.
|
|
11
|
+
*
|
|
12
|
+
* See [Client#subscribe]{@link Client#subscribe} for example.
|
|
13
|
+
*/
|
|
14
|
+
export interface IMessage extends IFrame {
|
|
15
|
+
/**
|
|
16
|
+
* When subscribing with manual acknowledgement, call this method on the message to ACK the message.
|
|
17
|
+
*
|
|
18
|
+
* See [Client#ack]{@link Client#ack} for an example.
|
|
19
|
+
*/
|
|
20
|
+
ack: (headers?: StompHeaders) => void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* When subscribing with manual acknowledgement, call this method on the message to NACK the message.
|
|
24
|
+
*
|
|
25
|
+
* See [Client#nack]{@link Client#nack} for an example.
|
|
26
|
+
*/
|
|
27
|
+
nack: (headers?: StompHeaders) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Aliased to {@link IMessage}.
|
|
32
|
+
*
|
|
33
|
+
* Part of `@stomp/stompjs`.
|
|
34
|
+
*/
|
|
35
|
+
export type Message = IMessage;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Transaction is created by calling [Client#begin]{@link Client#begin}
|
|
3
|
+
*
|
|
4
|
+
* Part of `@stomp/stompjs`.
|
|
5
|
+
*
|
|
6
|
+
* TODO: Example and caveat
|
|
7
|
+
*/
|
|
8
|
+
export interface ITransaction {
|
|
9
|
+
/**
|
|
10
|
+
* You will need to access this to send, ack, or nack within this transaction.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Commit this transaction. See [Client#commit]{@link Client#commit} for an example.
|
|
16
|
+
*/
|
|
17
|
+
commit: () => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Abort this transaction. See [Client#abort]{@link Client#abort} for an example.
|
|
21
|
+
*/
|
|
22
|
+
abort: () => void;
|
|
23
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './client';
|
|
2
|
+
export * from './frame-impl';
|
|
3
|
+
export * from './i-frame';
|
|
4
|
+
export * from './i-message';
|
|
5
|
+
export * from './parser';
|
|
6
|
+
export * from './stomp-config';
|
|
7
|
+
export * from './stomp-headers';
|
|
8
|
+
export * from './stomp-subscription';
|
|
9
|
+
export * from './i-transaction';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export * from './versions';
|
|
12
|
+
|
|
13
|
+
// Compatibility code
|
|
14
|
+
export * from './compatibility/compat-client';
|
|
15
|
+
export * from './compatibility/stomp';
|
package/src/parser.ts
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { IRawFrameType } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
const NULL = 0;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
const LF = 10;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
const CR = 13;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
const COLON = 58;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This is an evented, rec descent parser.
|
|
22
|
+
* A stream of Octets can be passed and whenever it recognizes
|
|
23
|
+
* a complete Frame or an incoming ping it will invoke the registered callbacks.
|
|
24
|
+
*
|
|
25
|
+
* All incoming Octets are fed into _onByte function.
|
|
26
|
+
* Depending on current state the _onByte function keeps changing.
|
|
27
|
+
* Depending on the state it keeps accumulating into _token and _results.
|
|
28
|
+
* State is indicated by current value of _onByte, all states are named as _collect.
|
|
29
|
+
*
|
|
30
|
+
* STOMP standards https://stomp.github.io/stomp-specification-1.2.html
|
|
31
|
+
* imply that all lengths are considered in bytes (instead of string lengths).
|
|
32
|
+
* So, before actual parsing, if the incoming data is String it is converted to Octets.
|
|
33
|
+
* This allows faithful implementation of the protocol and allows NULL Octets to be present in the body.
|
|
34
|
+
*
|
|
35
|
+
* There is no peek function on the incoming data.
|
|
36
|
+
* When a state change occurs based on an Octet without consuming the Octet,
|
|
37
|
+
* the Octet, after state change, is fed again (_reinjectByte).
|
|
38
|
+
* This became possible as the state change can be determined by inspecting just one Octet.
|
|
39
|
+
*
|
|
40
|
+
* There are two modes to collect the body, if content-length header is there then it by counting Octets
|
|
41
|
+
* otherwise it is determined by NULL terminator.
|
|
42
|
+
*
|
|
43
|
+
* Following the standards, the command and headers are converted to Strings
|
|
44
|
+
* and the body is returned as Octets.
|
|
45
|
+
* Headers are returned as an array and not as Hash - to allow multiple occurrence of an header.
|
|
46
|
+
*
|
|
47
|
+
* This parser does not use Regular Expressions as that can only operate on Strings.
|
|
48
|
+
*
|
|
49
|
+
* It handles if multiple STOMP frames are given as one chunk, a frame is split into multiple chunks, or
|
|
50
|
+
* any combination there of. The parser remembers its state (any partial frame) and continues when a new chunk
|
|
51
|
+
* is pushed.
|
|
52
|
+
*
|
|
53
|
+
* Typically the higher level function will convert headers to Hash, handle unescaping of header values
|
|
54
|
+
* (which is protocol version specific), and convert body to text.
|
|
55
|
+
*
|
|
56
|
+
* Check the parser.spec.js to understand cases that this parser is supposed to handle.
|
|
57
|
+
*
|
|
58
|
+
* Part of `@stomp/stompjs`.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export class Parser {
|
|
63
|
+
private readonly _encoder = new TextEncoder();
|
|
64
|
+
private readonly _decoder = new TextDecoder();
|
|
65
|
+
|
|
66
|
+
// @ts-ignore - it always has a value
|
|
67
|
+
private _results: IRawFrameType;
|
|
68
|
+
|
|
69
|
+
private _token: number[] = [];
|
|
70
|
+
private _headerKey: string | undefined;
|
|
71
|
+
private _bodyBytesRemaining: number | undefined;
|
|
72
|
+
|
|
73
|
+
// @ts-ignore - it always has a value
|
|
74
|
+
private _onByte: (byte: number) => void;
|
|
75
|
+
|
|
76
|
+
public constructor(
|
|
77
|
+
public onFrame: (rawFrame: IRawFrameType) => void,
|
|
78
|
+
public onIncomingPing: () => void
|
|
79
|
+
) {
|
|
80
|
+
this._initState();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public parseChunk(
|
|
84
|
+
segment: string | ArrayBuffer,
|
|
85
|
+
appendMissingNULLonIncoming: boolean = false
|
|
86
|
+
) {
|
|
87
|
+
let chunk: Uint8Array;
|
|
88
|
+
|
|
89
|
+
if (segment instanceof ArrayBuffer) {
|
|
90
|
+
chunk = new Uint8Array(segment);
|
|
91
|
+
} else {
|
|
92
|
+
chunk = this._encoder.encode(segment);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// See https://github.com/stomp-js/stompjs/issues/89
|
|
96
|
+
// Remove when underlying issue is fixed.
|
|
97
|
+
//
|
|
98
|
+
// Send a NULL byte, if the last byte of a Text frame was not NULL.F
|
|
99
|
+
if (appendMissingNULLonIncoming && chunk[chunk.length - 1] !== 0) {
|
|
100
|
+
const chunkWithNull = new Uint8Array(chunk.length + 1);
|
|
101
|
+
chunkWithNull.set(chunk, 0);
|
|
102
|
+
chunkWithNull[chunk.length] = 0;
|
|
103
|
+
chunk = chunkWithNull;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// tslint:disable-next-line:prefer-for-of
|
|
107
|
+
for (let i = 0; i < chunk.length; i++) {
|
|
108
|
+
const byte = chunk[i];
|
|
109
|
+
this._onByte(byte);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// The following implements a simple Rec Descent Parser.
|
|
114
|
+
// The grammar is simple and just one byte tells what should be the next state
|
|
115
|
+
|
|
116
|
+
private _collectFrame(byte: number): void {
|
|
117
|
+
if (byte === NULL) {
|
|
118
|
+
// Ignore
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (byte === CR) {
|
|
122
|
+
// Ignore CR
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (byte === LF) {
|
|
126
|
+
// Incoming Ping
|
|
127
|
+
this.onIncomingPing();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this._onByte = this._collectCommand;
|
|
132
|
+
this._reinjectByte(byte);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private _collectCommand(byte: number): void {
|
|
136
|
+
if (byte === CR) {
|
|
137
|
+
// Ignore CR
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (byte === LF) {
|
|
141
|
+
this._results.command = this._consumeTokenAsUTF8();
|
|
142
|
+
this._onByte = this._collectHeaders;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
this._consumeByte(byte);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private _collectHeaders(byte: number): void {
|
|
150
|
+
if (byte === CR) {
|
|
151
|
+
// Ignore CR
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (byte === LF) {
|
|
155
|
+
this._setupCollectBody();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this._onByte = this._collectHeaderKey;
|
|
159
|
+
this._reinjectByte(byte);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private _reinjectByte(byte: number) {
|
|
163
|
+
this._onByte(byte);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private _collectHeaderKey(byte: number): void {
|
|
167
|
+
if (byte === COLON) {
|
|
168
|
+
this._headerKey = this._consumeTokenAsUTF8();
|
|
169
|
+
this._onByte = this._collectHeaderValue;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this._consumeByte(byte);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private _collectHeaderValue(byte: number): void {
|
|
176
|
+
if (byte === CR) {
|
|
177
|
+
// Ignore CR
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (byte === LF) {
|
|
181
|
+
this._results.headers.push([
|
|
182
|
+
this._headerKey as string,
|
|
183
|
+
this._consumeTokenAsUTF8(),
|
|
184
|
+
]);
|
|
185
|
+
this._headerKey = undefined;
|
|
186
|
+
this._onByte = this._collectHeaders;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this._consumeByte(byte);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private _setupCollectBody() {
|
|
193
|
+
const contentLengthHeader = this._results.headers.filter(
|
|
194
|
+
(header: [string, string]) => {
|
|
195
|
+
return header[0] === 'content-length';
|
|
196
|
+
}
|
|
197
|
+
)[0];
|
|
198
|
+
|
|
199
|
+
if (contentLengthHeader) {
|
|
200
|
+
this._bodyBytesRemaining = parseInt(contentLengthHeader[1], 10);
|
|
201
|
+
this._onByte = this._collectBodyFixedSize;
|
|
202
|
+
} else {
|
|
203
|
+
this._onByte = this._collectBodyNullTerminated;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
private _collectBodyNullTerminated(byte: number): void {
|
|
208
|
+
if (byte === NULL) {
|
|
209
|
+
this._retrievedBody();
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
this._consumeByte(byte);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private _collectBodyFixedSize(byte: number): void {
|
|
216
|
+
// It is post decrement, so that we discard the trailing NULL octet
|
|
217
|
+
if ((this._bodyBytesRemaining as number)-- === 0) {
|
|
218
|
+
this._retrievedBody();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this._consumeByte(byte);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private _retrievedBody() {
|
|
225
|
+
this._results.binaryBody = this._consumeTokenAsRaw();
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
this.onFrame(this._results);
|
|
229
|
+
} catch (e) {
|
|
230
|
+
console.log(
|
|
231
|
+
`Ignoring an exception thrown by a frame handler. Original exception: `,
|
|
232
|
+
e
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
this._initState();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Rec Descent Parser helpers
|
|
240
|
+
|
|
241
|
+
private _consumeByte(byte: number) {
|
|
242
|
+
this._token.push(byte);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
private _consumeTokenAsUTF8() {
|
|
246
|
+
return this._decoder.decode(this._consumeTokenAsRaw());
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
private _consumeTokenAsRaw() {
|
|
250
|
+
const rawResult = new Uint8Array(this._token);
|
|
251
|
+
this._token = [];
|
|
252
|
+
return rawResult;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private _initState() {
|
|
256
|
+
this._results = {
|
|
257
|
+
command: undefined,
|
|
258
|
+
headers: [],
|
|
259
|
+
binaryBody: undefined,
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
this._token = [];
|
|
263
|
+
this._headerKey = undefined;
|
|
264
|
+
|
|
265
|
+
this._onByte = this._collectFrame;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { StompHeaders } from './stomp-headers';
|
|
2
|
+
import {
|
|
3
|
+
ActivationState,
|
|
4
|
+
closeEventCallbackType,
|
|
5
|
+
debugFnType,
|
|
6
|
+
frameCallbackType,
|
|
7
|
+
messageCallbackType,
|
|
8
|
+
wsErrorCallbackType,
|
|
9
|
+
} from './types';
|
|
10
|
+
import { Versions } from './versions';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configuration options for STOMP Client, each key corresponds to
|
|
14
|
+
* field by the same name in {@link Client}. This can be passed to
|
|
15
|
+
* the constructor of {@link Client} or to [Client#configure]{@link Client#configure}.
|
|
16
|
+
*
|
|
17
|
+
* There used to be a class with the same name in `@stomp/ng2-stompjs`, which has been replaced by
|
|
18
|
+
* {@link RxStompConfig} and {@link InjectableRxStompConfig}.
|
|
19
|
+
*
|
|
20
|
+
* Part of `@stomp/stompjs`.
|
|
21
|
+
*/
|
|
22
|
+
export class StompConfig {
|
|
23
|
+
/**
|
|
24
|
+
* See [Client#brokerURL]{@link Client#brokerURL}.
|
|
25
|
+
*/
|
|
26
|
+
public brokerURL?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* See See [Client#stompVersions]{@link Client#stompVersions}.
|
|
30
|
+
*/
|
|
31
|
+
public stompVersions?: Versions;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* See [Client#webSocketFactory]{@link Client#webSocketFactory}.
|
|
35
|
+
*/
|
|
36
|
+
public webSocketFactory?: () => any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* See [Client#connectionTimeout]{@link Client#connectionTimeout}.
|
|
40
|
+
*/
|
|
41
|
+
public connectionTimeout?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* See [Client#reconnectDelay]{@link Client#reconnectDelay}.
|
|
45
|
+
*/
|
|
46
|
+
public reconnectDelay?: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* See [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}.
|
|
50
|
+
*/
|
|
51
|
+
public heartbeatIncoming?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* See [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
|
|
55
|
+
*/
|
|
56
|
+
public heartbeatOutgoing?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* See [Client#splitLargeFrames]{@link Client#splitLargeFrames}.
|
|
60
|
+
*/
|
|
61
|
+
public splitLargeFrames?: boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* See [Client#forceBinaryWSFrames]{@link Client#forceBinaryWSFrames}.
|
|
65
|
+
*/
|
|
66
|
+
public forceBinaryWSFrames?: boolean;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* See [Client#appendMissingNULLonIncoming]{@link Client#appendMissingNULLonIncoming}.
|
|
70
|
+
*/
|
|
71
|
+
public appendMissingNULLonIncoming?: boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* See [Client#maxWebSocketChunkSize]{@link Client#maxWebSocketChunkSize}.
|
|
75
|
+
*/
|
|
76
|
+
public maxWebSocketChunkSize?: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* See [Client#connectHeaders]{@link Client#connectHeaders}.
|
|
80
|
+
*/
|
|
81
|
+
public connectHeaders?: StompHeaders;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* See [Client#disconnectHeaders]{@link Client#disconnectHeaders}.
|
|
85
|
+
*/
|
|
86
|
+
public disconnectHeaders?: StompHeaders;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* See [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
|
|
90
|
+
*/
|
|
91
|
+
public onUnhandledMessage?: messageCallbackType;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* See [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
|
|
95
|
+
*/
|
|
96
|
+
public onUnhandledReceipt?: frameCallbackType;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* See [Client#onUnhandledFrame]{@link Client#onUnhandledFrame}.
|
|
100
|
+
*/
|
|
101
|
+
public onUnhandledFrame?: frameCallbackType;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* See [Client#beforeConnect]{@link Client#beforeConnect}.
|
|
105
|
+
*/
|
|
106
|
+
public beforeConnect?: () => void | Promise<void>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* See [Client#onConnect]{@link Client#onConnect}.
|
|
110
|
+
*/
|
|
111
|
+
public onConnect?: frameCallbackType;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* See [Client#onDisconnect]{@link Client#onDisconnect}.
|
|
115
|
+
*/
|
|
116
|
+
public onDisconnect?: frameCallbackType;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* See [Client#onStompError]{@link Client#onStompError}.
|
|
120
|
+
*/
|
|
121
|
+
public onStompError?: frameCallbackType;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* See [Client#onWebSocketClose]{@link Client#onWebSocketClose}.
|
|
125
|
+
*/
|
|
126
|
+
public onWebSocketClose?: closeEventCallbackType;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* See [Client#onWebSocketError]{@link Client#onWebSocketError}.
|
|
130
|
+
*/
|
|
131
|
+
public onWebSocketError?: wsErrorCallbackType;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* See [Client#logRawCommunication]{@link Client#logRawCommunication}.
|
|
135
|
+
*/
|
|
136
|
+
public logRawCommunication?: boolean;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* See [Client#debug]{@link Client#debug}.
|
|
140
|
+
*/
|
|
141
|
+
public debug?: debugFnType;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* See [Client#discardWebsocketOnCommFailure]{@link Client#discardWebsocketOnCommFailure}.
|
|
145
|
+
*/
|
|
146
|
+
public discardWebsocketOnCommFailure?: boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* See [Client#onChangeState]{@link Client#onChangeState}.
|
|
150
|
+
*/
|
|
151
|
+
public onChangeState?: (state: ActivationState) => void;
|
|
152
|
+
}
|