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