@tsed/di 8.0.0-alpha.5 → 8.0.0-alpha.7
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.map +1 -1
- package/lib/esm/common/decorators/configuration.js.map +1 -1
- package/lib/esm/common/decorators/constant.js.map +1 -1
- package/lib/esm/common/decorators/controller.js.map +1 -1
- package/lib/esm/common/decorators/inject.js +1 -1
- package/lib/esm/common/decorators/inject.js.map +1 -1
- package/lib/esm/common/decorators/intercept.js.map +1 -1
- package/lib/esm/common/decorators/lazyInject.js.map +1 -1
- package/lib/esm/common/decorators/module.js +1 -1
- package/lib/esm/common/decorators/module.js.map +1 -1
- package/lib/esm/common/decorators/opts.js.map +1 -1
- package/lib/esm/common/decorators/overrideProvider.js.map +1 -1
- package/lib/esm/common/decorators/scope.js.map +1 -1
- package/lib/esm/common/decorators/useOpts.js +1 -1
- package/lib/esm/common/decorators/useOpts.js.map +1 -1
- package/lib/esm/common/decorators/value.js.map +1 -1
- package/lib/esm/common/domain/Container.js.map +1 -1
- package/lib/esm/common/domain/LocalsContainer.js.map +1 -1
- package/lib/esm/common/domain/Provider.js.map +1 -1
- package/lib/esm/common/errors/InjectionError.js.map +1 -1
- package/lib/esm/common/registries/GlobalProviders.js +1 -5
- package/lib/esm/common/registries/GlobalProviders.js.map +1 -1
- package/lib/esm/common/registries/ProviderRegistry.js.map +1 -1
- package/lib/esm/common/services/DIConfiguration.js.map +1 -1
- package/lib/esm/common/services/InjectorService.js.map +1 -1
- package/lib/esm/common/utils/createContainer.js.map +1 -1
- package/lib/esm/common/utils/resolveControllers.js +1 -1
- package/lib/esm/common/utils/resolveControllers.js.map +1 -1
- package/lib/esm/node/decorators/injectContext.js.map +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/DILogger.js.map +1 -1
- package/lib/esm/node/services/DITest.js.map +1 -1
- package/lib/esm/node/utils/asyncHookContext.js.map +1 -1
- package/lib/esm/node/utils/setLoggerFormat.js.map +1 -1
- package/lib/esm/node/utils/setLoggerLevel.js.map +1 -1
- package/lib/types/common/decorators/module.d.ts +1 -1
- package/lib/types/common/domain/Container.d.ts +1 -1
- package/lib/types/common/domain/Provider.d.ts +1 -1
- package/lib/types/common/interfaces/ProviderOpts.d.ts +1 -1
- package/lib/types/common/interfaces/TokenProvider.d.ts +1 -1
- package/lib/types/node/domain/ContextLogger.d.ts +1 -1
- package/lib/types/node/utils/asyncHookContext.d.ts +1 -1
- package/package.json +13 -14
- package/vitest.config.mts +4 -4
- package/lib/cjs/common/constants/constants.js +0 -9
- package/lib/cjs/common/constants/constants.js.map +0 -1
- package/lib/cjs/common/decorators/autoInjectable.js +0 -38
- package/lib/cjs/common/decorators/autoInjectable.js.map +0 -1
- package/lib/cjs/common/decorators/configuration.js +0 -24
- package/lib/cjs/common/decorators/configuration.js.map +0 -1
- package/lib/cjs/common/decorators/constant.js +0 -74
- package/lib/cjs/common/decorators/constant.js.map +0 -1
- package/lib/cjs/common/decorators/controller.js +0 -53
- package/lib/cjs/common/decorators/controller.js.map +0 -1
- package/lib/cjs/common/decorators/inject.js +0 -84
- package/lib/cjs/common/decorators/inject.js.map +0 -1
- package/lib/cjs/common/decorators/injectable.js +0 -32
- package/lib/cjs/common/decorators/injectable.js.map +0 -1
- package/lib/cjs/common/decorators/intercept.js +0 -65
- package/lib/cjs/common/decorators/intercept.js.map +0 -1
- package/lib/cjs/common/decorators/interceptor.js +0 -21
- package/lib/cjs/common/decorators/interceptor.js.map +0 -1
- package/lib/cjs/common/decorators/lazyInject.js +0 -71
- package/lib/cjs/common/decorators/lazyInject.js.map +0 -1
- package/lib/cjs/common/decorators/module.js +0 -32
- package/lib/cjs/common/decorators/module.js.map +0 -1
- package/lib/cjs/common/decorators/opts.js +0 -54
- package/lib/cjs/common/decorators/opts.js.map +0 -1
- package/lib/cjs/common/decorators/overrideProvider.js +0 -17
- package/lib/cjs/common/decorators/overrideProvider.js.map +0 -1
- package/lib/cjs/common/decorators/scope.js +0 -16
- package/lib/cjs/common/decorators/scope.js.map +0 -1
- package/lib/cjs/common/decorators/service.js +0 -18
- package/lib/cjs/common/decorators/service.js.map +0 -1
- package/lib/cjs/common/decorators/useOpts.js +0 -61
- package/lib/cjs/common/decorators/useOpts.js.map +0 -1
- package/lib/cjs/common/decorators/value.js +0 -62
- package/lib/cjs/common/decorators/value.js.map +0 -1
- package/lib/cjs/common/domain/Container.js +0 -72
- package/lib/cjs/common/domain/Container.js.map +0 -1
- package/lib/cjs/common/domain/ControllerProvider.js +0 -36
- package/lib/cjs/common/domain/ControllerProvider.js.map +0 -1
- package/lib/cjs/common/domain/InjectablePropertyType.js +0 -12
- package/lib/cjs/common/domain/InjectablePropertyType.js.map +0 -1
- package/lib/cjs/common/domain/LocalsContainer.js +0 -15
- package/lib/cjs/common/domain/LocalsContainer.js.map +0 -1
- package/lib/cjs/common/domain/Provider.js +0 -134
- package/lib/cjs/common/domain/Provider.js.map +0 -1
- package/lib/cjs/common/domain/ProviderScope.js +0 -10
- package/lib/cjs/common/domain/ProviderScope.js.map +0 -1
- package/lib/cjs/common/domain/ProviderType.js +0 -15
- package/lib/cjs/common/domain/ProviderType.js.map +0 -1
- package/lib/cjs/common/errors/InjectionError.js +0 -58
- package/lib/cjs/common/errors/InjectionError.js.map +0 -1
- package/lib/cjs/common/errors/InvalidPropertyTokenError.js +0 -12
- package/lib/cjs/common/errors/InvalidPropertyTokenError.js.map +0 -1
- package/lib/cjs/common/index.js +0 -58
- package/lib/cjs/common/index.js.map +0 -1
- package/lib/cjs/common/interfaces/DIConfigurationOptions.js +0 -3
- package/lib/cjs/common/interfaces/DIConfigurationOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/DILogger.js +0 -3
- package/lib/cjs/common/interfaces/DILogger.js.map +0 -1
- package/lib/cjs/common/interfaces/DILoggerOptions.js +0 -3
- package/lib/cjs/common/interfaces/DILoggerOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/DIResolver.js +0 -3
- package/lib/cjs/common/interfaces/DIResolver.js.map +0 -1
- package/lib/cjs/common/interfaces/ImportTokenProviderOpts.js +0 -3
- package/lib/cjs/common/interfaces/ImportTokenProviderOpts.js.map +0 -1
- package/lib/cjs/common/interfaces/InterceptorContext.js +0 -3
- package/lib/cjs/common/interfaces/InterceptorContext.js.map +0 -1
- package/lib/cjs/common/interfaces/InterceptorMethods.js +0 -3
- package/lib/cjs/common/interfaces/InterceptorMethods.js.map +0 -1
- package/lib/cjs/common/interfaces/InvokeOptions.js +0 -3
- package/lib/cjs/common/interfaces/InvokeOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/OnDestroy.js +0 -3
- package/lib/cjs/common/interfaces/OnDestroy.js.map +0 -1
- package/lib/cjs/common/interfaces/OnInit.js +0 -3
- package/lib/cjs/common/interfaces/OnInit.js.map +0 -1
- package/lib/cjs/common/interfaces/ProviderOpts.js +0 -3
- package/lib/cjs/common/interfaces/ProviderOpts.js.map +0 -1
- package/lib/cjs/common/interfaces/RegistrySettings.js +0 -3
- package/lib/cjs/common/interfaces/RegistrySettings.js.map +0 -1
- package/lib/cjs/common/interfaces/ResolvedInvokeOptions.js +0 -3
- package/lib/cjs/common/interfaces/ResolvedInvokeOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/TokenProvider.js +0 -3
- package/lib/cjs/common/interfaces/TokenProvider.js.map +0 -1
- package/lib/cjs/common/interfaces/TokenRoute.js +0 -3
- package/lib/cjs/common/interfaces/TokenRoute.js.map +0 -1
- package/lib/cjs/common/registries/GlobalProviders.js +0 -121
- package/lib/cjs/common/registries/GlobalProviders.js.map +0 -1
- package/lib/cjs/common/registries/ProviderRegistry.js +0 -86
- package/lib/cjs/common/registries/ProviderRegistry.js.map +0 -1
- package/lib/cjs/common/services/DIConfiguration.js +0 -142
- package/lib/cjs/common/services/DIConfiguration.js.map +0 -1
- package/lib/cjs/common/services/DILogger.js +0 -14
- package/lib/cjs/common/services/DILogger.js.map +0 -1
- package/lib/cjs/common/services/InjectorService.js +0 -536
- package/lib/cjs/common/services/InjectorService.js.map +0 -1
- package/lib/cjs/common/utils/colors.js +0 -10
- package/lib/cjs/common/utils/colors.js.map +0 -1
- package/lib/cjs/common/utils/createContainer.js +0 -14
- package/lib/cjs/common/utils/createContainer.js.map +0 -1
- package/lib/cjs/common/utils/getConfiguration.js +0 -23
- package/lib/cjs/common/utils/getConfiguration.js.map +0 -1
- package/lib/cjs/common/utils/getConstructorDependencies.js +0 -13
- package/lib/cjs/common/utils/getConstructorDependencies.js.map +0 -1
- package/lib/cjs/common/utils/resolveControllers.js +0 -47
- package/lib/cjs/common/utils/resolveControllers.js.map +0 -1
- package/lib/cjs/index.js +0 -6
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/node/decorators/injectContext.js +0 -39
- package/lib/cjs/node/decorators/injectContext.js.map +0 -1
- package/lib/cjs/node/domain/ContextLogger.js +0 -99
- package/lib/cjs/node/domain/ContextLogger.js.map +0 -1
- package/lib/cjs/node/domain/DIContext.js +0 -102
- package/lib/cjs/node/domain/DIContext.js.map +0 -1
- package/lib/cjs/node/index.js +0 -18
- package/lib/cjs/node/index.js.map +0 -1
- package/lib/cjs/node/interfaces/AlterRunInContext.js +0 -3
- package/lib/cjs/node/interfaces/AlterRunInContext.js.map +0 -1
- package/lib/cjs/node/services/DILogger.js +0 -12
- package/lib/cjs/node/services/DILogger.js.map +0 -1
- package/lib/cjs/node/services/DITest.js +0 -126
- package/lib/cjs/node/services/DITest.js.map +0 -1
- package/lib/cjs/node/utils/asyncHookContext.js +0 -43
- package/lib/cjs/node/utils/asyncHookContext.js.map +0 -1
- package/lib/cjs/node/utils/attachLogger.js +0 -10
- package/lib/cjs/node/utils/attachLogger.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerConfiguration.js +0 -11
- package/lib/cjs/node/utils/setLoggerConfiguration.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerFormat.js +0 -33
- package/lib/cjs/node/utils/setLoggerFormat.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerLevel.js +0 -15
- package/lib/cjs/node/utils/setLoggerLevel.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/common/constants/constants.d.ts +0 -5
- package/lib/types-esm/common/decorators/autoInjectable.d.ts +0 -1
- package/lib/types-esm/common/decorators/configuration.d.ts +0 -8
- package/lib/types-esm/common/decorators/constant.d.ts +0 -39
- package/lib/types-esm/common/decorators/controller.d.ts +0 -42
- package/lib/types-esm/common/decorators/inject.d.ts +0 -35
- package/lib/types-esm/common/decorators/injectable.d.ts +0 -20
- package/lib/types-esm/common/decorators/intercept.d.ts +0 -13
- package/lib/types-esm/common/decorators/interceptor.d.ts +0 -10
- package/lib/types-esm/common/decorators/lazyInject.d.ts +0 -43
- package/lib/types-esm/common/decorators/module.d.ts +0 -37
- package/lib/types-esm/common/decorators/opts.d.ts +0 -41
- package/lib/types-esm/common/decorators/overrideProvider.d.ts +0 -8
- package/lib/types-esm/common/decorators/scope.d.ts +0 -8
- package/lib/types-esm/common/decorators/service.d.ts +0 -10
- package/lib/types-esm/common/decorators/useOpts.d.ts +0 -42
- package/lib/types-esm/common/decorators/value.d.ts +0 -37
- package/lib/types-esm/common/domain/Container.d.ts +0 -43
- package/lib/types-esm/common/domain/ControllerProvider.d.ts +0 -17
- package/lib/types-esm/common/domain/InjectablePropertyType.d.ts +0 -7
- package/lib/types-esm/common/domain/LocalsContainer.d.ts +0 -6
- package/lib/types-esm/common/domain/Provider.d.ts +0 -71
- package/lib/types-esm/common/domain/ProviderScope.d.ts +0 -5
- package/lib/types-esm/common/domain/ProviderType.d.ts +0 -10
- package/lib/types-esm/common/errors/InjectionError.d.ts +0 -8
- package/lib/types-esm/common/errors/InvalidPropertyTokenError.d.ts +0 -4
- package/lib/types-esm/common/index.d.ts +0 -54
- package/lib/types-esm/common/interfaces/DIConfigurationOptions.d.ts +0 -29
- package/lib/types-esm/common/interfaces/DILogger.d.ts +0 -8
- package/lib/types-esm/common/interfaces/DILoggerOptions.d.ts +0 -53
- package/lib/types-esm/common/interfaces/DIResolver.d.ts +0 -5
- package/lib/types-esm/common/interfaces/ImportTokenProviderOpts.d.ts +0 -19
- package/lib/types-esm/common/interfaces/InterceptorContext.d.ts +0 -11
- package/lib/types-esm/common/interfaces/InterceptorMethods.d.ts +0 -4
- package/lib/types-esm/common/interfaces/InvokeOptions.d.ts +0 -30
- package/lib/types-esm/common/interfaces/OnDestroy.d.ts +0 -3
- package/lib/types-esm/common/interfaces/OnInit.d.ts +0 -3
- package/lib/types-esm/common/interfaces/ProviderOpts.d.ts +0 -59
- package/lib/types-esm/common/interfaces/RegistrySettings.d.ts +0 -21
- package/lib/types-esm/common/interfaces/ResolvedInvokeOptions.d.ts +0 -12
- package/lib/types-esm/common/interfaces/TokenProvider.d.ts +0 -2
- package/lib/types-esm/common/interfaces/TokenRoute.d.ts +0 -5
- package/lib/types-esm/common/registries/GlobalProviders.d.ts +0 -58
- package/lib/types-esm/common/registries/ProviderRegistry.d.ts +0 -58
- package/lib/types-esm/common/services/DIConfiguration.d.ts +0 -57
- package/lib/types-esm/common/services/DILogger.d.ts +0 -3
- package/lib/types-esm/common/services/InjectorService.d.ts +0 -203
- package/lib/types-esm/common/utils/colors.d.ts +0 -5
- package/lib/types-esm/common/utils/createContainer.d.ts +0 -3
- package/lib/types-esm/common/utils/getConfiguration.d.ts +0 -3
- package/lib/types-esm/common/utils/getConstructorDependencies.d.ts +0 -2
- package/lib/types-esm/common/utils/resolveControllers.d.ts +0 -12
- package/lib/types-esm/index.d.ts +0 -2
- package/lib/types-esm/node/decorators/injectContext.d.ts +0 -16
- package/lib/types-esm/node/domain/ContextLogger.d.ts +0 -37
- package/lib/types-esm/node/domain/DIContext.d.ts +0 -61
- package/lib/types-esm/node/index.d.ts +0 -14
- package/lib/types-esm/node/interfaces/AlterRunInContext.d.ts +0 -3
- package/lib/types-esm/node/services/DILogger.d.ts +0 -1
- package/lib/types-esm/node/services/DITest.d.ts +0 -37
- package/lib/types-esm/node/utils/asyncHookContext.d.ts +0 -15
- package/lib/types-esm/node/utils/attachLogger.d.ts +0 -2
- package/lib/types-esm/node/utils/setLoggerConfiguration.d.ts +0 -2
- package/lib/types-esm/node/utils/setLoggerFormat.d.ts +0 -6
- package/lib/types-esm/node/utils/setLoggerLevel.d.ts +0 -6
- /package/{webpack.config.js → webpack.config.cjs} +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
2
|
-
import type { DIResolver } from "./DIResolver.js";
|
|
3
|
-
import type { ImportTokenProviderOpts } from "./ImportTokenProviderOpts.js";
|
|
4
|
-
import type { TokenProvider } from "./TokenProvider.js";
|
|
5
|
-
declare global {
|
|
6
|
-
namespace TsED {
|
|
7
|
-
interface Context {
|
|
8
|
-
}
|
|
9
|
-
interface Configuration extends Record<string, any> {
|
|
10
|
-
scopes: {
|
|
11
|
-
[key: string]: ProviderScope;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Define a list of resolvers (it can be an external DI).
|
|
15
|
-
*/
|
|
16
|
-
resolvers: DIResolver[];
|
|
17
|
-
/**
|
|
18
|
-
* Define dependencies to build the provider
|
|
19
|
-
*/
|
|
20
|
-
imports: (TokenProvider | ImportTokenProviderOpts)[];
|
|
21
|
-
/**
|
|
22
|
-
* Mount controllers
|
|
23
|
-
*/
|
|
24
|
-
mount: Record<string, TokenProvider[]>;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export interface DIConfigurationOptions extends TsED.Configuration {
|
|
29
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export interface DILoggerOptions {
|
|
2
|
-
/**
|
|
3
|
-
* Enable debug mode. By default debug is false.
|
|
4
|
-
*/
|
|
5
|
-
debug?: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Enable info mode. By default debug is false.
|
|
8
|
-
*/
|
|
9
|
-
level?: "debug" | "info" | "warn" | "error" | "off";
|
|
10
|
-
/**
|
|
11
|
-
* Enable log performance tracker and disable log server.
|
|
12
|
-
*/
|
|
13
|
-
perf?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* List of regexp to ignore log.
|
|
16
|
-
*/
|
|
17
|
-
ignoreUrlPatterns?: (string | RegExp)[];
|
|
18
|
-
/**
|
|
19
|
-
* The number of space characters to use as white space in JSON output. Default is 2 (0 in production).
|
|
20
|
-
*/
|
|
21
|
-
jsonIndentation?: number;
|
|
22
|
-
/**
|
|
23
|
-
* A function called for each incoming request to create a request id.
|
|
24
|
-
* @returns {number}
|
|
25
|
-
*/
|
|
26
|
-
reqIdBuilder?: (req: any) => string;
|
|
27
|
-
/**
|
|
28
|
-
* Disable routes table displayed in the logger. By default debug is `false`.
|
|
29
|
-
*/
|
|
30
|
-
disableRoutesSummary?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Disable bootstrap log displayed in the logger. By default debug is `false`.
|
|
33
|
-
*/
|
|
34
|
-
disableBootstrapLog?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Specify log format. Example: `%[%d{[yyyy-MM-dd hh:mm:ss,SSS}] %p%] %m`. See [@tsed/logger configuration](https://tsedio.github.io/logger/).
|
|
37
|
-
*/
|
|
38
|
-
format?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Specify the log stack size for the context.logger. When the stack.length is reach, the logger is flushed during the request.
|
|
41
|
-
* Default size is set to 30.
|
|
42
|
-
*/
|
|
43
|
-
maxStackSize?: number;
|
|
44
|
-
}
|
|
45
|
-
declare global {
|
|
46
|
-
namespace TsED {
|
|
47
|
-
interface LoggerConfiguration extends DILoggerOptions {
|
|
48
|
-
}
|
|
49
|
-
interface Configuration extends Record<string, any> {
|
|
50
|
-
logger?: LoggerConfiguration;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AbstractType, Type } from "@tsed/core";
|
|
2
|
-
import type { TokenProvider } from "./TokenProvider.js";
|
|
3
|
-
export type UseImportTokenProviderOpts = {
|
|
4
|
-
token: TokenProvider;
|
|
5
|
-
use: unknown;
|
|
6
|
-
};
|
|
7
|
-
export type UseClassImportTokenProviderOpts = {
|
|
8
|
-
token: TokenProvider;
|
|
9
|
-
useClass: Type | AbstractType<any>;
|
|
10
|
-
};
|
|
11
|
-
export type UseFactoryImportTokenProviderOpts = {
|
|
12
|
-
token: TokenProvider;
|
|
13
|
-
useFactory: (...args: unknown[]) => unknown;
|
|
14
|
-
};
|
|
15
|
-
export type UseAsyncFactoryImportTokenProviderOpts = {
|
|
16
|
-
token: TokenProvider;
|
|
17
|
-
useAsyncFactory: (...args: unknown[]) => Promise<unknown>;
|
|
18
|
-
};
|
|
19
|
-
export type ImportTokenProviderOpts = UseImportTokenProviderOpts | UseClassImportTokenProviderOpts | UseFactoryImportTokenProviderOpts | UseAsyncFactoryImportTokenProviderOpts;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Type } from "@tsed/core";
|
|
2
|
-
export interface InterceptorNext {
|
|
3
|
-
<T>(err?: Error): T;
|
|
4
|
-
}
|
|
5
|
-
export interface InterceptorContext<Klass = Type, Opts = any> {
|
|
6
|
-
target: Klass;
|
|
7
|
-
propertyKey: string | symbol;
|
|
8
|
-
args: any[];
|
|
9
|
-
next: InterceptorNext;
|
|
10
|
-
options?: Opts;
|
|
11
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
2
|
-
import { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
|
-
import { TokenProvider } from "./TokenProvider.js";
|
|
4
|
-
export interface InvokeOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Define dependencies to build the provider and inject them in the constructor.
|
|
7
|
-
*/
|
|
8
|
-
deps: TokenProvider[];
|
|
9
|
-
/**
|
|
10
|
-
* List of imports to be created before the provider. Imports list aren't injected directly in the provider constructor.
|
|
11
|
-
*/
|
|
12
|
-
imports: TokenProvider[];
|
|
13
|
-
/**
|
|
14
|
-
* Parent provider.
|
|
15
|
-
*/
|
|
16
|
-
parent?: TokenProvider;
|
|
17
|
-
/**
|
|
18
|
-
* Scope used by the injector to build the provider.
|
|
19
|
-
*/
|
|
20
|
-
scope: ProviderScope;
|
|
21
|
-
/**
|
|
22
|
-
* If true, the injector will rebuild the instance.
|
|
23
|
-
*/
|
|
24
|
-
rebuild?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Option given to injectable props or parameter constructor (UseOpts).
|
|
27
|
-
*/
|
|
28
|
-
useOpts?: Record<string, unknown>;
|
|
29
|
-
locals?: LocalsContainer;
|
|
30
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Type } from "@tsed/core";
|
|
2
|
-
import type { ProviderType } from "../domain/ProviderType.js";
|
|
3
|
-
import type { DIResolver } from "./DIResolver.js";
|
|
4
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
5
|
-
import type { TokenProvider } from "./TokenProvider.js";
|
|
6
|
-
export interface ProviderOpts<T = any> {
|
|
7
|
-
/**
|
|
8
|
-
* An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
|
|
9
|
-
*/
|
|
10
|
-
provide: TokenProvider<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Create alias token to retrieve the instance provider.
|
|
13
|
-
*/
|
|
14
|
-
alias?: TokenProvider;
|
|
15
|
-
/**
|
|
16
|
-
* Provider type
|
|
17
|
-
*/
|
|
18
|
-
type?: TokenProvider | ProviderType;
|
|
19
|
-
/**
|
|
20
|
-
* Instance build by the injector
|
|
21
|
-
*/
|
|
22
|
-
instance?: T;
|
|
23
|
-
/**
|
|
24
|
-
* Define dependencies to build the provider
|
|
25
|
-
*/
|
|
26
|
-
deps?: TokenProvider[];
|
|
27
|
-
/**
|
|
28
|
-
* Class to instantiate for the `token`.
|
|
29
|
-
*/
|
|
30
|
-
useClass?: Type<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Provide a function to build the provider
|
|
33
|
-
*/
|
|
34
|
-
useFactory?: Function;
|
|
35
|
-
/**
|
|
36
|
-
* Provide an async function to build the provider
|
|
37
|
-
*/
|
|
38
|
-
useAsyncFactory?: Function;
|
|
39
|
-
/**
|
|
40
|
-
* Provide predefined value
|
|
41
|
-
*/
|
|
42
|
-
useValue?: any;
|
|
43
|
-
/**
|
|
44
|
-
* Scope used by the injector to build the provider.
|
|
45
|
-
*/
|
|
46
|
-
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
|
-
/**
|
|
52
|
-
* hooks to intercept custom events
|
|
53
|
-
*/
|
|
54
|
-
hooks?: Record<string, (instance: T, ...args: any[]) => Promise<any> | any>;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
3
|
-
import type { Provider } from "../domain/Provider.js";
|
|
4
|
-
import type { InjectorService } from "../services/InjectorService.js";
|
|
5
|
-
import type { ResolvedInvokeOptions } from "./ResolvedInvokeOptions.js";
|
|
6
|
-
/**
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
export interface RegistrySettings {
|
|
10
|
-
injectable?: boolean;
|
|
11
|
-
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../domain/Provider.js";
|
|
2
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
|
-
import type { TokenProvider } from "./TokenProvider.js";
|
|
4
|
-
export interface ResolvedInvokeOptions {
|
|
5
|
-
token: TokenProvider;
|
|
6
|
-
parent?: TokenProvider;
|
|
7
|
-
scope: ProviderScope;
|
|
8
|
-
deps: TokenProvider[];
|
|
9
|
-
imports: (TokenProvider | [TokenProvider])[];
|
|
10
|
-
provider: Provider;
|
|
11
|
-
construct(deps: TokenProvider[]): any;
|
|
12
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import type { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
3
|
-
import { Provider } from "../domain/Provider.js";
|
|
4
|
-
import { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
5
|
-
import { RegistrySettings } from "../interfaces/RegistrySettings.js";
|
|
6
|
-
import { ResolvedInvokeOptions } from "../interfaces/ResolvedInvokeOptions.js";
|
|
7
|
-
import { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
8
|
-
import type { InjectorService } from "../services/InjectorService.js";
|
|
9
|
-
export declare class GlobalProviderRegistry extends Map<TokenProvider, Provider> {
|
|
10
|
-
#private;
|
|
11
|
-
/**
|
|
12
|
-
* The get() method returns a specified element from a Map object.
|
|
13
|
-
* @param key Required. The key of the element to return from the Map object.
|
|
14
|
-
* @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
|
|
15
|
-
*/
|
|
16
|
-
get(key: TokenProvider): Provider | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* The has() method returns a boolean indicating whether an element with the specified key exists or not.
|
|
19
|
-
* @param key
|
|
20
|
-
* @returns {boolean}
|
|
21
|
-
*/
|
|
22
|
-
has(key: TokenProvider): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The set() method adds or updates an element with a specified key and value to a Map object.
|
|
25
|
-
* @param key Required. The key of the element to add to the Map object.
|
|
26
|
-
* @param metadata Required. The value of the element to add to the Map object.
|
|
27
|
-
*/
|
|
28
|
-
set(key: TokenProvider, metadata: Provider): this;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param target
|
|
32
|
-
* @param options
|
|
33
|
-
*/
|
|
34
|
-
merge(target: TokenProvider, options: Partial<ProviderOpts>): Provider<any>;
|
|
35
|
-
/**
|
|
36
|
-
* The delete() method removes the specified element from a Map object.
|
|
37
|
-
* @param key Required. The key of the element to remove from the Map object.
|
|
38
|
-
* @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
|
|
39
|
-
*/
|
|
40
|
-
delete(key: TokenProvider): boolean;
|
|
41
|
-
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
|
-
getRegistrySettings(target: TokenProvider): RegistrySettings;
|
|
46
|
-
createRegisterFn(type: string): (provider: any | ProviderOpts, instance?: any) => void;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param key
|
|
50
|
-
* @param options
|
|
51
|
-
*/
|
|
52
|
-
protected createIfNotExists(key: TokenProvider, options: Partial<ProviderOpts>): Provider;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @type {GlobalProviders}
|
|
57
|
-
*/
|
|
58
|
-
export declare const GlobalProviders: GlobalProviderRegistry;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Provider } from "../domain/Provider.js";
|
|
2
|
-
import type { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
3
|
-
/**
|
|
4
|
-
* Register a provider configuration.
|
|
5
|
-
* @param {ProviderOpts<any>} provider
|
|
6
|
-
*/
|
|
7
|
-
export declare function registerProvider<Type = any>(provider: Partial<ProviderOpts<Type>>): Provider<any>;
|
|
8
|
-
/**
|
|
9
|
-
* Add a new value in the `ProviderRegistry`.
|
|
10
|
-
*
|
|
11
|
-
* #### Example with symbol definition
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import {registerValue, InjectorService} from "@tsed/di";
|
|
16
|
-
*
|
|
17
|
-
* const MyValue = Symbol.from("MyValue")
|
|
18
|
-
*
|
|
19
|
-
* registerValue({token: MyValue, useValue: "myValue"});
|
|
20
|
-
*
|
|
21
|
-
* @Service()
|
|
22
|
-
* export class OtherService {
|
|
23
|
-
* constructor(@Inject(MyValue) myValue: string){
|
|
24
|
-
* console.log(myValue); /// "myValue"
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const registerValue: (provider: any | ProviderOpts<any>, value?: any) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Add a new controller in the `ProviderRegistry`. This controller will be built when `InjectorService` will be loaded.
|
|
32
|
-
*
|
|
33
|
-
* #### Example
|
|
34
|
-
*
|
|
35
|
-
* ```typescript
|
|
36
|
-
* import {registerController, InjectorService} from "@tsed/di";
|
|
37
|
-
*
|
|
38
|
-
* export default class MyController {
|
|
39
|
-
* constructor(){}
|
|
40
|
-
* transform() {
|
|
41
|
-
* return "test";
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
45
|
-
* registerController({provide: MyController});
|
|
46
|
-
* // or
|
|
47
|
-
* registerController(MyController);
|
|
48
|
-
*
|
|
49
|
-
* const injector = new InjectorService();
|
|
50
|
-
* injector.load();
|
|
51
|
-
*
|
|
52
|
-
* const myController = injector.get<MyController>(MyController);
|
|
53
|
-
* myController.getFoo(); // test
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @param provider Provider configuration.
|
|
57
|
-
*/
|
|
58
|
-
export declare const registerController: (provider: any, instance?: any) => void;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Env } from "@tsed/core";
|
|
2
|
-
import type { ProviderScope } from "../domain/ProviderScope.js";
|
|
3
|
-
import type { DILoggerOptions } from "../interfaces/DILoggerOptions.js";
|
|
4
|
-
import type { DIResolver } from "../interfaces/DIResolver.js";
|
|
5
|
-
import type { ImportTokenProviderOpts } from "../interfaces/ImportTokenProviderOpts.js";
|
|
6
|
-
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
7
|
-
import type { TokenRoute } from "../interfaces/TokenRoute.js";
|
|
8
|
-
export declare class DIConfiguration {
|
|
9
|
-
readonly default: Map<string, any>;
|
|
10
|
-
protected map: Map<string, any>;
|
|
11
|
-
constructor(initialProps?: {});
|
|
12
|
-
get version(): string;
|
|
13
|
-
set version(v: string);
|
|
14
|
-
get rootDir(): string;
|
|
15
|
-
set rootDir(value: string);
|
|
16
|
-
get env(): Env;
|
|
17
|
-
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
|
-
get imports(): (TokenProvider | ImportTokenProviderOpts)[];
|
|
23
|
-
set imports(imports: (TokenProvider | ImportTokenProviderOpts)[]);
|
|
24
|
-
get routes(): TokenRoute[];
|
|
25
|
-
set routes(routes: TokenRoute[]);
|
|
26
|
-
get logger(): Partial<DILoggerOptions>;
|
|
27
|
-
set logger(value: Partial<DILoggerOptions>);
|
|
28
|
-
get debug(): boolean;
|
|
29
|
-
set debug(debug: boolean);
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param callbackfn
|
|
33
|
-
* @param thisArg
|
|
34
|
-
*/
|
|
35
|
-
forEach(callbackfn: (value: any, index: string, map: Map<string, any>) => void, thisArg?: any): void;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @param propertyKey
|
|
39
|
-
* @param value
|
|
40
|
-
*/
|
|
41
|
-
set(propertyKey: string | Partial<TsED.Configuration>, value?: any): this;
|
|
42
|
-
setRaw(propertyKey: string, value: any): this;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param propertyKey
|
|
46
|
-
* @param defaultValue
|
|
47
|
-
* @returns {undefined|any}
|
|
48
|
-
*/
|
|
49
|
-
get<T = any>(propertyKey: string, defaultValue?: T): T;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @param value
|
|
53
|
-
* @returns {any}
|
|
54
|
-
*/
|
|
55
|
-
resolve(value: any): any;
|
|
56
|
-
protected getRaw(propertyKey: string, defaultValue?: any): any;
|
|
57
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { Container } from "../domain/Container.js";
|
|
2
|
-
import { LocalsContainer } from "../domain/LocalsContainer.js";
|
|
3
|
-
import { Provider } from "../domain/Provider.js";
|
|
4
|
-
import { ProviderScope } from "../domain/ProviderScope.js";
|
|
5
|
-
import type { DILogger } from "../interfaces/DILogger.js";
|
|
6
|
-
import type { InvokeOptions } from "../interfaces/InvokeOptions.js";
|
|
7
|
-
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
8
|
-
import { DIConfiguration } from "./DIConfiguration.js";
|
|
9
|
-
/**
|
|
10
|
-
* This service contain all services collected by `@Service` or services declared manually with `InjectorService.factory()` or `InjectorService.service()`.
|
|
11
|
-
*
|
|
12
|
-
* ### Example:
|
|
13
|
-
*
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import {InjectorService} from "@tsed/di";
|
|
16
|
-
*
|
|
17
|
-
* // Import the services (all services are decorated with @Service()";
|
|
18
|
-
* import MyService1 from "./services/service1.js";
|
|
19
|
-
* import MyService2 from "./services/service2.js";
|
|
20
|
-
* import MyService3 from "./services/service3.js";
|
|
21
|
-
*
|
|
22
|
-
* // When all services are imported, you can load InjectorService.
|
|
23
|
-
* const injector = new InjectorService()
|
|
24
|
-
*
|
|
25
|
-
* await injector.load();
|
|
26
|
-
*
|
|
27
|
-
* const myService1 = injector.get<MyService1>(MyServcice1);
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare class InjectorService extends Container {
|
|
31
|
-
#private;
|
|
32
|
-
settings: DIConfiguration;
|
|
33
|
-
logger: DILogger;
|
|
34
|
-
private resolvedConfiguration;
|
|
35
|
-
constructor();
|
|
36
|
-
get resolvers(): import("../index.js").DIResolver[];
|
|
37
|
-
get scopes(): Record<string, ProviderScope>;
|
|
38
|
-
/**
|
|
39
|
-
* Return the current injector service.
|
|
40
|
-
*/
|
|
41
|
-
static getInstance(): InjectorService;
|
|
42
|
-
/**
|
|
43
|
-
* Get the locals container initiated by DITest or .bootstrap() method.
|
|
44
|
-
*/
|
|
45
|
-
static getLocals(): LocalsContainer;
|
|
46
|
-
/**
|
|
47
|
-
* Reset the locals container.
|
|
48
|
-
*/
|
|
49
|
-
static unsetLocals(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Retrieve default scope for a given provider.
|
|
52
|
-
* @param provider
|
|
53
|
-
*/
|
|
54
|
-
scopeOf(provider: Provider): ProviderScope;
|
|
55
|
-
/**
|
|
56
|
-
* Return a list of instance build by the injector.
|
|
57
|
-
*/
|
|
58
|
-
toArray(): any[];
|
|
59
|
-
/**
|
|
60
|
-
* Get a service or factory already constructed from his symbol or class.
|
|
61
|
-
*
|
|
62
|
-
* #### Example
|
|
63
|
-
*
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import {InjectorService} from "@tsed/di";
|
|
66
|
-
* import MyService from "./services.js";
|
|
67
|
-
*
|
|
68
|
-
* class OtherService {
|
|
69
|
-
* constructor(injectorService: InjectorService) {
|
|
70
|
-
* const myService = injectorService.get<MyService>(MyService);
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @param token The class or symbol registered in InjectorService.
|
|
76
|
-
* @param options
|
|
77
|
-
*/
|
|
78
|
-
get<T = any>(token: TokenProvider<T>, options?: Record<string, unknown>): T | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Return all instance of the same provider type
|
|
81
|
-
*/
|
|
82
|
-
getMany<Type = any>(type: any, locals?: LocalsContainer, options?: Partial<InvokeOptions>): Type[];
|
|
83
|
-
/**
|
|
84
|
-
* The has() method returns a boolean indicating whether an element with the specified key exists or not.
|
|
85
|
-
*/
|
|
86
|
-
has(token: TokenProvider): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Declare an alias for a given token.
|
|
89
|
-
*/
|
|
90
|
-
alias(token: TokenProvider, alias: TokenProvider): this;
|
|
91
|
-
/**
|
|
92
|
-
* Invoke the class and inject all services that required by the class constructor.
|
|
93
|
-
*
|
|
94
|
-
* #### Example
|
|
95
|
-
*
|
|
96
|
-
* ```typescript
|
|
97
|
-
* import {InjectorService} from "@tsed/di";
|
|
98
|
-
* import MyService from "./services.js";
|
|
99
|
-
*
|
|
100
|
-
* class OtherService {
|
|
101
|
-
* constructor(injectorService: InjectorService) {
|
|
102
|
-
* const myService = injectorService.invoke<MyService>(MyService);
|
|
103
|
-
* }
|
|
104
|
-
* }
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* @param token The injectable class to invoke. Class parameters are injected according constructor signature.
|
|
108
|
-
* @param locals Optional object. If preset then any argument Class are read from this object first, before the `InjectorService` is consulted.
|
|
109
|
-
* @param options
|
|
110
|
-
* @returns {Type} The class constructed.
|
|
111
|
-
*/
|
|
112
|
-
invoke<Type = any>(token: TokenProvider<Type>, locals?: LocalsContainer, options?: Partial<InvokeOptions>): Type;
|
|
113
|
-
/**
|
|
114
|
-
* Build only providers which are asynchronous.
|
|
115
|
-
*/
|
|
116
|
-
loadAsync(): Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* Build only providers which are synchronous.
|
|
119
|
-
*/
|
|
120
|
-
loadSync(): void;
|
|
121
|
-
/**
|
|
122
|
-
* Boostrap injector from container and resolve configuration.
|
|
123
|
-
*
|
|
124
|
-
* @param container
|
|
125
|
-
*/
|
|
126
|
-
bootstrap(container?: Container): this;
|
|
127
|
-
/**
|
|
128
|
-
* Load injector from a given module
|
|
129
|
-
* @param rootModule
|
|
130
|
-
*/
|
|
131
|
-
loadModule(rootModule: TokenProvider): Promise<void>;
|
|
132
|
-
/**
|
|
133
|
-
* Build all providers from given container (or GlobalProviders) and emit `$onInit` event.
|
|
134
|
-
*
|
|
135
|
-
* @param container
|
|
136
|
-
*/
|
|
137
|
-
load(container?: Container): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Load all configurations registered on providers
|
|
140
|
-
*/
|
|
141
|
-
resolveConfiguration(): void;
|
|
142
|
-
lazyInvoke<T = any>(token: TokenProvider): Promise<any>;
|
|
143
|
-
/**
|
|
144
|
-
* Emit an event to all service. See service [lifecycle hooks](/docs/services.md#lifecycle-hooks).
|
|
145
|
-
* @param eventName The event name to emit at all services.
|
|
146
|
-
* @param args List of the parameters to give to each service.
|
|
147
|
-
* @returns A list of promises.
|
|
148
|
-
*/
|
|
149
|
-
emit(eventName: string, ...args: any[]): Promise<void>;
|
|
150
|
-
/**
|
|
151
|
-
* Alter value attached to an event.
|
|
152
|
-
* @param eventName
|
|
153
|
-
* @param value
|
|
154
|
-
* @param args
|
|
155
|
-
*/
|
|
156
|
-
alter<T = any>(eventName: string, value: any, ...args: any[]): T;
|
|
157
|
-
/**
|
|
158
|
-
* Alter value attached to an event asynchronously.
|
|
159
|
-
* @param eventName
|
|
160
|
-
* @param value
|
|
161
|
-
* @param args
|
|
162
|
-
*/
|
|
163
|
-
alterAsync<T = any>(eventName: string, value: any, ...args: any[]): Promise<T>;
|
|
164
|
-
/**
|
|
165
|
-
* Destroy the injector and all services.
|
|
166
|
-
*/
|
|
167
|
-
destroy(): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Ensure that a provider is added to the container.
|
|
170
|
-
* @protected
|
|
171
|
-
*/
|
|
172
|
-
protected ensureProvider(token: TokenProvider, force: true): Provider;
|
|
173
|
-
protected ensureProvider(token: TokenProvider, force: false): Provider | undefined;
|
|
174
|
-
protected ensureProvider(token: TokenProvider): Provider | undefined;
|
|
175
|
-
protected getInstance(token: any): any;
|
|
176
|
-
/**
|
|
177
|
-
* Invoke a class method and inject service.
|
|
178
|
-
*
|
|
179
|
-
* #### IInjectableMethod options
|
|
180
|
-
*
|
|
181
|
-
* * **target**: Optional. The class instance.
|
|
182
|
-
* * **methodName**: `string` Optional. The method name.
|
|
183
|
-
* * **designParamTypes**: `any[]` Optional. List of injectable types.
|
|
184
|
-
* * **locals**: `Map<Function, any>` Optional. If preset then any argument Class are read from this object first, before the `InjectorService` is consulted.
|
|
185
|
-
*
|
|
186
|
-
* #### Example
|
|
187
|
-
*
|
|
188
|
-
* @param target
|
|
189
|
-
* @param locals
|
|
190
|
-
* @param options
|
|
191
|
-
* @private
|
|
192
|
-
*/
|
|
193
|
-
protected resolve<T>(target: TokenProvider, locals?: LocalsContainer, options?: Partial<InvokeOptions>): T | Promise<T>;
|
|
194
|
-
private resolveImportsProviders;
|
|
195
|
-
/**
|
|
196
|
-
* Create options to invoke a provider or class.
|
|
197
|
-
* @param token
|
|
198
|
-
* @param locals
|
|
199
|
-
* @param options
|
|
200
|
-
*/
|
|
201
|
-
private mapInvokeOptions;
|
|
202
|
-
private registerHooks;
|
|
203
|
-
}
|