@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,10 @@
1
+ /**
2
+ * @module Managers
3
+ * @description Intermediary export file for client manager. Export [TDataBaseManager]{@link TDataBaseManager}.
4
+ *
5
+ * @author [Tristan Valcke]{@link https://github.com/Itee}
6
+ * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
7
+ */
8
+ /* eslint-env browser */
9
+
10
+ export { TDataBaseManager } from './TDataBaseManager.js'
@@ -0,0 +1,84 @@
1
+ import { toEnum } from '@itee/utils'
2
+ import {
3
+ isNotNumber,
4
+ isNotString,
5
+ isNull,
6
+ isUndefined
7
+ } from '@itee/validators'
8
+
9
+ /**
10
+ * @deprecated
11
+ * @type {ReadonlyArray<unknown>}
12
+ */
13
+ const TIdFactoryType = /*#__PURE__*/toEnum( {
14
+ Number: 0,
15
+ String: 1,
16
+ Uuid: 2
17
+ } )
18
+
19
+ /**
20
+ * @deprecated
21
+ */
22
+ class TIdFactory {
23
+
24
+ constructor( type = TIdFactoryType.Number, base = null ) {
25
+
26
+ this.type = type
27
+ this.base = base
28
+
29
+ this._counter = 0
30
+
31
+ }
32
+
33
+ get type() {
34
+ return this._type
35
+ }
36
+
37
+ set type( value ) {
38
+
39
+ if ( isNull( value ) ) { throw new Error( `Type cannot be null ! Expect an value from TIdFactoryType enum: ${ TIdFactoryType.types() }` ) }
40
+ if ( isUndefined( value ) ) { throw new Error( `Type cannot be undefined ! Expect an value from TIdFactoryType enum: ${ TIdFactoryType.types() }` ) }
41
+ if ( !TIdFactoryType.includes( value ) ) { throw new Error( `Invalide type ! Expect an value from TIdFactoryType enum: ${ TIdFactoryType.types() }` ) }
42
+
43
+ this._type = value
44
+ }
45
+
46
+ get base() {
47
+ return this._base
48
+ }
49
+
50
+ set base( value ) {
51
+
52
+ if ( isUndefined( value ) ) { throw new Error( 'Base cannot be undefined ! Expect an instance of Object3D.' ) }
53
+
54
+ if ( ( this._type === TIdFactoryType.Number ) && isNotNumber( value ) ) { throw new Error( 'Invalide Base ! It does not match the type.' ) }
55
+ if ( ( this._type === TIdFactoryType.String ) && isNotString( value ) ) { throw new Error( 'Invalide Base ! It does not match the type.' ) }
56
+ // if( (this._type === TIdFactoryType.Uuid) && isNotUuid( value ) ) { throw new Error( 'Invalide Base ! It does not match the type.' ) }
57
+
58
+ this._base = value
59
+ }
60
+
61
+ setType( value ) {
62
+
63
+ this.type = value
64
+ return this
65
+
66
+ }
67
+
68
+ setBase( value ) {
69
+
70
+ this.base = value
71
+ return this
72
+
73
+ }
74
+
75
+ createId() {
76
+ return this._base + this._counter++
77
+ }
78
+
79
+ }
80
+
81
+ export {
82
+ TIdFactory,
83
+ TIdFactoryType
84
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module Managers
3
+ * @description Intermediary export file for client manager. Export [TDataBaseManager]{@link TDataBaseManager}.
4
+ *
5
+ * @author [Tristan Valcke]{@link https://github.com/Itee}
6
+ * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
7
+ */
8
+
9
+ export * from './TIdFactory.js'