ts-ioc-container 31.1.7 → 31.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-ioc-container",
|
|
3
|
-
"version": "31.1.
|
|
3
|
+
"version": "31.1.8",
|
|
4
4
|
"description": "Typescript IoC container",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"ts-node": "^10.9.1",
|
|
60
60
|
"typescript": "5.4.3"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "2c612a818f6601926b047f2313692b2d56a263a5"
|
|
63
63
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Alias, DependencyKey, IContainerModule, Tagged } from '../container/IContainer';
|
|
2
2
|
import { constructor, MapFn } from '../utils';
|
|
3
|
+
import { IProvider } from '../provider/IProvider';
|
|
3
4
|
export type ScopePredicate = (c: Tagged) => boolean;
|
|
4
|
-
export interface IRegistration extends IContainerModule {
|
|
5
|
+
export interface IRegistration<T = unknown> extends IContainerModule {
|
|
5
6
|
addAliases(...aliases: Alias[]): this;
|
|
6
7
|
when(isValidWhen: ScopePredicate): this;
|
|
7
8
|
to(key: DependencyKey): this;
|
|
9
|
+
pipe(...mappers: MapFn<IProvider<T>>[]): this;
|
|
8
10
|
}
|
|
9
11
|
export declare const key: (key: DependencyKey) => MapFn<IRegistration>;
|
|
10
12
|
export declare const alias: (...aliases: Alias[]) => MapFn<IRegistration>;
|
|
11
13
|
export declare const scope: (predicate: ScopePredicate) => MapFn<IRegistration>;
|
|
12
|
-
export declare const getTransformers: (Target: constructor<unknown>) => MapFn<IRegistration
|
|
14
|
+
export declare const getTransformers: (Target: constructor<unknown>) => MapFn<IRegistration<unknown>>[];
|
|
13
15
|
export declare const register: (...mappers: MapFn<IRegistration>[]) => ClassDecorator;
|
|
@@ -2,12 +2,12 @@ import { Alias, DependencyKey, IContainer } from '../container/IContainer';
|
|
|
2
2
|
import { constructor, MapFn } from '../utils';
|
|
3
3
|
import { IProvider, ResolveDependency } from '../provider/IProvider';
|
|
4
4
|
import { IRegistration, ScopePredicate } from './IRegistration';
|
|
5
|
-
export declare class Registration<T = unknown> implements IRegistration {
|
|
5
|
+
export declare class Registration<T = unknown> implements IRegistration<T> {
|
|
6
6
|
private createProvider;
|
|
7
7
|
private key?;
|
|
8
8
|
private matchScope;
|
|
9
|
-
static fromClass<T>(Target: constructor<T>): IRegistration
|
|
10
|
-
static fromValue<T>(value: T): IRegistration
|
|
9
|
+
static fromClass<T>(Target: constructor<T>): IRegistration<unknown>;
|
|
10
|
+
static fromValue<T>(value: T): IRegistration<unknown>;
|
|
11
11
|
static fromFn<T>(fn: ResolveDependency<T>): Registration<T>;
|
|
12
12
|
private aliases;
|
|
13
13
|
private mappers;
|