@dipscope/type-manager 4.1.0 → 4.1.1

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 (125) hide show
  1. package/CHANGELOG.md +197 -197
  2. package/{LICENSE.txt → LICENSE.md} +201 -201
  3. package/README.md +2037 -2020
  4. package/alias.d.ts +10 -10
  5. package/core/alias.d.ts +6 -6
  6. package/core/custom-data.d.ts +6 -6
  7. package/core/default-value-resolver.d.ts +7 -7
  8. package/core/default-value.d.ts +7 -7
  9. package/core/discriminant.d.ts +8 -8
  10. package/core/discriminator.d.ts +6 -6
  11. package/core/factory.d.ts +18 -18
  12. package/core/fn.d.ts +316 -316
  13. package/core/generic-argument.d.ts +7 -7
  14. package/core/generic-metadata.d.ts +7 -7
  15. package/core/index.d.ts +44 -44
  16. package/core/index.js +1 -1
  17. package/core/index.js.map +1 -0
  18. package/core/inject-index.d.ts +6 -6
  19. package/core/inject-metadata.d.ts +72 -72
  20. package/core/inject-options.d.ts +22 -22
  21. package/core/injector.d.ts +16 -16
  22. package/core/log-level.d.ts +11 -11
  23. package/core/log.d.ts +65 -65
  24. package/core/metadata.d.ts +42 -42
  25. package/core/naming-convention.d.ts +15 -15
  26. package/core/property-metadata.d.ts +178 -178
  27. package/core/property-name.d.ts +6 -6
  28. package/core/property-options.d.ts +100 -100
  29. package/core/reference-callback.d.ts +7 -7
  30. package/core/reference-handler.d.ts +32 -32
  31. package/core/reference-key.d.ts +6 -6
  32. package/core/reference-value-initializer.d.ts +8 -8
  33. package/core/reference-value-resolver.d.ts +8 -8
  34. package/core/reference-value.d.ts +6 -6
  35. package/core/serializer-context-options.d.ts +63 -63
  36. package/core/serializer-context.d.ts +296 -296
  37. package/core/serializer.d.ts +27 -27
  38. package/core/type-abstraction.d.ts +8 -8
  39. package/core/type-argument.d.ts +9 -9
  40. package/core/type-context-entry.d.ts +36 -36
  41. package/core/type-context.d.ts +58 -58
  42. package/core/type-ctor.d.ts +6 -6
  43. package/core/type-fn.d.ts +8 -8
  44. package/core/type-like.d.ts +7 -7
  45. package/core/type-metadata-resolver.d.ts +8 -8
  46. package/core/type-metadata-symbol.d.ts +6 -6
  47. package/core/type-metadata.d.ts +304 -304
  48. package/core/type-name.d.ts +6 -6
  49. package/core/type-options-base.d.ts +100 -100
  50. package/core/type-options.d.ts +53 -53
  51. package/core/type-resolver.d.ts +7 -7
  52. package/custom-data.d.ts +11 -11
  53. package/default-value.d.ts +11 -11
  54. package/deserializable.d.ts +11 -11
  55. package/deserialized-default-value.d.ts +11 -11
  56. package/discriminant.d.ts +11 -11
  57. package/discriminator.d.ts +11 -11
  58. package/factories/index.d.ts +1 -1
  59. package/factories/index.js +1 -1
  60. package/factories/index.js.map +1 -0
  61. package/factories/type-factory.d.ts +19 -19
  62. package/factory.d.ts +11 -11
  63. package/index.d.ts +24 -24
  64. package/index.js +1 -1
  65. package/index.js.map +1 -0
  66. package/inject.d.ts +10 -10
  67. package/injectable.d.ts +10 -10
  68. package/injector.d.ts +11 -11
  69. package/injectors/index.d.ts +1 -1
  70. package/injectors/index.js +1 -1
  71. package/injectors/index.js.map +1 -0
  72. package/injectors/singleton-injector.d.ts +31 -31
  73. package/naming-convention.d.ts +11 -11
  74. package/naming-conventions/camel-case-naming-convention.d.ts +26 -26
  75. package/naming-conventions/flat-case-naming-convention.d.ts +25 -25
  76. package/naming-conventions/flat-upper-case-naming-convention.d.ts +25 -25
  77. package/naming-conventions/index.d.ts +8 -8
  78. package/naming-conventions/index.js +1 -1
  79. package/naming-conventions/index.js.map +1 -0
  80. package/naming-conventions/kebab-case-naming-convention.d.ts +26 -26
  81. package/naming-conventions/kebab-upper-case-naming-convention.d.ts +26 -26
  82. package/naming-conventions/pascal-case-naming-convention.d.ts +26 -26
  83. package/naming-conventions/snake-case-naming-convention.d.ts +26 -26
  84. package/naming-conventions/snake-upper-case-naming-convention.d.ts +26 -26
  85. package/package.json +48 -48
  86. package/preserve-discriminator.d.ts +10 -10
  87. package/property.d.ts +12 -12
  88. package/reference-handler.d.ts +11 -11
  89. package/reference-handlers/direct-reference-handler.d.ts +33 -33
  90. package/reference-handlers/index.d.ts +3 -3
  91. package/reference-handlers/index.js +1 -1
  92. package/reference-handlers/index.js.map +1 -0
  93. package/reference-handlers/lead-reference-handler.d.ts +34 -34
  94. package/reference-handlers/path-reference-handler.d.ts +56 -56
  95. package/serializable.d.ts +11 -11
  96. package/serialized-default-value.d.ts +11 -11
  97. package/serializer.d.ts +11 -11
  98. package/serializers/array-buffer-serializer.d.ts +28 -28
  99. package/serializers/array-serializer.d.ts +28 -28
  100. package/serializers/boolean-serializer.d.ts +37 -37
  101. package/serializers/data-view-serializer.d.ts +28 -28
  102. package/serializers/date-serializer.d.ts +28 -28
  103. package/serializers/float-32-array-serializer.d.ts +28 -28
  104. package/serializers/float-64-array-serializer.d.ts +28 -28
  105. package/serializers/index.d.ts +19 -19
  106. package/serializers/index.js +1 -1
  107. package/serializers/index.js.map +1 -0
  108. package/serializers/int-16-array-serializer.d.ts +28 -28
  109. package/serializers/int-32-array-serializer.d.ts +28 -28
  110. package/serializers/int-8-array-serializer.d.ts +28 -28
  111. package/serializers/map-serializer.d.ts +28 -28
  112. package/serializers/number-serializer.d.ts +37 -37
  113. package/serializers/set-serializer.d.ts +28 -28
  114. package/serializers/string-serializer.d.ts +37 -37
  115. package/serializers/type-serializer.d.ts +28 -28
  116. package/serializers/uint-16-array-serializer.d.ts +28 -28
  117. package/serializers/uint-32-array-serializer.d.ts +28 -28
  118. package/serializers/uint-8-array-serializer.d.ts +28 -28
  119. package/serializers/uint-8-clamped-array-serializer.d.ts +28 -28
  120. package/type-and-property.d.ts +12 -12
  121. package/type-manager-options.d.ts +24 -24
  122. package/type-manager.d.ts +331 -331
  123. package/type.d.ts +9 -9
  124. package/use-default-value.d.ts +10 -10
  125. package/use-implicit-conversion.d.ts +10 -10
