@tsed/core 6.95.7 → 6.96.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/package.json +1 -1
- package/lib/cjs/decorators/configurable.d.ts +0 -2
- package/lib/cjs/decorators/deprecated.d.ts +0 -32
- package/lib/cjs/decorators/enumerable.d.ts +0 -2
- package/lib/cjs/decorators/index.d.ts +0 -14
- package/lib/cjs/decorators/notConfigurable.d.ts +0 -2
- package/lib/cjs/decorators/notEnumerable.d.ts +0 -2
- package/lib/cjs/decorators/readOnly.d.ts +0 -2
- package/lib/cjs/decorators/storeFn.d.ts +0 -9
- package/lib/cjs/decorators/storeMerge.d.ts +0 -1
- package/lib/cjs/decorators/storeSet.d.ts +0 -1
- package/lib/cjs/decorators/writable.d.ts +0 -2
- package/lib/cjs/domain/AnyToPromise.d.ts +0 -42
- package/lib/cjs/domain/DecoratorTypes.d.ts +0 -10
- package/lib/cjs/domain/Env.d.ts +0 -13
- package/lib/cjs/domain/Hooks.d.ts +0 -45
- package/lib/cjs/domain/Metadata.d.ts +0 -442
- package/lib/cjs/domain/Store.d.ts +0 -69
- package/lib/cjs/domain/Type.d.ts +0 -11
- package/lib/cjs/domain/index.d.ts +0 -7
- package/lib/cjs/errors/UnsupportedDecoratorType.d.ts +0 -5
- package/lib/cjs/index.d.ts +0 -6
- package/lib/cjs/interfaces/AnyDecorator.d.ts +0 -1
- package/lib/cjs/interfaces/DecoratorParameters.d.ts +0 -3
- package/lib/cjs/interfaces/HashOf.d.ts +0 -1
- package/lib/cjs/interfaces/MetadataTypes.d.ts +0 -5
- package/lib/cjs/interfaces/ValueOf.d.ts +0 -1
- package/lib/cjs/interfaces/index.d.ts +0 -4
- package/lib/cjs/utils/catchError.d.ts +0 -2
- package/lib/cjs/utils/decorators/decorateMethodsOf.d.ts +0 -1
- package/lib/cjs/utils/decorators/decoratorArgs.d.ts +0 -2
- package/lib/cjs/utils/decorators/decoratorTypeOf.d.ts +0 -2
- package/lib/cjs/utils/decorators/inheritedDescriptorOf.d.ts +0 -1
- package/lib/cjs/utils/decorators/useDecorators.d.ts +0 -2
- package/lib/cjs/utils/decorators/useMethodDecorators.d.ts +0 -3
- package/lib/cjs/utils/http/getHostInfoFromPort.d.ts +0 -6
- package/lib/cjs/utils/imports/importPackage.d.ts +0 -1
- package/lib/cjs/utils/index.d.ts +0 -13
- package/lib/cjs/utils/objects/ancestorOf.d.ts +0 -2
- package/lib/cjs/utils/objects/ancestorsOf.d.ts +0 -6
- package/lib/cjs/utils/objects/classOf.d.ts +0 -13
- package/lib/cjs/utils/objects/cleanObject.d.ts +0 -6
- package/lib/cjs/utils/objects/constructorOf.d.ts +0 -11
- package/lib/cjs/utils/objects/createInstance.d.ts +0 -1
- package/lib/cjs/utils/objects/deepClone.d.ts +0 -6
- package/lib/cjs/utils/objects/deepExtends.d.ts +0 -10
- package/lib/cjs/utils/objects/deepMerge.d.ts +0 -9
- package/lib/cjs/utils/objects/descriptorOf.d.ts +0 -8
- package/lib/cjs/utils/objects/getClassOrSymbol.d.ts +0 -1
- package/lib/cjs/utils/objects/getConstructorArgNames.d.ts +0 -1
- package/lib/cjs/utils/objects/getEnumerableKeys.d.ts +0 -5
- package/lib/cjs/utils/objects/getValue.d.ts +0 -32
- package/lib/cjs/utils/objects/index.d.ts +0 -43
- package/lib/cjs/utils/objects/isArray.d.ts +0 -13
- package/lib/cjs/utils/objects/isArrowFn.d.ts +0 -1
- package/lib/cjs/utils/objects/isBoolean.d.ts +0 -7
- package/lib/cjs/utils/objects/isClass.d.ts +0 -1
- package/lib/cjs/utils/objects/isCollection.d.ts +0 -6
- package/lib/cjs/utils/objects/isDate.d.ts +0 -6
- package/lib/cjs/utils/objects/isEmpty.d.ts +0 -6
- package/lib/cjs/utils/objects/isEnumerable.d.ts +0 -6
- package/lib/cjs/utils/objects/isFunction.d.ts +0 -1
- package/lib/cjs/utils/objects/isInheritedFrom.d.ts +0 -1
- package/lib/cjs/utils/objects/isNil.d.ts +0 -1
- package/lib/cjs/utils/objects/isNumber.d.ts +0 -7
- package/lib/cjs/utils/objects/isObject.d.ts +0 -1
- package/lib/cjs/utils/objects/isObservable.d.ts +0 -1
- package/lib/cjs/utils/objects/isPlainObject.d.ts +0 -7
- package/lib/cjs/utils/objects/isPrimitive.d.ts +0 -14
- package/lib/cjs/utils/objects/isPromise.d.ts +0 -7
- package/lib/cjs/utils/objects/isProtectedKey.d.ts +0 -5
- package/lib/cjs/utils/objects/isSerializable.d.ts +0 -1
- package/lib/cjs/utils/objects/isStream.d.ts +0 -1
- package/lib/cjs/utils/objects/isString.d.ts +0 -6
- package/lib/cjs/utils/objects/isSymbol.d.ts +0 -6
- package/lib/cjs/utils/objects/methodsOf.d.ts +0 -5
- package/lib/cjs/utils/objects/nameOf.d.ts +0 -14
- package/lib/cjs/utils/objects/objectKeys.d.ts +0 -1
- package/lib/cjs/utils/objects/primitiveOf.d.ts +0 -1
- package/lib/cjs/utils/objects/prototypeOf.d.ts +0 -6
- package/lib/cjs/utils/objects/setValue.d.ts +0 -1
- package/lib/cjs/utils/objects/toMap.d.ts +0 -3
- package/lib/cjs/utils/objects/toStringConstructor.d.ts +0 -1
- package/lib/cjs/utils/proxyDelegation.d.ts +0 -33
- package/lib/cjs/utils/uniq.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
3
|
-
*
|
|
4
|
-
* ```typescript
|
|
5
|
-
* provide Foo {
|
|
6
|
-
*
|
|
7
|
-
* @Deprecated("Foo.method: Use Foo.method2 instead")
|
|
8
|
-
* public method() {
|
|
9
|
-
*
|
|
10
|
-
* }
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.
|
|
14
|
-
* By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.
|
|
15
|
-
*
|
|
16
|
-
* If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`
|
|
17
|
-
* property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.
|
|
18
|
-
*
|
|
19
|
-
* If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`
|
|
20
|
-
* property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.
|
|
21
|
-
*
|
|
22
|
-
* If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,
|
|
23
|
-
* then an exception will be thrown when the deprecated function is called.
|
|
24
|
-
*
|
|
25
|
-
* The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`
|
|
26
|
-
* and `process.traceDeprecation`.
|
|
27
|
-
*
|
|
28
|
-
* @param message
|
|
29
|
-
* @returns {Function}
|
|
30
|
-
* @decorator
|
|
31
|
-
*/
|
|
32
|
-
export declare function Deprecated(message: string): Function;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module common/core
|
|
3
|
-
*/
|
|
4
|
-
/** */
|
|
5
|
-
export * from "./deprecated";
|
|
6
|
-
export * from "./configurable";
|
|
7
|
-
export * from "./enumerable";
|
|
8
|
-
export * from "./writable";
|
|
9
|
-
export * from "./readOnly";
|
|
10
|
-
export * from "./notConfigurable";
|
|
11
|
-
export * from "./notEnumerable";
|
|
12
|
-
export * from "./storeSet";
|
|
13
|
-
export * from "./storeMerge";
|
|
14
|
-
export * from "./storeFn";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Store } from "../domain/Store";
|
|
2
|
-
import { DecoratorParameters } from "../interfaces/DecoratorParameters";
|
|
3
|
-
/**
|
|
4
|
-
* Create a store correctly configured from the parameters given by the decorator.
|
|
5
|
-
* The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).
|
|
6
|
-
* @param {(store: Store, parameters: DecoratorParameters) => void} fn
|
|
7
|
-
* @returns {Function}
|
|
8
|
-
*/
|
|
9
|
-
export declare function StoreFn(fn: (store: Store, parameters: DecoratorParameters) => void): Function;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function StoreMerge(key: any, value: any): Function;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function StoreSet(key: any, value: any): Function;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ignore
|
|
3
|
-
*/
|
|
4
|
-
export declare enum AnyToPromiseStatus {
|
|
5
|
-
PENDING = "PENDING",
|
|
6
|
-
CANCELED = "CANCELED",
|
|
7
|
-
RESOLVED = "RESOLVED",
|
|
8
|
-
REJECTED = "REJECTED"
|
|
9
|
-
}
|
|
10
|
-
export declare enum AnyToPromiseResponseTypes {
|
|
11
|
-
STREAM = "STREAM",
|
|
12
|
-
BUFFER = "BUFFER",
|
|
13
|
-
DATA = "DATA"
|
|
14
|
-
}
|
|
15
|
-
export interface AnyPromiseResult<T = any> {
|
|
16
|
-
state: AnyToPromiseStatus;
|
|
17
|
-
type: AnyToPromiseResponseTypes;
|
|
18
|
-
status?: number;
|
|
19
|
-
headers?: Record<string, any>;
|
|
20
|
-
data: T;
|
|
21
|
-
}
|
|
22
|
-
export declare class AnyToPromise<T = any> {
|
|
23
|
-
#private;
|
|
24
|
-
status: AnyToPromiseStatus;
|
|
25
|
-
args: any[];
|
|
26
|
-
constructor({ hasNextFunction }?: {
|
|
27
|
-
hasNextFunction?: boolean;
|
|
28
|
-
});
|
|
29
|
-
isDone(): boolean;
|
|
30
|
-
get next(): (error?: any) => void;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
call(cb: Function): Promise<AnyPromiseResult<T>>;
|
|
35
|
-
reject(er: any): void;
|
|
36
|
-
resolve(response?: any): void;
|
|
37
|
-
destroy(): void;
|
|
38
|
-
cancel(): any;
|
|
39
|
-
done(status: AnyToPromiseStatus): void;
|
|
40
|
-
handle(process: any, additionalProps?: {}): any;
|
|
41
|
-
protected isCanceledResponse(process: any): boolean;
|
|
42
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare enum DecoratorTypes {
|
|
2
|
-
PARAM = "parameter",
|
|
3
|
-
PARAM_CTOR = "parameter.constructor",
|
|
4
|
-
PARAM_STC = "parameter.static",
|
|
5
|
-
PROP = "property",
|
|
6
|
-
PROP_STC = "property.static",
|
|
7
|
-
METHOD = "method",
|
|
8
|
-
METHOD_STC = "method.static",
|
|
9
|
-
CLASS = "class"
|
|
10
|
-
}
|
package/lib/cjs/domain/Env.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export declare class Hooks {
|
|
2
|
-
private listeners;
|
|
3
|
-
/**
|
|
4
|
-
* Listen a hook event
|
|
5
|
-
* @param event
|
|
6
|
-
* @param cb
|
|
7
|
-
*/
|
|
8
|
-
on(event: string, cb: Function): this;
|
|
9
|
-
/**
|
|
10
|
-
* Remove a listener attached to an event
|
|
11
|
-
* @param event
|
|
12
|
-
* @param cb
|
|
13
|
-
*/
|
|
14
|
-
off(event: string, cb: Function): this;
|
|
15
|
-
/**
|
|
16
|
-
* Trigger an event and call listener.
|
|
17
|
-
* @param event
|
|
18
|
-
* @param args
|
|
19
|
-
* @param callThis
|
|
20
|
-
*/
|
|
21
|
-
emit(event: string, args?: any[], callThis?: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* Trigger an event, listener alter given value and return it.
|
|
24
|
-
* @param event
|
|
25
|
-
* @param value
|
|
26
|
-
* @param args
|
|
27
|
-
* @param callThis
|
|
28
|
-
*/
|
|
29
|
-
alter(event: string, value: any, args?: any[], callThis?: any): any;
|
|
30
|
-
/**
|
|
31
|
-
* Trigger an event and call async listener.
|
|
32
|
-
* @param event
|
|
33
|
-
* @param args
|
|
34
|
-
* @param callThis
|
|
35
|
-
*/
|
|
36
|
-
asyncEmit(event: string, args?: any[], callThis?: any): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Trigger an event, async listener alter given value and return it.
|
|
39
|
-
* @param event
|
|
40
|
-
* @param value
|
|
41
|
-
* @param args
|
|
42
|
-
* @param callThis
|
|
43
|
-
*/
|
|
44
|
-
asyncAlter(event: string, value: any, args?: string[], callThis?: any): Promise<any>;
|
|
45
|
-
}
|
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* @stable
|
|
4
|
-
*/
|
|
5
|
-
export declare class Metadata {
|
|
6
|
-
/**
|
|
7
|
-
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
8
|
-
* @param key A key used to store and retrieve metadata.
|
|
9
|
-
* @param target The target object on which the metadata is defined.
|
|
10
|
-
* @param propertyKey The property key for the target.
|
|
11
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
12
|
-
* @example
|
|
13
|
-
*
|
|
14
|
-
* ```typescript
|
|
15
|
-
* class Example {
|
|
16
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
17
|
-
* // static staticProperty;
|
|
18
|
-
* // property;
|
|
19
|
-
*
|
|
20
|
-
* static staticMethod(p) { }
|
|
21
|
-
* method(p) { }
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* // constructor
|
|
25
|
-
* result = Metadata.get("custom:annotation", Example);
|
|
26
|
-
*
|
|
27
|
-
* // property (on constructor)
|
|
28
|
-
* result = Metadata.get("custom:annotation", Example, "staticProperty");
|
|
29
|
-
*
|
|
30
|
-
* // property (on prototype)
|
|
31
|
-
* result = Metadata.get("custom:annotation", Example.prototype, "property");
|
|
32
|
-
*
|
|
33
|
-
* // method (on constructor)
|
|
34
|
-
* result = Metadata.get("custom:annotation", Example, "staticMethod");
|
|
35
|
-
*
|
|
36
|
-
* // method (on prototype)
|
|
37
|
-
* result = Metadata.get("custom:annotation", Example.prototype, "method");
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
static get(key: string, target: any, propertyKey?: string | symbol): any;
|
|
42
|
-
/**
|
|
43
|
-
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
44
|
-
* @param key A key used to store and retrieve metadata.
|
|
45
|
-
* @param target The target object on which the metadata is defined.
|
|
46
|
-
* @param propertyKey The property key for the target.
|
|
47
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* ```typescript
|
|
51
|
-
* class Example {
|
|
52
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
53
|
-
* // static staticProperty;
|
|
54
|
-
* // property;
|
|
55
|
-
*
|
|
56
|
-
* static staticMethod(p) { }
|
|
57
|
-
* method(p) { }
|
|
58
|
-
* }
|
|
59
|
-
*
|
|
60
|
-
* // constructor
|
|
61
|
-
* result = Metadata.getOwn("custom:annotation", Example);
|
|
62
|
-
*
|
|
63
|
-
* // property (on constructor)
|
|
64
|
-
* result = Metadata.getOwn("custom:annotation", Example, "staticProperty");
|
|
65
|
-
*
|
|
66
|
-
* // property (on prototype)
|
|
67
|
-
* result = Metadata.getOwn("custom:annotation", Example.prototype, "property");
|
|
68
|
-
*
|
|
69
|
-
* // method (on constructor)
|
|
70
|
-
* result = Metadata.getOwn("custom:annotation", Example, "staticMethod");
|
|
71
|
-
*
|
|
72
|
-
* // method (on prototype)
|
|
73
|
-
* result = Metadata.getOwn("custom:annotation", Example.prototype, "method");
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
*/
|
|
77
|
-
static getOwn(key: string, target: any, propertyKey?: string | symbol): any;
|
|
78
|
-
/**
|
|
79
|
-
* Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
|
|
80
|
-
* @param target The target object on which the metadata is defined.
|
|
81
|
-
* @param propertyKey The property key for the target.
|
|
82
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
83
|
-
* @example
|
|
84
|
-
*
|
|
85
|
-
* ```typescript
|
|
86
|
-
* class Example {
|
|
87
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
88
|
-
* // static staticProperty;
|
|
89
|
-
* // property;
|
|
90
|
-
*
|
|
91
|
-
* static staticMethod(p) { }
|
|
92
|
-
* method(p) { }
|
|
93
|
-
* }
|
|
94
|
-
*
|
|
95
|
-
* // on contructor
|
|
96
|
-
* result = Metadata.getType(Example);
|
|
97
|
-
*
|
|
98
|
-
* // property (on constructor)
|
|
99
|
-
* result = Metadata.getType(Example, "staticProperty");
|
|
100
|
-
*
|
|
101
|
-
* // method (on constructor)
|
|
102
|
-
* result = Metadata.getType(Example, "staticMethod");
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
static getType(target: any, propertyKey?: string | symbol): any;
|
|
107
|
-
/**
|
|
108
|
-
* Gets the metadata value for the provided metadata DESIGN_TYPE on the target object or its prototype chain.
|
|
109
|
-
* @param target The target object on which the metadata is defined.
|
|
110
|
-
* @param propertyKey The property key for the target.
|
|
111
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
112
|
-
* @example
|
|
113
|
-
*
|
|
114
|
-
* ```typescript
|
|
115
|
-
* class Example {
|
|
116
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
117
|
-
* // static staticProperty;
|
|
118
|
-
* // property;
|
|
119
|
-
*
|
|
120
|
-
* static staticMethod(p) { }
|
|
121
|
-
* method(p) { }
|
|
122
|
-
* }
|
|
123
|
-
*
|
|
124
|
-
* // on contructor
|
|
125
|
-
* result = Metadata.getOwnType(Example);
|
|
126
|
-
*
|
|
127
|
-
* // property (on constructor)
|
|
128
|
-
* result = Metadata.getOwnType(Example, "staticProperty");
|
|
129
|
-
*
|
|
130
|
-
* // method (on constructor)
|
|
131
|
-
* result = Metadata.getOwnType(Example, "staticMethod");
|
|
132
|
-
* ```
|
|
133
|
-
*
|
|
134
|
-
*/
|
|
135
|
-
static getOwnType(target: any, propertyKey?: string | symbol): any;
|
|
136
|
-
/**
|
|
137
|
-
* Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
|
|
138
|
-
* @param target The target object on which the metadata is defined.
|
|
139
|
-
* @param propertyKey The property key for the target.
|
|
140
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
141
|
-
* @example
|
|
142
|
-
*
|
|
143
|
-
* ```typescript
|
|
144
|
-
* class Example {
|
|
145
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
146
|
-
* // static staticProperty;
|
|
147
|
-
* // property;
|
|
148
|
-
*
|
|
149
|
-
* static staticMethod(p) { }
|
|
150
|
-
* method(p) { }
|
|
151
|
-
* }
|
|
152
|
-
*
|
|
153
|
-
* // on contructor
|
|
154
|
-
* result = Metadata.getReturnType(Example);
|
|
155
|
-
*
|
|
156
|
-
* // property (on constructor)
|
|
157
|
-
* result = Metadata.getReturnType(Example, "staticProperty");
|
|
158
|
-
*
|
|
159
|
-
* // method (on constructor)
|
|
160
|
-
* result = Metadata.getReturnType(Example, "staticMethod");
|
|
161
|
-
* ```
|
|
162
|
-
*
|
|
163
|
-
*/
|
|
164
|
-
static getReturnType(target: any, propertyKey?: string | symbol): any;
|
|
165
|
-
/**
|
|
166
|
-
* Gets the metadata value for the provided metadata DESIGN_RETURN_TYPE on the target object or its prototype chain.
|
|
167
|
-
* @param target The target object on which the metadata is defined.
|
|
168
|
-
* @param propertyKey The property key for the target.
|
|
169
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
170
|
-
* @example
|
|
171
|
-
*
|
|
172
|
-
* ```typescript
|
|
173
|
-
* class Example {
|
|
174
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
175
|
-
* // static staticProperty;
|
|
176
|
-
* // property;
|
|
177
|
-
*
|
|
178
|
-
* static staticMethod(p) { }
|
|
179
|
-
* method(p) { }
|
|
180
|
-
* }
|
|
181
|
-
*
|
|
182
|
-
* // on contructor
|
|
183
|
-
* result = Metadata.getOwnReturnType(Example);
|
|
184
|
-
*
|
|
185
|
-
* // property (on constructor)
|
|
186
|
-
* result = Metadata.getOwnReturnType(Example, "staticProperty");
|
|
187
|
-
*
|
|
188
|
-
* // method (on constructor)
|
|
189
|
-
* result = Metadata.getOwnReturnType(Example, "staticMethod");
|
|
190
|
-
* ```
|
|
191
|
-
*
|
|
192
|
-
*/
|
|
193
|
-
static getOwnReturnType(target: any, propertyKey?: string | symbol): any;
|
|
194
|
-
/**
|
|
195
|
-
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
196
|
-
* @param key A key used to store and retrieve metadata.
|
|
197
|
-
* @param target The target object on which the metadata is defined.
|
|
198
|
-
* @param propertyKey The property key for the target.
|
|
199
|
-
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
200
|
-
* @example
|
|
201
|
-
*
|
|
202
|
-
* ```typescript
|
|
203
|
-
* class Example {
|
|
204
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
205
|
-
* // static staticProperty;
|
|
206
|
-
* // property;
|
|
207
|
-
*
|
|
208
|
-
* static staticMethod(p) { }
|
|
209
|
-
* method(p) { }
|
|
210
|
-
* }
|
|
211
|
-
*
|
|
212
|
-
* // constructor
|
|
213
|
-
* result = Metadata.has("custom:annotation", Example);
|
|
214
|
-
*
|
|
215
|
-
* // property (on constructor)
|
|
216
|
-
* result = Metadata.has("custom:annotation", Example, "staticProperty");
|
|
217
|
-
*
|
|
218
|
-
* // property (on prototype)
|
|
219
|
-
* result = Metadata.has("custom:annotation", Example.prototype, "property");
|
|
220
|
-
*
|
|
221
|
-
* // method (on constructor)
|
|
222
|
-
* result = Metadata.has("custom:annotation", Example, "staticMethod");
|
|
223
|
-
*
|
|
224
|
-
* // method (on prototype)
|
|
225
|
-
* result = Metadata.has("custom:annotation", Example.prototype, "method");
|
|
226
|
-
* ```
|
|
227
|
-
*
|
|
228
|
-
*/
|
|
229
|
-
static has(key: string, target: any, propertyKey?: string | symbol): boolean;
|
|
230
|
-
/**
|
|
231
|
-
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
232
|
-
* @param key A key used to store and retrieve metadata.
|
|
233
|
-
* @param target The target object on which the metadata is defined.
|
|
234
|
-
* @param propertyKey The property key for the target.
|
|
235
|
-
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
236
|
-
* @example
|
|
237
|
-
*
|
|
238
|
-
* ```typescript
|
|
239
|
-
* class Example {
|
|
240
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
241
|
-
* // static staticProperty;
|
|
242
|
-
* // property;
|
|
243
|
-
*
|
|
244
|
-
* static staticMethod(p) { }
|
|
245
|
-
* method(p) { }
|
|
246
|
-
* }
|
|
247
|
-
*
|
|
248
|
-
* // constructor
|
|
249
|
-
* result = Metadata.has("custom:annotation", Example);
|
|
250
|
-
*
|
|
251
|
-
* // property (on constructor)
|
|
252
|
-
* result = Metadata.hasOwn("custom:annotation", Example, "staticProperty");
|
|
253
|
-
*
|
|
254
|
-
* // property (on prototype)
|
|
255
|
-
* result = Metadata.hasOwn("custom:annotation", Example.prototype, "property");
|
|
256
|
-
*
|
|
257
|
-
* // method (on constructor)
|
|
258
|
-
* result = Metadata.hasOwn("custom:annotation", Example, "staticMethod");
|
|
259
|
-
*
|
|
260
|
-
* // method (on prototype)
|
|
261
|
-
* result = Metadata.hasOwn("custom:annotation", Example.prototype, "method");
|
|
262
|
-
* ```
|
|
263
|
-
*
|
|
264
|
-
*/
|
|
265
|
-
static hasOwn(key: string, target: any, propertyKey?: string | symbol): boolean;
|
|
266
|
-
/**
|
|
267
|
-
* Deletes the metadata entry from the target object with the provided key.
|
|
268
|
-
* @param key A key used to store and retrieve metadata.
|
|
269
|
-
* @param target The target object on which the metadata is defined.
|
|
270
|
-
* @param propertyKey The property key for the target.
|
|
271
|
-
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
|
272
|
-
* @example
|
|
273
|
-
*
|
|
274
|
-
* ```typescript
|
|
275
|
-
* class Example {
|
|
276
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
277
|
-
* // static staticProperty;
|
|
278
|
-
* // property;
|
|
279
|
-
*
|
|
280
|
-
* static staticMethod(p) { }
|
|
281
|
-
* method(p) { }
|
|
282
|
-
* }
|
|
283
|
-
*
|
|
284
|
-
* // constructor
|
|
285
|
-
* result = Metadata.delete("custom:annotation", Example);
|
|
286
|
-
*
|
|
287
|
-
* // property (on constructor)
|
|
288
|
-
* result = Metadata.delete("custom:annotation", Example, "staticProperty");
|
|
289
|
-
*
|
|
290
|
-
* // property (on prototype)
|
|
291
|
-
* result = Metadata.delete("custom:annotation", Example.prototype, "property");
|
|
292
|
-
*
|
|
293
|
-
* // method (on constructor)
|
|
294
|
-
* result = Metadata.delete("custom:annotation", Example, "staticMethod");
|
|
295
|
-
*
|
|
296
|
-
* // method (on prototype)
|
|
297
|
-
* result = Metadata.delete("custom:annotation", Example.prototype, "method");
|
|
298
|
-
* ```
|
|
299
|
-
*
|
|
300
|
-
*/
|
|
301
|
-
static delete(key: string, target: any, propertyKey?: string | symbol): boolean;
|
|
302
|
-
/**
|
|
303
|
-
* Set the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
|
|
304
|
-
* @param target The target object on which the metadata is defined.
|
|
305
|
-
* @param propertyKey The property key for the target.
|
|
306
|
-
* @param value A value that contains attached metadata.
|
|
307
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
308
|
-
* @example
|
|
309
|
-
*
|
|
310
|
-
* ```typescript
|
|
311
|
-
* class Example {
|
|
312
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
313
|
-
* // static staticProperty;
|
|
314
|
-
* // property;
|
|
315
|
-
*
|
|
316
|
-
* static staticMethod(p) { }
|
|
317
|
-
* method(p) { }
|
|
318
|
-
* }
|
|
319
|
-
*
|
|
320
|
-
* // on contructor
|
|
321
|
-
* result = Metadata.setParamTypes(Example, undefined, [Object]);
|
|
322
|
-
*
|
|
323
|
-
* // property (on constructor)
|
|
324
|
-
* result = Metadata.setParamTypes(Example, "staticProperty", [Object]);
|
|
325
|
-
*
|
|
326
|
-
* // property (on prototype)
|
|
327
|
-
* result = Metadata.setParamTypes(Example.prototype, "property", [Object]);
|
|
328
|
-
*
|
|
329
|
-
* // method (on constructor)
|
|
330
|
-
* result = Metadata.setParamTypes(Example, "staticMethod", [Object]);
|
|
331
|
-
*
|
|
332
|
-
* // method (on prototype)
|
|
333
|
-
* result = Metadata.setParamTypes(Example.prototype, "method", [Object]);
|
|
334
|
-
* ```
|
|
335
|
-
*
|
|
336
|
-
*/
|
|
337
|
-
static setParamTypes(target: any, propertyKey: string | symbol, value: any): void;
|
|
338
|
-
/**
|
|
339
|
-
* Get all metadata for a metadataKey.
|
|
340
|
-
* @param metadataKey
|
|
341
|
-
*/
|
|
342
|
-
static getTargetsFromPropertyKey: (metadataKey: string | symbol) => any[];
|
|
343
|
-
/**
|
|
344
|
-
* Define a unique metadata entry on the target.
|
|
345
|
-
* @param key A key used to store and retrieve metadata.
|
|
346
|
-
* @param value A value that contains attached metadata.
|
|
347
|
-
* @param target The target object on which to define metadata.
|
|
348
|
-
* @param propertyKey The property key for the target.
|
|
349
|
-
* @example
|
|
350
|
-
*
|
|
351
|
-
* ```typescript
|
|
352
|
-
* class Example {
|
|
353
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
354
|
-
* // static staticProperty;
|
|
355
|
-
* // property;
|
|
356
|
-
*
|
|
357
|
-
* static staticMethod(p) { }
|
|
358
|
-
* method(p) { }
|
|
359
|
-
* }
|
|
360
|
-
*
|
|
361
|
-
* // constructor
|
|
362
|
-
* Reflect.defineMetadata("custom:annotation", options, Example);
|
|
363
|
-
*
|
|
364
|
-
* // property (on constructor)
|
|
365
|
-
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
|
|
366
|
-
*
|
|
367
|
-
* // property (on prototype)
|
|
368
|
-
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
|
|
369
|
-
*
|
|
370
|
-
* // method (on constructor)
|
|
371
|
-
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
|
|
372
|
-
*
|
|
373
|
-
* // method (on prototype)
|
|
374
|
-
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
|
|
375
|
-
*
|
|
376
|
-
* // decorator factory as metadata-producing annotation.
|
|
377
|
-
* function MyAnnotation(options): PropertyDecorator {
|
|
378
|
-
* return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
|
|
379
|
-
* }
|
|
380
|
-
* ```
|
|
381
|
-
*
|
|
382
|
-
*/
|
|
383
|
-
static set(key: string, value: any, target: any, propertyKey?: string | symbol): void;
|
|
384
|
-
/**
|
|
385
|
-
* Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
|
|
386
|
-
* @param targetPrototype
|
|
387
|
-
* @param propertyKey The property key for the target.
|
|
388
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
389
|
-
* @example
|
|
390
|
-
*
|
|
391
|
-
* ```typescript
|
|
392
|
-
* class Example {
|
|
393
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
394
|
-
* // static staticProperty;
|
|
395
|
-
* // property;
|
|
396
|
-
*
|
|
397
|
-
* static staticMethod(p) { }
|
|
398
|
-
* method(p) { }
|
|
399
|
-
* }
|
|
400
|
-
*
|
|
401
|
-
* // on contructor
|
|
402
|
-
* result = Metadata.getParamTypes(Example.prototype);
|
|
403
|
-
*
|
|
404
|
-
* // property (on constructor)
|
|
405
|
-
* result = Metadata.getParamTypes(Example.prototype, "staticProperty");
|
|
406
|
-
*
|
|
407
|
-
* // method (on constructor)
|
|
408
|
-
* result = Metadata.getParamTypes(Example.prototype, "staticMethod");
|
|
409
|
-
* ```
|
|
410
|
-
*
|
|
411
|
-
*/
|
|
412
|
-
static getParamTypes(targetPrototype: any, propertyKey?: string | symbol): any[];
|
|
413
|
-
/**
|
|
414
|
-
* Gets the metadata value for the provided metadata DESIGN_PARAM_TYPES on the target object or its prototype chain.
|
|
415
|
-
* @param target The target object on which the metadata is defined.
|
|
416
|
-
* @param propertyKey The property key for the target.
|
|
417
|
-
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
418
|
-
* @example
|
|
419
|
-
*
|
|
420
|
-
* ```typescript
|
|
421
|
-
* class Example {
|
|
422
|
-
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
423
|
-
* // static staticProperty;
|
|
424
|
-
* // property;
|
|
425
|
-
*
|
|
426
|
-
* static staticMethod(p) { }
|
|
427
|
-
* method(p) { }
|
|
428
|
-
* }
|
|
429
|
-
*
|
|
430
|
-
* // on contructor
|
|
431
|
-
* result = Metadata.getParamTypes(Example);
|
|
432
|
-
*
|
|
433
|
-
* // property (on constructor)
|
|
434
|
-
* result = Metadata.getParamTypes(Example, "staticProperty");
|
|
435
|
-
*
|
|
436
|
-
* // method (on constructor)
|
|
437
|
-
* result = Metadata.getParamTypes(Example, "staticMethod");
|
|
438
|
-
* ```
|
|
439
|
-
*
|
|
440
|
-
*/
|
|
441
|
-
static getOwnParamTypes(target: any, propertyKey?: string | symbol): any[];
|
|
442
|
-
}
|