@spinajs/di 2.0.180 → 2.0.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/lib/cjs/array.d.ts +10 -10
  2. package/lib/cjs/array.js +13 -13
  3. package/lib/cjs/binder.d.ts +39 -39
  4. package/lib/cjs/binder.js +96 -96
  5. package/lib/cjs/container-cache.d.ts +17 -17
  6. package/lib/cjs/container-cache.js +63 -63
  7. package/lib/cjs/container.d.ts +133 -133
  8. package/lib/cjs/container.js +466 -466
  9. package/lib/cjs/container.js.map +1 -1
  10. package/lib/cjs/decorators.d.ts +141 -141
  11. package/lib/cjs/decorators.js +303 -303
  12. package/lib/cjs/enums.d.ts +31 -31
  13. package/lib/cjs/enums.js +35 -35
  14. package/lib/cjs/enums.js.map +1 -1
  15. package/lib/cjs/exceptions.d.ts +17 -17
  16. package/lib/cjs/exceptions.js +25 -25
  17. package/lib/cjs/helpers.d.ts +35 -35
  18. package/lib/cjs/helpers.js +86 -86
  19. package/lib/cjs/index.d.ts +12 -12
  20. package/lib/cjs/index.js +41 -41
  21. package/lib/cjs/interfaces.d.ts +172 -172
  22. package/lib/cjs/interfaces.js +53 -53
  23. package/lib/cjs/registry.d.ts +14 -14
  24. package/lib/cjs/registry.js +80 -80
  25. package/lib/cjs/root.d.ts +108 -108
  26. package/lib/cjs/root.js +216 -217
  27. package/lib/cjs/root.js.map +1 -1
  28. package/lib/cjs/types.d.ts +13 -13
  29. package/lib/cjs/types.js +2 -2
  30. package/lib/mjs/array.d.ts +10 -10
  31. package/lib/mjs/array.js +9 -9
  32. package/lib/mjs/binder.d.ts +39 -39
  33. package/lib/mjs/binder.js +92 -92
  34. package/lib/mjs/container-cache.d.ts +17 -17
  35. package/lib/mjs/container-cache.js +59 -59
  36. package/lib/mjs/container.d.ts +133 -133
  37. package/lib/mjs/container.js +459 -459
  38. package/lib/mjs/container.js.map +1 -1
  39. package/lib/mjs/decorators.d.ts +141 -141
  40. package/lib/mjs/decorators.js +266 -266
  41. package/lib/mjs/enums.d.ts +31 -31
  42. package/lib/mjs/enums.js +32 -32
  43. package/lib/mjs/enums.js.map +1 -1
  44. package/lib/mjs/exceptions.d.ts +17 -17
  45. package/lib/mjs/exceptions.js +19 -19
  46. package/lib/mjs/helpers.d.ts +35 -35
  47. package/lib/mjs/helpers.js +72 -72
  48. package/lib/mjs/index.d.ts +12 -12
  49. package/lib/mjs/index.js +12 -12
  50. package/lib/mjs/interfaces.d.ts +172 -172
  51. package/lib/mjs/interfaces.js +45 -45
  52. package/lib/mjs/registry.d.ts +14 -14
  53. package/lib/mjs/registry.js +76 -76
  54. package/lib/mjs/root.d.ts +108 -108
  55. package/lib/mjs/root.js +159 -159
  56. package/lib/mjs/types.d.ts +13 -13
  57. package/lib/mjs/types.js +1 -1
  58. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  59. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  60. package/package.json +2 -2
