@itee/client 10.0.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +251 -0
  2. package/LICENSE.md +23 -0
  3. package/README.md +76 -0
  4. package/builds/itee-client.cjs.js +6517 -0
  5. package/builds/itee-client.cjs.js.map +1 -0
  6. package/builds/itee-client.cjs.min.js +125 -0
  7. package/builds/itee-client.esm.js +6468 -0
  8. package/builds/itee-client.esm.js.map +1 -0
  9. package/builds/itee-client.esm.min.js +124 -0
  10. package/builds/itee-client.iife.js +6524 -0
  11. package/builds/itee-client.iife.js.map +1 -0
  12. package/builds/itee-client.iife.min.js +125 -0
  13. package/package.json +87 -0
  14. package/sources/client.js +14 -0
  15. package/sources/cores/TAbstractFactory.js +42 -0
  16. package/sources/cores/TCloningFactory.js +39 -0
  17. package/sources/cores/TConstants.js +433 -0
  18. package/sources/cores/TInstancingFactory.js +41 -0
  19. package/sources/cores/TStore.js +303 -0
  20. package/sources/cores/_cores.js +13 -0
  21. package/sources/input_devices/TKeyboardController.js +158 -0
  22. package/sources/input_devices/TMouseController.js +31 -0
  23. package/sources/input_devices/_inputDevices.js +11 -0
  24. package/sources/loaders/TBinaryConverter.js +35 -0
  25. package/sources/loaders/TBinaryReader.js +1029 -0
  26. package/sources/loaders/TBinarySerializer.js +258 -0
  27. package/sources/loaders/TBinaryWriter.js +429 -0
  28. package/sources/loaders/_loaders.js +21 -0
  29. package/sources/loaders/converters/ArrayBinaryConverter.js +33 -0
  30. package/sources/loaders/converters/BooleanBinaryConverter.js +24 -0
  31. package/sources/loaders/converters/DateBinaryConverter.js +21 -0
  32. package/sources/loaders/converters/NullBinaryConverter.js +13 -0
  33. package/sources/loaders/converters/NumberBinaryConverter.js +15 -0
  34. package/sources/loaders/converters/ObjectBinaryConverter.js +101 -0
  35. package/sources/loaders/converters/RegExBinaryConverter.js +11 -0
  36. package/sources/loaders/converters/StringBinaryConverter.js +26 -0
  37. package/sources/loaders/converters/UndefinedBinaryConverter.js +13 -0
  38. package/sources/managers/TDataBaseManager.js +1649 -0
  39. package/sources/managers/_managers.js +10 -0
  40. package/sources/utils/TIdFactory.js +84 -0
  41. package/sources/utils/_utils.js +9 -0
  42. package/sources/webapis/WebAPI.js +773 -0
  43. package/sources/webapis/WebAPIOrigin.js +141 -0
  44. package/sources/webapis/_webapis.js +10 -0
  45. package/sources/webapis/messages/WebAPIMessage.js +75 -0
  46. package/sources/webapis/messages/WebAPIMessageData.js +51 -0
  47. package/sources/webapis/messages/WebAPIMessageError.js +79 -0
  48. package/sources/webapis/messages/WebAPIMessageEvent.js +58 -0
  49. package/sources/webapis/messages/WebAPIMessageProgress.js +91 -0
  50. package/sources/webapis/messages/WebAPIMessageReady.js +66 -0
  51. package/sources/webapis/messages/WebAPIMessageRequest.js +94 -0
  52. package/sources/webapis/messages/WebAPIMessageResponse.js +80 -0
  53. package/sources/webapis/messages/_messages.js +16 -0
  54. package/sources/workers/AbstractWorker.js +149 -0
  55. package/sources/workers/_workers.js +10 -0
  56. package/sources/workers/messages/WorkerMessage.js +33 -0
  57. package/sources/workers/messages/WorkerMessageData.js +30 -0
  58. package/sources/workers/messages/WorkerMessageError.js +32 -0
  59. package/sources/workers/messages/WorkerMessageMethodCall.js +60 -0
  60. package/sources/workers/messages/WorkerMessageProgress.js +67 -0
  61. package/sources/workers/messages/_messages.js +14 -0
