UNPKG

5.81 kBTypeScriptView Raw
1import { Client } from '../client';
2import { StompHeaders } from '../stomp-headers';
3import { frameCallbackType, messageCallbackType } from '../types';
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](../additional-documentation/upgrading.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 reconnect_delay: number;
97 /**
98 * Available for backward compatibility, renamed to [Client#webSocket]{@link Client#webSocket}.
99 *
100 * **Deprecated**
101 */
102 readonly ws: any;
103 /**
104 * Available for backward compatibility, renamed to [Client#connectedVersion]{@link Client#connectedVersion}.
105 *
106 * **Deprecated**
107 */
108 readonly version: string;
109 /**
110 * Available for backward compatibility, renamed to [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
111 *
112 * **Deprecated**
113 */
114 /**
115 * Available for backward compatibility, renamed to [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
116 *
117 * **Deprecated**
118 */
119 onreceive: messageCallbackType;
120 /**
121 * Available for backward compatibility, renamed to [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
122 * Prefer using [Client#watchForReceipt]{@link Client#watchForReceipt}.
123 *
124 * **Deprecated**
125 */
126 /**
127 * Available for backward compatibility, renamed to [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
128 *
129 * **Deprecated**
130 */
131 onreceipt: frameCallbackType;
132 private _heartbeatInfo;
133 /**
134 * Available for backward compatibility, renamed to [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}
135 * [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
136 *
137 * **Deprecated**
138 */
139 /**
140 * Available for backward compatibility, renamed to [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}
141 * [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
142 *
143 * **Deprecated**
144 */
145 heartbeat: {
146 incoming: number;
147 outgoing: number;
148 };
149}