@@ -1,267 +1,267 @@
1
- import { ResolveType } from './enums.js';
2
- import * as DI from './root.js';
3
- import { isConstructor, isTypedArray } from './helpers.js';
4
- export const DI_DESCRIPTION_SYMBOL = '__DI_INJECTION_DESCRIPTOR__';
5
- export function AddDependencyForProperty(callback) {
6
- return (target, propertyKey, indexOrDescriptor) => {
7
- let descriptor = Reflect.getOwnMetadata(DI_DESCRIPTION_SYMBOL, target.constructor);
8
- if (!descriptor) {
9
- descriptor = {
10
- inject: [],
11
- resolver: ResolveType.Singleton,
12
- };
13
- Reflect.defineMetadata(DI_DESCRIPTION_SYMBOL, descriptor, target.constructor);
14
- }
15
- if (callback) {
16
- callback(descriptor, target, propertyKey, indexOrDescriptor);
17
- }
18
- };
19
- }
20
- export function AddDependency(callback) {
21
- return (target, propertyKey, indexOrDescriptor) => {
22
- let descriptor = Reflect.getOwnMetadata(DI_DESCRIPTION_SYMBOL, target);
23
- if (!descriptor) {
24
- descriptor = {
25
- inject: [],
26
- resolver: ResolveType.Singleton,
27
- };
28
- Reflect.defineMetadata(DI_DESCRIPTION_SYMBOL, descriptor, target);
29
- }
30
- if (callback) {
31
- callback(descriptor, target, propertyKey, indexOrDescriptor);
32
- }
33
- };
34
- }
35
- /**
36
- *
37
- * Class with this decorator is automatically registered in DI container an can be resolved.
38
- * NOTE: we dont need to register class before resolving. Injectable decorator is mainly used in extensions & plugins
39
- * to register implementation that can be resolved by framework or other parts without knowing about specific implementations eg.
40
- * avaible database drivers.
41
- *
42
- * @param as - register class in DI container as something else.
43
- *
44
- * @example
45
- * ```typescript
46
- *
47
- * @Injectable(OrmDriver)
48
- * class MysqlOrmDriver{
49
- *
50
- * // implementation ...
51
- * }
52
- *
53
- *
54
- * // somewhere else in code
55
- * const avaibleDrivers = DI.resolve(Array.of(OrmDriver));
56
- *
57
- *
58
- * ```
59
- *
60
- */
61
- export function Injectable(as) {
62
- return (target) => {
63
- if (as) {
64
- DI.register(target).as(as);
65
- }
66
- else {
67
- DI.register(target).asSelf();
68
- }
69
- };
70
- }
71
- /**
72
- * Sets dependency injection guidelines - what to inject for specified class. If multiple instances are registered at specified type,
73
- * only first one is resolved and injected
74
- * @param args - what to inject - class definitions
75
- * @example
76
- * ```javascript
77
- *
78
- * @Inject(Bar)
79
- * class Foo{
80
- *
81
- * @Inject(Bar)
82
- * barInstance : Bar;
83
- *
84
- * constructor(bar : Bar){
85
- * // bar is injected when Foo is created via DI container
86
- * this.barInstance = bar;
87
- * }
88
- *
89
- * someFunc(){
90
- *
91
- * this._barInstance.doSmth();
92
- * }
93
- * }
94
- *
95
- * ```
96
- */
97
- export function Inject(...args) {
98
- return AddDependency((descriptor) => {
99
- for (const a of args) {
100
- // avoid injecting duplicates
101
- if (!descriptor.inject.find((i) => {
102
- if (isTypedArray(i)) {
103
- if (isTypedArray(a)) {
104
- return i.Type === a.Type;
105
- }
106
- else {
107
- return i.Type === a;
108
- }
109
- }
110
- else {
111
- return i.inject === a;
112
- }
113
- })) {
114
- descriptor.inject.push({
115
- autoinject: false,
116
- autoinjectKey: '',
117
- inject: a,
118
- mapFunc: null,
119
- });
120
- }
121
- }
122
- });
123
- }
124
- /**
125
- * Automatically injects dependency based on reflected property type. Uses experimental typescript reflection api
126
- * If decorator is applied to array property all registered type instances are injected, otherwise only first / only that exists
127
- *
128
- * @param injectType - when injecting array of some type, type must be explicitly provided. Typescript reflection cant reflect declared array types
129
- * @param mapFunc - when injecting array we sometimes need services mapped by some kind of key, so later we dont need to search o(n) elements for specific service, but reference by key/name
130
- * @example
131
- * ```javascript
132
- * class Foo{
133
- *
134
- * @Autoinject
135
- * barInstance : Bar;
136
- *
137
- * constructor(){
138
- * // ....
139
- * }
140
- *
141
- * someFunc(){
142
- *
143
- * // automatically injected dependency is avaible now
144
- * this.barInstance.doSmth();
145
- * }
146
- * }
147
- *
148
- * ```
149
- */
150
- export function Autoinject(typeOrOptions, options) {
151
- return AddDependencyForProperty((descriptor, target, propertyKey) => {
152
- let type = Reflect.getMetadata('design:type', target, propertyKey);
153
- const isArray = type.name === 'Array' || type.name === 'Map';
154
- let opt = options;
155
- if (isConstructor(typeOrOptions)) {
156
- if (isArray && !typeOrOptions) {
157
- throw new Error('you must provide inject type when injecting array');
158
- }
159
- type = typeOrOptions;
160
- }
161
- else {
162
- opt = typeOrOptions;
163
- }
164
- descriptor.inject.push({
165
- autoinject: true,
166
- autoinjectKey: propertyKey,
167
- inject: isArray ? Array.ofType(typeOrOptions) : type,
168
- mapFunc: opt?.mapFunc,
169
- options: opt?.options,
170
- });
171
- });
172
- }
173
- /**
174
- * Lazy injects service to object. Use only with class properties
175
- *
176
- * @param service - class or name of service to inject
177
- *
178
- * @example
179
- * ```javascript
180
- *
181
- * class Foo{
182
- * ...
183
- *
184
- * @LazyInject(Bar)
185
- * _barInstance : Bar; // _barInstance is not yet resolved
186
- *
187
- * someFunc(){
188
- * // barInstance is resolved only when first accessed
189
- * this._barInstance.doSmth();
190
- * }
191
- * }
192
- *
193
- * ```
194
- */
195
- export function LazyInject(service) {
196
- return (target, key) => {
197
- const type = Reflect.getMetadata('design:type', target, key);
198
- // property getter
199
- const getter = () => {
200
- if (!service) {
201
- return DI.resolve(type);
202
- }
203
- else {
204
- if (typeof service === 'string') {
205
- return DI.get(service);
206
- }
207
- else {
208
- return DI.resolve(service);
209
- }
210
- }
211
- };
212
- // Create new property with getter and setter
213
- Object.defineProperty(target, key, {
214
- get: getter,
215
- });
216
- };
217
- }
218
- /**
219
- * Per child instance injection decorator - object is resolved once per container - child containers have own instances.
220
- */
221
- export function PerChildInstance() {
222
- return AddDependency((descriptor) => {
223
- descriptor.resolver = ResolveType.PerChildContainer;
224
- });
225
- }
226
- /**
227
- * NewInstance injection decorator - every time class is injected - its created from scratch
228
- */
229
- export function NewInstance() {
230
- return AddDependency((descriptor) => {
231
- descriptor.resolver = ResolveType.NewInstance;
232
- });
233
- }
234
- /**
235
- * If we have multiple registered types at one base type
236
- * we can resolve only one by default. Per instance means, that
237
- * we can resolve all types registered at base type once. Limitaiton is
238
- * that, you should call resolve not on base type, but on target type.
239
- *
240
- * In comparison, Singleton flag means that only one instance can be resolved
241
- * for base class
242
- */
243
- export function PerInstance() {
244
- return AddDependency((descriptor) => {
245
- descriptor.resolver = ResolveType.PerInstance;
246
- });
247
- }
248
- /**
249
- *
250
- * Before resolve, check function on all resolved instances of given type is called with creation options
251
- * It is used for ensuring that for eg. only one instance of service with provided
252
- * options is resolved, but allow to create with other option set
253
- *
254
- * @returns
255
- */
256
- export function PerInstanceCheck() {
257
- return AddDependency((descriptor) => {
258
- descriptor.resolver = ResolveType.PerInstanceCheck;
259
- });
260
- }
261
- /**
262
- * Singleton injection decorator - every time class is resolved - its created only once globally ( even in child DI containers )
263
- */
264
- export function Singleton() {
265
- return AddDependency();
266
- }
1
+ import { ResolveType } from './enums.js';
2
+ import * as DI from './root.js';
3
+ import { isConstructor, isTypedArray } from './helpers.js';
4
+ export const DI_DESCRIPTION_SYMBOL = '__DI_INJECTION_DESCRIPTOR__';
5
+ export function AddDependencyForProperty(callback) {
6
+ return (target, propertyKey, indexOrDescriptor) => {
7
+ let descriptor = Reflect.getOwnMetadata(DI_DESCRIPTION_SYMBOL, target.constructor);
8
+ if (!descriptor) {
9
+ descriptor = {
10
+ inject: [],
11
+ resolver: ResolveType.Singleton,
12
+ };
13
+ Reflect.defineMetadata(DI_DESCRIPTION_SYMBOL, descriptor, target.constructor);
14
+ }
15
+ if (callback) {
16
+ callback(descriptor, target, propertyKey, indexOrDescriptor);
17
+ }
18
+ };
19
+ }
20
+ export function AddDependency(callback) {
21
+ return (target, propertyKey, indexOrDescriptor) => {
22
+ let descriptor = Reflect.getOwnMetadata(DI_DESCRIPTION_SYMBOL, target);
23
+ if (!descriptor) {
24
+ descriptor = {
25
+ inject: [],
26
+ resolver: ResolveType.Singleton,
27
+ };
28
+ Reflect.defineMetadata(DI_DESCRIPTION_SYMBOL, descriptor, target);
29
+ }
30
+ if (callback) {
31
+ callback(descriptor, target, propertyKey, indexOrDescriptor);
32
+ }
33
+ };
34
+ }
35
+ /**
36
+ *
37
+ * Class with this decorator is automatically registered in DI container an can be resolved.
38
+ * NOTE: we dont need to register class before resolving. Injectable decorator is mainly used in extensions & plugins
39
+ * to register implementation that can be resolved by framework or other parts without knowing about specific implementations eg.
40
+ * avaible database drivers.
41
+ *
42
+ * @param as - register class in DI container as something else.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ *
47
+ * @Injectable(OrmDriver)
48
+ * class MysqlOrmDriver{
49
+ *
50
+ * // implementation ...
51
+ * }
52
+ *
53
+ *
54
+ * // somewhere else in code
55
+ * const avaibleDrivers = DI.resolve(Array.of(OrmDriver));
56
+ *
57
+ *
58
+ * ```
59
+ *
60
+ */
61
+ export function Injectable(as) {
62
+ return (target) => {
63
+ if (as) {
64
+ DI.register(target).as(as);
65
+ }
66
+ else {
67
+ DI.register(target).asSelf();
68
+ }
69
+ };
70
+ }
71
+ /**
72
+ * Sets dependency injection guidelines - what to inject for specified class. If multiple instances are registered at specified type,
73
+ * only first one is resolved and injected
74
+ * @param args - what to inject - class definitions
75
+ * @example
76
+ * ```javascript
77
+ *
78
+ * @Inject(Bar)
79
+ * class Foo{
80
+ *
81
+ * @Inject(Bar)
82
+ * barInstance : Bar;
83
+ *
84
+ * constructor(bar : Bar){
85
+ * // bar is injected when Foo is created via DI container
86
+ * this.barInstance = bar;
87
+ * }
88
+ *
89
+ * someFunc(){
90
+ *
91
+ * this._barInstance.doSmth();
92
+ * }
93
+ * }
94
+ *
95
+ * ```
96
+ */
97
+ export function Inject(...args) {
98
+ return AddDependency((descriptor) => {
99
+ for (const a of args) {
100
+ // avoid injecting duplicates
101
+ if (!descriptor.inject.find((i) => {
102
+ if (isTypedArray(i)) {
103
+ if (isTypedArray(a)) {
104
+ return i.Type === a.Type;
105
+ }
106
+ else {
107
+ return i.Type === a;
108
+ }
109
+ }
110
+ else {
111
+ return i.inject === a;
112
+ }
113
+ })) {
114
+ descriptor.inject.push({
115
+ autoinject: false,
116
+ autoinjectKey: '',
117
+ inject: a,
118
+ mapFunc: null,
119
+ });
120
+ }
121
+ }
122
+ });
123
+ }
124
+ /**
125
+ * Automatically injects dependency based on reflected property type. Uses experimental typescript reflection api
126
+ * If decorator is applied to array property all registered type instances are injected, otherwise only first / only that exists
127
+ *
128
+ * @param injectType - when injecting array of some type, type must be explicitly provided. Typescript reflection cant reflect declared array types
129
+ * @param mapFunc - when injecting array we sometimes need services mapped by some kind of key, so later we dont need to search o(n) elements for specific service, but reference by key/name
130
+ * @example
131
+ * ```javascript
132
+ * class Foo{
133
+ *
134
+ * @Autoinject
135
+ * barInstance : Bar;
136
+ *
137
+ * constructor(){
138
+ * // ....
139
+ * }
140
+ *
141
+ * someFunc(){
142
+ *
143
+ * // automatically injected dependency is avaible now
144
+ * this.barInstance.doSmth();
145
+ * }
146
+ * }
147
+ *
148
+ * ```
149
+ */
150
+ export function Autoinject(typeOrOptions, options) {
151
+ return AddDependencyForProperty((descriptor, target, propertyKey) => {
152
+ let type = Reflect.getMetadata('design:type', target, propertyKey);
153
+ const isArray = type.name === 'Array' || type.name === 'Map';
154
+ let opt = options;
155
+ if (isConstructor(typeOrOptions)) {
156
+ if (isArray && !typeOrOptions) {
157
+ throw new Error('you must provide inject type when injecting array');
158
+ }
159
+ type = typeOrOptions;
160
+ }
161
+ else {
162
+ opt = typeOrOptions;
163
+ }
164
+ descriptor.inject.push({
165
+ autoinject: true,
166
+ autoinjectKey: propertyKey,
167
+ inject: isArray ? Array.ofType(typeOrOptions) : type,
168
+ mapFunc: opt?.mapFunc,
169
+ options: opt?.options,
170
+ });
171
+ });
172
+ }
173
+ /**
174
+ * Lazy injects service to object. Use only with class properties
175
+ *
176
+ * @param service - class or name of service to inject
177
+ *
178
+ * @example
179
+ * ```javascript
180
+ *
181
+ * class Foo{
182
+ * ...
183
+ *
184
+ * @LazyInject(Bar)
185
+ * _barInstance : Bar; // _barInstance is not yet resolved
186
+ *
187
+ * someFunc(){
188
+ * // barInstance is resolved only when first accessed
189
+ * this._barInstance.doSmth();
190
+ * }
191
+ * }
192
+ *
193
+ * ```
194
+ */
195
+ export function LazyInject(service) {
196
+ return (target, key) => {
197
+ const type = Reflect.getMetadata('design:type', target, key);
198
+ // property getter
199
+ const getter = () => {
200
+ if (!service) {
201
+ return DI.resolve(type);
202
+ }
203
+ else {
204
+ if (typeof service === 'string') {
205
+ return DI.get(service);
206
+ }
207
+ else {
208
+ return DI.resolve(service);
209
+ }
210
+ }
211
+ };
212
+ // Create new property with getter and setter
213
+ Object.defineProperty(target, key, {
214
+ get: getter,
215
+ });
216
+ };
217
+ }
218
+ /**
219
+ * Per child instance injection decorator - object is resolved once per container - child containers have own instances.
220
+ */
221
+ export function PerChildInstance() {
222
+ return AddDependency((descriptor) => {
223
+ descriptor.resolver = ResolveType.PerChildContainer;
224
+ });
225
+ }
226
+ /**
227
+ * NewInstance injection decorator - every time class is injected - its created from scratch
228
+ */
229
+ export function NewInstance() {
230
+ return AddDependency((descriptor) => {
231
+ descriptor.resolver = ResolveType.NewInstance;
232
+ });
233
+ }
234
+ /**
235
+ * If we have multiple registered types at one base type
236
+ * we can resolve only one by default. Per instance means, that
237
+ * we can resolve all types registered at base type once. Limitaiton is
238
+ * that, you should call resolve not on base type, but on target type.
239
+ *
240
+ * In comparison, Singleton flag means that only one instance can be resolved
241
+ * for base class
242
+ */
243
+ export function PerInstance() {
244
+ return AddDependency((descriptor) => {
245
+ descriptor.resolver = ResolveType.PerInstance;
246
+ });
247
+ }
248
+ /**
249
+ *
250
+ * Before resolve, check function on all resolved instances of given type is called with creation options
251
+ * It is used for ensuring that for eg. only one instance of service with provided
252
+ * options is resolved, but allow to create with other option set
253
+ *
254
+ * @returns
255
+ */
256
+ export function PerInstanceCheck() {
257
+ return AddDependency((descriptor) => {
258
+ descriptor.resolver = ResolveType.PerInstanceCheck;
259
+ });
260
+ }
261
+ /**
262
+ * Singleton injection decorator - every time class is resolved - its created only once globally ( even in child DI containers )
263
+ */
264
+ export function Singleton() {
265
+ return AddDependency();
266
+ }
267
267
  //# sourceMappingURL=decorators.js.map
