@dipscope/type-manager 4.0.4 → 5.0.0-beta.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 (127) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/{LICENSE.txt → LICENSE.md} +0 -0
  3. package/README.md +143 -321
  4. package/alias.d.ts +3 -7
  5. package/custom-data.d.ts +3 -8
  6. package/default-value-resolver.d.ts +7 -0
  7. package/default-value.d.ts +4 -7
  8. package/discriminant.d.ts +5 -8
  9. package/discriminator.d.ts +3 -8
  10. package/factories/type-factory.d.ts +3 -3
  11. package/factory.d.ts +15 -8
  12. package/functions/get-own-reflect-metadata.d.ts +9 -0
  13. package/functions/get-reflect-metadata.d.ts +10 -0
  14. package/functions/get-words.d.ts +8 -0
  15. package/functions/index.d.ts +16 -0
  16. package/functions/is-arrow-function.d.ts +8 -0
  17. package/functions/is-ctor-function.d.ts +8 -0
  18. package/functions/is-data-view.d.ts +8 -0
  19. package/functions/is-float-32-array.d.ts +8 -0
  20. package/functions/is-float-64-array.d.ts +8 -0
  21. package/functions/is-int-16-array.d.ts +8 -0
  22. package/functions/is-int-32-array.d.ts +8 -0
  23. package/functions/is-int-8-array.d.ts +8 -0
  24. package/functions/is-uint-16-array.d.ts +8 -0
  25. package/functions/is-uint-32-array.d.ts +8 -0
  26. package/functions/is-uint-8-array.d.ts +8 -0
  27. package/functions/is-uint-8-clamped-array.d.ts +8 -0
  28. package/functions/name-of.d.ts +8 -0
  29. package/{core/generic-argument.d.ts → generic-argument.d.ts} +0 -0
  30. package/{core/generic-metadata.d.ts → generic-metadata.d.ts} +0 -0
  31. package/index.d.ts +39 -7
  32. package/index.js +1 -2
  33. package/{core/inject-index.d.ts → inject-index.d.ts} +0 -0
  34. package/{core/inject-metadata.d.ts → inject-metadata.d.ts} +0 -0
  35. package/{core/inject-options.d.ts → inject-options.d.ts} +0 -0
  36. package/inject.d.ts +2 -2
  37. package/injector.d.ts +13 -8
  38. package/injectors/singleton-injector.d.ts +2 -2
  39. package/{core/log-level.d.ts → log-level.d.ts} +0 -0
  40. package/{core/log.d.ts → log.d.ts} +41 -11
  41. package/{core/metadata.d.ts → metadata.d.ts} +0 -0
  42. package/naming-convention.d.ts +12 -8
  43. package/naming-conventions/camel-case-naming-convention.d.ts +1 -1
  44. package/naming-conventions/flat-case-naming-convention.d.ts +1 -1
  45. package/naming-conventions/flat-upper-case-naming-convention.d.ts +1 -1
  46. package/naming-conventions/kebab-case-naming-convention.d.ts +1 -1
  47. package/naming-conventions/kebab-upper-case-naming-convention.d.ts +1 -1
  48. package/naming-conventions/pascal-case-naming-convention.d.ts +1 -1
  49. package/naming-conventions/snake-case-naming-convention.d.ts +1 -1
  50. package/naming-conventions/snake-upper-case-naming-convention.d.ts +1 -1
  51. package/package.json +6 -3
  52. package/{core/property-metadata.d.ts → property-metadata.d.ts} +18 -12
  53. package/{core/property-name.d.ts → property-name.d.ts} +0 -0
  54. package/{core/property-options.d.ts → property-options.d.ts} +21 -4
  55. package/property.d.ts +3 -2
  56. package/{core/reference-callback.d.ts → reference-callback.d.ts} +0 -0
  57. package/reference-handler.d.ts +29 -8
  58. package/reference-handlers/direct-reference-handler.d.ts +6 -6
  59. package/reference-handlers/lead-reference-handler.d.ts +6 -6
  60. package/reference-handlers/path-reference-handler.d.ts +6 -6
  61. package/{core/reference-key.d.ts → reference-key.d.ts} +0 -0
  62. package/{core/reference-value-initializer.d.ts → reference-value-initializer.d.ts} +0 -0
  63. package/{core/reference-value-resolver.d.ts → reference-value-resolver.d.ts} +0 -0
  64. package/{core/reference-value.d.ts → reference-value.d.ts} +0 -0
  65. package/{core/serializer-context-options.d.ts → serializer-context-options.d.ts} +0 -0
  66. package/{core/serializer-context.d.ts → serializer-context.d.ts} +9 -3
  67. package/serializer.d.ts +24 -8
  68. package/serializers/array-buffer-serializer.d.ts +3 -3
  69. package/serializers/array-serializer.d.ts +3 -3
  70. package/serializers/boolean-serializer.d.ts +3 -3
  71. package/serializers/data-view-serializer.d.ts +3 -3
  72. package/serializers/date-serializer.d.ts +3 -3
  73. package/serializers/float-32-array-serializer.d.ts +3 -3
  74. package/serializers/float-64-array-serializer.d.ts +3 -3
  75. package/serializers/int-16-array-serializer.d.ts +3 -3
  76. package/serializers/int-32-array-serializer.d.ts +3 -3
  77. package/serializers/int-8-array-serializer.d.ts +3 -3
  78. package/serializers/map-serializer.d.ts +3 -3
  79. package/serializers/number-serializer.d.ts +3 -3
  80. package/serializers/set-serializer.d.ts +3 -3
  81. package/serializers/string-serializer.d.ts +3 -3
  82. package/serializers/type-serializer.d.ts +3 -3
  83. package/serializers/uint-16-array-serializer.d.ts +3 -3
  84. package/serializers/uint-32-array-serializer.d.ts +3 -3
  85. package/serializers/uint-8-array-serializer.d.ts +3 -3
  86. package/serializers/uint-8-clamped-array-serializer.d.ts +3 -3
  87. package/{core/type-abstraction.d.ts → type-abstraction.d.ts} +0 -0
  88. package/{core/type-argument.d.ts → type-argument.d.ts} +0 -0
  89. package/{core/type-context-entry.d.ts → type-context-entry.d.ts} +0 -0
  90. package/{core/type-context.d.ts → type-context.d.ts} +0 -0
  91. package/{core/type-ctor.d.ts → type-ctor.d.ts} +0 -0
  92. package/{core/type-fn.d.ts → type-fn.d.ts} +0 -0
  93. package/{core/type-like.d.ts → type-like.d.ts} +0 -0
  94. package/type-manager-options.d.ts +3 -3
  95. package/type-manager.d.ts +10 -10
  96. package/{core/type-metadata-resolver.d.ts → type-metadata-resolver.d.ts} +0 -0
  97. package/{core/type-metadata-symbol.d.ts → type-metadata-symbol.d.ts} +0 -0
  98. package/{core/type-metadata.d.ts → type-metadata.d.ts} +9 -3
  99. package/{core/type-name.d.ts → type-name.d.ts} +0 -0
  100. package/{core/type-options-base.d.ts → type-options-base.d.ts} +0 -9
  101. package/{core/type-options.d.ts → type-options.d.ts} +26 -0
  102. package/{core/type-resolver.d.ts → type-resolver.d.ts} +0 -0
  103. package/type.d.ts +1 -1
  104. package/core/alias.d.ts +0 -6
  105. package/core/custom-data.d.ts +0 -6
  106. package/core/discriminant.d.ts +0 -8
  107. package/core/discriminator.d.ts +0 -6
  108. package/core/factory.d.ts +0 -18
  109. package/core/fn.d.ts +0 -316
  110. package/core/index.d.ts +0 -42
  111. package/core/index.js +0 -2
  112. package/core/injector.d.ts +0 -16
  113. package/core/naming-convention.d.ts +0 -15
  114. package/core/reference-handler.d.ts +0 -32
  115. package/core/serializer.d.ts +0 -27
  116. package/deserializable.d.ts +0 -11
  117. package/factories/index.js +0 -2
  118. package/injectable.d.ts +0 -10
  119. package/injectors/index.js +0 -2
  120. package/naming-conventions/index.js +0 -2
  121. package/preserve-discriminator.d.ts +0 -10
  122. package/reference-handlers/index.js +0 -2
  123. package/serializable.d.ts +0 -11
  124. package/serializers/index.js +0 -2
  125. package/type-and-property.d.ts +0 -12
  126. package/use-default-value.d.ts +0 -10
  127. package/use-implicit-conversion.d.ts +0 -10
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Map serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Number serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Set serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * String serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Type serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Uint 16 array serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Uint 32 array serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Uint 8 array serializer.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Serializer } from '../core/serializer';
2
- import { SerializerContext } from '../core/serializer-context';
3
- import { TypeLike } from '../core/type-like';
1
+ import { Serializer } from '../serializer';
2
+ import { SerializerContext } from '../serializer-context';
3
+ import { TypeLike } from '../type-like';
4
4
  /**
5
5
  * Uint 8 clamped array serializer.
6
6
  *
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
- import { TypeFn } from './core';
2
- import { TypeOptions } from './core/type-options';
3
- import { TypeOptionsBase } from './core/type-options-base';
1
+ import { TypeFn } from './type-fn';
2
+ import { TypeOptions } from './type-options';
3
+ import { TypeOptionsBase } from './type-options-base';
4
4
  /**
5
5
  * Type manager options.
6
6
  *
package/type-manager.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Alias } from './core/alias';
2
- import { TypeFn } from './core/type-fn';
3
- import { TypeLike } from './core/type-like';
4
- import { TypeMetadata } from './core/type-metadata';
5
- import { TypeOptions } from './core/type-options';
6
- import { TypeOptionsBase } from './core/type-options-base';
1
+ import { Alias } from './alias';
2
+ import { TypeFn } from './type-fn';
3
+ import { TypeLike } from './type-like';
7
4
  import { TypeManagerOptions } from './type-manager-options';
5
+ import { TypeMetadata } from './type-metadata';
6
+ import { TypeOptions } from './type-options';
7
+ import { TypeOptionsBase } from './type-options-base';
8
8
  /**
9
9
  * Type manager class for external usage.
10
10
  *
@@ -165,7 +165,7 @@ export declare class TypeManager<TType> {
165
165
  *
166
166
  * @returns {TypeLike<any>} Object created from provided input value or undefined.
167
167
  */
