@dipscope/type-manager 4.0.3 → 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 -184
  2. package/{LICENSE.txt → LICENSE.md} +201 -201
  3. package/README.md +2037 -2005
  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 -0
  8. package/core/default-value.d.ts +7 -0
  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 -42
  16. package/core/index.js +2 -2
  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 -172
  27. package/core/property-name.d.ts +6 -6
  28. package/core/property-options.d.ts +100 -92
  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 -290
  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 -298
  48. package/core/type-name.d.ts +6 -6
  49. package/core/type-options-base.d.ts +100 -92
  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 -10
  54. package/deserializable.d.ts +11 -11
  55. package/deserialized-default-value.d.ts +11 -0
  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 +2 -2
  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 -22
  64. package/index.js +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 -0
  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 +2 -2
  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/alias.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- /**
2
- * Alias decorator.
3
- *
4
- * Can be used on type and property to define an alias.
5
- *
6
- * @param {string} alias Type or property alias.
7
- *
8
- * @returns {ClassDecorator&PropertyDecorator} Class and property decorator.
9
- */
10
- export declare function Alias(alias: string): ClassDecorator & PropertyDecorator;
1
+ /**
2
+ * Alias decorator.
3
+ *
4
+ * Can be used on type and property to define an alias.
5
+ *
6
+ * @param {string} alias Type or property alias.
7
+ *
8
+ * @returns {ClassDecorator&PropertyDecorator} Class and property decorator.
9
+ */
10
+ export declare function Alias(alias: string): ClassDecorator & PropertyDecorator;
package/core/alias.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /**
2
- * Type to explicitly define an alias within a source code.
3
- *
4
- * @type {Alias}
5
- */
6
- export declare type Alias = string;
1
+ /**
2
+ * Type to explicitly define an alias within a source code.
3
+ *
4
+ * @type {Alias}
5
+ */
6
+ export declare type Alias = string;
@@ -1,6 +1,6 @@
1
- /**
2
- * Custom data which can be defined by developer.
3
- *
4
- * @type {CustomData}
5
- */
6
- export declare type CustomData = Record<string, any>;
1
+ /**
2
+ * Custom data which can be defined by developer.
3
+ *
4
+ * @type {CustomData}
5
+ */
6
+ export declare type CustomData = Record<string, any>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolver used to get default value. May be used if type represents a reference
3
+ * which have to be unique.
4
+ *
5
+ * @type {DefaultValueResolver}
6
+ */
7
+ export declare type DefaultValueResolver = () => any;
@@ -0,0 +1,7 @@
1
+ import { DefaultValueResolver } from './default-value-resolver';
2
+ /**
3
+ * Default value which can be defined by developer.
4
+ *
5
+ * @type {DefaultValue}
6
+ */
7
+ export declare type DefaultValue = any | DefaultValueResolver;
@@ -1,8 +1,8 @@
1
- import { TypeName } from './type-name';
2
- /**
3
- * Discriminant intends to describe a unique key for a polymorphic type which will be
4
- * used during serialization and deserialization. Can be a type name, any string or number.
5
- *
6
- * @type {Discriminant}
7
- */
8
- export declare type Discriminant = TypeName | string | number;
1
+ import { TypeName } from './type-name';
2
+ /**
3
+ * Discriminant intends to describe a unique key for a polymorphic type which will be
4
+ * used during serialization and deserialization. Can be a type name, any string or number.
5
+ *
6
+ * @type {Discriminant}
7
+ */
8
+ export declare type Discriminant = TypeName | string | number;
@@ -1,6 +1,6 @@
1
- /**
2
- * Discriminator intends to indicate the property used to identify the type of an object.
3
- *
4
- * @type {Discriminator}
5
- */
6
- export declare type Discriminator = string;
1
+ /**
2
+ * Discriminator intends to indicate the property used to identify the type of an object.
3
+ *
4
+ * @type {Discriminator}
5
+ */
6
+ export declare type Discriminator = string;
package/core/factory.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { Injector } from './injector';
2
- import { TypeContext } from './type-context';
3
- /**
4
- * Factory for building types.
5
- *
6
- * @type {Factory}
7
- */
8
- export interface Factory {
9
- /**
10
- * Builds type described by provided type context.
11
- *
12
- * @param {TypeContext<TType>} typeContext Type context.
13
- * @param {Injector} injector Injector.
14
- *
15
- * @returns {TType} Type instance described by provided type context.
16
- */
17
- build<TType>(typeContext: TypeContext<TType>, injector: Injector): TType;
18
- }
1
+ import { Injector } from './injector';
2
+ import { TypeContext } from './type-context';
3
+ /**
4
+ * Factory for building types.
5
+ *
6
+ * @type {Factory}
7
+ */
8
+ export interface Factory {
9
+ /**
10
+ * Builds type described by provided type context.
11
+ *
12
+ * @param {TypeContext<TType>} typeContext Type context.
13
+ * @param {Injector} injector Injector.
14
+ *
15
+ * @returns {TType} Type instance described by provided type context.
16
+ */
17
+ build<TType>(typeContext: TypeContext<TType>, injector: Injector): TType;
18
+ }