@@ -1,32 +1,32 @@
1
- /**
2
- * How to resolve class
3
- */
4
- export declare enum ResolveType {
5
- /**
6
- * Application wise single instance. Default behaviour
7
- */
8
- Singleton = 0,
9
- /**
10
- * New instance every time is requested
11
- */
12
- NewInstance = 1,
13
- /**
14
- * New instance per child DI container.
15
- */
16
- PerChildContainer = 2,
17
- /**
18
- * Singleton per target type
19
- *
20
- * eg. if we have multiple registered types at one base type
21
- * we can resolve any of it once
22
- *
23
- * In comparison, Singleton flag means that only one instance can be resolved
24
- * for base class
25
- */
26
- PerInstance = 3,
27
- /**
28
- * Only one instance with given name can exists of the same service
29
- */
30
- PerInstanceCheck = 4
31
- }
1
+ /**
2
+ * How to resolve class
3
+ */
4
+ export declare enum ResolveType {
5
+ /**
6
+ * Application wise single instance. Default behaviour
7
+ */
8
+ Singleton = 0,
9
+ /**
10
+ * New instance every time is requested
11
+ */
12
+ NewInstance = 1,
13
+ /**
14
+ * New instance per child DI container.
15
+ */
16
+ PerChildContainer = 2,
17
+ /**
18
+ * Singleton per target type
19
+ *
20
+ * eg. if we have multiple registered types at one base type
21
+ * we can resolve any of it once
22
+ *
23
+ * In comparison, Singleton flag means that only one instance can be resolved
24
+ * for base class
25
+ */
26
+ PerInstance = 3,
27
+ /**
28
+ * Only one instance with given name can exists of the same service
29
+ */
30
+ PerInstanceCheck = 4
31
+ }
32
32
  //# sourceMappingURL=enums.d.ts.map