168
- static serialize<TType>(typeFn: TypeFn<TType>, x: undefined): undefined;
168
+ static serialize<TType>(typeFn: TypeFn<TType>, x: undefined): any;
169
169
  static serialize<TType>(typeFn: TypeFn<TType>, x: null): null;
170
170
  static serialize<TType>(typeFn: TypeFn<TType>, x: Array<TType>): Array<any>;
171
171
  static serialize<TType>(typeFn: TypeFn<TType>, x: TType): any;
@@ -177,7 +177,7 @@ export declare class TypeManager<TType> {
177
177
  *
178
178
  * @returns {TypeLike<TType>} Type created from provided input value or undefined.
179
179
  */
180
- static deserialize<TType>(typeFn: TypeFn<TType>, x: undefined): undefined;
180
+ static deserialize<TType>(typeFn: TypeFn<TType>, x: undefined): any;
181
181
  static deserialize<TType>(typeFn: TypeFn<TType>, x: null): null;
182
182
  static deserialize<TType>(typeFn: TypeFn<TType>, x: Array<any>): Array<TType>;
183
183
  static deserialize<TType>(typeFn: TypeFn<TType>, x: any): TType;
@@ -294,7 +294,7 @@ export declare class TypeManager<TType> {
294
294
  *
295
295
  * @returns {TypeLike<any>} Object created from provided input value or undefined.
296
296
  */
297
- serialize(x: undefined): undefined;
297
+ serialize(x: undefined): any;
298
298
  serialize(x: null): null;
299
299
  serialize(x: Array<TType>): Array<any>;
300
300
  serialize(x: TType): any;
@@ -305,7 +305,7 @@ export declare class TypeManager<TType> {
305
305
  *
306
306
  * @returns {TypeLike<TType>} Type created from provided input value or undefined.
307
307
  */
308
- deserialize(x: undefined): undefined;
308
+ deserialize(x: undefined): any;
309
309
  deserialize(x: null): null;
310
310
  deserialize(x: Array<any>): Array<TType>;
311
311
  deserialize(x: any): TType;
@@ -107,11 +107,17 @@ export declare class TypeMetadata<TType> extends Metadata {
107
107
  */
108
108
  get customData(): CustomData;
109
109
  /**
110
- * Gets default value.
110
+ * Gets serialized default value.
111
111
  *
112
- * @returns {any|undefined} Resolved default value or undefined.
112
+ * @returns {any|undefined} Resolved serialized default value or undefined.
113
113
  */
114
- get defaultValue(): any | undefined;
114
+ get serializedDefaultValue(): any | undefined;
115
+ /**
116
+ * Gets deserialized default value.
117
+ *
118
+ * @returns {any|undefined} Resolved deserialized default value or undefined.
119
+ */
120
+ get deserializedDefaultValue(): any | undefined;
115
121
  /**
116
122
  * Gets discriminant.
117
123
  *
File without changes
@@ -24,15 +24,6 @@ export interface TypeOptionsBase<TType> {
24
24
  * @type {Discriminator}
25
25
  */
26
26
  discriminator: Discriminator;
27
- /**
28
- * Default value for undefined ones.
29
- *
30
- * Can be a lazy function which returns a value. Assigned only when
31
- * use default value option is true.
32
- *
33
- * @type {any}
34
- */
35
- defaultValue?: any;
36
27
  /**
37
28
  * Factory used to build instances of type.
38
29
  *
@@ -1,4 +1,5 @@
1
1
  import { Alias } from './alias';
2
+ import { DefaultValue } from './default-value';
2
3
  import { Discriminant } from './discriminant';
3
4
  import { GenericArgument } from './generic-argument';
4
5
  import { InjectIndex } from './inject-index';
@@ -20,6 +21,31 @@ export interface TypeOptions<TType> extends Partial<TypeOptionsBase<TType>> {
20
21
  * @type {Alias}
21
22
  */
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;
23
49
  /**
24
50
  * Discriminant.
25
51
  *
File without changes
package/type.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TypeOptions } from './core/type-options';
1
+ import { TypeOptions } from './type-options';
2
2
  /**
3
3
  * Type decorator.
4
4
  *
package/core/alias.d.ts DELETED
@@ -1,6 +0,0 @@
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 +0,0 @@
1
- /**
2
- * Custom data which can be defined by developer.
3
- *
4
- * @type {CustomData}
5
- */
6
- export declare type CustomData = Record<string, any>;
@@ -1,8 +0,0 @@
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 +0,0 @@
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 DELETED
@@ -1,18 +0,0 @@
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
- }
package/core/fn.d.ts DELETED
@@ -1,316 +0,0 @@
1
- /**
2
- * Helper class to encapsulate commonly used functions.
3
- *
4
- * @type {Fn}
5
- */
6
- export declare class Fn {
7
- /**
8
- * Checks if value is null or undefined.
9
- *
10
- * @param {any} x Input value.
11
- *
12
- * @returns {boolean} True when value is null or undefined. False otherwise.
13
- */
14
- static isNil(x: any): x is null | undefined;
15
- /**
16
- * Checks if value is null.
17
- *
18
- * @param {any} x Input value.
19
- *
20
- * @returns {boolean} True when value is null. False otherwise.
21
- */
22
- static isNull(x: any): x is null;
23
- /**
24
- * Checks if value is undefined.
25
- *
26
- * @param {any} x Input value.
27
- *
28
- * @returns {boolean} True when value is undefined. False otherwise.
29
- */
30
- static isUndefined(x: any): x is undefined;
31
- /**
32
- * Checks if value is object.
33
- *
34
- * @param {any} x Input value.
35
- *
36
- * @returns {boolean} True when value is object. False otherwise.
37
- */
38
- static isObject(x: any): x is Record<string, any>;
39
- /**
40
- * Checks if value is a plain object.
41
- *
42
- * @param {any} x Input value.
43
- *
44
- * @returns {boolean} True when value is a plain object. False otherwise.
45
- */
46
- static isPlainObject(x: any): x is Record<string, any>;
47
- /**
48
- * Checks if value is function.
49
- *
50
- * @param {any} x Input value.
51
- *
52
- * @returns {boolean} True when value is function. False otherwise.
53
- */
54
- static isFunction(x: any): x is (...args: Array<any>) => any;
55
- /**
56
- * Checks if value is an arrow function.
57
- *
58
- * @param {any} x Input value.
59
- *
60
- * @returns {boolean} True when value is an arrow function. False otherwise.
61
- */
62
- static isArrowFunction(x: any): x is (...args: Array<any>) => any;
63
- /**
64
- * Checks if value is a constructor.
65
- *
66
- * @param {any} x Input value.
67
- *
68
- * @returns {boolean} True when value is a constructor. False otherwise.
69
- */
70
- static isCtor(x: any): x is new (...args: Array<any>) => any;
71
- /**
72
- * Checks if value is string.
73
- *
74
- * @param {any} x Input value.
75
- *
76
- * @returns {boolean} True when value is string. False otherwise.
77
- */
78
- static isString(x: any): x is string;
79
- /**
80
- * Checks if value is number.
81
- *
82
- * @param {any} x Input value.
83
- *
84
- * @returns {boolean} True when value is number. False otherwise.
85
- */
86
- static isNumber(x: any): x is number;
87
- /**
88
- * Checks if value is symbol.
89
- *
90
- * @param {any} x Input value.
91
- *
92
- * @returns {boolean} True when value is symbol. False otherwise.
93
- */
94
- static isSymbol(x: any): x is symbol;
95
- /**
96
- * Checks if value is boolean.
97
- *
98
- * @param {any} x Input value.
99
- *
100
- * @returns {boolean} True when value is boolean. False otherwise.
101
- */
102
- static isBoolean(x: any): x is boolean;
103
- /**
104
- * Checks if value is array.
105
- *
106
- * @param {any} x Input value.
107
- *
108
- * @returns {boolean} True when value is array. False otherwise.
109
- */
110
- static isArray(x: any): x is Array<any>;
111
- /**
112
- * Checks if value is date.
113
- *
114
- * @param {any} x Input value.
115
- *
116
- * @returns {boolean} True when value is date. False otherwise.
117
- */
118
- static isDate(x: any): x is Date;
119
- /**
120
- * Checks if value is array buffer.
121
- *
122
- * @param {any} x Input value.
123
- *
124
- * @returns {boolean} True when value is array buffer. False otherwise.
125
- */
126
- static isArrayBuffer(x: any): x is ArrayBuffer;
127
- /**
128
- * Checks if value is data view.
129
- *
130
- * @param {any} x Input value.
131
- *
132
- * @returns {boolean} True when value is data view. False otherwise.
133
- */
134
- static isDataView(x: any): x is DataView;
135
- /**
136
- * Checks if value is float 32 array.
137
- *
138
- * @param {any} x Input value.
139
- *
140
- * @returns {boolean} True when value is float 32 array. False otherwise.
141
- */
142
- static isFloat32Array(x: any): x is Float32Array;
143
- /**
144
- * Checks if value is float 64 array.
145
- *
146
- * @param {any} x Input value.
147
- *
148
- * @returns {boolean} True when value is float 64 array. False otherwise.
149
- */
150
- static isFloat64Array(x: any): x is Float64Array;
151
- /**
152
- * Checks if value is int 8 array.
153
- *
154
- * @param {any} x Input value.
155
- *
156
- * @returns {boolean} True when value is int 8 array. False otherwise.
157
- */
158
- static isInt8Array(x: any): x is Int8Array;
159
- /**
160
- * Checks if value is int 16 array.
161
- *
162
- * @param {any} x Input value.
163
- *
164
- * @returns {boolean} True when value is int 16 array. False otherwise.
165
- */
166
- static isInt16Array(x: any): x is Int16Array;
167
- /**
168
- * Checks if value is int 32 array.
169
- *
170
- * @param {any} x Input value.
171
- *
172
- * @returns {boolean} True when value is int 32 array. False otherwise.
173
- */
174
- static isInt32Array(x: any): x is Int32Array;
175
- /**
176
- * Checks if value is map.
177
- *
178
- * @param {any} x Input value.
179
- *
180
- * @returns {boolean} True when value is map. False otherwise.
181
- */
182
- static isMap(x: any): x is Map<any, any>;
183
- /**
184
- * Checks if value is set.
185
- *
186
- * @param {any} x Input value.
187
- *
188
- * @returns {boolean} True when value is set. False otherwise.
189
- */
190
- static isSet(x: any): x is Set<any>;
191
- /**
192
- * Checks if value is uint 8 array.
193
- *
194
- * @param {any} x Input value.
195
- *
196
- * @returns {boolean} True when value is uint 8 array. False otherwise.
197
- */
198
- static isUint8Array(x: any): x is Uint8Array;
199
- /**
200
- * Checks if value is uint 8 clamped array.
201
- *
202
- * @param {any} x Input value.
203
- *
204
- * @returns {boolean} True when value is uint 8 clamped array. False otherwise.
205
- */
206
- static isUint8ClampedArray(x: any): x is Uint8ClampedArray;
207
- /**
208
- * Checks if value is uint 16 array.
209
- *
210
- * @param {any} x Input value.
211
- *
212
- * @returns {boolean} True when value is uint 16 array. False otherwise.
213
- */
214
- static isUint16Array(x: any): x is Uint16Array;
215
- /**
216
- * Checks if value is uint 32 array.
217
- *
218
- * @param {any} x Input value.
219
- *
220
- * @returns {boolean} True when value is uint 32 array. False otherwise.
221
- */
222
- static isUint32Array(x: any): x is Uint32Array;
223
- /**
224
- * Checks if value is weak map.
225
- *
226
- * @param {any} x Input value.
227
- *
228
- * @returns {boolean} True when value is weak map. False otherwise.
229
- */
230
- static isWeakMap(x: any): x is WeakMap<any, any>;
231
- /**
232
- * Checks if value is weak set.
233
- *
234
- * @param {any} x Input value.
235
- *
236
- * @returns {boolean} True when value is weak set. False otherwise.
237
- */
238
- static isWeakSet(x: any): x is WeakSet<any>;
239
- /**
240
- * Checks if provided value is empty.
241
- *
242
- * @param {any} x Input value.
243
- *
244
- * @returns {boolean} True when value is empty. False otherwise.
245
- */
246
- static isEmpty(x: any): boolean;
247
- /**
248
- * Performs deep assignment and returns target object.
249
- *
250
- * @param {Record<string, any>} target Target object.
251
- * @param {Array<Record<string, any>>} sources Source objects.
252
- *
253
- * @returns {Record<string, any>} Target object.
254
- */
255
- static assign<T, U>(target: T, source: U): T & U;
256
- static assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
257
- static assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
258
- /**
259
- * Defines name for any value.
260
- *
261
- * @param {any} x Input value.
262
- *
263
- * @returns {boolean} Name when present. Unknown otherwise.
264
- */
265
- static nameOf(x: any): string;
266
- /**
267
- * Splits a Unicode string into an array of its words.
268
- *
269
- * @param {string} x String.
270
- *
271
- * @returns {Array<string>} Array with the words of provided string.
272
- */
273
- static unicodeWords(x: string): Array<string>;
274
- /**
275
- * Splits a ASCII string into an array of its words.
276
- *
277
- * @param {string} x String.
278
- *
279
- * @returns {Array<string>} Array with the words of provided string.
280
- */
281
- static asciiWords(x: string): Array<string>;
282
- /**
283
- * Splits string into an array of its words.
284
- *
285
- * @param {string} x String.
286
- *
287
- * @returns {Array<string>} Array with the words of provided string.
288
- */
289
- static words(x: string): Array<string>;
290
- /**
291
- * Checks if reflect metadata is supported.
292
- *
293
- * @returns {boolean} True when supported. False otherwise.
294
- */
295
- static isReflectMetadataSupported(): boolean;
296
- /**
297
- * Extracts reflect metadata.
298
- *
299
- * @param {string} metadataKey Unique metadata key.
300
- * @param {any} target Target to extract from.
301
- * @param {string|symbol} targetKey Key in a target.
302
- *
303
- * @returns {any} Metadata for a key or undefined if metadata is not present.
304
- */
305
- static extractReflectMetadata(metadataKey: string, target: any, targetKey?: string | symbol): any;
306
- /**
307
- * Extracts own reflect metadata.
308
- *
309
- * @param {string} metadataKey Unique metadata key.
310
- * @param {any} target Target to extract from.
311
- * @param {string|symbol} targetKey Key in a target.
312
- *
313
- * @returns {any} Metadata for a key or undefined if metadata is not present.
314
- */
315
- static extractOwnReflectMetadata(metadataKey: string, target: any, targetKey?: string | symbol): any;
316
- }