UNPKG

2.33 kBTypeScriptView Raw
1import { CompatClient } from './compat-client';
2/**
3 * STOMP Class, acts like a factory to create {@link Client}.
4 *
5 * Part of `@stomp/stompjs`.
6 *
7 * **Deprecated**
8 *
9 * It will be removed in next major version. Please switch to {@link Client}.
10 */
11export declare class Stomp {
12 /**
13 * In case you need to use a non standard class for WebSocket.
14 *
15 * For example when using within NodeJS environment:
16 *
17 * ```javascript
18 * StompJs = require('../../esm5/');
19 * Stomp = StompJs.Stomp;
20 * Stomp.WebSocketClass = require('websocket').w3cwebsocket;
21 * ```
22 *
23 * **Deprecated**
24 *
25 *
26 * It will be removed in next major version. Please switch to {@link Client}
27 * using [Client#webSocketFactory]{@link Client#webSocketFactory}.
28 */
29 static WebSocketClass: any;
30 /**
31 * This method creates a WebSocket client that is connected to
32 * the STOMP server located at the url.
33 *
34 * ```javascript
35 * var url = "ws://localhost:61614/stomp";
36 * var client = Stomp.client(url);
37 * ```
38 *
39 * **Deprecated**
40 *
41 * It will be removed in next major version. Please switch to {@link Client}
42 * using [Client#brokerURL]{@link Client#brokerURL}.
43 */
44 static client(url: string, protocols?: string[]): CompatClient;
45 /**
46 * This method is an alternative to [Stomp#client]{@link Stomp#client} to let the user
47 * specify the WebSocket to use (either a standard HTML5 WebSocket or
48 * a similar object).
49 *
50 * In order to support reconnection, the function Client._connect should be callable more than once.
51 * While reconnecting
52 * a new instance of underlying transport (TCP Socket, WebSocket or SockJS) will be needed. So, this function
53 * alternatively allows passing a function that should return a new instance of the underlying socket.
54 *
55 * ```javascript
56 * var client = Stomp.over(function(){
57 * return new WebSocket('ws://localhost:15674/ws')
58 * });
59 * ```
60 *
61 * **Deprecated**
62 *
63 * It will be removed in next major version. Please switch to {@link Client}
64 * using [Client#webSocketFactory]{@link Client#webSocketFactory}.
65 */
66 static over(ws: any): CompatClient;
67}