package/lib/mjs/enums.js CHANGED
@@ -1,33 +1,33 @@
1
- /**
2
- * How to resolve class
3
- */
4
- export var ResolveType;
5
- (function (ResolveType) {
6
- /**
7
- * Application wise single instance. Default behaviour
8
- */
9
- ResolveType[ResolveType["Singleton"] = 0] = "Singleton";
10
- /**
11
- * New instance every time is requested
12
- */
13
- ResolveType[ResolveType["NewInstance"] = 1] = "NewInstance";
14
- /**
15
- * New instance per child DI container.
16
- */
17
- ResolveType[ResolveType["PerChildContainer"] = 2] = "PerChildContainer";
18
- /**
19
- * Singleton per target type
20
- *
21
- * eg. if we have multiple registered types at one base type
22
- * we can resolve any of it once
23
- *
24
- * In comparison, Singleton flag means that only one instance can be resolved
25
- * for base class
26
- */
27
- ResolveType[ResolveType["PerInstance"] = 3] = "PerInstance";
28
- /**
29
- * Only one instance with given name can exists of the same service
30
- */
31
- ResolveType[ResolveType["PerInstanceCheck"] = 4] = "PerInstanceCheck";
32
- })(ResolveType = ResolveType || (ResolveType = {}));
1
+ /**
2
+ * How to resolve class
3
+ */
4
+ export var ResolveType;
5
+ (function (ResolveType) {
6
+ /**
7
+ * Application wise single instance. Default behaviour
8
+ */
9
+ ResolveType[ResolveType["Singleton"] = 0] = "Singleton";
10
+ /**
11
+ * New instance every time is requested
12
+ */
13
+ ResolveType[ResolveType["NewInstance"] = 1] = "NewInstance";
14
+ /**
15
+ * New instance per child DI container.
16
+ */
17
+ ResolveType[ResolveType["PerChildContainer"] = 2] = "PerChildContainer";
18
+ /**
19
+ * Singleton per target type
20
+ *
21
+ * eg. if we have multiple registered types at one base type
22
+ * we can resolve any of it once
23
+ *
24
+ * In comparison, Singleton flag means that only one instance can be resolved
25
+ * for base class
26
+ */
27
+ ResolveType[ResolveType["PerInstance"] = 3] = "PerInstance";
28
+ /**
29
+ * Only one instance with given name can exists of the same service
30
+ */
31
+ ResolveType[ResolveType["PerInstanceCheck"] = 4] = "PerInstanceCheck";
32
+ })(ResolveType || (ResolveType = {}));
33
33
  //# sourceMappingURL=enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WA+BX;AA/BD,WAAY,WAAW;IACrB;;OAEG;IACH,uDAAS,CAAA;IAET;;OAEG;IACH,2DAAW,CAAA;IAEX;;OAEG;IACH,uEAAiB,CAAA;IAEjB;;;;;;;;OAQG;IACH,2DAAW,CAAA;IAEX;;OAEG;IACH,qEAAgB,CAAA;AAClB,CAAC,EA/BW,WAAW,GAAX,WAAW,KAAX,WAAW,QA+BtB"}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WA+BX;AA/BD,WAAY,WAAW;IACrB;;OAEG;IACH,uDAAS,CAAA;IAET;;OAEG;IACH,2DAAW,CAAA;IAEX;;OAEG;IACH,uEAAiB,CAAA;IAEjB;;;;;;;;OAQG;IACH,2DAAW,CAAA;IAEX;;OAEG;IACH,qEAAgB,CAAA;AAClB,CAAC,EA/BW,WAAW,KAAX,WAAW,QA+BtB"}