ts-ioc-container 32.19.0 → 32.19.2

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/cjm/by.js CHANGED
@@ -52,6 +52,13 @@ const depKey = (key = (0, utils_1.generateUUID)()) => {
52
52
  let isValidWhen;
53
53
  const mappers = [];
54
54
  return {
55
+ assignTo: (registration) => {
56
+ registration.pipe(...mappers).to(key);
57
+ if (isValidWhen) {
58
+ registration.when(isValidWhen);
59
+ }
60
+ return registration;
61
+ },
55
62
  register: (fn) => {
56
63
  const registration = new Registration_1.Registration(() => new Provider_1.Provider(fn), key).pipe(...mappers);
57
64
  if (isValidWhen) {
package/esm/by.js CHANGED
@@ -46,6 +46,13 @@ export const depKey = (key = generateUUID()) => {
46
46
  let isValidWhen;
47
47
  const mappers = [];
48
48
  return {
49
+ assignTo: (registration) => {
50
+ registration.pipe(...mappers).to(key);
51
+ if (isValidWhen) {
52
+ registration.when(isValidWhen);
53
+ }
54
+ return registration;
55
+ },
49
56
  register: (fn) => {
50
57
  const registration = new Registration(() => new Provider(fn), key).pipe(...mappers);
51
58
  if (isValidWhen) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-ioc-container",
3
- "version": "32.19.0",
3
+ "version": "32.19.2",
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": "a7029ca6a8b1260364a2440bb93fe93e138bae12"
62
+ "gitHead": "6079839647755cc6b4797f3abff6932de4a23d92"
63
63
  }
package/typings/by.d.ts CHANGED
@@ -26,11 +26,13 @@ export declare const by: {
26
26
  create: (...tags: string[]) => (l: IContainer) => IContainer;
27
27
  };
28
28
  };
29
- export declare const depKey: <T>(key?: DependencyKey) => {
29
+ export type DepKey<T> = {
30
+ assignTo: (registration: IRegistration<T>) => IRegistration<T>;
30
31
  register: (fn: (s: IContainer, ...args: unknown[]) => T) => IRegistration<T>;
31
32
  resolve: (s: IContainer, ...args: unknown[]) => T;
32
- pipe(...values: MapFn<IProvider<T>>[]): any;
33
- to(target: DependencyKey): any;
34
- when(value: ScopePredicate): any;
33
+ pipe(...values: MapFn<IProvider<T>>[]): DepKey<T>;
34
+ to(target: DependencyKey): DepKey<T>;
35
+ when(value: ScopePredicate): DepKey<T>;
35
36
  };
37
+ export declare const depKey: <T>(key?: DependencyKey) => DepKey<T>;
36
38
  export {};