@stomp/stompjs 7.0.0-beta2 → 7.0.0-beta4

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/src/types.ts CHANGED
@@ -4,7 +4,7 @@ import { StompHeaders } from './stomp-headers.js';
4
4
  import { Versions } from './versions.js';
5
5
 
6
6
  /**
7
- * This callback will receive a `string` as parameter.
7
+ * This callback will receive a `string` as a parameter.
8
8
  *
9
9
  * Part of `@stomp/stompjs`.
10
10
  */
@@ -22,7 +22,7 @@ export type messageCallbackType = (message: IMessage) => void;
22
22
  *
23
23
  * Part of `@stomp/stompjs`.
24
24
  */
25
- export type frameCallbackType = (receipt: IFrame) => void;
25
+ export type frameCallbackType = ((frame: IFrame) => void) | (() => void);
26
26
 
27
27
  /**
28
28
  * This callback will receive a [CloseEvent]{@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
@@ -64,7 +64,7 @@ export interface IPublishParams {
64
64
  */
65
65
  binaryBody?: Uint8Array;
66
66
  /**
67
- * By default a `content-length` header will be added in the Frame to the broker.
67
+ * By default, a `content-length` header will be added in the Frame to the broker.
68
68
  * Set it to `true` for the header to be skipped.
69
69
  */
70
70
  skipContentLengthHeader?: boolean;
@@ -110,17 +110,18 @@ export interface IStompSocketMessageEvent {
110
110
  * @internal
111
111
  */
112
112
  export interface IStompSocket {
113
- onclose: ((this: IStompSocket, ev?: any) => any) | null;
114
- onerror: ((this: IStompSocket, ev: any) => any) | null;
115
- onmessage: ((this: IStompSocket, ev: IStompSocketMessageEvent) => any) | null;
116
- onopen: ((this: IStompSocket, ev?: any) => any) | null;
117
- terminate?: ((this: IStompSocket) => any) | null;
113
+ url: string;
114
+ onclose: ((ev?: any) => any) | undefined | null;
115
+ onerror: ((ev: any) => any) | undefined | null;
116
+ onmessage: ((ev: IStompSocketMessageEvent) => any) | undefined | null;
117
+ onopen: ((ev?: any) => any) | undefined | null;
118
+ terminate?: (() => any) | undefined | null;
118
119
 
119
120
  /**
120
121
  * Returns a string that indicates how binary data from the socket is exposed to scripts:
121
122
  * We support only 'arraybuffer'.
122
123
  */
123
- binaryType: 'arraybuffer';
124
+ binaryType?: string;
124
125
 
125
126
  /**
126
127
  * Returns the state of the socket connection. It can have the values of StompSocketState.
package/src/versions.ts CHANGED
@@ -27,10 +27,10 @@ export class Versions {
27
27
  ]);
28
28
 
29
29
  /**
30
- * Takes an array of string of versions, typical elements '1.0', '1.1', or '1.2'
30
+ * Takes an array of versions, typical elements '1.2', '1.1', or '1.0'
31
31
  *
32
- * You will an instance if this class if you want to override supported versions to be declared during
33
- * STOMP handshake.
32
+ * You will be creating an instance of this class if you want to override
33
+ * supported versions to be declared during STOMP handshake.
34
34
  */
35
35
  constructor(public versions: string[]) {}
36
36