@@ -0,0 +1,433 @@
1
+ /**
2
+ * A freezed javascript object used like an enum.
3
+ * @typedef {object} Enum
4
+ * @constant
5
+ * @example
6
+ * var Meal = toEnum( {
7
+ * Food: 'Tartiflette',
8
+ * Drink: 'Saint-Emilion',
9
+ * Dessert: 'Mousse au chocolat'
10
+ * } )
11
+ *
12
+ * if( Foo.includes('Tartiflette') {
13
+ * // Happy
14
+ * }
15
+ *
16
+ * var myDrink = 'coke'
17
+ * if( myDrink === Meal.Drink ) {
18
+ *
19
+ * } else {
20
+ * // Your life is a pain
21
+ * }
22
+ *
23
+ * var MealTypes = Meal.types
24
+ * // ['Tartiflette', 'Saint-Emilion', 'Mousse au chocolat' ]
25
+ *
26
+ */
27
+ import { toEnum } from '@itee/utils'
28
+
29
+ /**
30
+ * @typedef {Enum} FileFormat
31
+ * @property {String} Asc="asc" - The ascii file format
32
+ * @property {String} Dae="dae" - The dae file format
33
+ * @property {String} Dbf="dbf" - The dbf file format
34
+ * @property {String} Fbx="fbx" - The fbx file format
35
+ * @property {String} Mtl="mtl" - The material file format
36
+ * @property {String} Json="json" - The json file format
37
+ * @property {String} Obj="obj" - The object file format
38
+ * @property {String} Shp="shp" - The shape file format
39
+ * @property {String} Stl="stl" - The stereolithographie file format
40
+ *
41
+ * @constant
42
+ * @type {FileFormat}
43
+ * @description The FileFormat Enum give some commonly used file format in 3d context
44
+ */
45
+ const FileFormat = /*#__PURE__*/toEnum( {
46
+ Asc: { value: 'asc' },
47
+ Dae: { value: 'dae' },
48
+ Dbf: { value: 'dbf' },
49
+ Fbx: { value: 'fbx' },
50
+ Mtl: { value: 'mtl' },
51
+ Json: { value: 'json' },
52
+ Obj: { value: 'obj' },
53
+ Shp: { value: 'shp' },
54
+ Stl: { value: 'stl' }
55
+ } )
56
+
57
+ /**
58
+ * @typedef {Enum} HttpStatusCode
59
+ * @property {number} Continue=100 - Waiting for the continuation of the request.
60
+ * @property {number} SwitchingProtocols=101 - The requester has asked the server to switch protocols and the server has agreed to do so.
61
+ * @property {number} Processing=102 - WebDAV: Processing in progress (prevents the client from exceeding the limited waiting time).
62
+ * @property {number} Ok=200 - Query successfully processed.
63
+ * @property {number} Created=201 - Query successfully processed and a document was created.
64
+ * @property {number} Accepted=202 - Query processed, but without guarantee of result.
65
+ * @property {number} NonAuthoritativeInformation=203 - Information returned, but generated by an uncertified source.
66
+ * @property {number} NoContent=204 - Query successfully processed but no information returned.
67
+ * @property {number} ResetContent=205 - Query successfully processed, the current page can be cleared.
68
+ * @property {number} PartialContent=206 - Only part of the resource has been transmitted.
69
+ * @property {number} MultiStatus=207 - WebDAV: Multiple Response.
70
+ * @property {number} AlreadyReported=208 - WebDAV: The document was previously sent to this collection.
71
+ * @property {number} ContentDifferent=210 - WebDAV: The copy of the client-side resource differs from that of the server (content or properties).
72
+ * @property {number} IMUsed=226 - The server has completed the request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the
73
+ * current instance.
74
+ * @property {number} MultipleChoices=300 - The requested URI refers to multiple resources.
75
+ * @property {number} MovedPermanently=301 - Document moved permanently.
76
+ * @property {number} Found=302 - Document moved temporarily.
77
+ * @property {number} SeeOther=303 - The answer to this query is elsewhere.
78
+ * @property {number} NotModified=304 - Document not modified since the last request.
79
+ * @property {number} UseProxy=305 - The request must be re-addressed to the proxy.
80
+ * @property {number} Unused=306 - Code used by an older version of RFC 2616, now reserved.
81
+ * @property {number} TemporaryRedirect=307 - The request must be temporarily redirected to the specified URI.
82
+ * @property {number} PermanentRedirect=308 - The request must be redirected permanently to the specified URI.
83
+ * @property {number} TooManyRedirects=310 - The request must be redirected too many times, or is the victim of a redirection loop.
84
+ * @property {number} BadRequest=400 - The syntax of the query is wrong.
85
+ * @property {number} Unauthorized=401 - Authentication is required to access the resource.
86
+ * @property {number} PaymentRequired=402 - Payment required to access the resource.
87
+ * @property {number} Forbidden=403 - The server understood the request, but refuses to execute it. Unlike error 401, authenticating will not make any difference. On servers where authentication is
88
+ * required, this usually means that authentication has been accepted but access rights do not allow the client to access the resource.
89
+ * @property {number} NotFound=404 - Resource not found.
90
+ * @property {number} MethodNotAllowed=405 - Unauthorized request method.
91
+ * @property {number} NotAcceptable=406 - The requested resource is not available in a format that would respect the "Accept" headers of the request.
92
+ * @property {number} ProxyAuthenticationRequired=407 - Access to the authorized resource by identification with the proxy.
93
+ * @property {number} RequestTimeOut=408 - Waiting time for an elapsed client request.
94
+ * @property {number} Conflict=409 - The request can not be processed in the current state.
95
+ * @property {number} Gone=410 - The resource is no longer available and no redirection address is known.
96
+ * @property {number} LengthRequired=411 - The length of the request has not been specified.
97
+ * @property {number} PreconditionFailed=412 - Preconditions sent by the query unverified.
98
+ * @property {number} RequestEntityTooLarge=413 - Abandoned processing due to excessive request
99
+ * @property {number} RequestURITooLong=414 - URI too long
100
+ * @property {number} UnsupportedMediaType=415 - Unsupported query format for a given method and resource.
101
+ * @property {number} RequestRangeUnsatisfiable=416 - Invalid "range" request header fields.
102
+ * @property {number} ExpectationFailed=417 - Expected behavior and defined in the header of the unsatisfactory request.
103
+ * @property {number} ImATeapot=418 - "I am a teapot". This code is defined in RFC 2324 dated April 1, 1998, Hyper Text Coffee Pot Control Protocol.
104
+ * @property {number} BadMapping=421 - The request was sent to a server that is not able to produce a response (for example, because a connection has been reused).
105
+ * @property {number} UnprocessableEntity=422 - WebDAV: The entity provided with the request is incomprehensible or incomplete.
106
+ * @property {number} Locked=423 - WebDAV: The operation can not take place because the resource is locked.
107
+ * @property {number} MethodFailure=424 - WebDAV: A method of the transaction failed.
108
+ * @property {number} UnorderedCollection=425 - WebDAV RFC 3648. This code is defined in the WebDAV Advanced Collections Protocol draft , but is absent from the Web Distributed Authoring and
109
+ * Versioning (WebDAV) Ordered Collections Protocol.
110
+ * @property {number} UpgradeRequired=426 - RFC 2817 The client should change protocol, for example to TLS / 1.0 .
111
+ * @property {number} PreconditionRequired=428 - RFC 6585 The request must be conditional.
112
+ * @property {number} TooManyRequests=429 - RFC 6585 The client has issued too many requests within a given time.
113
+ * @property {number} RequestHeaderFieldsTooLarge=431 - RFC 6585 HTTP headers issued exceed the maximum size allowed by the server.
114
+ * @property {number} NoResponse=444 - Indicates that the server did not return any information to the client and closed the connection.
115
+ * @property {number} RetryWith=449 - Code defined by Microsoft . The request should be returned after performing an action.
116
+ * @property {number} BlockedByWindowsParentalControls=450 - Code defined by Microsoft. This error is generated when Windows Parental Control tools are enabled and block access to the page.
117
+ * @property {number} UnavailableForLegalReasons=451 - This error code indicates that the requested resource is inaccessible for legal reasons
118
+ * @property {number} UnrecoverableError=456 - WebDAV: Fatal error.
119
+ * @property {number} SSLCertificateError=495 - An extension of the 400 Bad Request error, used when the client provided an invalid certificate.
120
+ * @property {number} SSLCertificateRequired=496 - An extension of the 400 Bad Request error, used when a required client certificate is not provided.
121
+ * @property {number} HTTPRequestSentToHTTPSPort=497 - An extension of the 400 Bad Request error, used when the client sends an HTTP request to port 443 normally intended for HTTPS requests.
122
+ * @property {number} ClientClosedRequest=499 - The client closed the connection before receiving the response. This error occurs when the processing is too long on the server side.
123
+ * @property {number} InternalServerError=500 - Internal server error.
124
+ * @property {number} NotImplemented=501 - Functionality claimed not supported by the server.
125
+ * @property {number} BadGateway=502 - Wrong response sent to an intermediate server by another server.
126
+ * @property {number} ServiceUnavailable=503 - Service temporarily unavailable or under maintenance.
127
+ * @property {number} GatewayTimeOut=504 - Waiting time for a response from a server to an intermediate server that has elapsed.
128
+ * @property {number} HTTPVersionNotSupported=505 - HTTP version not managed by the server.
129
+ * @property {number} VariantAlsoNegotiates=506 - RFC 2295: Negotiation Error. Transparent content negociation.
130
+ * @property {number} InsufficientStorage=507 - WebDAV: Insufficient space to modify properties or build the collection.
131
+ * @property {number} LoopDetected=508 - WebDAV: Loop in a Resource Match
132
+ * @property {number} BandwidthLimitExceeded=509 - Used by many servers to indicate a quota overrun.
133
+ * @property {number} NotExtended=510 - RFC 2774: The request does not respect the policy for accessing extended HTTP resources.
134
+ * @property {number} NetworkAuthenticationRequired=511 - RFC 6585: The client must authenticate to access the network. Used by captive portals to redirect clients to the authentication page.
135
+ * @property {number} UnknownError=520 - Error 520 is used as a wildcard response when the origin server returns an unexpected result.
136
+ * @property {number} WebServerIsDown=521 - The server has refused the connection from Cloudflare.
137
+ * @property {number} ConnectionTimedOut=522 - Cloudflare could not negotiate a TCP handshake with the origin server.
138
+ * @property {number} OriginIsUnreachable=523 - Cloudflare failed to reach the origin server. This can occur if DNS server name resolution fails.
139
+ * @property {number} ATimeoutOccured=524 - Cloudflare established a TCP connection with the origin server but did not receive an HTTP response before the login timeout.
140
+ * @property {number} SSLHandshakeFailed=525 - Cloudflare could not negotiate SSL / TLS handshake with the origin server.
141
+ * @property {number} InvalidSSLCertificate=526 - Cloudflare could not validate the SSL certificate presented by the origin server.
142
+ * @property {number} RailgunError=527 - Error 527 indicates that the request has timed out or failed after the WAN connection was established.
143
+ *
144
+ * @constant
145
+ * @type {HttpStatusCode}
146
+ * @description HttpStatusCode contains all http status code available to check and process correctly server response.
147
+ * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} for further information.
148
+ */
149
+ const HttpStatusCode = /*#__PURE__*/toEnum( {
150
+
151
+ // 100
152
+ Continue: { value: 100 },
153
+ SwitchingProtocols: { value: 101 },
154
+ Processing: { value: 102 },
155
+
156
+ // 200
157
+ Ok: { value: 200 },
158
+ Created: { value: 201 },
159
+ Accepted: { value: 202 },
160
+ NonAuthoritativeInformation: { value: 203 },
161
+ NoContent: { value: 204 },
162
+ ResetContent: { value: 205 },
163
+ PartialContent: { value: 206 },
164
+ MultiStatus: { value: 207 },
165
+ AlreadyReported: { value: 208 },
166
+ ContentDifferent: { value: 210 },
167
+ IMUsed: { value: 226 },
168
+
169
+ // 300
170
+ MultipleChoices: { value: 300 },
171
+ MovedPermanently: { value: 301 },
172
+ Found: { value: 302 },
173
+ SeeOther: { value: 303 },
174
+ NotModified: { value: 304 },
175
+ UseProxy: { value: 305 },
176
+ Unused: { value: 306 },
177
+ TemporaryRedirect: { value: 307 },
178
+ PermanentRedirect: { value: 308 },
179
+ TooManyRedirects: { value: 310 },
180
+
181
+ // 400
182
+ BadRequest: { value: 400 },
183
+ Unauthorized: { value: 401 },
184
+ PaymentRequired: { value: 402 },
185
+ Forbidden: { value: 403 },
186
+ NotFound: { value: 404 },
187
+ MethodNotAllowed: { value: 405 },
188
+ NotAcceptable: { value: 406 },
189
+ ProxyAuthenticationRequired: { value: 407 },
190
+ RequestTimeOut: { value: 408 },
191
+ Conflict: { value: 409 },
192
+ Gone: { value: 410 },
193
+ LengthRequired: { value: 411 },
194
+ PreconditionFailed: { value: 412 },
195
+ RequestEntityTooLarge: { value: 413 },
196
+ RequestRangeUnsatisfiable: { value: 416 },
197
+ ExpectationFailed: { value: 417 },
198
+ ImATeapot: { value: 418 },
199
+ BadMapping: { value: 421 },
200
+ UnprocessableEntity: { value: 422 },
201
+ Locked: { value: 423 },
202
+ MethodFailure: { value: 424 },
203
+ UnorderedCollection: { value: 425 },
204
+ UpgradeRequired: { value: 426 },
205
+ PreconditionRequired: { value: 428 },
206
+ TooManyRequests: { value: 429 },
207
+ RequestHeaderFieldsTooLarge: { value: 431 },
208
+ NoResponse: { value: 444 },
209
+ RetryWith: { value: 449 },
210
+ BlockedByWindowsParentalControls: { value: 450 },
211
+ UnavailableForLegalReasons: { value: 451 },
212
+ UnrecoverableError: { value: 456 },
213
+ SSLCertificateError: { value: 495 },
214
+ SSLCertificateRequired: { value: 496 },
215
+ HTTPRequestSentToHTTPSPort: { value: 497 },
216
+ ClientClosedRequest: { value: 499 },
217
+
218
+ // 500
219
+ InternalServerError: { value: 500 },
220
+ NotImplemented: { value: 501 },
221
+ BadGateway: { value: 502 },
222
+ ServiceUnavailable: { value: 503 },
223
+ GatewayTimeOut: { value: 504 },
224
+ HTTPVersionNotSupported: { value: 505 },
225
+ VariantAlsoNegotiates: { value: 506 },
226
+ InsufficientStorage: { value: 507 },
227
+ LoopDetected: { value: 508 },
228
+ BandwidthLimitExceeded: { value: 509 },
229
+ NotExtended: { value: 510 },
230
+ NetworkAuthenticationRequired: { value: 511 },
231
+ UnknownError: { value: 520 },
232
+ WebServerIsDown: { value: 521 },
233
+ ConnectionTimedOut: { value: 522 },
234
+ OriginIsUnreachable: { value: 523 },
235
+ ATimeoutOccured: { value: 524 },
236
+ SSLHandshakeFailed: { value: 525 },
237
+ InvalidSSLCertificate: { value: 526 },
238
+ RailgunError: { value: 527 }
239
+
240
+ } )
241
+
242
+ /**
243
+ * @typedef {Enum} HttpVerb
244
+ * @property {String} Create="PUT" - Corresponding to the create http verb for an itee server, namely "PUT".
245
+ * @property {String} Read="POST" - Corresponding to the read http verb for an itee server, namely "POST".
246
+ * @property {String} Update="PATCH" - Corresponding to the update http verb for an itee server, namely "PATCH".
247
+ * @property {String} Delete="DELETE" - Corresponding to the delete http verb for an itee server, namely "DELETE".
248
+ *
249
+ * @constant
250
+ * @type {HttpVerb}
251
+ * @description HttpVerb contains the CRUD actions with corresponding http verb to request an itee server.
252
+ * @see {@link https://en.wikipedia.org/wiki/Create,_read,_update_and_delete} for further information.
253
+ */
254
+ const HttpVerb = /*#__PURE__*/toEnum( {
255
+ Create: { value: 'PUT' },
256
+ Read: { value: 'POST' },
257
+ Update: { value: 'PATCH' },
258
+ Delete: { value: 'DELETE' }
259
+ } )
260
+
261
+ /**
262
+ * @typedef {Enum} Keys
263
+ * @property {Number} BACKSPACE=8 - The backspace key code
264
+ * @property {Number} TAB=9 - The tab key code
265
+ * @property {Number} ENTER=13 - The enter key code
266
+ * @property {Number} Etc...=* - All the rest
267
+ *
268
+ * @constant
269
+ * @type {Keys}
270
+ * @description Keys contains common keyboard key values, this allow to write semantic code instead of integer when dealing with key codes.
271
+ */
272
+ const Keys = /*#__PURE__*/toEnum( {
273
+ BACKSPACE: { value: 8 },
274
+ TAB: { value: 9 },
275
+ ENTER: { value: 13 },
276
+ SHIFT: { value: 16 },
277
+ CTRL: { value: 17 },
278
+ ALT: { value: 18 },
279
+ PAUSE: { value: 19 },
280
+ CAPS_LOCK: { value: 20 },
281
+ ESCAPE: { value: 27 },
282
+ SPACE: { value: 32 },
283
+ PAGE_UP: { value: 33 },
284
+ PAGE_DOWN: { value: 34 },
285
+ END: { value: 35 },
286
+ HOME: { value: 36 },
287
+ LEFT_ARROW: { value: 37 },
288
+ UP_ARROW: { value: 38 },
289
+ RIGHT_ARROW: { value: 39 },
290
+ DOWN_ARROW: { value: 40 },
291
+ INSERT: { value: 45 },
292
+ DELETE: { value: 46 },
293
+ ZERO: { value: 48 },
294
+ ONE: { value: 49 },
295
+ TWO: { value: 50 },
296
+ THREE: { value: 51 },
297
+ FOUR: { value: 52 },
298
+ FIVE: { value: 53 },
299
+ SIX: { value: 54 },
300
+ SEVEN: { value: 55 },
301
+ HEIGHT: { value: 56 },
302
+ NINE: { value: 57 },
303
+ A: { value: 65 },
304
+ B: { value: 66 },
305
+ C: { value: 67 },
306
+ D: { value: 68 },
307
+ E: { value: 69 },
308
+ F: { value: 70 },
309
+ G: { value: 71 },
310
+ H: { value: 72 },
311
+ I: { value: 73 },
312
+ J: { value: 74 },
313
+ K: { value: 75 },
314
+ L: { value: 76 },
315
+ M: { value: 77 },
316
+ N: { value: 78 },
317
+ O: { value: 79 },
318
+ P: { value: 80 },
319
+ Q: { value: 81 },
320
+ R: { value: 82 },
321
+ S: { value: 83 },
322
+ T: { value: 84 },
323
+ U: { value: 85 },
324
+ V: { value: 86 },
325
+ W: { value: 87 },
326
+ X: { value: 88 },
327
+ Y: { value: 89 },
328
+ Z: { value: 90 },
329
+ LEFT_WINDOW_KEY: { value: 91 },
330
+ RIGHT_WINDOW_KEY: { value: 92 },
331
+ SELECT_KEY: { value: 93 },
332
+ NUMPAD_0: { value: 96 },
333
+ NUMPAD_1: { value: 97 },
334
+ NUMPAD_2: { value: 98 },
335
+ NUMPAD_3: { value: 99 },
336
+ NUMPAD_4: { value: 100 },
337
+ NUMPAD_5: { value: 101 },
338
+ NUMPAD_6: { value: 102 },
339
+ NUMPAD_7: { value: 103 },
340
+ NUMPAD_8: { value: 104 },
341
+ NUMPAD_9: { value: 105 },
342
+ MULTIPLY: { value: 106 },
343
+ ADD: { value: 107 },
344
+ SUBSTRACT: { value: 109 },
345
+ DECIMAL_POINT: { value: 110 },
346
+ DIVIDE: { value: 111 },
347
+ F1: { value: 112 },
348
+ F2: { value: 113 },
349
+ F3: { value: 114 },
350
+ F4: { value: 115 },
351
+ F5: { value: 116 },
352
+ F6: { value: 117 },
353
+ F7: { value: 118 },
354
+ F8: { value: 119 },
355
+ F9: { value: 120 },
356
+ F10: { value: 121 },
357
+ F11: { value: 122 },
358
+ F12: { value: 123 },
359
+ NUM_LOCK: { value: 144 },
360
+ SCROLL_LOCK: { value: 145 },
361
+ SEMICOLON: { value: 186 },
362
+ EQUAL: { value: 187 },
363
+ COMMA: { value: 188 },
364
+ DASH: { value: 189 },
365
+ PERIODE: { value: 190 },
366
+ SLASH: { value: 191 },
367
+ GRAVE_ACCENT: { value: 192 },
368
+ OPEN_SQUARE_BRACKET: { value: 219 },
369
+ BACKSLASH: { value: 220 },
370
+ CLOSE_SQUARE_BRACKET: { value: 221 },
371
+ SINGLE_QUOTE: { value: 222 }
372
+ } )
373
+
374
+ /**
375
+ * @typedef {Enum} MimeType
376
+ * @property {Number} ...
377
+ *
378
+ * @constant
379
+ * @type {MimeType}
380
+ * @description Todo...
381
+ */
382
+ const MimeType = /*#__PURE__*/toEnum( {} )
383
+
384
+ /**
385
+ * @typedef {Enum} Mouse
386
+ * @property {Number} Wheel=-1 - The enter key code
387
+ * @property {Number} Left=0 - The enter key code
388
+ * @property {Number} Middle=1 - The enter key code
389
+ * @property {Number} Right=2 - The enter key code
390
+ *
391
+ * @constant
392
+ * @type {Mouse}
393
+ * @description This Mouse Enum expose 4 common state of mouse button values (Wheel, Left, Middle and Right), this allow to write semantic code instead of integer when dealing with mouse button codes.
394
+ */
395
+ const Mouse = /*#__PURE__*/toEnum( {
396
+ Wheel: { value: -1 },
397
+ Left: { value: 0 },
398
+ Middle: { value: 1 },
399
+ Right: { value: 2 }
400
+ } )
401
+
402
+ /**
403
+ * @typedef {Enum} ResponseType
404
+ * @property {String} ArrayBuffer="arraybuffer" - The "arraybuffer" server response type.
405
+ * @property {String} Blob="blob" - The "blob" server response type.
406
+ * @property {String} Document="document" - The "document" server response type.
407
+ * @property {String} Json="json" - The "json" server response type.
408
+ * @property {String} DOMString="text" - The "text" server response type.
409
+ * @property {String} Default="text" - The "" server response type ( equivalent to DOMString ).
410
+ *
411
+ * @constant
412
+ * @type {ResponseType}
413
+ * @description ResponseType allow to filter wich type of response is recieved from the server.
414
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType} for further information.
415
+ */
416
+ const ResponseType = /*#__PURE__*/toEnum( {
417
+ ArrayBuffer: { value: 'arraybuffer' },
418
+ Blob: { value: 'blob' },
419
+ Document: { value: 'document' },
420
+ Json: { value: 'json' },
421
+ DOMString: { value: 'text' },
422
+ Default: { value: '' }
423
+ } )
424
+
425
+ export {
426
+ FileFormat,
427
+ HttpStatusCode,
428
+ HttpVerb,
429
+ Keys,
430
+ MimeType,
431
+ Mouse,
432
+ ResponseType
433
+ }
@@ -0,0 +1,41 @@
1
+ import { TAbstractFactory } from './TAbstractFactory.js'
2
+
3
+ /**
4
+ * @class
5
+ * @classdesc The TInstancingFactory is a kind a factory that performe instanciation based on registred constructor.
6
+ * @extends TAbstractFactory
7
+ *
8
+ * @author [Tristan Valcke]{@link https://github.com/Itee}
9
+ * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
10
+ */
11
+ class TInstancingFactory extends TAbstractFactory {
12
+
13
+ /**
14
+ * The ctor description
15
+ * @param parameters
16
+ */
17
+ constructor( parameters = {} ) {
18
+
19
+ const _parameters = { ...{}, ...parameters }
20
+
21
+ super( _parameters )
22
+
23
+ }
24
+
25
+ /**
26
+ *
27
+ * @param key
28
+ * @param parameters
29
+ * @returns {*}
30
+ */
31
+ create( key, ...parameters ) {
32
+ super.create( key, ...parameters )
33
+
34
+ return new this.get( key )( ...parameters )
35
+
36
+ }
37
+
38
+ }
39
+
40
+ export { TInstancingFactory }
41
+