@dipscope/type-manager 4.1.1 → 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.
- package/CHANGELOG.md +222 -197
- package/LICENSE.md +201 -201
- package/README.md +1827 -2037
- package/alias.d.ts +6 -10
- package/custom-data.d.ts +6 -11
- package/{core/default-value-resolver.d.ts → default-value-resolver.d.ts} +7 -7
- package/default-value.d.ts +7 -11
- package/discriminant.d.ts +8 -11
- package/discriminator.d.ts +6 -11
- package/factories/index.d.ts +1 -1
- package/factories/type-factory.d.ts +19 -19
- package/factory.d.ts +18 -11
- 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} +7 -7
- package/{core/generic-metadata.d.ts → generic-metadata.d.ts} +7 -7
- package/index.d.ts +54 -24
- package/index.js +1 -2
- package/{core/inject-index.d.ts → inject-index.d.ts} +6 -6
- package/{core/inject-metadata.d.ts → inject-metadata.d.ts} +72 -72
- package/{core/inject-options.d.ts → inject-options.d.ts} +22 -22
- package/inject.d.ts +10 -10
- package/injector.d.ts +16 -11
- package/injectors/index.d.ts +1 -1
- package/injectors/singleton-injector.d.ts +31 -31
- package/{core/log-level.d.ts → log-level.d.ts} +11 -11
- package/{core/log.d.ts → log.d.ts} +95 -65
- package/{core/metadata.d.ts → metadata.d.ts} +42 -42
- package/naming-convention.d.ts +15 -11
- package/naming-conventions/camel-case-naming-convention.d.ts +26 -26
- package/naming-conventions/flat-case-naming-convention.d.ts +25 -25
- package/naming-conventions/flat-upper-case-naming-convention.d.ts +25 -25
- package/naming-conventions/index.d.ts +8 -8
- package/naming-conventions/kebab-case-naming-convention.d.ts +26 -26
- package/naming-conventions/kebab-upper-case-naming-convention.d.ts +26 -26
- package/naming-conventions/pascal-case-naming-convention.d.ts +26 -26
- package/naming-conventions/snake-case-naming-convention.d.ts +26 -26
- package/naming-conventions/snake-upper-case-naming-convention.d.ts +26 -26
- package/package.json +51 -48
- package/{core/property-metadata.d.ts → property-metadata.d.ts} +178 -178
- package/{core/property-name.d.ts → property-name.d.ts} +6 -6
- package/{core/property-options.d.ts → property-options.d.ts} +109 -100
- package/property.d.ts +13 -12
- package/{core/reference-callback.d.ts → reference-callback.d.ts} +7 -7
- package/reference-handler.d.ts +32 -11
- package/reference-handlers/direct-reference-handler.d.ts +33 -33
- package/reference-handlers/index.d.ts +3 -3
- package/reference-handlers/lead-reference-handler.d.ts +34 -34
- package/reference-handlers/path-reference-handler.d.ts +56 -56
- package/{core/reference-key.d.ts → reference-key.d.ts} +6 -6
- package/{core/reference-value-initializer.d.ts → reference-value-initializer.d.ts} +8 -8
- package/{core/reference-value-resolver.d.ts → reference-value-resolver.d.ts} +8 -8
- package/{core/reference-value.d.ts → reference-value.d.ts} +6 -6
- package/{core/serializer-context-options.d.ts → serializer-context-options.d.ts} +63 -63
- package/{core/serializer-context.d.ts → serializer-context.d.ts} +296 -296
- package/serializer.d.ts +27 -11
- package/serializers/array-buffer-serializer.d.ts +28 -28
- package/serializers/array-serializer.d.ts +28 -28
- package/serializers/boolean-serializer.d.ts +37 -37
- package/serializers/data-view-serializer.d.ts +28 -28
- package/serializers/date-serializer.d.ts +28 -28
- package/serializers/float-32-array-serializer.d.ts +28 -28
- package/serializers/float-64-array-serializer.d.ts +28 -28
- package/serializers/index.d.ts +19 -19
- package/serializers/int-16-array-serializer.d.ts +28 -28
- package/serializers/int-32-array-serializer.d.ts +28 -28
- package/serializers/int-8-array-serializer.d.ts +28 -28
- package/serializers/map-serializer.d.ts +28 -28
- package/serializers/number-serializer.d.ts +37 -37
- package/serializers/set-serializer.d.ts +28 -28
- package/serializers/string-serializer.d.ts +37 -37
- package/serializers/type-serializer.d.ts +28 -28
- package/serializers/uint-16-array-serializer.d.ts +28 -28
- package/serializers/uint-32-array-serializer.d.ts +28 -28
- package/serializers/uint-8-array-serializer.d.ts +28 -28
- package/serializers/uint-8-clamped-array-serializer.d.ts +28 -28
- package/{core/type-abstraction.d.ts → type-abstraction.d.ts} +8 -8
- package/{core/type-argument.d.ts → type-argument.d.ts} +9 -9
- package/{core/type-context-entry.d.ts → type-context-entry.d.ts} +36 -36
- package/{core/type-context.d.ts → type-context.d.ts} +58 -58
- package/{core/type-ctor.d.ts → type-ctor.d.ts} +6 -6
- package/{core/type-fn.d.ts → type-fn.d.ts} +8 -8
- package/{core/type-like.d.ts → type-like.d.ts} +7 -7
- package/type-manager-options.d.ts +24 -24
- package/type-manager.d.ts +331 -331
- package/{core/type-metadata-resolver.d.ts → type-metadata-resolver.d.ts} +8 -8
- package/{core/type-metadata-symbol.d.ts → type-metadata-symbol.d.ts} +6 -6
- package/{core/type-metadata.d.ts → type-metadata.d.ts} +304 -304
- package/{core/type-name.d.ts → type-name.d.ts} +6 -6
- package/{core/type-options-base.d.ts → type-options-base.d.ts} +83 -100
- package/{core/type-options.d.ts → type-options.d.ts} +79 -53
- package/{core/type-resolver.d.ts → type-resolver.d.ts} +7 -7
- package/type.d.ts +9 -9
- 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/index.js.map +0 -1
- 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/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/factories/index.js.map +0 -1
- package/index.js.map +0 -1
- package/injectable.d.ts +0 -10
- package/injectors/index.js +0 -2
- package/injectors/index.js.map +0 -1
- package/naming-conventions/index.js +0 -2
- package/naming-conventions/index.js.map +0 -1
- package/preserve-discriminator.d.ts +0 -10
- package/reference-handlers/index.js +0 -2
- package/reference-handlers/index.js.map +0 -1
- package/serializable.d.ts +0 -11
- package/serialized-default-value.d.ts +0 -11
- package/serializers/index.js +0 -2
- package/serializers/index.js.map +0 -1
- package/type-and-property.d.ts +0 -12
- package/use-default-value.d.ts +0 -10
- package/use-implicit-conversion.d.ts +0 -10
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { TypeFn } from './type-fn';
|
|
2
|
-
/**
|
|
3
|
-
* Inject options.
|
|
4
|
-
*
|
|
5
|
-
* @type {InjectOptions<TType>}
|
|
6
|
-
*/
|
|
7
|
-
export interface InjectOptions<TType> {
|
|
8
|
-
/**
|
|
9
|
-
* Parameter key to inject within a type context. If specified then
|
|
10
|
-
* type function will be ignored.
|
|
11
|
-
*
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
key?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Type of injection. Used if key is not specified. Will be resolved using
|
|
17
|
-
* type injector.
|
|
18
|
-
*
|
|
19
|
-
* @type {TypeFn<TType>}
|
|
20
|
-
*/
|
|
21
|
-
typeFn?: TypeFn<TType>;
|
|
22
|
-
}
|
|
1
|
+
import { TypeFn } from './type-fn';
|
|
2
|
+
/**
|
|
3
|
+
* Inject options.
|
|
4
|
+
*
|
|
5
|
+
* @type {InjectOptions<TType>}
|
|
6
|
+
*/
|
|
7
|
+
export interface InjectOptions<TType> {
|
|
8
|
+
/**
|
|
9
|
+
* Parameter key to inject within a type context. If specified then
|
|
10
|
+
* type function will be ignored.
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
key?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Type of injection. Used if key is not specified. Will be resolved using
|
|
17
|
+
* type injector.
|
|
18
|
+
*
|
|
19
|
+
* @type {TypeFn<TType>}
|
|
20
|
+
*/
|
|
21
|
+
typeFn?: TypeFn<TType>;
|
|
22
|
+
}
|
package/inject.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { InjectOptions } from './
|
|
2
|
-
import { TypeFn } from './
|
|
3
|
-
/**
|
|
4
|
-
* Inject decorator.
|
|
5
|
-
*
|
|
6
|
-
* @param {TypeFn<TType>|InjectOptions<TType>|string} x Type function, inject options or parameter key from type context.
|
|
7
|
-
*
|
|
8
|
-
* @returns {ParameterDecorator} Parameter decorator.
|
|
9
|
-
*/
|
|
10
|
-
export declare function Inject<TType>(x: TypeFn<TType> | InjectOptions<TType> | string): ParameterDecorator;
|
|
1
|
+
import { InjectOptions } from './inject-options';
|
|
2
|
+
import { TypeFn } from './type-fn';
|
|
3
|
+
/**
|
|
4
|
+
* Inject decorator.
|
|
5
|
+
*
|
|
6
|
+
* @param {TypeFn<TType>|InjectOptions<TType>|string} x Type function, inject options or parameter key from type context.
|
|
7
|
+
*
|
|
8
|
+
* @returns {ParameterDecorator} Parameter decorator.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Inject<TType>(x: TypeFn<TType> | InjectOptions<TType> | string): ParameterDecorator;
|
package/injector.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* Injector
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { TypeMetadata } from './type-metadata';
|
|
2
|
+
/**
|
|
3
|
+
* Injector used to resolve dependent types.
|
|
4
|
+
*
|
|
5
|
+
* @type {Injector}
|
|
6
|
+
*/
|
|
7
|
+
export interface Injector {
|
|
8
|
+
/**
|
|
9
|
+
* Method to get instance described by type metadata.
|
|
10
|
+
*
|
|
11
|
+
* @param {TypeMetadata<TType>} typeMetadata Type metadata.
|
|
12
|
+
*
|
|
13
|
+
* @returns {TType|undefined} Instance of type described by type metadata or undefined.
|
|
14
|
+
*/
|
|
15
|
+
get<TType>(typeMetadata: TypeMetadata<TType>): TType | undefined;
|
|
16
|
+
}
|
package/injectors/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './singleton-injector';
|
|
1
|
+
export * from './singleton-injector';
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Injector } from '../
|
|
2
|
-
import { TypeMetadata } from '../
|
|
3
|
-
/**
|
|
4
|
-
* Singleton injector.
|
|
5
|
-
*
|
|
6
|
-
* @type {SingletonInjector}
|
|
7
|
-
*/
|
|
8
|
-
export declare class SingletonInjector implements Injector {
|
|
9
|
-
/**
|
|
10
|
-
* Map with resolved types.
|
|
11
|
-
*
|
|
12
|
-
* @type {WeakMap<TypeMetadata<any>, any>}
|
|
13
|
-
*/
|
|
14
|
-
private readonly instanceMap;
|
|
15
|
-
/**
|
|
16
|
-
* Method to get instance described by type metadata.
|
|
17
|
-
*
|
|
18
|
-
* @param {TypeMetadata<TType>} typeMetadata Type metadata.
|
|
19
|
-
*
|
|
20
|
-
* @returns {TType} Instance of type described by type metadata or undefined.
|
|
21
|
-
*/
|
|
22
|
-
get<TType>(typeMetadata: TypeMetadata<TType>): TType | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Creates instance described by type metadata.
|
|
25
|
-
*
|
|
26
|
-
* @param {TypeMetadata<TType>} typeMetadata Type metadata.
|
|
27
|
-
*
|
|
28
|
-
* @returns {TType} Type instance described by type metadata.
|
|
29
|
-
*/
|
|
30
|
-
private init;
|
|
31
|
-
}
|
|
1
|
+
import { Injector } from '../injector';
|
|
2
|
+
import { TypeMetadata } from '../type-metadata';
|
|
3
|
+
/**
|
|
4
|
+
* Singleton injector.
|
|
5
|
+
*
|
|
6
|
+
* @type {SingletonInjector}
|
|
7
|
+
*/
|
|
8
|
+
export declare class SingletonInjector implements Injector {
|
|
9
|
+
/**
|
|
10
|
+
* Map with resolved types.
|
|
11
|
+
*
|
|
12
|
+
* @type {WeakMap<TypeMetadata<any>, any>}
|
|
13
|
+
*/
|
|
14
|
+
private readonly instanceMap;
|
|
15
|
+
/**
|
|
16
|
+
* Method to get instance described by type metadata.
|
|
17
|
+
*
|
|
18
|
+
* @param {TypeMetadata<TType>} typeMetadata Type metadata.
|
|
19
|
+
*
|
|
20
|
+
* @returns {TType} Instance of type described by type metadata or undefined.
|
|
21
|
+
*/
|
|
22
|
+
get<TType>(typeMetadata: TypeMetadata<TType>): TType | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Creates instance described by type metadata.
|
|
25
|
+
*
|
|
26
|
+
* @param {TypeMetadata<TType>} typeMetadata Type metadata.
|
|
27
|
+
*
|
|
28
|
+
* @returns {TType} Type instance described by type metadata.
|
|
29
|
+
*/
|
|
30
|
+
private init;
|
|
31
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Log level.
|
|
3
|
-
*
|
|
4
|
-
* @type {LogLevel}
|
|
5
|
-
*/
|
|
6
|
-
export declare enum LogLevel {
|
|
7
|
-
Info = 0,
|
|
8
|
-
Warn = 1,
|
|
9
|
-
Error = 2,
|
|
10
|
-
None = 3
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Log level.
|
|
3
|
+
*
|
|
4
|
+
* @type {LogLevel}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum LogLevel {
|
|
7
|
+
Info = 0,
|
|
8
|
+
Warn = 1,
|
|
9
|
+
Error = 2,
|
|
10
|
+
None = 3
|
|
11
|
+
}
|
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
import { LogLevel } from './log-level';
|
|
2
|
-
/**
|
|
3
|
-
* Main logger class.
|
|
4
|
-
*
|
|
5
|
-
* @type {Log}
|
|
6
|
-
*/
|
|
7
|
-
export declare class Log {
|
|
8
|
-
/**
|
|
9
|
-
* Log level defines what kind of messages should be displayed in console.
|
|
10
|
-
*
|
|
11
|
-
* @type {LogLevel}
|
|
12
|
-
*/
|
|
13
|
-
logLevel: LogLevel;
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @type {boolean}
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @type {boolean}
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @type {boolean}
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* @
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
1
|
+
import { LogLevel } from './log-level';
|
|
2
|
+
/**
|
|
3
|
+
* Main logger class used by serializers for displaying messages.
|
|
4
|
+
*
|
|
5
|
+
* @type {Log}
|
|
6
|
+
*/
|
|
7
|
+
export declare class Log {
|
|
8
|
+
/**
|
|
9
|
+
* Log level defines what kind of messages should be displayed in console.
|
|
10
|
+
*
|
|
11
|
+
* @type {LogLevel}
|
|
12
|
+
*/
|
|
13
|
+
readonly logLevel: LogLevel;
|
|
14
|
+
/**
|
|
15
|
+
* Info enabled?
|
|
16
|
+
*
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
readonly infoEnabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Warn enabled?
|
|
22
|
+
*
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
25
|
+
readonly warnEnabled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Error enabled?
|
|
28
|
+
*
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
readonly errorEnabled: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Supports console?
|
|
34
|
+
*
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
*/
|
|
37
|
+
readonly supportsConsole: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Supports console log?
|
|
40
|
+
*
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
*/
|
|
43
|
+
readonly supportsConsoleLog: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Supports console info?
|
|
46
|
+
*
|
|
47
|
+
* @type {boolean}
|
|
48
|
+
*/
|
|
49
|
+
readonly supportsConsoleInfo: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Supports console warn?
|
|
52
|
+
*
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
*/
|
|
55
|
+
readonly supportsConsoleWarn: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Supports console error?
|
|
58
|
+
*
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
*/
|
|
61
|
+
readonly supportsConsoleError: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Constructor.
|
|
64
|
+
*
|
|
65
|
+
* @param {LogLevel} logLevel Log level.
|
|
66
|
+
*/
|
|
67
|
+
constructor(logLevel: LogLevel);
|
|
68
|
+
/**
|
|
69
|
+
* Displays info message.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} message Message to display.
|
|
72
|
+
* @param {Array<any>} optionalParams Optional data related to a message.
|
|
73
|
+
*
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
info(message: string, ...optionalParams: Array<any>): void;
|
|
77
|
+
/**
|
|
78
|
+
* Displays warn message.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} message Message to display.
|
|
81
|
+
* @param {Array<any>} optionalParams Optional data related to a message.
|
|
82
|
+
*
|
|
83
|
+
* @returns {void}
|
|
84
|
+
*/
|
|
85
|
+
warn(message: any, ...optionalParams: Array<any>): void;
|
|
86
|
+
/**
|
|
87
|
+
* Displays error message.
|
|
88
|
+
*
|
|
89
|
+
* @param {string} message Message to display.
|
|
90
|
+
* @param {Array<any>} optionalParams Optional data related to a message.
|
|
91
|
+
*
|
|
92
|
+
* @returns {void}
|
|
93
|
+
*/
|
|
94
|
+
error(message: string, ...optionalParams: Array<any>): void;
|
|
95
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { GenericArgument } from './generic-argument';
|
|
2
|
-
import { GenericMetadata } from './generic-metadata';
|
|
3
|
-
import { TypeArgument } from './type-argument';
|
|
4
|
-
import { TypeMetadata } from './type-metadata';
|
|
5
|
-
import { TypeMetadataResolver } from './type-metadata-resolver';
|
|
6
|
-
/**
|
|
7
|
-
* Metadata class.
|
|
8
|
-
*
|
|
9
|
-
* Encapsulates common methods and properties which can be used by all types of metadata.
|
|
10
|
-
*
|
|
11
|
-
* @type {Metadata}
|
|
12
|
-
*/
|
|
13
|
-
export declare class Metadata {
|
|
14
|
-
/**
|
|
15
|
-
* Type metadata resolver.
|
|
16
|
-
*
|
|
17
|
-
* @type {TypeMetadataResolver<any>}
|
|
18
|
-
*/
|
|
19
|
-
readonly typeMetadataResolver: TypeMetadataResolver<any>;
|
|
20
|
-
/**
|
|
21
|
-
* Constructor.
|
|
22
|
-
*
|
|
23
|
-
* @param {TypeMetadataResolver<any>} typeMetadataResolver Type metadata resolver.
|
|
24
|
-
*/
|
|
25
|
-
constructor(typeMetadataResolver: TypeMetadataResolver<any>);
|
|
26
|
-
/**
|
|
27
|
-
* Defines type metadata based on provided type argument.
|
|
28
|
-
*
|
|
29
|
-
* @param {TypeArgument<any>} typeArgument Type argument.
|
|
30
|
-
*
|
|
31
|
-
* @returns {TypeMetadata<any>} Type metadata.
|
|
32
|
-
*/
|
|
33
|
-
protected defineTypeMetadata(typeArgument: TypeArgument<any>): TypeMetadata<any>;
|
|
34
|
-
/**
|
|
35
|
-
* Defines generic metadatas based on provided generic arguments.
|
|
36
|
-
*
|
|
37
|
-
* @param {Array<GenericArgument<any>>} genericArguments Generic arguments.
|
|
38
|
-
*
|
|
39
|
-
* @returns {Array<GenericMetadata<any>>} Generics metadatas.
|
|
40
|
-
*/
|
|
41
|
-
protected defineGenericMetadatas(genericArguments: Array<GenericArgument<any>>): Array<GenericMetadata<any>>;
|
|
42
|
-
}
|
|
1
|
+
import { GenericArgument } from './generic-argument';
|
|
2
|
+
import { GenericMetadata } from './generic-metadata';
|
|
3
|
+
import { TypeArgument } from './type-argument';
|
|
4
|
+
import { TypeMetadata } from './type-metadata';
|
|
5
|
+
import { TypeMetadataResolver } from './type-metadata-resolver';
|
|
6
|
+
/**
|
|
7
|
+
* Metadata class.
|
|
8
|
+
*
|
|
9
|
+
* Encapsulates common methods and properties which can be used by all types of metadata.
|
|
10
|
+
*
|
|
11
|
+
* @type {Metadata}
|
|
12
|
+
*/
|
|
13
|
+
export declare class Metadata {
|
|
14
|
+
/**
|
|
15
|
+
* Type metadata resolver.
|
|
16
|
+
*
|
|
17
|
+
* @type {TypeMetadataResolver<any>}
|
|
18
|
+
*/
|
|
19
|
+
readonly typeMetadataResolver: TypeMetadataResolver<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Constructor.
|
|
22
|
+
*
|
|
23
|
+
* @param {TypeMetadataResolver<any>} typeMetadataResolver Type metadata resolver.
|
|
24
|
+
*/
|
|
25
|
+
constructor(typeMetadataResolver: TypeMetadataResolver<any>);
|
|
26
|
+
/**
|
|
27
|
+
* Defines type metadata based on provided type argument.
|
|
28
|
+
*
|
|
29
|
+
* @param {TypeArgument<any>} typeArgument Type argument.
|
|
30
|
+
*
|
|
31
|
+
* @returns {TypeMetadata<any>} Type metadata.
|
|
32
|
+
*/
|
|
33
|
+
protected defineTypeMetadata(typeArgument: TypeArgument<any>): TypeMetadata<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Defines generic metadatas based on provided generic arguments.
|
|
36
|
+
*
|
|
37
|
+
* @param {Array<GenericArgument<any>>} genericArguments Generic arguments.
|
|
38
|
+
*
|
|
39
|
+
* @returns {Array<GenericMetadata<any>>} Generics metadatas.
|
|
40
|
+
*/
|
|
41
|
+
protected defineGenericMetadatas(genericArguments: Array<GenericArgument<any>>): Array<GenericMetadata<any>>;
|
|
42
|
+
}
|
package/naming-convention.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents naming convention.
|
|
3
|
+
*
|
|
4
|
+
* @type {NamingConvention}
|
|
5
|
+
*/
|
|
6
|
+
export interface NamingConvention {
|
|
7
|
+
/**
|
|
8
|
+
* Converts name from provided to target one.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} name Name.
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} Converted name.
|
|
13
|
+
*/
|
|
14
|
+
convert(name: string): string;
|
|
15
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { NamingConvention } from '../
|
|
2
|
-
/**
|
|
3
|
-
* Camel case naming convention.
|
|
4
|
-
*
|
|
5
|
-
* @type {CamelCaseNamingConvention}
|
|
6
|
-
*/
|
|
7
|
-
export declare class CamelCaseNamingConvention implements NamingConvention {
|
|
8
|
-
/**
|
|
9
|
-
* Converts name from provided to target one.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} name Name.
|
|
12
|
-
*
|
|
13
|
-
* @returns {string} Converted name.
|
|
14
|
-
*/
|
|
15
|
-
convert(name: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Reduce function.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} result Result string.
|
|
20
|
-
* @param {string} word Word to process.
|
|
21
|
-
* @param {number} index Word index.
|
|
22
|
-
*
|
|
23
|
-
* @returns {string} Reduced string.
|
|
24
|
-
*/
|
|
25
|
-
private reduce;
|
|
26
|
-
}
|
|
1
|
+
import { NamingConvention } from '../naming-convention';
|
|
2
|
+
/**
|
|
3
|
+
* Camel case naming convention.
|
|
4
|
+
*
|
|
5
|
+
* @type {CamelCaseNamingConvention}
|
|
6
|
+
*/
|
|
7
|
+
export declare class CamelCaseNamingConvention implements NamingConvention {
|
|
8
|
+
/**
|
|
9
|
+
* Converts name from provided to target one.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name Name.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string} Converted name.
|
|
14
|
+
*/
|
|
15
|
+
convert(name: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Reduce function.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} result Result string.
|
|
20
|
+
* @param {string} word Word to process.
|
|
21
|
+
* @param {number} index Word index.
|
|
22
|
+
*
|
|
23
|
+
* @returns {string} Reduced string.
|
|
24
|
+
*/
|
|
25
|
+
private reduce;
|
|
26
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { NamingConvention } from '../
|
|
2
|
-
/**
|
|
3
|
-
* Flat case naming convention.
|
|
4
|
-
*
|
|
5
|
-
* @type {FlatCaseNamingConvention}
|
|
6
|
-
*/
|
|
7
|
-
export declare class FlatCaseNamingConvention implements NamingConvention {
|
|
8
|
-
/**
|
|
9
|
-
* Converts name from provided to target one.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} name Name.
|
|
12
|
-
*
|
|
13
|
-
* @returns {string} Converted name.
|
|
14
|
-
*/
|
|
15
|
-
convert(name: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Reduce function.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} result Result string.
|
|
20
|
-
* @param {string} word Word to process.
|
|
21
|
-
*
|
|
22
|
-
* @returns {string} Reduced string.
|
|
23
|
-
*/
|
|
24
|
-
private reduce;
|
|
25
|
-
}
|
|
1
|
+
import { NamingConvention } from '../naming-convention';
|
|
2
|
+
/**
|
|
3
|
+
* Flat case naming convention.
|
|
4
|
+
*
|
|
5
|
+
* @type {FlatCaseNamingConvention}
|
|
6
|
+
*/
|
|
7
|
+
export declare class FlatCaseNamingConvention implements NamingConvention {
|
|
8
|
+
/**
|
|
9
|
+
* Converts name from provided to target one.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name Name.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string} Converted name.
|
|
14
|
+
*/
|
|
15
|
+
convert(name: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Reduce function.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} result Result string.
|
|
20
|
+
* @param {string} word Word to process.
|
|
21
|
+
*
|
|
22
|
+
* @returns {string} Reduced string.
|
|
23
|
+
*/
|
|
24
|
+
private reduce;
|
|
25
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { NamingConvention } from '../
|
|
2
|
-
/**
|
|
3
|
-
* Flat upper case naming convention.
|
|
4
|
-
*
|
|
5
|
-
* @type {FlatUpperCaseNamingConvention}
|
|
6
|
-
*/
|
|
7
|
-
export declare class FlatUpperCaseNamingConvention implements NamingConvention {
|
|
8
|
-
/**
|
|
9
|
-
* Converts name from provided to target one.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} name Name.
|
|
12
|
-
*
|
|
13
|
-
* @returns {string} Converted name.
|
|
14
|
-
*/
|
|
15
|
-
convert(name: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Reduce function.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} result Result string.
|
|
20
|
-
* @param {string} word Word to process.
|
|
21
|
-
*
|
|
22
|
-
* @returns {string} Reduced string.
|
|
23
|
-
*/
|
|
24
|
-
private reduce;
|
|
25
|
-
}
|
|
1
|
+
import { NamingConvention } from '../naming-convention';
|
|
2
|
+
/**
|
|
3
|
+
* Flat upper case naming convention.
|
|
4
|
+
*
|
|
5
|
+
* @type {FlatUpperCaseNamingConvention}
|
|
6
|
+
*/
|
|
7
|
+
export declare class FlatUpperCaseNamingConvention implements NamingConvention {
|
|
8
|
+
/**
|
|
9
|
+
* Converts name from provided to target one.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name Name.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string} Converted name.
|
|
14
|
+
*/
|
|
15
|
+
convert(name: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Reduce function.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} result Result string.
|
|
20
|
+
* @param {string} word Word to process.
|
|
21
|
+
*
|
|
22
|
+
* @returns {string} Reduced string.
|
|
23
|
+
*/
|
|
24
|
+
private reduce;
|
|
25
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './camel-case-naming-convention';
|
|
2
|
-
export * from './flat-case-naming-convention';
|
|
3
|
-
export * from './flat-upper-case-naming-convention';
|
|
4
|
-
export * from './kebab-case-naming-convention';
|
|
5
|
-
export * from './kebab-upper-case-naming-convention';
|
|
6
|
-
export * from './pascal-case-naming-convention';
|
|
7
|
-
export * from './snake-case-naming-convention';
|
|
8
|
-
export * from './snake-upper-case-naming-convention';
|
|
1
|
+
export * from './camel-case-naming-convention';
|
|
2
|
+
export * from './flat-case-naming-convention';
|
|
3
|
+
export * from './flat-upper-case-naming-convention';
|
|
4
|
+
export * from './kebab-case-naming-convention';
|
|
5
|
+
export * from './kebab-upper-case-naming-convention';
|
|
6
|
+
export * from './pascal-case-naming-convention';
|
|
7
|
+
export * from './snake-case-naming-convention';
|
|
8
|
+
export * from './snake-upper-case-naming-convention';
|