@kaokei/di 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -4
- package/dist/index.cjs.js +230 -329
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +2 -2
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.cjs.runtime.js +218 -310
- package/dist/index.cjs.runtime.js.map +1 -1
- package/dist/index.cjs.runtime.min.js +2 -2
- package/dist/index.cjs.runtime.min.js.map +1 -1
- package/dist/index.esm.js +230 -327
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.esm.runtime.js +218 -299
- package/dist/index.esm.runtime.js.map +1 -1
- package/dist/index.esm.runtime.min.js +3 -3
- package/dist/index.esm.runtime.min.js.map +1 -1
- package/dist/index.iife.js +230 -329
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +3 -3
- package/dist/index.iife.min.js.map +1 -1
- package/dist/src/Injector.d.ts +142 -131
- package/dist/src/Injector.d.ts.map +1 -1
- package/dist/src/constants.d.ts +16 -17
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/decorator.d.ts +41 -41
- package/dist/src/decorator.d.ts.map +1 -1
- package/dist/src/errors/CircularDependencyError.d.ts +5 -5
- package/dist/src/errors/CircularDependencyError.d.ts.map +1 -1
- package/dist/src/errors/InjectFailedError.d.ts +5 -5
- package/dist/src/errors/InjectFailedError.d.ts.map +1 -1
- package/dist/src/errors/ProviderNotValidError.d.ts +5 -5
- package/dist/src/errors/ProviderNotValidError.d.ts.map +1 -1
- package/dist/src/errors/TokenNotFoundError.d.ts +5 -5
- package/dist/src/errors/TokenNotFoundError.d.ts.map +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/forwardRef.d.ts +6 -6
- package/dist/src/forwardRef.d.ts.map +1 -1
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils.d.ts +3 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +38 -37
- package/CHANGELOG.md +0 -135
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/index.d.ts.map +0 -1
package/dist/src/Injector.d.ts
CHANGED
|
@@ -1,132 +1,143 @@
|
|
|
1
|
-
export interface InjectionKey<T> extends Symbol {
|
|
2
|
-
}
|
|
3
|
-
|
|
4
|
-
[P in keyof T]: Ret<T[P]>;
|
|
5
|
-
} : T;
|
|
6
|
-
export declare class Injector {
|
|
7
|
-
parent?: Injector;
|
|
8
|
-
providerMap: Map<any, any>;
|
|
9
|
-
beforeCacheHook?: any;
|
|
10
|
-
mergePropertyHook?: any;
|
|
11
|
-
constructor(providers?: any[], parent?: Injector, options?: any);
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
73
|
-
* @
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* @
|
|
82
|
-
* @
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* @
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
1
|
+
export interface InjectionKey<T> extends Symbol {
|
|
2
|
+
}
|
|
3
|
+
type Ret<T> = T extends new (...args: any) => infer S ? S : T extends Array<any> ? {
|
|
4
|
+
[P in keyof T]: Ret<T[P]>;
|
|
5
|
+
} : T;
|
|
6
|
+
export declare class Injector {
|
|
7
|
+
parent?: Injector;
|
|
8
|
+
providerMap: Map<any, any>;
|
|
9
|
+
beforeCacheHook?: any;
|
|
10
|
+
mergePropertyHook?: any;
|
|
11
|
+
constructor(providers?: any[], parent?: Injector, options?: any);
|
|
12
|
+
/**
|
|
13
|
+
* 如果没有parent则是root injector
|
|
14
|
+
*/
|
|
15
|
+
isRootInjector(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 如果没有指定当前token是可选的,则抛出异常
|
|
18
|
+
* @param token
|
|
19
|
+
* @param options
|
|
20
|
+
*/
|
|
21
|
+
checkTokenNotFoundError(token: any, options: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* 对外暴露的接口 - 获取服务对象
|
|
24
|
+
*
|
|
25
|
+
* @param {*} token
|
|
26
|
+
* @param {*} options
|
|
27
|
+
* @return {*} {*}
|
|
28
|
+
* @memberof Injector
|
|
29
|
+
*/
|
|
30
|
+
get<T>(token: InjectionKey<T>, options?: any): T;
|
|
31
|
+
get<R, T = unknown>(token: T, options?: any): T extends R ? Ret<T> : Ret<R>;
|
|
32
|
+
/**
|
|
33
|
+
* 如果token对应的provider不存在
|
|
34
|
+
* 那么就创建一个
|
|
35
|
+
* 目前来看这个方法只是针对root injector使用,属于兜底策略
|
|
36
|
+
* 调用该方法之前需要保证token对应的provider已经存在或者token本身是一个可注入的类
|
|
37
|
+
*
|
|
38
|
+
* @param {*} token
|
|
39
|
+
* @return {*}
|
|
40
|
+
* @memberof Injector
|
|
41
|
+
*/
|
|
42
|
+
getProviderByToken(token: any): any;
|
|
43
|
+
/**
|
|
44
|
+
* 通过provider直接获取service实例
|
|
45
|
+
*
|
|
46
|
+
* @param {*} provider
|
|
47
|
+
* @param {*} options
|
|
48
|
+
* @return {*}
|
|
49
|
+
* @memberof Injector
|
|
50
|
+
*/
|
|
51
|
+
getServiceByProvider(provider: any, options: any): any;
|
|
52
|
+
/**
|
|
53
|
+
* 通过useValue获取服务实例
|
|
54
|
+
*
|
|
55
|
+
* @param {*} provider
|
|
56
|
+
* @return {*}
|
|
57
|
+
* @memberof Injector
|
|
58
|
+
*/
|
|
59
|
+
getServiceUseValueWithProvider(provider: any): any;
|
|
60
|
+
/**
|
|
61
|
+
* 通过useClass获取服务实例
|
|
62
|
+
*
|
|
63
|
+
* @param {*} provider
|
|
64
|
+
* @param {*} options
|
|
65
|
+
* @return {*}
|
|
66
|
+
* @memberof Injector
|
|
67
|
+
*/
|
|
68
|
+
getServiceUseClassWithProvider(provider: any, options: any): any;
|
|
69
|
+
/**
|
|
70
|
+
* 通过useExisting获取服务实例
|
|
71
|
+
*
|
|
72
|
+
* @param {*} provider
|
|
73
|
+
* @param {*} options
|
|
74
|
+
* @return {*}
|
|
75
|
+
* @memberof Injector
|
|
76
|
+
*/
|
|
77
|
+
getServiceUseExistingWithProvider(provider: any, options: any): any;
|
|
78
|
+
/**
|
|
79
|
+
* 通过useFactory获取服务实例
|
|
80
|
+
*
|
|
81
|
+
* @param {*} provider
|
|
82
|
+
* @param {*} options
|
|
83
|
+
* @return {*}
|
|
84
|
+
* @memberof Injector
|
|
85
|
+
*/
|
|
86
|
+
getServiceUseFactoryWithProvider(provider: any, options: any): any;
|
|
87
|
+
/**
|
|
88
|
+
* 获取构造函数的参数-返回数组
|
|
89
|
+
*
|
|
90
|
+
* @param {*} ClassName
|
|
91
|
+
* @param {*} provider
|
|
92
|
+
* @return {*}
|
|
93
|
+
* @memberof Injector
|
|
94
|
+
*/
|
|
95
|
+
getContructorParameters(ClassName: any, provider: any): any;
|
|
96
|
+
/**
|
|
97
|
+
* 获取构造函数的参数的装饰器元数据
|
|
98
|
+
*
|
|
99
|
+
* @param {*} ClassName
|
|
100
|
+
* @return {*}
|
|
101
|
+
* @memberof Injector
|
|
102
|
+
*/
|
|
103
|
+
getContructorParametersMetas(ClassName: any): any;
|
|
104
|
+
/**
|
|
105
|
+
* 获取注入的实例属性-返回对象
|
|
106
|
+
*
|
|
107
|
+
* @param {*} ClassName
|
|
108
|
+
* @param {*} provider
|
|
109
|
+
* @return {*}
|
|
110
|
+
* @memberof Injector
|
|
111
|
+
*/
|
|
112
|
+
getInjectProperties(ClassName: any, provider: any): any;
|
|
113
|
+
/**
|
|
114
|
+
* 获取注入属性的装饰器数据
|
|
115
|
+
*
|
|
116
|
+
* @param {*} ClassName
|
|
117
|
+
* @return {*}
|
|
118
|
+
* @memberof Injector
|
|
119
|
+
*/
|
|
120
|
+
getInjectPropertiesMetas(ClassName: any): any;
|
|
121
|
+
/**
|
|
122
|
+
* 把providers数组转换成map,避免后续的遍历
|
|
123
|
+
*
|
|
124
|
+
* @param {any[]} providers
|
|
125
|
+
* @memberof Injector
|
|
126
|
+
*/
|
|
127
|
+
addProviders(providers: any[]): void;
|
|
128
|
+
/**
|
|
129
|
+
* 添加新的provider
|
|
130
|
+
*
|
|
131
|
+
* @param {*} provider
|
|
132
|
+
* @memberof Injector
|
|
133
|
+
*/
|
|
134
|
+
addProvider(provider: any): void;
|
|
135
|
+
/**
|
|
136
|
+
* 释放当前Injector中的所有服务实例
|
|
137
|
+
*
|
|
138
|
+
* @memberof Injector
|
|
139
|
+
*/
|
|
140
|
+
dispose(): void;
|
|
141
|
+
}
|
|
142
|
+
export {};
|
|
132
143
|
//# sourceMappingURL=Injector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Injector.d.ts","sourceRoot":"","sources":["Injector.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,MAAM;CAAG;
|
|
1
|
+
{"version":3,"file":"Injector.d.ts","sourceRoot":"","sources":["../../src/Injector.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,MAAM;CAAG;AAElD,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GACjD,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAClB;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC7B,CAAC,CAAC;AAoBR,qBAAa,QAAQ;IACZ,MAAM,CAAC,EAAE,QAAQ,CAAC;IAElB,WAAW,gBAAuB;IAElC,eAAe,CAAC,EAAE,GAAG,CAAC;IAEtB,iBAAiB,CAAC,EAAE,GAAG,CAAC;gBAEnB,SAAS,GAAE,GAAG,EAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAE,GAAQ;IAavE;;OAEG;IACH,cAAc;IAId;;;;OAIG;IACH,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAMhD;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC;IAChD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IA2C3E;;;;;;;;;OASG;IACH,kBAAkB,CAAC,KAAK,EAAE,GAAG;IAO7B;;;;;;;OAOG;IACH,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAoBhD;;;;;;OAMG;IACH,8BAA8B,CAAC,QAAQ,EAAE,GAAG;IAM5C;;;;;;;OAOG;IACH,8BAA8B,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAqB1D;;;;;;;OAOG;IACH,iCAAiC,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAa7D;;;;;;;OAOG;IACH,gCAAgC,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IAgB5D;;;;;;;OAOG;IACH,uBAAuB,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAQrD;;;;;;OAMG;IACH,4BAA4B,CAAC,SAAS,EAAE,GAAG;IAqC3C;;;;;;;OAOG;IACH,mBAAmB,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAejD;;;;;;OAMG;IACH,wBAAwB,CAAC,SAAS,EAAE,GAAG;IAmCvC;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE;IAM7B;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,GAAG;IAWzB;;;;OAIG;IACH,OAAO;CAaR"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export declare const DECORATOR_KEYS: {
|
|
2
|
-
DESIGN_PROPERTY_TYPE: string;
|
|
3
|
-
DESIGN_PARAM_TYPES: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
1
|
+
export declare const DECORATOR_KEYS: {
|
|
2
|
+
DESIGN_PROPERTY_TYPE: string;
|
|
3
|
+
DESIGN_PARAM_TYPES: string;
|
|
4
|
+
SERVICE_INJECTED_PARAMS: string;
|
|
5
|
+
SERVICE_INJECTED_PROPS: string;
|
|
6
|
+
INJECT: symbol;
|
|
7
|
+
INJECTABLE: symbol;
|
|
8
|
+
SELF: string;
|
|
9
|
+
SKIP_SELF: string;
|
|
10
|
+
OPTIONAL: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const SERVICE_STATUS: {
|
|
13
|
+
INITING: symbol;
|
|
14
|
+
CONSTRUCTED: symbol;
|
|
15
|
+
MERGED: symbol;
|
|
16
|
+
};
|
|
18
17
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;CAmB1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;CAI1B,CAAC"}
|
package/dist/src/decorator.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 这里记录不同的装饰器的参数的含义
|
|
3
|
-
*
|
|
4
|
-
* class decorator:
|
|
5
|
-
* 只有一个参数:构造函数
|
|
6
|
-
* property decorator:
|
|
7
|
-
* 静态属性:构造函数, 属性名
|
|
8
|
-
* 实例属性:原型, 属性名
|
|
9
|
-
* parameter decorator:
|
|
10
|
-
* 构造函数参数:构造函数, undefined, 0
|
|
11
|
-
* 普通函数参数:原型, 方法名, 0
|
|
12
|
-
* 静态函数参数:构造函数, 方法名, 0
|
|
13
|
-
* method decorator:
|
|
14
|
-
* 静态方法:构造函数, 方法名, 属性描述符
|
|
15
|
-
* 实例方法:原型, 方法名, 属性描述符
|
|
16
|
-
* accessor decorator:
|
|
17
|
-
* 静态访问器:构造函数, 方法名, 属性描述符
|
|
18
|
-
* 实例访问器:原型, 方法名, 属性描述符
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* 创建装饰器的高阶函数
|
|
22
|
-
* 装饰器的通用逻辑就是通过Reflect记录到全局的Map中
|
|
23
|
-
* 所以可以抽象出一个通用逻辑,这里需要注意对Inject装饰器有特殊判断
|
|
24
|
-
*
|
|
25
|
-
* @param {(string | symbol)} decoratorKey 代表某个装饰器的名称
|
|
26
|
-
* @param {*} [defaultValue] 该装饰器函数的默认参数
|
|
27
|
-
* @return {*} 一个装饰器
|
|
28
|
-
*/
|
|
29
|
-
export declare function createDecorator(decoratorKey: string | symbol, defaultValue?: any): (decoratorValue?: any) =>
|
|
30
|
-
export declare const Inject: (decoratorValue?: any) =>
|
|
31
|
-
export declare const Self: (decoratorValue?: any) =>
|
|
32
|
-
export declare const Skip: (decoratorValue?: any) =>
|
|
33
|
-
export declare const Optional: (decoratorValue?: any) =>
|
|
34
|
-
/**
|
|
35
|
-
* 表明服务可注入
|
|
36
|
-
* 主要工作就是收集构造函数的参数类型信息
|
|
37
|
-
*
|
|
38
|
-
* @export
|
|
39
|
-
* @return {*}
|
|
40
|
-
*/
|
|
41
|
-
export declare function Injectable(): (target: any) => any;
|
|
1
|
+
/**
|
|
2
|
+
* 这里记录不同的装饰器的参数的含义
|
|
3
|
+
*
|
|
4
|
+
* class decorator:
|
|
5
|
+
* 只有一个参数:构造函数
|
|
6
|
+
* property decorator:
|
|
7
|
+
* 静态属性:构造函数, 属性名
|
|
8
|
+
* 实例属性:原型, 属性名
|
|
9
|
+
* parameter decorator:
|
|
10
|
+
* 构造函数参数:构造函数, undefined, 0
|
|
11
|
+
* 普通函数参数:原型, 方法名, 0
|
|
12
|
+
* 静态函数参数:构造函数, 方法名, 0
|
|
13
|
+
* method decorator:
|
|
14
|
+
* 静态方法:构造函数, 方法名, 属性描述符
|
|
15
|
+
* 实例方法:原型, 方法名, 属性描述符
|
|
16
|
+
* accessor decorator:
|
|
17
|
+
* 静态访问器:构造函数, 方法名, 属性描述符
|
|
18
|
+
* 实例访问器:原型, 方法名, 属性描述符
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* 创建装饰器的高阶函数
|
|
22
|
+
* 装饰器的通用逻辑就是通过Reflect记录到全局的Map中
|
|
23
|
+
* 所以可以抽象出一个通用逻辑,这里需要注意对Inject装饰器有特殊判断
|
|
24
|
+
*
|
|
25
|
+
* @param {(string | symbol)} decoratorKey 代表某个装饰器的名称
|
|
26
|
+
* @param {*} [defaultValue] 该装饰器函数的默认参数
|
|
27
|
+
* @return {*} 一个装饰器
|
|
28
|
+
*/
|
|
29
|
+
export declare function createDecorator(decoratorKey: string | symbol, defaultValue?: any): (decoratorValue?: any) => any;
|
|
30
|
+
export declare const Inject: (decoratorValue?: any) => any;
|
|
31
|
+
export declare const Self: (decoratorValue?: any) => any;
|
|
32
|
+
export declare const Skip: (decoratorValue?: any) => any;
|
|
33
|
+
export declare const Optional: (decoratorValue?: any) => any;
|
|
34
|
+
/**
|
|
35
|
+
* 表明服务可注入
|
|
36
|
+
* 主要工作就是收集构造函数的参数类型信息
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @return {*}
|
|
40
|
+
*/
|
|
41
|
+
export declare function Injectable(): (target: any) => any;
|
|
42
42
|
//# sourceMappingURL=decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,YAAY,CAAC,EAAE,GAAG,qBAGgB,GAAG,
|
|
1
|
+
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,YAAY,CAAC,EAAE,GAAG,qBAGgB,GAAG,KAAG,GAAG,CA6D5C;AAGD,eAAO,MAAM,MAAM,oBAhEiB,GAAG,KAAG,GAgEkB,CAAC;AAG7D,eAAO,MAAM,IAAI,oBAnEmB,GAAG,KAAG,GAmEoB,CAAC;AAG/D,eAAO,MAAM,IAAI,oBAtEmB,GAAG,KAAG,GAsEyB,CAAC;AAIpE,eAAO,MAAM,QAAQ,oBA1Ee,GAAG,KAAG,GA0E4B,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,UAAU,aACC,GAAG,SAM7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class CircularDependencyError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
message: string;
|
|
4
|
-
constructor(provider: any, options: any);
|
|
5
|
-
}
|
|
1
|
+
export declare class CircularDependencyError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
message: string;
|
|
4
|
+
constructor(provider: any, options: any);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=CircularDependencyError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularDependencyError.d.ts","sourceRoot":"","sources":["CircularDependencyError.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAwB,SAAQ,KAAK;IACzC,IAAI,SAA+B;IAEnC,OAAO,SAAa;gBAEf,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;CAaxC"}
|
|
1
|
+
{"version":3,"file":"CircularDependencyError.d.ts","sourceRoot":"","sources":["../../../src/errors/CircularDependencyError.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAwB,SAAQ,KAAK;IACzC,IAAI,SAA+B;IAEnC,OAAO,SAAa;gBAEf,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;CAaxC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class InjectFailedError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
message: string;
|
|
4
|
-
constructor(injectMeta: any, ClassName: any, key: string | number, paramType?: any);
|
|
5
|
-
}
|
|
1
|
+
export declare class InjectFailedError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
message: string;
|
|
4
|
+
constructor(injectMeta: any, ClassName: any, key: string | number, paramType?: any);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=InjectFailedError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InjectFailedError.d.ts","sourceRoot":"","sources":["InjectFailedError.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IACnC,IAAI,SAAyB;IAC7B,OAAO,SAAa;gBAGzB,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,GAAG,EACd,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,SAAS,CAAC,EAAE,GAAG;CAoBlB"}
|
|
1
|
+
{"version":3,"file":"InjectFailedError.d.ts","sourceRoot":"","sources":["../../../src/errors/InjectFailedError.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IACnC,IAAI,SAAyB;IAC7B,OAAO,SAAa;gBAGzB,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,GAAG,EACd,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,SAAS,CAAC,EAAE,GAAG;CAoBlB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class ProviderNotValidError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
message: string;
|
|
4
|
-
constructor(provider: any);
|
|
5
|
-
}
|
|
1
|
+
export declare class ProviderNotValidError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
message: string;
|
|
4
|
+
constructor(provider: any);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=ProviderNotValidError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderNotValidError.d.ts","sourceRoot":"","sources":["ProviderNotValidError.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;IACvC,IAAI,SAA8B;IAClC,OAAO,SAAa;gBAEf,QAAQ,EAAE,GAAG;CAK1B"}
|
|
1
|
+
{"version":3,"file":"ProviderNotValidError.d.ts","sourceRoot":"","sources":["../../../src/errors/ProviderNotValidError.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;IACvC,IAAI,SAA8B;IAClC,OAAO,SAAa;gBAEf,QAAQ,EAAE,GAAG;CAK1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class TokenNotFoundError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
message: string;
|
|
4
|
-
constructor(token: any);
|
|
5
|
-
}
|
|
1
|
+
export declare class TokenNotFoundError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
message: string;
|
|
4
|
+
constructor(token: any);
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=TokenNotFoundError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenNotFoundError.d.ts","sourceRoot":"","sources":["TokenNotFoundError.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;IACpC,IAAI,SAA2B;IAC/B,OAAO,SAAa;gBAEf,KAAK,EAAE,GAAG;CAKvB"}
|
|
1
|
+
{"version":3,"file":"TokenNotFoundError.d.ts","sourceRoot":"","sources":["../../../src/errors/TokenNotFoundError.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;IACpC,IAAI,SAA2B;IAC/B,OAAO,SAAa;gBAEf,KAAK,EAAE,GAAG;CAKvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CircularDependencyError } from './CircularDependencyError';
|
|
2
|
-
export { InjectFailedError } from './InjectFailedError';
|
|
3
|
-
export { ProviderNotValidError } from './ProviderNotValidError';
|
|
4
|
-
export { TokenNotFoundError } from './TokenNotFoundError';
|
|
1
|
+
export { CircularDependencyError } from './CircularDependencyError';
|
|
2
|
+
export { InjectFailedError } from './InjectFailedError';
|
|
3
|
+
export { ProviderNotValidError } from './ProviderNotValidError';
|
|
4
|
+
export { TokenNotFoundError } from './TokenNotFoundError';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/src/forwardRef.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface ForwardRefFn {
|
|
2
|
-
(): any;
|
|
3
|
-
}
|
|
4
|
-
export declare function forwardRef(fn: ForwardRefFn): ForwardRefFn;
|
|
5
|
-
export declare function isForwardRef(fn: any): fn is () => any;
|
|
6
|
-
export declare function resolveForwardRef<T>(type: T): T;
|
|
1
|
+
export interface ForwardRefFn {
|
|
2
|
+
(): any;
|
|
3
|
+
}
|
|
4
|
+
export declare function forwardRef(fn: ForwardRefFn): ForwardRefFn;
|
|
5
|
+
export declare function isForwardRef(fn: any): fn is () => any;
|
|
6
|
+
export declare function resolveForwardRef<T>(type: T): T;
|
|
7
7
|
//# sourceMappingURL=forwardRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forwardRef.d.ts","sourceRoot":"","sources":["forwardRef.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,IAAI,GAAG,CAAC;CACT;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,YAAY,gBAG1C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,MAAM,GAAG,CAMrD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE/C"}
|
|
1
|
+
{"version":3,"file":"forwardRef.d.ts","sourceRoot":"","sources":["../../src/forwardRef.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,IAAI,GAAG,CAAC;CACT;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,YAAY,gBAG1C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,MAAM,GAAG,CAMrD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE/C"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './decorator';
|
|
4
|
-
export * from './forwardRef';
|
|
5
|
-
export * from './Injector';
|
|
6
|
-
export * from './utils';
|
|
7
|
-
export * from './errors';
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './decorator';
|
|
4
|
+
export * from './forwardRef';
|
|
5
|
+
export * from './Injector';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export * from './errors';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAExB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAExB,cAAc,UAAU,CAAC"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare function has(obj: any, key: string): any;
|
|
2
|
-
export declare function merge(target: any, source: any): any;
|
|
1
|
+
export declare function has(obj: any, key: string): any;
|
|
2
|
+
export declare function merge(target: any, source: any): any;
|
|
3
|
+
export declare function isInjectableToken(token: any): any;
|
|
3
4
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,OAExC;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAO7C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,OAK3C"}
|