UNPKG

3.72 kBPlain TextView Raw
1import { StompHeaders } from './stomp-headers.js';
2import {
3 ActivationState,
4 closeEventCallbackType,
5 debugFnType,
6 frameCallbackType,
7 messageCallbackType,
8 wsErrorCallbackType,
9} from './types.js';
10import { Versions } from './versions.js';
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 * Part of `@stomp/stompjs`.
18 */
19export class StompConfig {
20 /**
21 * See [Client#brokerURL]{@link Client#brokerURL}.
22 */
23 public brokerURL?: string;
24
25 /**
26 * See [Client#stompVersions]{@link Client#stompVersions}.
27 */
28 public stompVersions?: Versions;
29
30 /**
31 * See [Client#webSocketFactory]{@link Client#webSocketFactory}.
32 */
33 public webSocketFactory?: () => any;
34
35 /**
36 * See [Client#connectionTimeout]{@link Client#connectionTimeout}.
37 */
38 public connectionTimeout?: number;
39
40 /**
41 * See [Client#reconnectDelay]{@link Client#reconnectDelay}.
42 */
43 public reconnectDelay?: number;
44
45 /**
46 * See [Client#heartbeatIncoming]{@link Client#heartbeatIncoming}.
47 */
48 public heartbeatIncoming?: number;
49
50 /**
51 * See [Client#heartbeatOutgoing]{@link Client#heartbeatOutgoing}.
52 */
53 public heartbeatOutgoing?: number;
54
55 /**
56 * See [Client#splitLargeFrames]{@link Client#splitLargeFrames}.
57 */
58 public splitLargeFrames?: boolean;
59
60 /**
61 * See [Client#forceBinaryWSFrames]{@link Client#forceBinaryWSFrames}.
62 */
63 public forceBinaryWSFrames?: boolean;
64
65 /**
66 * See [Client#appendMissingNULLonIncoming]{@link Client#appendMissingNULLonIncoming}.
67 */
68 public appendMissingNULLonIncoming?: boolean;
69
70 /**
71 * See [Client#maxWebSocketChunkSize]{@link Client#maxWebSocketChunkSize}.
72 */
73 public maxWebSocketChunkSize?: number;
74
75 /**
76 * See [Client#connectHeaders]{@link Client#connectHeaders}.
77 */
78 public connectHeaders?: StompHeaders;
79
80 /**
81 * See [Client#disconnectHeaders]{@link Client#disconnectHeaders}.
82 */
83 public disconnectHeaders?: StompHeaders;
84
85 /**
86 * See [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
87 */
88 public onUnhandledMessage?: messageCallbackType;
89
90 /**
91 * See [Client#onUnhandledReceipt]{@link Client#onUnhandledReceipt}.
92 */
93 public onUnhandledReceipt?: frameCallbackType;
94
95 /**
96 * See [Client#onUnhandledFrame]{@link Client#onUnhandledFrame}.
97 */
98 public onUnhandledFrame?: frameCallbackType;
99
100 /**
101 * See [Client#beforeConnect]{@link Client#beforeConnect}.
102 */
103 public beforeConnect?: () => void | Promise<void>;
104
105 /**
106 * See [Client#onConnect]{@link Client#onConnect}.
107 */
108 public onConnect?: frameCallbackType;
109
110 /**
111 * See [Client#onDisconnect]{@link Client#onDisconnect}.
112 */
113 public onDisconnect?: frameCallbackType;
114
115 /**
116 * See [Client#onStompError]{@link Client#onStompError}.
117 */
118 public onStompError?: frameCallbackType;
119
120 /**
121 * See [Client#onWebSocketClose]{@link Client#onWebSocketClose}.
122 */
123 public onWebSocketClose?: closeEventCallbackType;
124
125 /**
126 * See [Client#onWebSocketError]{@link Client#onWebSocketError}.
127 */
128 public onWebSocketError?: wsErrorCallbackType;
129
130 /**
131 * See [Client#logRawCommunication]{@link Client#logRawCommunication}.
132 */
133 public logRawCommunication?: boolean;
134
135 /**
136 * See [Client#debug]{@link Client#debug}.
137 */
138 public debug?: debugFnType;
139
140 /**
141 * See [Client#discardWebsocketOnCommFailure]{@link Client#discardWebsocketOnCommFailure}.
142 */
143 public discardWebsocketOnCommFailure?: boolean;
144
145 /**
146 * See [Client#onChangeState]{@link Client#onChangeState}.
147 */
148 public onChangeState?: (state: ActivationState) => void;
149}