UNPKG

6.07 kBTypeScriptView Raw
1import { Client } from '../client.js';
2import { StompHeaders } from '../stomp-headers.js';
3import { frameCallbackType, messageCallbackType } from '../types.js';
4/**
5 * Available for backward compatibility, please shift to using {@link Client}.
6 *
7 * **Deprecated**
8 *
9 * Part of `@stomp/stompjs`.
10 *
11 * To upgrade, please follow the [Upgrade Guide](https://stomp-js.github.io/guide/stompjs/upgrading-stompjs.html)
12 */
13export declare class CompatClient extends Client {
14 /**
15 * It is no op now. No longer needed. Large packets work out of the box.
16 */
17 maxWebSocketFrameSize: number;
18 /**
19 * Available for backward compatibility, please shift to using {@link Client}
20 * and [Client#webSocketFactory]{@link Client#webSocketFactory}.
21 *
22 * **Deprecated**
23 *
24 * @internal
25 */
26 constructor(webSocketFactory: () => any);
27 private _parseConnect;
28 /**
29 * Available for backward compatibility, please shift to using [Client#activate]{@link Client#activate}.
30 *
31 * **Deprecated**
32 *
33 * The `connect` method accepts different number of arguments and types. See the Overloads list. Use the
34 * version with headers to pass your broker specific options.
35 *
36 * overloads:
37 * - connect(headers, connectCallback)
38 * - connect(headers, connectCallback, errorCallback)
39 * - connect(login, passcode, connectCallback)
40 * - connect(login, passcode, connectCallback, errorCallback)
41 * - connect(login, passcode, connectCallback, errorCallback, closeEventCallback)
42 * - connect(login, passcode, connectCallback, errorCallback, closeEventCallback, host)
43 *
44 * params:
45 * - headers, see [Client#connectHeaders]{@link Client#connectHeaders}
46 * - connectCallback, see [Client#onConnect]{@link Client#onConnect}
47 * - errorCallback, see [Client#onStompError]{@link Client#onStompError}
48 * - closeEventCallback, see [Client#onWebSocketClose]{@link Client#onWebSocketClose}
49 * - login [String], see [Client#connectHeaders](../classes/Client.html#connectHeaders)
50 * - passcode [String], [Client#connectHeaders](../classes/Client.html#connectHeaders)
51 * - host [String], see [Client#connectHeaders](../classes/Client.html#connectHeaders)
52 *
53 * To upgrade, please follow the [Upgrade Guide](../additional-documentation/upgrading.html)
54 */
55 connect(...args: any[]): void;
56 /**
57 * Available for backward compatibility, please shift to using [Client#deactivate]{@link Client#deactivate}.
58 *
59 * **Deprecated**
60 *
61 * See:
62 * [Client#onDisconnect]{@link Client#onDisconnect}, and
63 * [Client#disconnectHeaders]{@link Client#disconnectHeaders}
64 *
65 * To upgrade, please follow the [Upgrade Guide](../additional-documentation/upgrading.html)
66 */
67 disconnect(disconnectCallback?: any, headers?: StompHeaders): void;
68 /**
69 * Available for backward compatibility, use [Client#publish]{@link Client#publish}.
70 *
71 * Send a message to a named destination. Refer to your STOMP broker documentation for types
72 * and naming of destinations. The headers will, typically, be available to the subscriber.
73 * However, there may be special purpose headers corresponding to your STOMP broker.
74 *
75 * **Deprecated**, use [Client#publish]{@link Client#publish}
76 *
77 * Note: Body must be String. You will need to covert the payload to string in case it is not string (e.g. JSON)
78 *
79 * ```javascript
80 * client.send("/queue/test", {priority: 9}, "Hello, STOMP");
81 *
82 * // If you want to send a message with a body, you must also pass the headers argument.
83 * client.send("/queue/test", {}, "Hello, STOMP");
84 * ```
85 *
86 * To upgrade, please follow the [Upgrade Guide](../additional-documentation/upgrading.html)
87 */
88 send(destination: string, headers?: {
89 [key: string]: any;
90 }, body?: string): void;
91 /**
92 * Available for backward compatibility, renamed to [Client#reconnectDelay]{@link Client#reconnectDelay}.
93 *
94 * **Deprecated**
95 */
96 set reconnect_delay(value: number);
97 /**
98 * Available for backward compatibility, renamed to [Client#webSocket]{@link Client#webSocket}.
99 *
100 * **Deprecated**
101 */
102 get ws(): any;
103 /**
104 * Available for backward compatibility, renamed to [Client#connectedVersion]{@link Client#connectedVersion}.
105 *
106 * **Deprecated**
107 */
108 get version(): string | undefined;
109 /**
110 * Available for backward compatibility, renamed to [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
111 *
112 * **Deprecated**
113 */
114 get onreceive(): messageCallbackType;
115 /**
116 * Available for backward compatibility, renamed to [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
117 *
118 * **Deprecated**
119 */
120 set onreceive(value: messageCallbackType);
121 /**
122 * Available for backward compatibility, renamed to [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
123 * Prefer using [Client#watchForReceipt]{@link Client#watchForReceipt}.
124 *
125 * **Deprecated**
126 */
127 get onreceipt(): frameCallbackType;
128 /**
129 * Available for backward compatibility, renamed to [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
130 *
131 * **Deprecated**
132 */
133 set onreceipt(value: frameCallbackType);
134 private _heartbeatInfo;
135 /**
136 * Available for backward compatibility, renamed to [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}
137 * [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
138 *
139 * **Deprecated**
140 */
141 get heartbeat(): {
142 incoming: number;
143 outgoing: number;
144 };
145 /**
146 * Available for backward compatibility, renamed to [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}
147 * [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
148 *
149 * **Deprecated**
150 */
151 set heartbeat(value: {
152 incoming: number;
153 outgoing: number;
154 });
155}