package/CHANGELOG.md CHANGED
@@ -1,197 +1,197 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [4.1.0] - 2022-05-18
9
-
10
- ### Added
11
-
12
- - Getters for serialized and deserialized default value in metadata.
13
- - Decorators and options to define serialized and deserialized default value explicitly.
14
-
15
- ## [4.0.4] - 2022-05-15
16
-
17
- ### Changed
18
-
19
- - Set webpack global output object to `this`.
20
-
21
- ## [4.0.3] - 2022-05-07
22
-
23
- ### Added
24
-
25
- - Getters of serialized and deserialized property names for property metadata.
26
-
27
- ### Removed
28
-
29
- - Definition logic of serialized and deserialized property names from type serializer.
30
-
31
- ### Fixed
32
-
33
- - Serialized property name was displayed in log messages.
34
-
35
- ## [4.0.2] - 2022-05-01
36
-
37
- ### Changed
38
-
39
- - Used symbol instead of string based key to store type metadata.
40
- - Avoid complete reset of custom data by providing `null` as argument.
41
- - Code style improvements.
42
-
43
- ## [4.0.1] - 2021-08-01
44
-
45
- ### Changed
46
-
47
- - Custom data options are now behave like built in configure options.
48
- - Path reference handler is now using path traversal instead of direct evaluation for resolving references.
49
-
50
- ## [4.0.0] - 2021-03-24
51
-
52
- ### Added
53
-
54
- - Polymorphic types support.
55
- - Enums support.
56
- - Accessors support.
57
- - Multiple runtime configurations support.
58
-
59
- ### Changed
60
-
61
- - Newly introduced `TypeFn` is now used instead of `TypeCtor` in configure methods due to adding polymorphic types support.
62
- - Static methods of `TypeManager` now return static instance to enable method chaining.
63
-
64
- ### Migrating from previous version
65
-
66
- - Replace `TypeCtor` with `TypeFn` if you are using declarative configuration.
67
-
68
- ## [3.0.0] - 2021-03-06
69
-
70
- ### Added
71
-
72
- - Generics support.
73
- - Circular object reference support.
74
- - Short property declaration syntax.
75
- - Naming convention support.
76
- - Module separation.
77
- - New set of serializers.
78
-
79
- ### Changed
80
-
81
- - Core types, interfaces and classes moved to a core module to keep main namespace clean.
82
- - All decorators are now available from the main namespace.
83
-
84
- ### Fixed
85
-
86
- - Invalid implicit conversion of boolean serializer.
87
- - Properties were not assigned during deserialization if they already have initialized value.
88
-
89
- ### Removed
90
-
91
- - Multiple decorator and related options as they are no longer required.
92
-
93
- ### Migrating from previous version
94
-
95
- - Replace all core type and interface imports from `@dipscope/type-manager` to `@dipscope/type-manager/core`.
96
- - Replace all helper decorator imports from `@dipscope/type-manager/helpers` to `@dipscope/type-manager`.
97
- - Change all places where `Property` decorator is used to declare an array of types to a proper generic variant.
98
- - If you are using `TypeSerializer`, `TypeFactory`, `TypeInjector` helper decorators or interfaces then rename them to `Serializer`, `Factory`, `Injector` accordingly.
99
- - If you are using `typeAlias` or `typeResolver` property options replace them to `typeArgument`.
100
-
101
- ## [2.0.4] - 2021-02-13
102
-
103
- ### Changed
104
-
105
- - Improved type serializer context to avoid instance of call in serializers.
106
-
107
- ## [2.0.3] - 2021-02-13
108
-
109
- ### Fixed
110
-
111
- - Broken helpers module.
112
-
113
- ## [2.0.2] - 2021-02-11
114
-
115
- ### Fixed
116
-
117
- - Broken module resolvers.
118
-
119
- ## [2.0.1] - 2021-02-11
120
-
121
- ### Fixed
122
-
123
- - Broken imports from newly introduced namespaces.
124
-
125
- ## [2.0.0] - 2021-02-10
126
-
127
- ### Added
128
-
129
- - Dependency injection support.
130
- - Immutable types support.
131
- - Type hint support.
132
- - Custom data support.
133
-
134
- ### Changed
135
-
136
- - Type serializer now an inteface.
137
- - Some helper decorators renamed to match option names.
138
- - Helper decorators moved to their own namespace.
139
-
140
- ### Migrating from previous version
141
-
142
- - Replace extension with implementation for custom type serializers.
143
- - If your custom serializers uses implicit conversion make it part of the serialize and deserialize methods. You can check if it should be used based on newly introduced serializer context.
144
- - If you are using `Serializer` helper decorator then rename it to `TypeSerializer`.
145
- - For all helper decorators change imports to `@dipscope/type-manager/helpers`. Now they are located in their own namespace.
146
-
147
- ## [1.3.0] - 2021-01-20
148
-
149
- ### Added
150
-
151
- - Type manager methods to configure each option individually.
152
-
153
- ### Fixed
154
-
155
- - Type options were not applied after changes at runtime.
156
-
157
- ## [1.2.2] - 2020-12-25
158
-
159
- ### Fixed
160
-
161
- - Type error when trying to serialize and deserialize object with null values.
162
- - Explicit deserialization of properties.
163
-
164
- ## [1.2.1] - 2020-12-24
165
-
166
- ### Fixed
167
-
168
- - Broken exports for browser based applications.
169
-
170
- ## [1.2.0] - 2020-12-23
171
-
172
- ### Added
173
-
174
- - Multiple property option to indicate that certain property is an array when using without reflect metadata.
175
-
176
- ### Fixed
177
-
178
- - Type extraction using reflect metadata.
179
-
180
- ## [1.1.0] - 2020-12-22
181
-
182
- ### Added
183
-
184
- - Global type options.
185
- - Default value definition for types and properties.
186
- - Implicit conversion for types and properties.
187
- - Type manager stringify and parse methods for working with JSON.
188
-
189
- ## [1.0.0] - 2020-12-16
190
-
191
- ### Added
192
-
193
- - Type manager for serializing and deserializing objects.
194
- - Decorator annotations for type and property metadata.
195
- - Declarative configuration for type and property metadata.
196
- - Custom serializer support.
197
- - Reflect metadata support.
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.1.0] - 2022-05-18
9
+
10
+ ### Added
11
+
12
+ - Getters for serialized and deserialized default value in metadata.
13
+ - Decorators and options to define serialized and deserialized default value explicitly.
14
+
15
+ ## [4.0.4] - 2022-05-15
16
+
17
+ ### Changed
18
+
19
+ - Set webpack global output object to `this`.
20
+
21
+ ## [4.0.3] - 2022-05-07
22
+
23
+ ### Added
24
+
25
+ - Getters of serialized and deserialized property names for property metadata.
26
+
27
+ ### Removed
28
+
29
+ - Definition logic of serialized and deserialized property names from type serializer.
30
+
31
+ ### Fixed
32
+
33
+ - Serialized property name was displayed in log messages.
34
+
35
+ ## [4.0.2] - 2022-05-01
36
+
37
+ ### Changed
38
+
39
+ - Used symbol instead of string based key to store type metadata.
40
+ - Avoid complete reset of custom data by providing `null` as argument.
41
+ - Code style improvements.
42
+
43
+ ## [4.0.1] - 2021-08-01
44
+
45
+ ### Changed
46
+
47
+ - Custom data options are now behave like built in configure options.
48
+ - Path reference handler is now using path traversal instead of direct evaluation for resolving references.
49
+
50
+ ## [4.0.0] - 2021-03-24
51
+
52
+ ### Added
53
+
54
+ - Polymorphic types support.
55
+ - Enums support.
56
+ - Accessors support.
57
+ - Multiple runtime configurations support.
58
+
59
+ ### Changed
60
+
61
+ - Newly introduced `TypeFn` is now used instead of `TypeCtor` in configure methods due to adding polymorphic types support.
62
+ - Static methods of `TypeManager` now return static instance to enable method chaining.
63
+
64
+ ### Migrating from previous version
65
+
66
+ - Replace `TypeCtor` with `TypeFn` if you are using declarative configuration.
67
+
68
+ ## [3.0.0] - 2021-03-06
69
+
70
+ ### Added
71
+
72
+ - Generics support.
73
+ - Circular object reference support.
74
+ - Short property declaration syntax.
75
+ - Naming convention support.
76
+ - Module separation.
77
+ - New set of serializers.
78
+
79
+ ### Changed
80
+
81
+ - Core types, interfaces and classes moved to a core module to keep main namespace clean.
82
+ - All decorators are now available from the main namespace.
83
+
84
+ ### Fixed
85
+
86
+ - Invalid implicit conversion of boolean serializer.
87
+ - Properties were not assigned during deserialization if they already have initialized value.
88
+
89
+ ### Removed
90
+
91
+ - Multiple decorator and related options as they are no longer required.
92
+
93
+ ### Migrating from previous version
94
+
95
+ - Replace all core type and interface imports from `@dipscope/type-manager` to `@dipscope/type-manager/core`.
96
+ - Replace all helper decorator imports from `@dipscope/type-manager/helpers` to `@dipscope/type-manager`.
97
+ - Change all places where `Property` decorator is used to declare an array of types to a proper generic variant.
98
+ - If you are using `TypeSerializer`, `TypeFactory`, `TypeInjector` helper decorators or interfaces then rename them to `Serializer`, `Factory`, `Injector` accordingly.
99
+ - If you are using `typeAlias` or `typeResolver` property options replace them to `typeArgument`.
100
+
101
+ ## [2.0.4] - 2021-02-13
102
+
103
+ ### Changed
104
+
105
+ - Improved type serializer context to avoid instance of call in serializers.
106
+
107
+ ## [2.0.3] - 2021-02-13
108
+
109
+ ### Fixed
110
+
111
+ - Broken helpers module.
112
+
113
+ ## [2.0.2] - 2021-02-11
114
+
115
+ ### Fixed
116
+
117
+ - Broken module resolvers.
118
+
119
+ ## [2.0.1] - 2021-02-11
120
+
121
+ ### Fixed
122
+
123
+ - Broken imports from newly introduced namespaces.
124
+
125
+ ## [2.0.0] - 2021-02-10
126
+
127
+ ### Added
128
+
129
+ - Dependency injection support.
130
+ - Immutable types support.
131
+ - Type hint support.
132
+ - Custom data support.
133
+
134
+ ### Changed
135
+
136
+ - Type serializer now an inteface.
137
+ - Some helper decorators renamed to match option names.
138
+ - Helper decorators moved to their own namespace.
139
+
140
+ ### Migrating from previous version
141
+
142
+ - Replace extension with implementation for custom type serializers.
143
+ - If your custom serializers uses implicit conversion make it part of the serialize and deserialize methods. You can check if it should be used based on newly introduced serializer context.
144
+ - If you are using `Serializer` helper decorator then rename it to `TypeSerializer`.
145
+ - For all helper decorators change imports to `@dipscope/type-manager/helpers`. Now they are located in their own namespace.
146
+
147
+ ## [1.3.0] - 2021-01-20
148
+
149
+ ### Added
150
+
151
+ - Type manager methods to configure each option individually.
152
+
153
+ ### Fixed
154
+
155
+ - Type options were not applied after changes at runtime.
156
+
157
+ ## [1.2.2] - 2020-12-25
158
+
159
+ ### Fixed
160
+
161
+ - Type error when trying to serialize and deserialize object with null values.
162
+ - Explicit deserialization of properties.
163
+
164
+ ## [1.2.1] - 2020-12-24
165
+
166
+ ### Fixed
167
+
168
+ - Broken exports for browser based applications.
169
+
170
+ ## [1.2.0] - 2020-12-23
171
+
172
+ ### Added
173
+
174
+ - Multiple property option to indicate that certain property is an array when using without reflect metadata.
175
+
176
+ ### Fixed
177
+
178
+ - Type extraction using reflect metadata.
179
+
180
+ ## [1.1.0] - 2020-12-22
181
+
182
+ ### Added
183
+
184
+ - Global type options.
185
+ - Default value definition for types and properties.
186
+ - Implicit conversion for types and properties.
187
+ - Type manager stringify and parse methods for working with JSON.
188
+
189
+ ## [1.0.0] - 2020-12-16
190
+
191
+ ### Added
192
+
193
+ - Type manager for serializing and deserializing objects.
194
+ - Decorator annotations for type and property metadata.
195
+ - Declarative configuration for type and property metadata.
196
+ - Custom serializer support.
197
+ - Reflect metadata support.