@tsed/di 8.0.0-rc.5 → 8.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/lib/browser/di.umd.min.js +1 -1
- package/lib/browser/di.umd.min.js.map +1 -1
- package/lib/esm/common/decorators/autoInjectable.js +1 -1
- package/lib/esm/common/decorators/autoInjectable.js.map +1 -1
- package/lib/esm/common/decorators/configuration.js +7 -1
- package/lib/esm/common/decorators/configuration.js.map +1 -1
- package/lib/esm/common/decorators/controller.js +1 -1
- package/lib/esm/common/decorators/injectable.js +3 -3
- package/lib/esm/common/decorators/injectable.js.map +1 -1
- package/lib/esm/common/decorators/module.js +2 -4
- package/lib/esm/common/decorators/module.js.map +1 -1
- package/lib/esm/common/domain/Container.js +2 -2
- package/lib/esm/common/domain/Container.js.map +1 -1
- package/lib/esm/common/domain/ControllerProvider.js +2 -2
- package/lib/esm/common/domain/ControllerProvider.js.map +1 -1
- package/lib/esm/common/domain/LocalsContainer.js +1 -1
- package/lib/esm/common/domain/LocalsContainer.js.map +1 -1
- package/lib/esm/common/domain/Provider.js +44 -29
- package/lib/esm/common/domain/Provider.js.map +1 -1
- package/lib/esm/common/fn/inject.js +3 -2
- package/lib/esm/common/fn/inject.js.map +1 -1
- package/lib/esm/common/fn/injectMany.js +10 -1
- package/lib/esm/common/fn/injectMany.js.map +1 -1
- package/lib/esm/common/fn/injectable.js +2 -48
- package/lib/esm/common/fn/injectable.js.map +1 -1
- package/lib/esm/common/fn/injector.js +5 -17
- package/lib/esm/common/fn/injector.js.map +1 -1
- package/lib/esm/common/fn/lazyInject.js +4 -4
- package/lib/esm/common/fn/lazyInject.js.map +1 -1
- package/lib/esm/common/index.js +2 -3
- package/lib/esm/common/index.js.map +1 -1
- package/lib/esm/common/registries/GlobalProviders.js +8 -14
- package/lib/esm/common/registries/GlobalProviders.js.map +1 -1
- package/lib/esm/common/registries/ProviderRegistry.js +7 -3
- package/lib/esm/common/registries/ProviderRegistry.js.map +1 -1
- package/lib/esm/common/services/DIConfiguration.js +1 -14
- package/lib/esm/common/services/DIConfiguration.js.map +1 -1
- package/lib/esm/common/services/DILogger.js +3 -9
- package/lib/esm/common/services/DILogger.js.map +1 -1
- package/lib/esm/common/services/InjectorService.js +157 -157
- package/lib/esm/common/services/InjectorService.js.map +1 -1
- package/lib/esm/common/utils/discoverHooks.js +14 -0
- package/lib/esm/common/utils/discoverHooks.js.map +1 -0
- package/lib/esm/common/utils/providerBuilder.js +55 -0
- package/lib/esm/common/utils/providerBuilder.js.map +1 -0
- package/lib/esm/node/domain/ContextLogger.js +1 -1
- package/lib/esm/node/domain/ContextLogger.js.map +1 -1
- package/lib/esm/node/domain/DIContext.js.map +1 -1
- package/lib/esm/node/services/DITest.js +9 -14
- package/lib/esm/node/services/DITest.js.map +1 -1
- package/lib/esm/node/utils/attachLogger.js +4 -3
- package/lib/esm/node/utils/attachLogger.js.map +1 -1
- package/lib/esm/node/utils/setLoggerConfiguration.js +3 -3
- package/lib/esm/node/utils/setLoggerConfiguration.js.map +1 -1
- package/lib/esm/node/utils/setLoggerFormat.js +8 -7
- package/lib/esm/node/utils/setLoggerFormat.js.map +1 -1
- package/lib/esm/node/utils/setLoggerLevel.js +4 -4
- package/lib/esm/node/utils/setLoggerLevel.js.map +1 -1
- package/lib/types/common/decorators/controller.d.ts +1 -1
- package/lib/types/common/decorators/injectable.d.ts +1 -1
- package/lib/types/common/decorators/module.d.ts +0 -6
- package/lib/types/common/domain/ControllerProvider.d.ts +1 -1
- package/lib/types/common/domain/LocalsContainer.d.ts +1 -1
- package/lib/types/common/domain/Provider.d.ts +26 -7
- package/lib/types/common/fn/injectMany.d.ts +9 -0
- package/lib/types/common/fn/injectable.d.ts +403 -18
- package/lib/types/common/fn/injector.d.ts +2 -9
- package/lib/types/common/index.d.ts +2 -3
- package/lib/types/common/interfaces/DIConfigurationOptions.d.ts +0 -5
- package/lib/types/common/interfaces/InvokeOptions.d.ts +0 -5
- package/lib/types/common/interfaces/ProviderOpts.d.ts +1 -6
- package/lib/types/common/interfaces/RegistrySettings.d.ts +0 -12
- package/lib/types/common/interfaces/ResolvedInvokeOptions.d.ts +2 -2
- package/lib/types/common/registries/GlobalProviders.d.ts +1 -7
- package/lib/types/common/registries/ProviderRegistry.d.ts +12 -2
- package/lib/types/common/services/DIConfiguration.d.ts +1 -6
- package/lib/types/common/services/InjectorService.d.ts +50 -38
- package/lib/types/common/utils/discoverHooks.d.ts +2 -0
- package/lib/types/common/utils/providerBuilder.d.ts +17 -0
- package/lib/types/node/domain/ContextLogger.d.ts +1 -1
- package/lib/types/node/services/DITest.d.ts +1 -2
- package/lib/types/node/utils/attachLogger.d.ts +2 -2
- package/lib/types/node/utils/setLoggerConfiguration.d.ts +1 -2
- package/lib/types/node/utils/setLoggerFormat.d.ts +1 -3
- package/lib/types/node/utils/setLoggerLevel.d.ts +1 -3
- package/package.json +13 -11
- package/vitest.config.mts +4 -4
- package/lib/esm/common/fn/events.js +0 -31
- package/lib/esm/common/fn/events.js.map +0 -1
- package/lib/esm/common/interfaces/DIResolver.js +0 -2
- package/lib/esm/common/interfaces/DIResolver.js.map +0 -1
- package/lib/esm/common/utils/resolveControllers.js +0 -42
- package/lib/esm/common/utils/resolveControllers.js.map +0 -1
- package/lib/types/common/fn/events.d.ts +0 -23
- package/lib/types/common/interfaces/DIResolver.d.ts +0 -5
- package/lib/types/common/utils/resolveControllers.d.ts +0 -12
|
@@ -1,23 +1,408 @@
|
|
|
1
|
-
import "../registries/ProviderRegistry.js";
|
|
2
|
-
import { Store, type Type } from "@tsed/core";
|
|
3
1
|
import { ControllerProvider } from "../domain/ControllerProvider.js";
|
|
4
2
|
import type { Provider } from "../domain/Provider.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export declare const injectable: <Token extends import("../index.js").TokenProvider>(token: Token, options?: Partial<import("../index.js").ProviderOpts<import("@tsed/core").Type<any>>>) => {
|
|
4
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & {
|
|
5
|
+
inspect(): Provider<any>;
|
|
6
|
+
store(): import("@tsed/core").Store;
|
|
7
|
+
token(): Token;
|
|
8
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
9
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
10
|
+
value(v: unknown): any & any;
|
|
11
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
12
|
+
};
|
|
13
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & {
|
|
14
|
+
inspect(): Provider<any>;
|
|
15
|
+
store(): import("@tsed/core").Store;
|
|
16
|
+
token(): Token;
|
|
17
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
18
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
19
|
+
value(v: unknown): any & any;
|
|
20
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
21
|
+
};
|
|
22
|
+
scope: (value: import("../index.js").ProviderScope) => any & {
|
|
23
|
+
inspect(): Provider<any>;
|
|
24
|
+
store(): import("@tsed/core").Store;
|
|
25
|
+
token(): Token;
|
|
26
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
27
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
28
|
+
value(v: unknown): any & any;
|
|
29
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
30
|
+
};
|
|
31
|
+
path: (value: string) => any & {
|
|
32
|
+
inspect(): Provider<any>;
|
|
33
|
+
store(): import("@tsed/core").Store;
|
|
34
|
+
token(): Token;
|
|
35
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
36
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
37
|
+
value(v: unknown): any & any;
|
|
38
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
39
|
+
};
|
|
40
|
+
alias: (value: string) => any & {
|
|
41
|
+
inspect(): Provider<any>;
|
|
42
|
+
store(): import("@tsed/core").Store;
|
|
43
|
+
token(): Token;
|
|
44
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
45
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
46
|
+
value(v: unknown): any & any;
|
|
47
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
48
|
+
};
|
|
49
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & {
|
|
50
|
+
inspect(): Provider<any>;
|
|
51
|
+
store(): import("@tsed/core").Store;
|
|
52
|
+
token(): Token;
|
|
53
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
54
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
55
|
+
value(v: unknown): any & any;
|
|
56
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
57
|
+
};
|
|
58
|
+
configuration: (value: Partial<TsED.Configuration>) => any & {
|
|
59
|
+
inspect(): Provider<any>;
|
|
60
|
+
store(): import("@tsed/core").Store;
|
|
61
|
+
token(): Token;
|
|
62
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
63
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
64
|
+
value(v: unknown): any & any;
|
|
65
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
66
|
+
};
|
|
67
|
+
priority: (value: number) => any & {
|
|
68
|
+
inspect(): Provider<any>;
|
|
69
|
+
store(): import("@tsed/core").Store;
|
|
70
|
+
token(): Token;
|
|
71
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
72
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
73
|
+
value(v: unknown): any & any;
|
|
74
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
75
|
+
};
|
|
76
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & {
|
|
77
|
+
inspect(): Provider<any>;
|
|
78
|
+
store(): import("@tsed/core").Store;
|
|
79
|
+
token(): Token;
|
|
80
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
81
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
82
|
+
value(v: unknown): any & any;
|
|
83
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
84
|
+
};
|
|
9
85
|
} & {
|
|
10
|
-
inspect():
|
|
11
|
-
store(): Store;
|
|
86
|
+
inspect(): Provider<any>;
|
|
87
|
+
store(): import("@tsed/core").Store;
|
|
12
88
|
token(): Token;
|
|
13
|
-
factory(f: (...args: unknown[]) => unknown):
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
89
|
+
factory(f: (...args: unknown[]) => unknown): {
|
|
90
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
91
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
92
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
93
|
+
path: (value: string) => any & any;
|
|
94
|
+
alias: (value: string) => any & any;
|
|
95
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
96
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
97
|
+
priority: (value: number) => any & any;
|
|
98
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
99
|
+
} & any;
|
|
100
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): {
|
|
101
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
102
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
103
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
104
|
+
path: (value: string) => any & any;
|
|
105
|
+
alias: (value: string) => any & any;
|
|
106
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
107
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
108
|
+
priority: (value: number) => any & any;
|
|
109
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
110
|
+
} & any;
|
|
111
|
+
value(v: unknown): {
|
|
112
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
113
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
114
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
115
|
+
path: (value: string) => any & any;
|
|
116
|
+
alias: (value: string) => any & any;
|
|
117
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
118
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
119
|
+
priority: (value: number) => any & any;
|
|
120
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
121
|
+
} & any;
|
|
122
|
+
class(c: import("@tsed/core").Type<any>): {
|
|
123
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
124
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
125
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
126
|
+
path: (value: string) => any & any;
|
|
127
|
+
alias: (value: string) => any & any;
|
|
128
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
129
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
130
|
+
priority: (value: number) => any & any;
|
|
131
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
132
|
+
} & any;
|
|
133
|
+
};
|
|
134
|
+
export declare const interceptor: <Token extends import("../index.js").TokenProvider>(token: Token, options?: Partial<import("../index.js").ProviderOpts<import("@tsed/core").Type<any>>>) => {
|
|
135
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & {
|
|
136
|
+
inspect(): Provider<any>;
|
|
137
|
+
store(): import("@tsed/core").Store;
|
|
138
|
+
token(): Token;
|
|
139
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
140
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
141
|
+
value(v: unknown): any & any;
|
|
142
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
143
|
+
};
|
|
144
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & {
|
|
145
|
+
inspect(): Provider<any>;
|
|
146
|
+
store(): import("@tsed/core").Store;
|
|
147
|
+
token(): Token;
|
|
148
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
149
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
150
|
+
value(v: unknown): any & any;
|
|
151
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
152
|
+
};
|
|
153
|
+
scope: (value: import("../index.js").ProviderScope) => any & {
|
|
154
|
+
inspect(): Provider<any>;
|
|
155
|
+
store(): import("@tsed/core").Store;
|
|
156
|
+
token(): Token;
|
|
157
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
158
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
159
|
+
value(v: unknown): any & any;
|
|
160
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
161
|
+
};
|
|
162
|
+
path: (value: string) => any & {
|
|
163
|
+
inspect(): Provider<any>;
|
|
164
|
+
store(): import("@tsed/core").Store;
|
|
165
|
+
token(): Token;
|
|
166
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
167
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
168
|
+
value(v: unknown): any & any;
|
|
169
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
170
|
+
};
|
|
171
|
+
alias: (value: string) => any & {
|
|
172
|
+
inspect(): Provider<any>;
|
|
173
|
+
store(): import("@tsed/core").Store;
|
|
174
|
+
token(): Token;
|
|
175
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
176
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
177
|
+
value(v: unknown): any & any;
|
|
178
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
179
|
+
};
|
|
180
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & {
|
|
181
|
+
inspect(): Provider<any>;
|
|
182
|
+
store(): import("@tsed/core").Store;
|
|
183
|
+
token(): Token;
|
|
184
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
185
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
186
|
+
value(v: unknown): any & any;
|
|
187
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
188
|
+
};
|
|
189
|
+
configuration: (value: Partial<TsED.Configuration>) => any & {
|
|
190
|
+
inspect(): Provider<any>;
|
|
191
|
+
store(): import("@tsed/core").Store;
|
|
192
|
+
token(): Token;
|
|
193
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
194
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
195
|
+
value(v: unknown): any & any;
|
|
196
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
197
|
+
};
|
|
198
|
+
priority: (value: number) => any & {
|
|
199
|
+
inspect(): Provider<any>;
|
|
200
|
+
store(): import("@tsed/core").Store;
|
|
201
|
+
token(): Token;
|
|
202
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
203
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
204
|
+
value(v: unknown): any & any;
|
|
205
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
206
|
+
};
|
|
207
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & {
|
|
208
|
+
inspect(): Provider<any>;
|
|
209
|
+
store(): import("@tsed/core").Store;
|
|
210
|
+
token(): Token;
|
|
211
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
212
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
213
|
+
value(v: unknown): any & any;
|
|
214
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
215
|
+
};
|
|
216
|
+
} & {
|
|
217
|
+
inspect(): Provider<any>;
|
|
218
|
+
store(): import("@tsed/core").Store;
|
|
219
|
+
token(): Token;
|
|
220
|
+
factory(f: (...args: unknown[]) => unknown): {
|
|
221
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
222
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
223
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
224
|
+
path: (value: string) => any & any;
|
|
225
|
+
alias: (value: string) => any & any;
|
|
226
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
227
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
228
|
+
priority: (value: number) => any & any;
|
|
229
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
230
|
+
} & any;
|
|
231
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): {
|
|
232
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
233
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
234
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
235
|
+
path: (value: string) => any & any;
|
|
236
|
+
alias: (value: string) => any & any;
|
|
237
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
238
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
239
|
+
priority: (value: number) => any & any;
|
|
240
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
241
|
+
} & any;
|
|
242
|
+
value(v: unknown): {
|
|
243
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
244
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
245
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
246
|
+
path: (value: string) => any & any;
|
|
247
|
+
alias: (value: string) => any & any;
|
|
248
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
249
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
250
|
+
priority: (value: number) => any & any;
|
|
251
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
252
|
+
} & any;
|
|
253
|
+
class(c: import("@tsed/core").Type<any>): {
|
|
254
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
255
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
256
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
257
|
+
path: (value: string) => any & any;
|
|
258
|
+
alias: (value: string) => any & any;
|
|
259
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
260
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
261
|
+
priority: (value: number) => any & any;
|
|
262
|
+
type: (value: string | symbol | Function | import("@tsed/core").Type<any> | import("@tsed/core").AbstractType<any>) => any & any;
|
|
263
|
+
} & any;
|
|
264
|
+
};
|
|
265
|
+
export declare const controller: <Token extends import("../index.js").TokenProvider>(token: Token, options?: Partial<import("../index.js").ProviderOpts<import("@tsed/core").Type<any>>>) => {
|
|
266
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & {
|
|
267
|
+
inspect(): ControllerProvider<any>;
|
|
268
|
+
store(): import("@tsed/core").Store;
|
|
269
|
+
token(): Token;
|
|
270
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
271
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
272
|
+
value(v: unknown): any & any;
|
|
273
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
274
|
+
};
|
|
275
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & {
|
|
276
|
+
inspect(): ControllerProvider<any>;
|
|
277
|
+
store(): import("@tsed/core").Store;
|
|
278
|
+
token(): Token;
|
|
279
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
280
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
281
|
+
value(v: unknown): any & any;
|
|
282
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
283
|
+
};
|
|
284
|
+
scope: (value: import("../index.js").ProviderScope) => any & {
|
|
285
|
+
inspect(): ControllerProvider<any>;
|
|
286
|
+
store(): import("@tsed/core").Store;
|
|
287
|
+
token(): Token;
|
|
288
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
289
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
290
|
+
value(v: unknown): any & any;
|
|
291
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
292
|
+
};
|
|
293
|
+
path: (value: string) => any & {
|
|
294
|
+
inspect(): ControllerProvider<any>;
|
|
295
|
+
store(): import("@tsed/core").Store;
|
|
296
|
+
token(): Token;
|
|
297
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
298
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
299
|
+
value(v: unknown): any & any;
|
|
300
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
301
|
+
};
|
|
302
|
+
alias: (value: string) => any & {
|
|
303
|
+
inspect(): ControllerProvider<any>;
|
|
304
|
+
store(): import("@tsed/core").Store;
|
|
305
|
+
token(): Token;
|
|
306
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
307
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
308
|
+
value(v: unknown): any & any;
|
|
309
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
310
|
+
};
|
|
311
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & {
|
|
312
|
+
inspect(): ControllerProvider<any>;
|
|
313
|
+
store(): import("@tsed/core").Store;
|
|
314
|
+
token(): Token;
|
|
315
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
316
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
317
|
+
value(v: unknown): any & any;
|
|
318
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
319
|
+
};
|
|
320
|
+
configuration: (value: Partial<TsED.Configuration>) => any & {
|
|
321
|
+
inspect(): ControllerProvider<any>;
|
|
322
|
+
store(): import("@tsed/core").Store;
|
|
323
|
+
token(): Token;
|
|
324
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
325
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
326
|
+
value(v: unknown): any & any;
|
|
327
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
328
|
+
};
|
|
329
|
+
priority: (value: number) => any & {
|
|
330
|
+
inspect(): ControllerProvider<any>;
|
|
331
|
+
store(): import("@tsed/core").Store;
|
|
332
|
+
token(): Token;
|
|
333
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
334
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
335
|
+
value(v: unknown): any & any;
|
|
336
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
337
|
+
};
|
|
338
|
+
children: (value: import("../index.js").TokenProvider[]) => any & {
|
|
339
|
+
inspect(): ControllerProvider<any>;
|
|
340
|
+
store(): import("@tsed/core").Store;
|
|
341
|
+
token(): Token;
|
|
342
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
343
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
344
|
+
value(v: unknown): any & any;
|
|
345
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
346
|
+
};
|
|
347
|
+
middlewares: (value: Partial<import("../domain/ControllerProvider.js").ControllerMiddlewares>) => any & {
|
|
348
|
+
inspect(): ControllerProvider<any>;
|
|
349
|
+
store(): import("@tsed/core").Store;
|
|
350
|
+
token(): Token;
|
|
351
|
+
factory(f: (...args: unknown[]) => unknown): any & any;
|
|
352
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): any & any;
|
|
353
|
+
value(v: unknown): any & any;
|
|
354
|
+
class(c: import("@tsed/core").Type<any>): any & any;
|
|
355
|
+
};
|
|
356
|
+
} & {
|
|
357
|
+
inspect(): ControllerProvider<any>;
|
|
358
|
+
store(): import("@tsed/core").Store;
|
|
359
|
+
token(): Token;
|
|
360
|
+
factory(f: (...args: unknown[]) => unknown): {
|
|
361
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
362
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
363
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
364
|
+
path: (value: string) => any & any;
|
|
365
|
+
alias: (value: string) => any & any;
|
|
366
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
367
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
368
|
+
priority: (value: number) => any & any;
|
|
369
|
+
children: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
370
|
+
middlewares: (value: Partial<import("../domain/ControllerProvider.js").ControllerMiddlewares>) => any & any;
|
|
371
|
+
} & any;
|
|
372
|
+
asyncFactory(f: (...args: unknown[]) => Promise<unknown>): {
|
|
373
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
374
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
375
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
376
|
+
path: (value: string) => any & any;
|
|
377
|
+
alias: (value: string) => any & any;
|
|
378
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
379
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
380
|
+
priority: (value: number) => any & any;
|
|
381
|
+
children: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
382
|
+
middlewares: (value: Partial<import("../domain/ControllerProvider.js").ControllerMiddlewares>) => any & any;
|
|
383
|
+
} & any;
|
|
384
|
+
value(v: unknown): {
|
|
385
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
386
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
387
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
388
|
+
path: (value: string) => any & any;
|
|
389
|
+
alias: (value: string) => any & any;
|
|
390
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
391
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
392
|
+
priority: (value: number) => any & any;
|
|
393
|
+
children: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
394
|
+
middlewares: (value: Partial<import("../domain/ControllerProvider.js").ControllerMiddlewares>) => any & any;
|
|
395
|
+
} & any;
|
|
396
|
+
class(c: import("@tsed/core").Type<any>): {
|
|
397
|
+
deps: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
398
|
+
imports: (value: (import("../index.js").TokenProvider | [import("../index.js").TokenProvider])[]) => any & any;
|
|
399
|
+
scope: (value: import("../index.js").ProviderScope) => any & any;
|
|
400
|
+
path: (value: string) => any & any;
|
|
401
|
+
alias: (value: string) => any & any;
|
|
402
|
+
hooks: (value: Record<string, import("../domain/Provider.js").ProviderHookCallback<any>>) => any & any;
|
|
403
|
+
configuration: (value: Partial<TsED.Configuration>) => any & any;
|
|
404
|
+
priority: (value: number) => any & any;
|
|
405
|
+
children: (value: import("../index.js").TokenProvider[]) => any & any;
|
|
406
|
+
middlewares: (value: Partial<import("../domain/ControllerProvider.js").ControllerMiddlewares>) => any & any;
|
|
407
|
+
} & any;
|
|
17
408
|
};
|
|
18
|
-
export declare function providerBuilder<Provider, Picked extends keyof Provider>(props: string[], baseOpts?: Partial<ProviderOpts<Provider>>): <Token extends TokenProvider>(token: Token, options?: Partial<ProviderOpts<Type>>) => ProviderBuilder<Token, Provider, Pick<Provider, Picked>>;
|
|
19
|
-
type PickedProps = "scope" | "path" | "alias" | "hooks" | "deps" | "resolvers" | "imports" | "configuration";
|
|
20
|
-
export declare const injectable: <Token extends TokenProvider>(token: Token, options?: Partial<ProviderOpts<Type>>) => ProviderBuilder<Token, Provider<any>, Pick<Provider<any>, "type" | PickedProps>>;
|
|
21
|
-
export declare const interceptor: <Token extends TokenProvider>(token: Token, options?: Partial<ProviderOpts<Type>>) => ProviderBuilder<Token, Provider<any>, Pick<Provider<any>, "type" | PickedProps>>;
|
|
22
|
-
export declare const controller: <Token extends TokenProvider>(token: Token, options?: Partial<ProviderOpts<Type>>) => ProviderBuilder<Token, ControllerProvider<any>, Pick<ControllerProvider<any>, "children" | "middlewares" | PickedProps>>;
|
|
23
|
-
export {};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { InjectorService } from "../services/InjectorService.js";
|
|
2
|
-
type InjectorFnOpts = {
|
|
3
|
-
rebuild?: boolean;
|
|
4
|
-
logger?: any;
|
|
5
|
-
settings?: Partial<TsED.Configuration>;
|
|
6
|
-
};
|
|
7
2
|
/**
|
|
8
|
-
*
|
|
3
|
+
* Return the existing injector service.
|
|
9
4
|
*
|
|
10
5
|
* Example:
|
|
11
6
|
*
|
|
@@ -18,7 +13,5 @@ type InjectorFnOpts = {
|
|
|
18
13
|
* }
|
|
19
14
|
* ```
|
|
20
15
|
*/
|
|
21
|
-
export declare function injector(
|
|
22
|
-
export declare function hasInjector(): boolean;
|
|
16
|
+
export declare function injector(): InjectorService;
|
|
23
17
|
export declare function destroyInjector(): Promise<void>;
|
|
24
|
-
export {};
|
|
@@ -29,7 +29,6 @@ export * from "./errors/InjectionError.js";
|
|
|
29
29
|
export * from "./errors/InvalidPropertyTokenError.js";
|
|
30
30
|
export * from "./fn/configuration.js";
|
|
31
31
|
export * from "./fn/constant.js";
|
|
32
|
-
export * from "./fn/events.js";
|
|
33
32
|
export * from "./fn/inject.js";
|
|
34
33
|
export * from "./fn/injectable.js";
|
|
35
34
|
export * from "./fn/injectMany.js";
|
|
@@ -40,7 +39,6 @@ export * from "./fn/refValue.js";
|
|
|
40
39
|
export * from "./interfaces/DIConfigurationOptions.js";
|
|
41
40
|
export * from "./interfaces/DILogger.js";
|
|
42
41
|
export * from "./interfaces/DILoggerOptions.js";
|
|
43
|
-
export * from "./interfaces/DIResolver.js";
|
|
44
42
|
export * from "./interfaces/ImportTokenProviderOpts.js";
|
|
45
43
|
export * from "./interfaces/InterceptorContext.js";
|
|
46
44
|
export * from "./interfaces/InterceptorMethods.js";
|
|
@@ -59,6 +57,7 @@ export * from "./services/DILogger.js";
|
|
|
59
57
|
export * from "./services/InjectorService.js";
|
|
60
58
|
export * from "./utils/colors.js";
|
|
61
59
|
export * from "./utils/createContainer.js";
|
|
60
|
+
export * from "./utils/discoverHooks.js";
|
|
62
61
|
export * from "./utils/getConfiguration.js";
|
|
63
62
|
export * from "./utils/getConstructorDependencies.js";
|
|
64
|
-
export * from "./utils/
|
|
63
|
+
export * from "./utils/providerBuilder.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
2
|
-
import type { DIResolver } from "./DIResolver.js";
|
|
3
2
|
import type { ImportTokenProviderOpts } from "./ImportTokenProviderOpts.js";
|
|
4
3
|
import type { TokenProvider } from "./TokenProvider.js";
|
|
5
4
|
declare global {
|
|
@@ -15,10 +14,6 @@ declare global {
|
|
|
15
14
|
scopes: {
|
|
16
15
|
[key: string]: ProviderScope;
|
|
17
16
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Define a list of resolvers (it can be an external DI).
|
|
20
|
-
*/
|
|
21
|
-
resolvers: DIResolver[];
|
|
22
17
|
/**
|
|
23
18
|
* Define dependencies to build the provider
|
|
24
19
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
2
|
-
import { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
2
|
import { TokenProvider } from "./TokenProvider.js";
|
|
4
3
|
export interface InvokeOptions {
|
|
5
4
|
/**
|
|
@@ -14,10 +13,6 @@ export interface InvokeOptions {
|
|
|
14
13
|
* Parent provider.
|
|
15
14
|
*/
|
|
16
15
|
parent?: TokenProvider;
|
|
17
|
-
/**
|
|
18
|
-
* Scope used by the injector to build the provider.
|
|
19
|
-
*/
|
|
20
|
-
scope: ProviderScope;
|
|
21
16
|
/**
|
|
22
17
|
* If true, the injector will rebuild the instance.
|
|
23
18
|
*/
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Type } from "@tsed/core";
|
|
2
2
|
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
3
|
import type { ProviderType } from "../domain/ProviderType.js";
|
|
4
|
-
import type { DIResolver } from "./DIResolver.js";
|
|
5
4
|
import type { TokenProvider } from "./TokenProvider.js";
|
|
6
5
|
export interface ProviderOpts<T = any> {
|
|
7
6
|
/**
|
|
8
7
|
* An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
|
|
9
8
|
*/
|
|
10
|
-
|
|
9
|
+
token: TokenProvider<T>;
|
|
11
10
|
/**
|
|
12
11
|
* Create alias token to retrieve the instance provider.
|
|
13
12
|
*/
|
|
@@ -44,10 +43,6 @@ export interface ProviderOpts<T = any> {
|
|
|
44
43
|
* Scope used by the injector to build the provider.
|
|
45
44
|
*/
|
|
46
45
|
scope?: ProviderScope;
|
|
47
|
-
/**
|
|
48
|
-
* A list of resolvers which will be used to resolve missing Symbol/Class when injector invoke a Class. This property allow external DI usage.
|
|
49
|
-
*/
|
|
50
|
-
resolvers?: DIResolver[];
|
|
51
46
|
/**
|
|
52
47
|
* hooks to intercept custom events
|
|
53
48
|
*/
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
3
2
|
import type { Provider } from "../domain/Provider.js";
|
|
4
|
-
import type { InjectorService } from "../services/InjectorService.js";
|
|
5
|
-
import type { ResolvedInvokeOptions } from "./ResolvedInvokeOptions.js";
|
|
6
3
|
/**
|
|
7
4
|
* @ignore
|
|
8
5
|
*/
|
|
9
6
|
export interface RegistrySettings {
|
|
10
7
|
injectable?: boolean;
|
|
11
8
|
model?: Type<Provider>;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param provider
|
|
15
|
-
* @param {Map<string | Function, any>} locals
|
|
16
|
-
* @param options
|
|
17
|
-
*/
|
|
18
|
-
onInvoke?(provider: Provider, locals: LocalsContainer, options: ResolvedInvokeOptions & {
|
|
19
|
-
injector: InjectorService;
|
|
20
|
-
}): void;
|
|
21
9
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
1
2
|
import type { Provider } from "../domain/Provider.js";
|
|
2
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
3
|
import type { TokenProvider } from "./TokenProvider.js";
|
|
4
4
|
export interface ResolvedInvokeOptions {
|
|
5
5
|
token: TokenProvider;
|
|
6
6
|
parent?: TokenProvider;
|
|
7
|
-
scope: ProviderScope;
|
|
8
7
|
deps: TokenProvider[];
|
|
9
8
|
imports: (TokenProvider | [TokenProvider])[];
|
|
10
9
|
provider: Provider;
|
|
10
|
+
locals: LocalsContainer;
|
|
11
11
|
construct(deps: TokenProvider[]): any;
|
|
12
12
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
3
2
|
import { Provider } from "../domain/Provider.js";
|
|
4
3
|
import { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
5
4
|
import { RegistrySettings } from "../interfaces/RegistrySettings.js";
|
|
6
|
-
import { ResolvedInvokeOptions } from "../interfaces/ResolvedInvokeOptions.js";
|
|
7
5
|
import { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
8
|
-
import type { InjectorService } from "../services/InjectorService.js";
|
|
9
6
|
export declare class GlobalProviderRegistry extends Map<TokenProvider, Provider> {
|
|
10
7
|
#private;
|
|
11
8
|
/**
|
|
@@ -39,11 +36,8 @@ export declare class GlobalProviderRegistry extends Map<TokenProvider, Provider>
|
|
|
39
36
|
*/
|
|
40
37
|
delete(key: TokenProvider): boolean;
|
|
41
38
|
createRegistry(type: string | symbol, model: Type<Provider>, options?: Partial<RegistrySettings>): this;
|
|
42
|
-
onInvoke(provider: Provider, locals: LocalsContainer, options: ResolvedInvokeOptions & {
|
|
43
|
-
injector: InjectorService;
|
|
44
|
-
}): void;
|
|
45
39
|
getRegistrySettings(target: TokenProvider): RegistrySettings;
|
|
46
|
-
|
|
40
|
+
protected createProvider(key: TokenProvider, options: Partial<ProviderOpts<any>>): Provider<any>;
|
|
47
41
|
/**
|
|
48
42
|
*
|
|
49
43
|
* @param key
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
2
|
+
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
3
|
+
type Opts<Type = any> = Partial<ProviderOpts<Type>> & ({
|
|
4
|
+
token: TokenProvider<Type>;
|
|
5
|
+
} | {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use token prop instead
|
|
8
|
+
*/
|
|
9
|
+
provide: TokenProvider<Type>;
|
|
10
|
+
});
|
|
2
11
|
/**
|
|
3
12
|
* Register a provider configuration.
|
|
4
|
-
* @
|
|
13
|
+
* @deprecated Since v8. Use injectable() function instead.
|
|
5
14
|
*/
|
|
6
|
-
export declare function registerProvider<Type = any>(
|
|
15
|
+
export declare function registerProvider<Type = any>({ token, provide, ...opts }: Opts<Type>): import("../index.js").Provider<any>;
|
|
16
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Env } from "@tsed/core";
|
|
2
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
2
|
import type { DILoggerOptions } from "../interfaces/DILoggerOptions.js";
|
|
4
|
-
import type { DIResolver } from "../interfaces/DIResolver.js";
|
|
5
3
|
import type { ImportTokenProviderOpts } from "../interfaces/ImportTokenProviderOpts.js";
|
|
6
4
|
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
7
5
|
import type { TokenRoute } from "../interfaces/TokenRoute.js";
|
|
6
|
+
export declare const CONFIGURATION: unique symbol;
|
|
8
7
|
export declare class DIConfiguration {
|
|
9
8
|
readonly default: Map<string, any>;
|
|
10
9
|
protected map: Map<string, any>;
|
|
@@ -15,10 +14,6 @@ export declare class DIConfiguration {
|
|
|
15
14
|
set rootDir(value: string);
|
|
16
15
|
get env(): Env;
|
|
17
16
|
set env(value: Env);
|
|
18
|
-
get scopes(): Record<string, ProviderScope>;
|
|
19
|
-
set scopes(value: Record<string, ProviderScope>);
|
|
20
|
-
get resolvers(): DIResolver[];
|
|
21
|
-
set resolvers(resolvers: DIResolver[]);
|
|
22
17
|
get imports(): (TokenProvider | ImportTokenProviderOpts)[];
|
|
23
18
|
set imports(imports: (TokenProvider | ImportTokenProviderOpts)[]);
|
|
24
19
|
get routes(): TokenRoute[];
|