@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/type-name.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /**
2
- * Type to explicitly define a type name within a source code.
3
- *
4
- * @type {TypeName}
5
- */
6
- export declare type TypeName = string;
1
+ /**
2
+ * Type to explicitly define a type name within a source code.
3
+ *
4
+ * @type {TypeName}
5
+ */
6
+ export declare type TypeName = string;
@@ -1,90 +1,90 @@
1
- import { CustomData } from './custom-data';
2
- import { Discriminator } from './discriminator';
3
- import { Factory } from './factory';
4
- import { Injector } from './injector';
5
- import { Log } from './log';
6
- import { NamingConvention } from './naming-convention';
7
- import { ReferenceHandler } from './reference-handler';
8
- import { Serializer } from './serializer';
9
- /**
10
- * Type options base interface.
11
- *
12
- * @type {TypeOptionsBase<TType>}
13
- */
14
- export declare type TypeOptionsBase<TType> = {
15
- /**
16
- * Custom developer data.
17
- *
18
- * @type {CustomData}
19
- */
20
- customData?: CustomData;
21
- /**
22
- * Discriminator.
23
- *
24
- * @type {Discriminator}
25
- */
26
- discriminator: Discriminator;
27
- /**
28
- * Factory used to build instances of type.
29
- *
30
- * @type {Factory}
31
- */
32
- factory: Factory;
33
- /**
34
- * Injector used to resolve types.
35
- *
36
- * @type {Injector}
37
- */
38
- injector: Injector;
39
- /**
40
- * Log instance with specified log level.
41
- *
42
- * @type {Log}
43
- */
44
- log: Log;
45
- /**
46
- * Naming convention.
47
- *
48
- * @type {NamingConvention}
49
- */
50
- namingConvention?: NamingConvention;
51
- /**
52
- * Preserve discriminator in object during serialization
53
- * and deserialization?
54
- *
55
- * @type {boolean}
56
- */
57
- preserveDiscriminator: boolean;
58
- /**
59
- * Reference handler.
60
- *
61
- * @type {ReferenceHandler}
62
- */
63
- referenceHandler: ReferenceHandler;
64
- /**
65
- * Serializer used to serialize and deserialize a type.
66
- *
67
- * @type {Serializer<TType>}
68
- */
69
- serializer: Serializer<TType>;
70
- /**
71
- * If set to true then null values are preserved. Otherwise they will be
72
- * treated as undefined.
73
- *
74
- * @type {boolean}
75
- */
76
- preserveNull: boolean;
77
- /**
78
- * Use default value assignment for undefined values?
79
- *
80
- * @type {boolean}
81
- */
82
- useDefaultValue: boolean;
83
- /**
84
- * Use implicit conversion when provided value can be converted
85
- * to the target one?
86
- *
87
- * @type {boolean}
88
- */
89
- useImplicitConversion: boolean;
90
- };
1
+ import { CustomData } from './custom-data';
2
+ import { Discriminator } from './discriminator';
3
+ import { Factory } from './factory';
4
+ import { Injector } from './injector';
5
+ import { Log } from './log';
6
+ import { NamingConvention } from './naming-convention';
7
+ import { ReferenceHandler } from './reference-handler';
8
+ import { Serializer } from './serializer';
9
+ /**
10
+ * Type options base interface.
11
+ *
12
+ * @type {TypeOptionsBase<TType>}
13
+ */
14
+ export declare type TypeOptionsBase<TType> = {
15
+ /**
16
+ * Custom developer data.
17
+ *
18
+ * @type {CustomData}
19
+ */
20
+ customData?: CustomData;
21
+ /**
22
+ * Discriminator.
23
+ *
24
+ * @type {Discriminator}
25
+ */
26
+ discriminator: Discriminator;
27
+ /**
28
+ * Factory used to build instances of type.
29
+ *
30
+ * @type {Factory}
31
+ */
32
+ factory: Factory;
33
+ /**
34
+ * Injector used to resolve types.
35
+ *
36
+ * @type {Injector}
37
+ */
38
+ injector: Injector;
39
+ /**
40
+ * Log instance with specified log level.
41
+ *
42
+ * @type {Log}
43
+ */
44
+ log: Log;
45
+ /**
46
+ * Naming convention.
47
+ *
48
+ * @type {NamingConvention}
49
+ */
50
+ namingConvention?: NamingConvention;
51
+ /**
52
+ * Preserve discriminator in object during serialization
53
+ * and deserialization?
54
+ *
55
+ * @type {boolean}
56
+ */
57
+ preserveDiscriminator: boolean;
58
+ /**
59
+ * Reference handler.
60
+ *
61
+ * @type {ReferenceHandler}
62
+ */
63
+ referenceHandler: ReferenceHandler;
64
+ /**
65
+ * Serializer used to serialize and deserialize a type.
66
+ *
67
+ * @type {Serializer<TType>}
68
+ */
69
+ serializer: Serializer<TType>;
70
+ /**
71
+ * If set to true then null values are preserved. Otherwise they will be
72
+ * treated as undefined.
73
+ *
74
+ * @type {boolean}
75
+ */
76
+ preserveNull: boolean;
77
+ /**
78
+ * Use default value assignment for undefined values?
79
+ *
80
+ * @type {boolean}
81
+ */
82
+ useDefaultValue: boolean;
83
+ /**
84
+ * Use implicit conversion when provided value can be converted
85
+ * to the target one?
86
+ *
87
+ * @type {boolean}
88
+ */
89
+ useImplicitConversion: boolean;
90
+ };
package/type-options.d.ts CHANGED
@@ -1,79 +1,79 @@
1
- import { Alias } from './alias';
2
- import { DefaultValue } from './default-value';
3
- import { Discriminant } from './discriminant';
4
- import { GenericArgument } from './generic-argument';
5
- import { InjectIndex } from './inject-index';
6
- import { InjectOptions } from './inject-options';
7
- import { PropertyName } from './property-name';
8
- import { PropertyOptions } from './property-options';
9
- import { TypeOptionsBase } from './type-options-base';
10
- /**
11
- * Type options interface.
12
- *
13
- * @type {TypeOptions<TType>}
14
- */
15
- export declare type TypeOptions<TType> = Partial<TypeOptionsBase<TType>> & {
16
- /**
17
- * Type alias.
18
- *
19
- * Can be used to resolve a type at runtime instead of type resolver function.
20
- *
21
- * @type {Alias}
22
- */
23
- alias?: Alias;
24
- /**
25
- * Default value for undefined ones.
26
- *
27
- * Used to set both serialized and deserialized default values and
28
- * only when use default value option is true.
29
- *
30
- * @type {DefaultValue}
31
- */
32
- defaultValue?: DefaultValue;
33
- /**
34
- * Serialized default value for undefined ones.
35
- *
36
- * Used only when use default value option is true.
37
- *
38
- * @type {DefaultValue}
39
- */
40
- serializedDefaultValue?: DefaultValue;
41
- /**
42
- * Deserialized default value for undefined ones.
43
- *
44
- * Used only when use default value option is true.
45
- *
46
- * @type {DefaultValue}
47
- */
48
- deserializedDefaultValue?: DefaultValue;
49
- /**
50
- * Discriminant.
51
- *
52
- * @type {Discriminant}
53
- */
54
- discriminant?: Discriminant;
55
- /**
56
- * Generic arguments.
57
- *
58
- * @type {Array<GenericArgument<any>>}
59
- */
60
- genericArguments?: Array<GenericArgument<any>>;
61
- /**
62
- * Injectable type?
63
- *
64
- * @type {boolean}
65
- */
66
- injectable?: boolean;
67
- /**
68
- * Inject options related to this type.
69
- *
70
- * @type {Map<InjectIndex, InjectOptions<any>>}
71
- */
72
- injectOptionsMap?: Map<InjectIndex, InjectOptions<any>>;
73
- /**
74
- * Property options related to this type. Map key is a property name.
75
- *
76
- * @type {Map<PropertyName, PropertyOptions<any>>}
77
- */
78
- propertyOptionsMap?: Map<PropertyName, PropertyOptions<any>>;
79
- };
1
+ import { Alias } from './alias';
2
+ import { DefaultValue } from './default-value';
3
+ import { Discriminant } from './discriminant';
4
+ import { GenericArgument } from './generic-argument';
5
+ import { InjectIndex } from './inject-index';
6
+ import { InjectOptions } from './inject-options';
7
+ import { PropertyName } from './property-name';
8
+ import { PropertyOptions } from './property-options';
9
+ import { TypeOptionsBase } from './type-options-base';
10
+ /**
11
+ * Type options interface.
12
+ *
13
+ * @type {TypeOptions<TType>}
14
+ */
15
+ export declare type TypeOptions<TType> = Partial<TypeOptionsBase<TType>> & {
16
+ /**
17
+ * Type alias.
18
+ *
19
+ * Can be used to resolve a type at runtime instead of type resolver function.
20
+ *
21
+ * @type {Alias}
22
+ */
23
+ alias?: Alias;
24
+ /**
25
+ * Default value for undefined ones.
26
+ *
27
+ * Used to set both serialized and deserialized default values and
28
+ * only when use default value option is true.
29
+ *
30
+ * @type {DefaultValue}
31
+ */
32
+ defaultValue?: DefaultValue;
33
+ /**
34
+ * Serialized default value for undefined ones.
35
+ *
36
+ * Used only when use default value option is true.
37
+ *
38
+ * @type {DefaultValue}
39
+ */
40
+ serializedDefaultValue?: DefaultValue;
41
+ /**
42
+ * Deserialized default value for undefined ones.
43
+ *
44
+ * Used only when use default value option is true.
45
+ *
46
+ * @type {DefaultValue}
47
+ */
48
+ deserializedDefaultValue?: DefaultValue;
49
+ /**
50
+ * Discriminant.
51
+ *
52
+ * @type {Discriminant}
53
+ */
54
+ discriminant?: Discriminant;
55
+ /**
56
+ * Generic arguments.
57
+ *
58
+ * @type {Array<GenericArgument<any>>}
59
+ */
60
+ genericArguments?: Array<GenericArgument<any>>;
61
+ /**
62
+ * Injectable type?
63
+ *
64
+ * @type {boolean}
65
+ */
66
+ injectable?: boolean;
67
+ /**
68
+ * Inject options related to this type.
69
+ *
70
+ * @type {Map<InjectIndex, InjectOptions<any>>}
71
+ */
72
+ injectOptionsMap?: Map<InjectIndex, InjectOptions<any>>;
73
+ /**
74
+ * Property options related to this type. Map key is a property name.
75
+ *
76
+ * @type {Map<PropertyName, PropertyOptions<any>>}
77
+ */
78
+ propertyOptionsMap?: Map<PropertyName, PropertyOptions<any>>;
79
+ };
@@ -1,7 +1,7 @@
1
- import { TypeFn } from './type-fn';
2
- /**
3
- * Type resolver.
4
- *
5
- * @type {TypeResolver<TType>}
6
- */
7
- export declare type TypeResolver<TType> = () => TypeFn<TType>;
1
+ import { TypeFn } from './type-fn';
2
+ /**
3
+ * Type resolver.
4
+ *
5
+ * @type {TypeResolver<TType>}
6
+ */
7
+ export declare type TypeResolver<TType> = () => TypeFn<TType>;
package/type.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { TypeOptions } from './type-options';
2
- /**
3
- * Type decorator.
4
- *
5
- * @param {TypeOptions<TType>} typeOptions Type options.
6
- *
7
- * @returns {ClassDecorator} Class decorator.
8
- */
9
- export declare function Type<TType>(typeOptions?: TypeOptions<TType>): ClassDecorator;
1
+ import { TypeOptions } from './type-options';
2
+ /**
3
+ * Type decorator.
4
+ *
5
+ * @param {TypeOptions<TType>} typeOptions Type options.
6
+ *
7
+ * @returns {ClassDecorator} Class decorator.
8
+ */
9
+ export declare function Type<TType>(typeOptions?: TypeOptions<TType>): ClassDecorator;