@dipscope/type-manager 4.1.0 → 5.0.0-beta.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.
- package/CHANGELOG.md +27 -0
- package/{LICENSE.txt → LICENSE.md} +0 -0
- package/README.md +150 -324
- package/alias.d.ts +3 -7
- package/custom-data.d.ts +3 -8
- package/{core/default-value-resolver.d.ts → default-value-resolver.d.ts} +0 -0
- package/default-value.d.ts +4 -8
- package/discriminant.d.ts +5 -8
- package/discriminator.d.ts +3 -8
- package/factories/type-factory.d.ts +3 -3
- package/factory.d.ts +15 -8
- package/functions/get-own-reflect-metadata.d.ts +9 -0
- package/functions/get-reflect-metadata.d.ts +10 -0
- package/functions/get-words.d.ts +8 -0
- package/functions/index.d.ts +16 -0
- package/functions/is-arrow-function.d.ts +8 -0
- package/functions/is-ctor-function.d.ts +8 -0
- package/functions/is-data-view.d.ts +8 -0
- package/functions/is-float-32-array.d.ts +8 -0
- package/functions/is-float-64-array.d.ts +8 -0
- package/functions/is-int-16-array.d.ts +8 -0
- package/functions/is-int-32-array.d.ts +8 -0
- package/functions/is-int-8-array.d.ts +8 -0
- package/functions/is-uint-16-array.d.ts +8 -0
- package/functions/is-uint-32-array.d.ts +8 -0
- package/functions/is-uint-8-array.d.ts +8 -0
- package/functions/is-uint-8-clamped-array.d.ts +8 -0
- package/functions/name-of.d.ts +8 -0
- package/{core/generic-argument.d.ts → generic-argument.d.ts} +0 -0
- package/{core/generic-metadata.d.ts → generic-metadata.d.ts} +0 -0
- package/index.d.ts +39 -9
- package/index.js +1 -2
- package/{core/inject-index.d.ts → inject-index.d.ts} +0 -0
- package/{core/inject-metadata.d.ts → inject-metadata.d.ts} +0 -0
- package/{core/inject-options.d.ts → inject-options.d.ts} +2 -2
- package/inject.d.ts +2 -2
- package/injector.d.ts +13 -8
- package/injectors/singleton-injector.d.ts +2 -2
- package/{core/log-level.d.ts → log-level.d.ts} +0 -0
- package/{core/log.d.ts → log.d.ts} +41 -11
- package/{core/metadata.d.ts → metadata.d.ts} +0 -0
- package/naming-convention.d.ts +12 -8
- package/naming-conventions/camel-case-naming-convention.d.ts +1 -1
- package/naming-conventions/flat-case-naming-convention.d.ts +1 -1
- package/naming-conventions/flat-upper-case-naming-convention.d.ts +1 -1
- package/naming-conventions/kebab-case-naming-convention.d.ts +1 -1
- package/naming-conventions/kebab-upper-case-naming-convention.d.ts +1 -1
- package/naming-conventions/pascal-case-naming-convention.d.ts +1 -1
- package/naming-conventions/snake-case-naming-convention.d.ts +1 -1
- package/naming-conventions/snake-upper-case-naming-convention.d.ts +1 -1
- package/package.json +6 -3
- package/{core/property-metadata.d.ts → property-metadata.d.ts} +18 -0
- package/{core/property-name.d.ts → property-name.d.ts} +0 -0
- package/{core/property-options.d.ts → property-options.d.ts} +18 -2
- package/property.d.ts +3 -2
- package/{core/reference-callback.d.ts → reference-callback.d.ts} +1 -1
- package/reference-handler.d.ts +28 -8
- package/reference-handlers/direct-reference-handler.d.ts +11 -12
- package/reference-handlers/lead-reference-handler.d.ts +11 -12
- package/reference-handlers/path-reference-handler.d.ts +11 -12
- package/{core/reference-key.d.ts → reference-key.d.ts} +0 -0
- package/reference-value-getter.d.ts +7 -0
- package/reference-value-setter.d.ts +7 -0
- package/{core/reference-value.d.ts → reference-value.d.ts} +0 -0
- package/serializer-context-options.d.ts +43 -0
- package/{core/serializer-context.d.ts → serializer-context.d.ts} +110 -44
- package/serializer.d.ts +24 -8
- package/serializers/array-buffer-serializer.d.ts +3 -3
- package/serializers/array-serializer.d.ts +3 -3
- package/serializers/boolean-serializer.d.ts +3 -3
- package/serializers/data-view-serializer.d.ts +3 -3
- package/serializers/date-serializer.d.ts +3 -3
- package/serializers/float-32-array-serializer.d.ts +3 -3
- package/serializers/float-64-array-serializer.d.ts +3 -3
- package/serializers/int-16-array-serializer.d.ts +3 -3
- package/serializers/int-32-array-serializer.d.ts +3 -3
- package/serializers/int-8-array-serializer.d.ts +3 -3
- package/serializers/map-serializer.d.ts +15 -3
- package/serializers/number-serializer.d.ts +3 -3
- package/serializers/set-serializer.d.ts +3 -3
- package/serializers/string-serializer.d.ts +3 -3
- package/serializers/type-serializer.d.ts +3 -3
- package/serializers/uint-16-array-serializer.d.ts +3 -3
- package/serializers/uint-32-array-serializer.d.ts +3 -3
- package/serializers/uint-8-array-serializer.d.ts +3 -3
- package/serializers/uint-8-clamped-array-serializer.d.ts +3 -3
- package/{core/type-abstraction.d.ts → type-abstraction.d.ts} +0 -0
- package/{core/type-argument.d.ts → type-argument.d.ts} +0 -0
- package/{core/type-context-entry.d.ts → type-context-entry.d.ts} +0 -0
- package/{core/type-context.d.ts → type-context.d.ts} +0 -0
- package/{core/type-ctor.d.ts → type-ctor.d.ts} +0 -0
- package/{core/type-fn.d.ts → type-fn.d.ts} +0 -0
- package/{core/type-like.d.ts → type-like.d.ts} +0 -0
- package/type-manager-options.d.ts +5 -5
- package/type-manager.d.ts +10 -10
- package/{core/type-metadata-resolver.d.ts → type-metadata-resolver.d.ts} +0 -0
- package/{core/type-metadata-symbol.d.ts → type-metadata-symbol.d.ts} +0 -0
- package/{core/type-metadata.d.ts → type-metadata.d.ts} +24 -6
- package/{core/type-name.d.ts → type-name.d.ts} +0 -0
- package/{core/type-options-base.d.ts → type-options-base.d.ts} +9 -19
- package/{core/type-options.d.ts → type-options.d.ts} +28 -2
- package/{core/type-resolver.d.ts → type-resolver.d.ts} +0 -0
- package/type.d.ts +1 -1
- package/core/alias.d.ts +0 -6
- package/core/custom-data.d.ts +0 -6
- package/core/default-value.d.ts +0 -7
- package/core/discriminant.d.ts +0 -8
- package/core/discriminator.d.ts +0 -6
- package/core/factory.d.ts +0 -18
- package/core/fn.d.ts +0 -316
- package/core/index.d.ts +0 -44
- package/core/index.js +0 -2
- package/core/injector.d.ts +0 -16
- package/core/naming-convention.d.ts +0 -15
- package/core/reference-handler.d.ts +0 -32
- package/core/reference-value-initializer.d.ts +0 -8
- package/core/reference-value-resolver.d.ts +0 -8
- package/core/serializer-context-options.d.ts +0 -63
- package/core/serializer.d.ts +0 -27
- package/deserializable.d.ts +0 -11
- package/deserialized-default-value.d.ts +0 -11
- package/factories/index.js +0 -2
- package/injectable.d.ts +0 -10
- package/injectors/index.js +0 -2
- package/naming-conventions/index.js +0 -2
- package/preserve-discriminator.d.ts +0 -10
- package/reference-handlers/index.js +0 -2
- package/serializable.d.ts +0 -11
- package/serialized-default-value.d.ts +0 -11
- package/serializers/index.js +0 -2
- package/type-and-property.d.ts +0 -12
- package/use-default-value.d.ts +0 -10
- package/use-implicit-conversion.d.ts +0 -10
package/alias.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Type to explicitly define an alias within a source code.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {string} alias Type or property alias.
|
|
7
|
-
*
|
|
8
|
-
* @returns {ClassDecorator&PropertyDecorator} Class and property decorator.
|
|
4
|
+
* @type {Alias}
|
|
9
5
|
*/
|
|
10
|
-
export declare
|
|
6
|
+
export declare type Alias = string;
|
package/custom-data.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { CustomData } from './core';
|
|
2
1
|
/**
|
|
3
|
-
* Custom data
|
|
2
|
+
* Custom data which can be defined by developer.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param {CustomData} customData Custom data.
|
|
8
|
-
*
|
|
9
|
-
* @returns {ClassDecorator&PropertyDecorator} Class and property decorator.
|
|
4
|
+
* @type {CustomData}
|
|
10
5
|
*/
|
|
11
|
-
export declare
|
|
6
|
+
export declare type CustomData = Record<string, any>;
|
|
File without changes
|
package/default-value.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DefaultValueResolver } from './default-value-resolver';
|
|
2
2
|
/**
|
|
3
|
-
* Default value
|
|
3
|
+
* Default value which can be defined by developer.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param {DefaultValue} defaultValue Default value.
|
|
8
|
-
*
|
|
9
|
-
* @returns {ClassDecorator&PropertyDecorator} Class and property decorator.
|
|
5
|
+
* @type {DefaultValue}
|
|
10
6
|
*/
|
|
11
|
-
export declare
|
|
7
|
+
export declare type DefaultValue = any | DefaultValueResolver;
|
package/discriminant.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeName } from './type-name';
|
|
2
2
|
/**
|
|
3
|
-
* Discriminant
|
|
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.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param {Discriminant} discriminant Discriminant.
|
|
8
|
-
*
|
|
9
|
-
* @returns {ClassDecorator} Class decorator.
|
|
6
|
+
* @type {Discriminant}
|
|
10
7
|
*/
|
|
11
|
-
export declare
|
|
8
|
+
export declare type Discriminant = TypeName | string | number;
|
package/discriminator.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { Discriminator } from './core/discriminator';
|
|
2
1
|
/**
|
|
3
|
-
* Discriminator
|
|
2
|
+
* Discriminator intends to indicate the property used to identify the type of an object.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param {Discriminator} discriminator Discriminator.
|
|
8
|
-
*
|
|
9
|
-
* @returns {ClassDecorator} Class decorator.
|
|
4
|
+
* @type {Discriminator}
|
|
10
5
|
*/
|
|
11
|
-
export declare
|
|
6
|
+
export declare type Discriminator = string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Factory } from '../
|
|
2
|
-
import { Injector } from '../
|
|
3
|
-
import { TypeContext } from '../
|
|
1
|
+
import { Factory } from '../factory';
|
|
2
|
+
import { Injector } from '../injector';
|
|
3
|
+
import { TypeContext } from '../type-context';
|
|
4
4
|
/**
|
|
5
5
|
* Type factory.
|
|
6
6
|
*
|
package/factory.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Injector } from './injector';
|
|
2
|
+
import { TypeContext } from './type-context';
|
|
2
3
|
/**
|
|
3
|
-
* Factory
|
|
4
|
+
* Factory for building types.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param {Factory} factory Factory.
|
|
8
|
-
*
|
|
9
|
-
* @returns {ClassDecorator} Class decorator.
|
|
6
|
+
* @type {Factory}
|
|
10
7
|
*/
|
|
11
|
-
export
|
|
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets own reflect metadata.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} metadataKey Unique metadata key.
|
|
5
|
+
* @param {any} target Target to extract from.
|
|
6
|
+
*
|
|
7
|
+
* @returns {any} Metadata for a key or undefined if metadata is not present.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getOwnReflectMetadata(metadataKey: string, target: any): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets reflect metadata.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} metadataKey Unique metadata key.
|
|
5
|
+
* @param {any} target Target to extract from.
|
|
6
|
+
* @param {string|symbol} propertyKey Key in a target.
|
|
7
|
+
*
|
|
8
|
+
* @returns {any} Metadata for a key or undefined if metadata is not present.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getReflectMetadata(metadataKey: string, target: any, propertyKey: string | symbol): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './get-reflect-metadata';
|
|
2
|
+
export * from './get-own-reflect-metadata';
|
|
3
|
+
export * from './get-words';
|
|
4
|
+
export * from './is-arrow-function';
|
|
5
|
+
export * from './is-ctor-function';
|
|
6
|
+
export * from './is-data-view';
|
|
7
|
+
export * from './is-float-32-array';
|
|
8
|
+
export * from './is-float-64-array';
|
|
9
|
+
export * from './is-int-8-array';
|
|
10
|
+
export * from './is-int-16-array';
|
|
11
|
+
export * from './is-int-32-array';
|
|
12
|
+
export * from './is-uint-8-array';
|
|
13
|
+
export * from './is-uint-8-clamped-array';
|
|
14
|
+
export * from './is-uint-16-array';
|
|
15
|
+
export * from './is-uint-32-array';
|
|
16
|
+
export * from './name-of';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if value is a constructor function.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} x Input value.
|
|
5
|
+
*
|
|
6
|
+
* @returns {boolean} True when value is a constructor function. False otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isCtorFunction(x: any): x is new (...args: Array<any>) => any;
|
|
File without changes
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
|
+
export * from './factories';
|
|
2
|
+
export * from './functions';
|
|
3
|
+
export * from './injectors';
|
|
4
|
+
export * from './naming-conventions';
|
|
5
|
+
export * from './reference-handlers';
|
|
6
|
+
export * from './serializers';
|
|
1
7
|
export * from './alias';
|
|
2
8
|
export * from './custom-data';
|
|
9
|
+
export * from './default-value-resolver';
|
|
3
10
|
export * from './default-value';
|
|
4
|
-
export * from './deserializable';
|
|
5
|
-
export * from './deserialized-default-value';
|
|
6
11
|
export * from './discriminant';
|
|
7
12
|
export * from './discriminator';
|
|
8
13
|
export * from './factory';
|
|
14
|
+
export * from './generic-argument';
|
|
15
|
+
export * from './generic-metadata';
|
|
16
|
+
export * from './inject-index';
|
|
17
|
+
export * from './inject-metadata';
|
|
18
|
+
export * from './inject-options';
|
|
9
19
|
export * from './inject';
|
|
10
|
-
export * from './injectable';
|
|
11
20
|
export * from './injector';
|
|
21
|
+
export * from './log-level';
|
|
22
|
+
export * from './log';
|
|
23
|
+
export * from './metadata';
|
|
12
24
|
export * from './naming-convention';
|
|
13
|
-
export * from './
|
|
25
|
+
export * from './property-metadata';
|
|
26
|
+
export * from './property-name';
|
|
27
|
+
export * from './property-options';
|
|
14
28
|
export * from './property';
|
|
29
|
+
export * from './reference-callback';
|
|
15
30
|
export * from './reference-handler';
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
31
|
+
export * from './reference-key';
|
|
32
|
+
export * from './reference-value-getter';
|
|
33
|
+
export * from './reference-value-setter';
|
|
34
|
+
export * from './reference-value';
|
|
35
|
+
export * from './serializer-context-options';
|
|
36
|
+
export * from './serializer-context';
|
|
18
37
|
export * from './serializer';
|
|
19
|
-
export * from './type-
|
|
38
|
+
export * from './type-abstraction';
|
|
39
|
+
export * from './type-argument';
|
|
40
|
+
export * from './type-context-entry';
|
|
41
|
+
export * from './type-context';
|
|
42
|
+
export * from './type-ctor';
|
|
43
|
+
export * from './type-fn';
|
|
44
|
+
export * from './type-like';
|
|
20
45
|
export * from './type-manager-options';
|
|
21
46
|
export * from './type-manager';
|
|
47
|
+
export * from './type-metadata-resolver';
|
|
48
|
+
export * from './type-metadata-symbol';
|
|
49
|
+
export * from './type-metadata';
|
|
50
|
+
export * from './type-name';
|
|
51
|
+
export * from './type-options-base';
|
|
52
|
+
export * from './type-options';
|
|
53
|
+
export * from './type-resolver';
|
|
22
54
|
export * from './type';
|
|
23
|
-
export * from './use-default-value';
|
|
24
|
-
export * from './use-implicit-conversion';
|