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