@ngxs/websocket-plugin 3.7.4 → 3.7.5-dev.master-887cc32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bundles/ngxs-websocket-plugin.umd.js +615 -615
- package/bundles/ngxs-websocket-plugin.umd.js.map +1 -1
- package/bundles/ngxs-websocket-plugin.umd.min.js.map +1 -1
- package/esm2015/index.js +9 -9
- package/esm2015/ngxs-websocket-plugin.js +11 -11
- package/esm2015/src/public_api.js +7 -7
- package/esm2015/src/symbols.js +197 -197
- package/esm2015/src/websocket-handler.js +245 -245
- package/esm2015/src/websocket.module.js +62 -62
- package/esm5/index.js +9 -9
- package/esm5/ngxs-websocket-plugin.js +11 -11
- package/esm5/src/public_api.js +7 -7
- package/esm5/src/symbols.js +293 -293
- package/esm5/src/websocket-handler.js +304 -304
- package/esm5/src/websocket.module.js +71 -71
- package/fesm2015/ngxs-websocket-plugin.js +498 -498
- package/fesm2015/ngxs-websocket-plugin.js.map +1 -1
- package/fesm5/ngxs-websocket-plugin.js +624 -624
- package/fesm5/ngxs-websocket-plugin.js.map +1 -1
- package/index.d.ts +4 -4
- package/ngxs-websocket-plugin.d.ts +7 -7
- package/package.json +2 -2
- package/src/public_api.d.ts +2 -2
- package/src/symbols.d.ts +100 -100
- package/src/websocket-handler.d.ts +34 -34
- package/src/websocket.module.d.ts +16 -16
- package/tests/typings.d.ts +18 -18
package/esm5/src/symbols.js
CHANGED
|
@@ -1,293 +1,293 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { InjectionToken } from '@angular/core';
|
|
7
|
-
/** @type {?} */
|
|
8
|
-
export var NGXS_WEBSOCKET_OPTIONS = new InjectionToken('NGXS_WEBSOCKET_OPTIONS');
|
|
9
|
-
/**
|
|
10
|
-
* @record
|
|
11
|
-
*/
|
|
12
|
-
export function NgxsWebsocketPluginOptions() { }
|
|
13
|
-
if (false) {
|
|
14
|
-
/**
|
|
15
|
-
* URL of the websocket.
|
|
16
|
-
* @type {?|undefined}
|
|
17
|
-
*/
|
|
18
|
-
NgxsWebsocketPluginOptions.prototype.url;
|
|
19
|
-
/**
|
|
20
|
-
* Either a single protocol string or an array of protocol strings.
|
|
21
|
-
* These strings are used to indicate sub-protocols, so that a single server
|
|
22
|
-
* can implement multiple WebSocket sub-protocols (for example, you might want one server to be able
|
|
23
|
-
* to handle different types of interactions depending on the specified protocol).
|
|
24
|
-
* If you don't specify a protocol string, an empty string is assumed.
|
|
25
|
-
* @type {?|undefined}
|
|
26
|
-
*/
|
|
27
|
-
NgxsWebsocketPluginOptions.prototype.protocol;
|
|
28
|
-
/**
|
|
29
|
-
* Sets the `binaryType` property of the underlying WebSocket.
|
|
30
|
-
* @type {?|undefined}
|
|
31
|
-
*/
|
|
32
|
-
NgxsWebsocketPluginOptions.prototype.binaryType;
|
|
33
|
-
/**
|
|
34
|
-
* The property name to distigunish this type for the store.
|
|
35
|
-
* Default: 'type'
|
|
36
|
-
* @type {?|undefined}
|
|
37
|
-
*/
|
|
38
|
-
NgxsWebsocketPluginOptions.prototype.typeKey;
|
|
39
|
-
/**
|
|
40
|
-
* Interval to try and reconnect.
|
|
41
|
-
* Default: 5000
|
|
42
|
-
* @type {?|undefined}
|
|
43
|
-
*/
|
|
44
|
-
NgxsWebsocketPluginOptions.prototype.reconnectInterval;
|
|
45
|
-
/**
|
|
46
|
-
* Number of reconnect attemps.
|
|
47
|
-
* Default: 10
|
|
48
|
-
* @type {?|undefined}
|
|
49
|
-
*/
|
|
50
|
-
NgxsWebsocketPluginOptions.prototype.reconnectAttempts;
|
|
51
|
-
/**
|
|
52
|
-
* Serializer to call before sending messages
|
|
53
|
-
* Default: `json.stringify`
|
|
54
|
-
* @type {?|undefined}
|
|
55
|
-
*/
|
|
56
|
-
NgxsWebsocketPluginOptions.prototype.serializer;
|
|
57
|
-
/**
|
|
58
|
-
* Deseralizer before publishing the message.
|
|
59
|
-
* @type {?|undefined}
|
|
60
|
-
*/
|
|
61
|
-
NgxsWebsocketPluginOptions.prototype.deserializer;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* @param {...?} _args
|
|
65
|
-
* @return {?}
|
|
66
|
-
*/
|
|
67
|
-
export function noop() {
|
|
68
|
-
var _args = [];
|
|
69
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
70
|
-
_args[_i] = arguments[_i];
|
|
71
|
-
}
|
|
72
|
-
return (/**
|
|
73
|
-
* @return {?}
|
|
74
|
-
*/
|
|
75
|
-
function () { });
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Action to connect to the websocket. Optionally pass a URL.
|
|
79
|
-
*/
|
|
80
|
-
var /**
|
|
81
|
-
* Action to connect to the websocket. Optionally pass a URL.
|
|
82
|
-
*/
|
|
83
|
-
ConnectWebSocket = /** @class */ (function () {
|
|
84
|
-
function ConnectWebSocket(payload) {
|
|
85
|
-
this.payload = payload;
|
|
86
|
-
}
|
|
87
|
-
Object.defineProperty(ConnectWebSocket, "type", {
|
|
88
|
-
get: /**
|
|
89
|
-
* @return {?}
|
|
90
|
-
*/
|
|
91
|
-
function () {
|
|
92
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
93
|
-
return '[WebSocket] Connect';
|
|
94
|
-
},
|
|
95
|
-
enumerable: true,
|
|
96
|
-
configurable: true
|
|
97
|
-
});
|
|
98
|
-
return ConnectWebSocket;
|
|
99
|
-
}());
|
|
100
|
-
/**
|
|
101
|
-
* Action to connect to the websocket. Optionally pass a URL.
|
|
102
|
-
*/
|
|
103
|
-
export { ConnectWebSocket };
|
|
104
|
-
if (false) {
|
|
105
|
-
/** @type {?} */
|
|
106
|
-
ConnectWebSocket.prototype.payload;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Action triggered when a error ocurrs
|
|
110
|
-
*/
|
|
111
|
-
var /**
|
|
112
|
-
* Action triggered when a error ocurrs
|
|
113
|
-
*/
|
|
114
|
-
WebsocketMessageError = /** @class */ (function () {
|
|
115
|
-
function WebsocketMessageError(payload) {
|
|
116
|
-
this.payload = payload;
|
|
117
|
-
}
|
|
118
|
-
Object.defineProperty(WebsocketMessageError, "type", {
|
|
119
|
-
get: /**
|
|
120
|
-
* @return {?}
|
|
121
|
-
*/
|
|
122
|
-
function () {
|
|
123
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
124
|
-
return '[WebSocket] Message Error';
|
|
125
|
-
},
|
|
126
|
-
enumerable: true,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
return WebsocketMessageError;
|
|
130
|
-
}());
|
|
131
|
-
/**
|
|
132
|
-
* Action triggered when a error ocurrs
|
|
133
|
-
*/
|
|
134
|
-
export { WebsocketMessageError };
|
|
135
|
-
if (false) {
|
|
136
|
-
/** @type {?} */
|
|
137
|
-
WebsocketMessageError.prototype.payload;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Action to disconnect the websocket.
|
|
141
|
-
*/
|
|
142
|
-
var /**
|
|
143
|
-
* Action to disconnect the websocket.
|
|
144
|
-
*/
|
|
145
|
-
DisconnectWebSocket = /** @class */ (function () {
|
|
146
|
-
function DisconnectWebSocket() {
|
|
147
|
-
}
|
|
148
|
-
Object.defineProperty(DisconnectWebSocket, "type", {
|
|
149
|
-
get: /**
|
|
150
|
-
* @return {?}
|
|
151
|
-
*/
|
|
152
|
-
function () {
|
|
153
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
154
|
-
return '[WebSocket] Disconnect';
|
|
155
|
-
},
|
|
156
|
-
enumerable: true,
|
|
157
|
-
configurable: true
|
|
158
|
-
});
|
|
159
|
-
return DisconnectWebSocket;
|
|
160
|
-
}());
|
|
161
|
-
/**
|
|
162
|
-
* Action to disconnect the websocket.
|
|
163
|
-
*/
|
|
164
|
-
export { DisconnectWebSocket };
|
|
165
|
-
/**
|
|
166
|
-
* Action triggered when websocket is connected
|
|
167
|
-
*/
|
|
168
|
-
var /**
|
|
169
|
-
* Action triggered when websocket is connected
|
|
170
|
-
*/
|
|
171
|
-
WebSocketConnected = /** @class */ (function () {
|
|
172
|
-
function WebSocketConnected() {
|
|
173
|
-
}
|
|
174
|
-
Object.defineProperty(WebSocketConnected, "type", {
|
|
175
|
-
get: /**
|
|
176
|
-
* @return {?}
|
|
177
|
-
*/
|
|
178
|
-
function () {
|
|
179
|
-
return '[WebSocket] Connected';
|
|
180
|
-
},
|
|
181
|
-
enumerable: true,
|
|
182
|
-
configurable: true
|
|
183
|
-
});
|
|
184
|
-
return WebSocketConnected;
|
|
185
|
-
}());
|
|
186
|
-
/**
|
|
187
|
-
* Action triggered when websocket is connected
|
|
188
|
-
*/
|
|
189
|
-
export { WebSocketConnected };
|
|
190
|
-
/**
|
|
191
|
-
* Action triggered when websocket is disconnected
|
|
192
|
-
*/
|
|
193
|
-
var /**
|
|
194
|
-
* Action triggered when websocket is disconnected
|
|
195
|
-
*/
|
|
196
|
-
WebSocketDisconnected = /** @class */ (function () {
|
|
197
|
-
function WebSocketDisconnected() {
|
|
198
|
-
}
|
|
199
|
-
Object.defineProperty(WebSocketDisconnected, "type", {
|
|
200
|
-
get: /**
|
|
201
|
-
* @return {?}
|
|
202
|
-
*/
|
|
203
|
-
function () {
|
|
204
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
205
|
-
return '[WebSocket] Disconnected';
|
|
206
|
-
},
|
|
207
|
-
enumerable: true,
|
|
208
|
-
configurable: true
|
|
209
|
-
});
|
|
210
|
-
return WebSocketDisconnected;
|
|
211
|
-
}());
|
|
212
|
-
/**
|
|
213
|
-
* Action triggered when websocket is disconnected
|
|
214
|
-
*/
|
|
215
|
-
export { WebSocketDisconnected };
|
|
216
|
-
/**
|
|
217
|
-
* Action to send to the server.
|
|
218
|
-
*/
|
|
219
|
-
var /**
|
|
220
|
-
* Action to send to the server.
|
|
221
|
-
*/
|
|
222
|
-
SendWebSocketMessage = /** @class */ (function () {
|
|
223
|
-
function SendWebSocketMessage(payload) {
|
|
224
|
-
this.payload = payload;
|
|
225
|
-
}
|
|
226
|
-
Object.defineProperty(SendWebSocketMessage, "type", {
|
|
227
|
-
get: /**
|
|
228
|
-
* @return {?}
|
|
229
|
-
*/
|
|
230
|
-
function () {
|
|
231
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
232
|
-
return '[WebSocket] Send Message';
|
|
233
|
-
},
|
|
234
|
-
enumerable: true,
|
|
235
|
-
configurable: true
|
|
236
|
-
});
|
|
237
|
-
return SendWebSocketMessage;
|
|
238
|
-
}());
|
|
239
|
-
/**
|
|
240
|
-
* Action to send to the server.
|
|
241
|
-
*/
|
|
242
|
-
export { SendWebSocketMessage };
|
|
243
|
-
if (false) {
|
|
244
|
-
/** @type {?} */
|
|
245
|
-
SendWebSocketMessage.prototype.payload;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Action dispatched when the user tries to connect if the connection already exists.
|
|
249
|
-
*/
|
|
250
|
-
var /**
|
|
251
|
-
* Action dispatched when the user tries to connect if the connection already exists.
|
|
252
|
-
*/
|
|
253
|
-
WebSocketConnectionUpdated = /** @class */ (function () {
|
|
254
|
-
function WebSocketConnectionUpdated() {
|
|
255
|
-
}
|
|
256
|
-
Object.defineProperty(WebSocketConnectionUpdated, "type", {
|
|
257
|
-
get: /**
|
|
258
|
-
* @return {?}
|
|
259
|
-
*/
|
|
260
|
-
function () {
|
|
261
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
262
|
-
return '[WebSocket] Connection Updated';
|
|
263
|
-
},
|
|
264
|
-
enumerable: true,
|
|
265
|
-
configurable: true
|
|
266
|
-
});
|
|
267
|
-
return WebSocketConnectionUpdated;
|
|
268
|
-
}());
|
|
269
|
-
/**
|
|
270
|
-
* Action dispatched when the user tries to connect if the connection already exists.
|
|
271
|
-
*/
|
|
272
|
-
export { WebSocketConnectionUpdated };
|
|
273
|
-
/**
|
|
274
|
-
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
275
|
-
* on the message that came from the server side socket
|
|
276
|
-
*/
|
|
277
|
-
var /**
|
|
278
|
-
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
279
|
-
* on the message that came from the server side socket
|
|
280
|
-
*/
|
|
281
|
-
TypeKeyPropertyMissingError = /** @class */ (function (_super) {
|
|
282
|
-
tslib_1.__extends(TypeKeyPropertyMissingError, _super);
|
|
283
|
-
function TypeKeyPropertyMissingError(typeKey) {
|
|
284
|
-
return _super.call(this, "Property " + typeKey + " is missing on the socket message") || this;
|
|
285
|
-
}
|
|
286
|
-
return TypeKeyPropertyMissingError;
|
|
287
|
-
}(Error));
|
|
288
|
-
/**
|
|
289
|
-
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
290
|
-
* on the message that came from the server side socket
|
|
291
|
-
*/
|
|
292
|
-
export { TypeKeyPropertyMissingError };
|
|
293
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview added by tsickle
|
|
3
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
+
*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { InjectionToken } from '@angular/core';
|
|
7
|
+
/** @type {?} */
|
|
8
|
+
export var NGXS_WEBSOCKET_OPTIONS = new InjectionToken('NGXS_WEBSOCKET_OPTIONS');
|
|
9
|
+
/**
|
|
10
|
+
* @record
|
|
11
|
+
*/
|
|
12
|
+
export function NgxsWebsocketPluginOptions() { }
|
|
13
|
+
if (false) {
|
|
14
|
+
/**
|
|
15
|
+
* URL of the websocket.
|
|
16
|
+
* @type {?|undefined}
|
|
17
|
+
*/
|
|
18
|
+
NgxsWebsocketPluginOptions.prototype.url;
|
|
19
|
+
/**
|
|
20
|
+
* Either a single protocol string or an array of protocol strings.
|
|
21
|
+
* These strings are used to indicate sub-protocols, so that a single server
|
|
22
|
+
* can implement multiple WebSocket sub-protocols (for example, you might want one server to be able
|
|
23
|
+
* to handle different types of interactions depending on the specified protocol).
|
|
24
|
+
* If you don't specify a protocol string, an empty string is assumed.
|
|
25
|
+
* @type {?|undefined}
|
|
26
|
+
*/
|
|
27
|
+
NgxsWebsocketPluginOptions.prototype.protocol;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the `binaryType` property of the underlying WebSocket.
|
|
30
|
+
* @type {?|undefined}
|
|
31
|
+
*/
|
|
32
|
+
NgxsWebsocketPluginOptions.prototype.binaryType;
|
|
33
|
+
/**
|
|
34
|
+
* The property name to distigunish this type for the store.
|
|
35
|
+
* Default: 'type'
|
|
36
|
+
* @type {?|undefined}
|
|
37
|
+
*/
|
|
38
|
+
NgxsWebsocketPluginOptions.prototype.typeKey;
|
|
39
|
+
/**
|
|
40
|
+
* Interval to try and reconnect.
|
|
41
|
+
* Default: 5000
|
|
42
|
+
* @type {?|undefined}
|
|
43
|
+
*/
|
|
44
|
+
NgxsWebsocketPluginOptions.prototype.reconnectInterval;
|
|
45
|
+
/**
|
|
46
|
+
* Number of reconnect attemps.
|
|
47
|
+
* Default: 10
|
|
48
|
+
* @type {?|undefined}
|
|
49
|
+
*/
|
|
50
|
+
NgxsWebsocketPluginOptions.prototype.reconnectAttempts;
|
|
51
|
+
/**
|
|
52
|
+
* Serializer to call before sending messages
|
|
53
|
+
* Default: `json.stringify`
|
|
54
|
+
* @type {?|undefined}
|
|
55
|
+
*/
|
|
56
|
+
NgxsWebsocketPluginOptions.prototype.serializer;
|
|
57
|
+
/**
|
|
58
|
+
* Deseralizer before publishing the message.
|
|
59
|
+
* @type {?|undefined}
|
|
60
|
+
*/
|
|
61
|
+
NgxsWebsocketPluginOptions.prototype.deserializer;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @param {...?} _args
|
|
65
|
+
* @return {?}
|
|
66
|
+
*/
|
|
67
|
+
export function noop() {
|
|
68
|
+
var _args = [];
|
|
69
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
70
|
+
_args[_i] = arguments[_i];
|
|
71
|
+
}
|
|
72
|
+
return (/**
|
|
73
|
+
* @return {?}
|
|
74
|
+
*/
|
|
75
|
+
function () { });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Action to connect to the websocket. Optionally pass a URL.
|
|
79
|
+
*/
|
|
80
|
+
var /**
|
|
81
|
+
* Action to connect to the websocket. Optionally pass a URL.
|
|
82
|
+
*/
|
|
83
|
+
ConnectWebSocket = /** @class */ (function () {
|
|
84
|
+
function ConnectWebSocket(payload) {
|
|
85
|
+
this.payload = payload;
|
|
86
|
+
}
|
|
87
|
+
Object.defineProperty(ConnectWebSocket, "type", {
|
|
88
|
+
get: /**
|
|
89
|
+
* @return {?}
|
|
90
|
+
*/
|
|
91
|
+
function () {
|
|
92
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
93
|
+
return '[WebSocket] Connect';
|
|
94
|
+
},
|
|
95
|
+
enumerable: true,
|
|
96
|
+
configurable: true
|
|
97
|
+
});
|
|
98
|
+
return ConnectWebSocket;
|
|
99
|
+
}());
|
|
100
|
+
/**
|
|
101
|
+
* Action to connect to the websocket. Optionally pass a URL.
|
|
102
|
+
*/
|
|
103
|
+
export { ConnectWebSocket };
|
|
104
|
+
if (false) {
|
|
105
|
+
/** @type {?} */
|
|
106
|
+
ConnectWebSocket.prototype.payload;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Action triggered when a error ocurrs
|
|
110
|
+
*/
|
|
111
|
+
var /**
|
|
112
|
+
* Action triggered when a error ocurrs
|
|
113
|
+
*/
|
|
114
|
+
WebsocketMessageError = /** @class */ (function () {
|
|
115
|
+
function WebsocketMessageError(payload) {
|
|
116
|
+
this.payload = payload;
|
|
117
|
+
}
|
|
118
|
+
Object.defineProperty(WebsocketMessageError, "type", {
|
|
119
|
+
get: /**
|
|
120
|
+
* @return {?}
|
|
121
|
+
*/
|
|
122
|
+
function () {
|
|
123
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
124
|
+
return '[WebSocket] Message Error';
|
|
125
|
+
},
|
|
126
|
+
enumerable: true,
|
|
127
|
+
configurable: true
|
|
128
|
+
});
|
|
129
|
+
return WebsocketMessageError;
|
|
130
|
+
}());
|
|
131
|
+
/**
|
|
132
|
+
* Action triggered when a error ocurrs
|
|
133
|
+
*/
|
|
134
|
+
export { WebsocketMessageError };
|
|
135
|
+
if (false) {
|
|
136
|
+
/** @type {?} */
|
|
137
|
+
WebsocketMessageError.prototype.payload;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Action to disconnect the websocket.
|
|
141
|
+
*/
|
|
142
|
+
var /**
|
|
143
|
+
* Action to disconnect the websocket.
|
|
144
|
+
*/
|
|
145
|
+
DisconnectWebSocket = /** @class */ (function () {
|
|
146
|
+
function DisconnectWebSocket() {
|
|
147
|
+
}
|
|
148
|
+
Object.defineProperty(DisconnectWebSocket, "type", {
|
|
149
|
+
get: /**
|
|
150
|
+
* @return {?}
|
|
151
|
+
*/
|
|
152
|
+
function () {
|
|
153
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
154
|
+
return '[WebSocket] Disconnect';
|
|
155
|
+
},
|
|
156
|
+
enumerable: true,
|
|
157
|
+
configurable: true
|
|
158
|
+
});
|
|
159
|
+
return DisconnectWebSocket;
|
|
160
|
+
}());
|
|
161
|
+
/**
|
|
162
|
+
* Action to disconnect the websocket.
|
|
163
|
+
*/
|
|
164
|
+
export { DisconnectWebSocket };
|
|
165
|
+
/**
|
|
166
|
+
* Action triggered when websocket is connected
|
|
167
|
+
*/
|
|
168
|
+
var /**
|
|
169
|
+
* Action triggered when websocket is connected
|
|
170
|
+
*/
|
|
171
|
+
WebSocketConnected = /** @class */ (function () {
|
|
172
|
+
function WebSocketConnected() {
|
|
173
|
+
}
|
|
174
|
+
Object.defineProperty(WebSocketConnected, "type", {
|
|
175
|
+
get: /**
|
|
176
|
+
* @return {?}
|
|
177
|
+
*/
|
|
178
|
+
function () {
|
|
179
|
+
return '[WebSocket] Connected';
|
|
180
|
+
},
|
|
181
|
+
enumerable: true,
|
|
182
|
+
configurable: true
|
|
183
|
+
});
|
|
184
|
+
return WebSocketConnected;
|
|
185
|
+
}());
|
|
186
|
+
/**
|
|
187
|
+
* Action triggered when websocket is connected
|
|
188
|
+
*/
|
|
189
|
+
export { WebSocketConnected };
|
|
190
|
+
/**
|
|
191
|
+
* Action triggered when websocket is disconnected
|
|
192
|
+
*/
|
|
193
|
+
var /**
|
|
194
|
+
* Action triggered when websocket is disconnected
|
|
195
|
+
*/
|
|
196
|
+
WebSocketDisconnected = /** @class */ (function () {
|
|
197
|
+
function WebSocketDisconnected() {
|
|
198
|
+
}
|
|
199
|
+
Object.defineProperty(WebSocketDisconnected, "type", {
|
|
200
|
+
get: /**
|
|
201
|
+
* @return {?}
|
|
202
|
+
*/
|
|
203
|
+
function () {
|
|
204
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
205
|
+
return '[WebSocket] Disconnected';
|
|
206
|
+
},
|
|
207
|
+
enumerable: true,
|
|
208
|
+
configurable: true
|
|
209
|
+
});
|
|
210
|
+
return WebSocketDisconnected;
|
|
211
|
+
}());
|
|
212
|
+
/**
|
|
213
|
+
* Action triggered when websocket is disconnected
|
|
214
|
+
*/
|
|
215
|
+
export { WebSocketDisconnected };
|
|
216
|
+
/**
|
|
217
|
+
* Action to send to the server.
|
|
218
|
+
*/
|
|
219
|
+
var /**
|
|
220
|
+
* Action to send to the server.
|
|
221
|
+
*/
|
|
222
|
+
SendWebSocketMessage = /** @class */ (function () {
|
|
223
|
+
function SendWebSocketMessage(payload) {
|
|
224
|
+
this.payload = payload;
|
|
225
|
+
}
|
|
226
|
+
Object.defineProperty(SendWebSocketMessage, "type", {
|
|
227
|
+
get: /**
|
|
228
|
+
* @return {?}
|
|
229
|
+
*/
|
|
230
|
+
function () {
|
|
231
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
232
|
+
return '[WebSocket] Send Message';
|
|
233
|
+
},
|
|
234
|
+
enumerable: true,
|
|
235
|
+
configurable: true
|
|
236
|
+
});
|
|
237
|
+
return SendWebSocketMessage;
|
|
238
|
+
}());
|
|
239
|
+
/**
|
|
240
|
+
* Action to send to the server.
|
|
241
|
+
*/
|
|
242
|
+
export { SendWebSocketMessage };
|
|
243
|
+
if (false) {
|
|
244
|
+
/** @type {?} */
|
|
245
|
+
SendWebSocketMessage.prototype.payload;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Action dispatched when the user tries to connect if the connection already exists.
|
|
249
|
+
*/
|
|
250
|
+
var /**
|
|
251
|
+
* Action dispatched when the user tries to connect if the connection already exists.
|
|
252
|
+
*/
|
|
253
|
+
WebSocketConnectionUpdated = /** @class */ (function () {
|
|
254
|
+
function WebSocketConnectionUpdated() {
|
|
255
|
+
}
|
|
256
|
+
Object.defineProperty(WebSocketConnectionUpdated, "type", {
|
|
257
|
+
get: /**
|
|
258
|
+
* @return {?}
|
|
259
|
+
*/
|
|
260
|
+
function () {
|
|
261
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
262
|
+
return '[WebSocket] Connection Updated';
|
|
263
|
+
},
|
|
264
|
+
enumerable: true,
|
|
265
|
+
configurable: true
|
|
266
|
+
});
|
|
267
|
+
return WebSocketConnectionUpdated;
|
|
268
|
+
}());
|
|
269
|
+
/**
|
|
270
|
+
* Action dispatched when the user tries to connect if the connection already exists.
|
|
271
|
+
*/
|
|
272
|
+
export { WebSocketConnectionUpdated };
|
|
273
|
+
/**
|
|
274
|
+
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
275
|
+
* on the message that came from the server side socket
|
|
276
|
+
*/
|
|
277
|
+
var /**
|
|
278
|
+
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
279
|
+
* on the message that came from the server side socket
|
|
280
|
+
*/
|
|
281
|
+
TypeKeyPropertyMissingError = /** @class */ (function (_super) {
|
|
282
|
+
tslib_1.__extends(TypeKeyPropertyMissingError, _super);
|
|
283
|
+
function TypeKeyPropertyMissingError(typeKey) {
|
|
284
|
+
return _super.call(this, "Property " + typeKey + " is missing on the socket message") || this;
|
|
285
|
+
}
|
|
286
|
+
return TypeKeyPropertyMissingError;
|
|
287
|
+
}(Error));
|
|
288
|
+
/**
|
|
289
|
+
* This error is thrown where there is no `type` (or custom `typeKey`) property
|
|
290
|
+
* on the message that came from the server side socket
|
|
291
|
+
*/
|
|
292
|
+
export { TypeKeyPropertyMissingError };
|
|
293
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3hzL3dlYnNvY2tldC1wbHVnaW4vIiwic291cmNlcyI6WyJzcmMvc3ltYm9scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBRS9DLE1BQU0sS0FBTyxzQkFBc0IsR0FBRyxJQUFJLGNBQWMsQ0FBQyx3QkFBd0IsQ0FBQzs7OztBQUVsRixnREFnRE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