@rocketmakers/ioc 0.3.5 → 0.3.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## 0.3.6 (2024-12-06)
2
+
3
+ ### Other Changes
4
+
5
+ * **deps:** Updated inversify version to 6.1.6 8ae899a
package/lib/binder.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  import { Curried1, Param1 } from './curry.generated';
2
2
  import { Func, IFunctionResolver } from './tail.generated';
3
3
  import { NewableOf, TupleToKeysOfMapped } from './types';
4
- declare type CollectCurriedParams<TOriginal extends Func, TCurried, TCollect extends any[] = []> = TOriginal extends TCurried ? TCollect : CollectCurriedParams<Curried1<TOriginal>, TCurried, [...TCollect, Param1<Parameters<TOriginal>>]>;
4
+ type CollectCurriedParams<TOriginal extends Func, TCurried, TCollect extends any[] = []> = TOriginal extends TCurried ? TCollect : CollectCurriedParams<Curried1<TOriginal>, TCurried, [...TCollect, Param1<Parameters<TOriginal>>]>;
5
5
  export declare class Binder<T, TItem, TDep> {
6
6
  protected key: string;
7
7
  protected keyTransformer: (keyName: string) => string;
8
8
  constructor(key: string, keyTransformer: (keyName: string) => string);
9
9
  /** Gets the underlying container binding to the specified key */
10
- get binding(): import("inversify/dts/interfaces/interfaces").interfaces.BindingToSyntax<TItem>;
10
+ get binding(): import("inversify/lib/cjs/interfaces/interfaces").interfaces.BindingToSyntax<TItem>;
11
11
  /** Register a function */
12
- function(item: TItem): import("inversify/dts/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
12
+ function(item: TItem): import("inversify/lib/cjs/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
13
13
  /** Register a function resolver */
14
- functionResolver(item: IFunctionResolver<TItem>): import("inversify/dts/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
14
+ functionResolver(item: IFunctionResolver<TItem>): import("inversify/lib/cjs/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
15
15
  /** Register a constant */
16
- constant(item: TItem): import("inversify/dts/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
16
+ constant(item: TItem): import("inversify/lib/cjs/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
17
17
  /** Register a curried function */
18
- functionCurry<TFn extends Func>(item: TFn, params: TupleToKeysOfMapped<CollectCurriedParams<TFn, TItem>, T & TDep>): import("inversify/dts/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
18
+ functionCurry<TFn extends Func>(item: TFn, params: TupleToKeysOfMapped<CollectCurriedParams<TFn, TItem>, T & TDep>): import("inversify/lib/cjs/interfaces/interfaces").interfaces.BindingWhenOnSyntax<TItem>;
19
19
  /** Register a class */
20
20
  class<C extends NewableOf<TItem>>(cls: C, params: TupleToKeysOfMapped<ConstructorParameters<C>, T & TDep>): import("./inversify").BindingInWhenOnSyntax<InstanceType<C>>;
21
21
  }
@@ -1,143 +1,143 @@
1
1
  /** Returns a mapped type that removes the first element from the type array */
2
- export declare type Tail1<T extends any[]> = ((...t: T) => any) extends (_1: any, ...tail: infer TTail) => any ? TTail : [
2
+ export type Tail1<T extends any[]> = ((...t: T) => any) extends (_1: any, ...tail: infer TTail) => any ? TTail : [
3
3
  ];
4
4
  /** Returns a mapped type that removes the first 2 elements from the type array */
5
- export declare type Tail2<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, ...tail: infer TTail) => any ? TTail : [
5
+ export type Tail2<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, ...tail: infer TTail) => any ? TTail : [
6
6
  ];
7
7
  /** Returns a mapped type that removes the first 3 elements from the type array */
8
- export declare type Tail3<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, ...tail: infer TTail) => any ? TTail : [
8
+ export type Tail3<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, ...tail: infer TTail) => any ? TTail : [
9
9
  ];
10
10
  /** Returns a mapped type that removes the first 4 elements from the type array */
11
- export declare type Tail4<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, ...tail: infer TTail) => any ? TTail : [
11
+ export type Tail4<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, ...tail: infer TTail) => any ? TTail : [
12
12
  ];
13
13
  /** Returns a mapped type that removes the first 5 elements from the type array */
14
- export declare type Tail5<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, ...tail: infer TTail) => any ? TTail : [
14
+ export type Tail5<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, ...tail: infer TTail) => any ? TTail : [
15
15
  ];
16
16
  /** Returns a mapped type that removes the first 6 elements from the type array */
17
- export declare type Tail6<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, ...tail: infer TTail) => any ? TTail : [
17
+ export type Tail6<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, ...tail: infer TTail) => any ? TTail : [
18
18
  ];
19
19
  /** Returns a mapped type that removes the first 7 elements from the type array */
20
- export declare type Tail7<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, ...tail: infer TTail) => any ? TTail : [
20
+ export type Tail7<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, ...tail: infer TTail) => any ? TTail : [
21
21
  ];
22
22
  /** Returns a mapped type that removes the first 8 elements from the type array */
23
- export declare type Tail8<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, ...tail: infer TTail) => any ? TTail : [
23
+ export type Tail8<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, ...tail: infer TTail) => any ? TTail : [
24
24
  ];
25
25
  /** Returns a mapped type that removes the first 9 elements from the type array */
26
- export declare type Tail9<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, ...tail: infer TTail) => any ? TTail : [
26
+ export type Tail9<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, ...tail: infer TTail) => any ? TTail : [
27
27
  ];
28
28
  /** Returns a mapped type that removes the first 10 elements from the type array */
29
- export declare type Tail10<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, ...tail: infer TTail) => any ? TTail : [
29
+ export type Tail10<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, ...tail: infer TTail) => any ? TTail : [
30
30
  ];
31
31
  /** Returns a mapped type that removes the first 11 elements from the type array */
32
- export declare type Tail11<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, ...tail: infer TTail) => any ? TTail : [
32
+ export type Tail11<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, ...tail: infer TTail) => any ? TTail : [
33
33
  ];
34
34
  /** Returns a mapped type that removes the first 12 elements from the type array */
35
- export declare type Tail12<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, ...tail: infer TTail) => any ? TTail : [
35
+ export type Tail12<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, ...tail: infer TTail) => any ? TTail : [
36
36
  ];
37
37
  /** Returns a mapped type that removes the first 13 elements from the type array */
38
- export declare type Tail13<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, ...tail: infer TTail) => any ? TTail : [
38
+ export type Tail13<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, ...tail: infer TTail) => any ? TTail : [
39
39
  ];
40
40
  /** Returns a mapped type that removes the first 14 elements from the type array */
41
- export declare type Tail14<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, ...tail: infer TTail) => any ? TTail : [
41
+ export type Tail14<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, ...tail: infer TTail) => any ? TTail : [
42
42
  ];
43
43
  /** Returns a mapped type that removes the first 15 elements from the type array */
44
- export declare type Tail15<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, ...tail: infer TTail) => any ? TTail : [
44
+ export type Tail15<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, ...tail: infer TTail) => any ? TTail : [
45
45
  ];
46
46
  /** Returns a mapped type that removes the first 16 elements from the type array */
47
- export declare type Tail16<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, ...tail: infer TTail) => any ? TTail : [
47
+ export type Tail16<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, ...tail: infer TTail) => any ? TTail : [
48
48
  ];
49
49
  /** Returns a mapped type that removes the first 17 elements from the type array */
50
- export declare type Tail17<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, ...tail: infer TTail) => any ? TTail : [
50
+ export type Tail17<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, ...tail: infer TTail) => any ? TTail : [
51
51
  ];
52
52
  /** Returns a mapped type that removes the first 18 elements from the type array */
53
- export declare type Tail18<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, ...tail: infer TTail) => any ? TTail : [
53
+ export type Tail18<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, ...tail: infer TTail) => any ? TTail : [
54
54
  ];
55
55
  /** Returns a mapped type that removes the first 19 elements from the type array */
56
- export declare type Tail19<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, _19: any, ...tail: infer TTail) => any ? TTail : [
56
+ export type Tail19<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, _19: any, ...tail: infer TTail) => any ? TTail : [
57
57
  ];
58
58
  /** Returns a mapped type that removes the first 20 elements from the type array */
59
- export declare type Tail20<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, _19: any, _20: any, ...tail: infer TTail) => any ? TTail : [
59
+ export type Tail20<T extends any[]> = ((...t: T) => any) extends (_1: any, _2: any, _3: any, _4: any, _5: any, _6: any, _7: any, _8: any, _9: any, _10: any, _11: any, _12: any, _13: any, _14: any, _15: any, _16: any, _17: any, _18: any, _19: any, _20: any, ...tail: infer TTail) => any ? TTail : [
60
60
  ];
61
61
  /** Returns a mapped type of the function that removes the first parameter from the method */
62
- export declare type Curried1<T extends (...args: any[]) => any> = (...tail: Tail1<Parameters<T>>) => ReturnType<T>;
62
+ export type Curried1<T extends (...args: any[]) => any> = (...tail: Tail1<Parameters<T>>) => ReturnType<T>;
63
63
  /** Returns a mapped type of the function that removes the first 2 parameters from the method */
64
- export declare type Curried2<T extends (...args: any[]) => any> = (...tail: Tail2<Parameters<T>>) => ReturnType<T>;
64
+ export type Curried2<T extends (...args: any[]) => any> = (...tail: Tail2<Parameters<T>>) => ReturnType<T>;
65
65
  /** Returns a mapped type of the function that removes the first 3 parameters from the method */
66
- export declare type Curried3<T extends (...args: any[]) => any> = (...tail: Tail3<Parameters<T>>) => ReturnType<T>;
66
+ export type Curried3<T extends (...args: any[]) => any> = (...tail: Tail3<Parameters<T>>) => ReturnType<T>;
67
67
  /** Returns a mapped type of the function that removes the first 4 parameters from the method */
68
- export declare type Curried4<T extends (...args: any[]) => any> = (...tail: Tail4<Parameters<T>>) => ReturnType<T>;
68
+ export type Curried4<T extends (...args: any[]) => any> = (...tail: Tail4<Parameters<T>>) => ReturnType<T>;
69
69
  /** Returns a mapped type of the function that removes the first 5 parameters from the method */
70
- export declare type Curried5<T extends (...args: any[]) => any> = (...tail: Tail5<Parameters<T>>) => ReturnType<T>;
70
+ export type Curried5<T extends (...args: any[]) => any> = (...tail: Tail5<Parameters<T>>) => ReturnType<T>;
71
71
  /** Returns a mapped type of the function that removes the first 6 parameters from the method */
72
- export declare type Curried6<T extends (...args: any[]) => any> = (...tail: Tail6<Parameters<T>>) => ReturnType<T>;
72
+ export type Curried6<T extends (...args: any[]) => any> = (...tail: Tail6<Parameters<T>>) => ReturnType<T>;
73
73
  /** Returns a mapped type of the function that removes the first 7 parameters from the method */
74
- export declare type Curried7<T extends (...args: any[]) => any> = (...tail: Tail7<Parameters<T>>) => ReturnType<T>;
74
+ export type Curried7<T extends (...args: any[]) => any> = (...tail: Tail7<Parameters<T>>) => ReturnType<T>;
75
75
  /** Returns a mapped type of the function that removes the first 8 parameters from the method */
76
- export declare type Curried8<T extends (...args: any[]) => any> = (...tail: Tail8<Parameters<T>>) => ReturnType<T>;
76
+ export type Curried8<T extends (...args: any[]) => any> = (...tail: Tail8<Parameters<T>>) => ReturnType<T>;
77
77
  /** Returns a mapped type of the function that removes the first 9 parameters from the method */
78
- export declare type Curried9<T extends (...args: any[]) => any> = (...tail: Tail9<Parameters<T>>) => ReturnType<T>;
78
+ export type Curried9<T extends (...args: any[]) => any> = (...tail: Tail9<Parameters<T>>) => ReturnType<T>;
79
79
  /** Returns a mapped type of the function that removes the first 10 parameters from the method */
80
- export declare type Curried10<T extends (...args: any[]) => any> = (...tail: Tail10<Parameters<T>>) => ReturnType<T>;
80
+ export type Curried10<T extends (...args: any[]) => any> = (...tail: Tail10<Parameters<T>>) => ReturnType<T>;
81
81
  /** Returns a mapped type of the function that removes the first 11 parameters from the method */
82
- export declare type Curried11<T extends (...args: any[]) => any> = (...tail: Tail11<Parameters<T>>) => ReturnType<T>;
82
+ export type Curried11<T extends (...args: any[]) => any> = (...tail: Tail11<Parameters<T>>) => ReturnType<T>;
83
83
  /** Returns a mapped type of the function that removes the first 12 parameters from the method */
84
- export declare type Curried12<T extends (...args: any[]) => any> = (...tail: Tail12<Parameters<T>>) => ReturnType<T>;
84
+ export type Curried12<T extends (...args: any[]) => any> = (...tail: Tail12<Parameters<T>>) => ReturnType<T>;
85
85
  /** Returns a mapped type of the function that removes the first 13 parameters from the method */
86
- export declare type Curried13<T extends (...args: any[]) => any> = (...tail: Tail13<Parameters<T>>) => ReturnType<T>;
86
+ export type Curried13<T extends (...args: any[]) => any> = (...tail: Tail13<Parameters<T>>) => ReturnType<T>;
87
87
  /** Returns a mapped type of the function that removes the first 14 parameters from the method */
88
- export declare type Curried14<T extends (...args: any[]) => any> = (...tail: Tail14<Parameters<T>>) => ReturnType<T>;
88
+ export type Curried14<T extends (...args: any[]) => any> = (...tail: Tail14<Parameters<T>>) => ReturnType<T>;
89
89
  /** Returns a mapped type of the function that removes the first 15 parameters from the method */
90
- export declare type Curried15<T extends (...args: any[]) => any> = (...tail: Tail15<Parameters<T>>) => ReturnType<T>;
90
+ export type Curried15<T extends (...args: any[]) => any> = (...tail: Tail15<Parameters<T>>) => ReturnType<T>;
91
91
  /** Returns a mapped type of the function that removes the first 16 parameters from the method */
92
- export declare type Curried16<T extends (...args: any[]) => any> = (...tail: Tail16<Parameters<T>>) => ReturnType<T>;
92
+ export type Curried16<T extends (...args: any[]) => any> = (...tail: Tail16<Parameters<T>>) => ReturnType<T>;
93
93
  /** Returns a mapped type of the function that removes the first 17 parameters from the method */
94
- export declare type Curried17<T extends (...args: any[]) => any> = (...tail: Tail17<Parameters<T>>) => ReturnType<T>;
94
+ export type Curried17<T extends (...args: any[]) => any> = (...tail: Tail17<Parameters<T>>) => ReturnType<T>;
95
95
  /** Returns a mapped type of the function that removes the first 18 parameters from the method */
96
- export declare type Curried18<T extends (...args: any[]) => any> = (...tail: Tail18<Parameters<T>>) => ReturnType<T>;
96
+ export type Curried18<T extends (...args: any[]) => any> = (...tail: Tail18<Parameters<T>>) => ReturnType<T>;
97
97
  /** Returns a mapped type of the function that removes the first 19 parameters from the method */
98
- export declare type Curried19<T extends (...args: any[]) => any> = (...tail: Tail19<Parameters<T>>) => ReturnType<T>;
98
+ export type Curried19<T extends (...args: any[]) => any> = (...tail: Tail19<Parameters<T>>) => ReturnType<T>;
99
99
  /** Returns a mapped type of the function that removes the first 20 parameters from the method */
100
- export declare type Curried20<T extends (...args: any[]) => any> = (...tail: Tail20<Parameters<T>>) => ReturnType<T>;
100
+ export type Curried20<T extends (...args: any[]) => any> = (...tail: Tail20<Parameters<T>>) => ReturnType<T>;
101
101
  /** Returns the type in position 1 of the type array */
102
- export declare type Param1<T extends any[]> = T extends [
102
+ export type Param1<T extends any[]> = T extends [
103
103
  any,
104
104
  ...any[]
105
105
  ] ? T[0] : never;
106
106
  /** Returns the type in position 2 of the type array */
107
- export declare type Param2<T extends any[]> = Param1<Tail1<T>>;
107
+ export type Param2<T extends any[]> = Param1<Tail1<T>>;
108
108
  /** Returns the type in position 3 of the type array */
109
- export declare type Param3<T extends any[]> = Param1<Tail2<T>>;
109
+ export type Param3<T extends any[]> = Param1<Tail2<T>>;
110
110
  /** Returns the type in position 4 of the type array */
111
- export declare type Param4<T extends any[]> = Param1<Tail3<T>>;
111
+ export type Param4<T extends any[]> = Param1<Tail3<T>>;
112
112
  /** Returns the type in position 5 of the type array */
113
- export declare type Param5<T extends any[]> = Param1<Tail4<T>>;
113
+ export type Param5<T extends any[]> = Param1<Tail4<T>>;
114
114
  /** Returns the type in position 6 of the type array */
115
- export declare type Param6<T extends any[]> = Param1<Tail5<T>>;
115
+ export type Param6<T extends any[]> = Param1<Tail5<T>>;
116
116
  /** Returns the type in position 7 of the type array */
117
- export declare type Param7<T extends any[]> = Param1<Tail6<T>>;
117
+ export type Param7<T extends any[]> = Param1<Tail6<T>>;
118
118
  /** Returns the type in position 8 of the type array */
119
- export declare type Param8<T extends any[]> = Param1<Tail7<T>>;
119
+ export type Param8<T extends any[]> = Param1<Tail7<T>>;
120
120
  /** Returns the type in position 9 of the type array */
121
- export declare type Param9<T extends any[]> = Param1<Tail8<T>>;
121
+ export type Param9<T extends any[]> = Param1<Tail8<T>>;
122
122
  /** Returns the type in position 10 of the type array */
123
- export declare type Param10<T extends any[]> = Param1<Tail9<T>>;
123
+ export type Param10<T extends any[]> = Param1<Tail9<T>>;
124
124
  /** Returns the type in position 11 of the type array */
125
- export declare type Param11<T extends any[]> = Param1<Tail10<T>>;
125
+ export type Param11<T extends any[]> = Param1<Tail10<T>>;
126
126
  /** Returns the type in position 12 of the type array */
127
- export declare type Param12<T extends any[]> = Param1<Tail11<T>>;
127
+ export type Param12<T extends any[]> = Param1<Tail11<T>>;
128
128
  /** Returns the type in position 13 of the type array */
129
- export declare type Param13<T extends any[]> = Param1<Tail12<T>>;
129
+ export type Param13<T extends any[]> = Param1<Tail12<T>>;
130
130
  /** Returns the type in position 14 of the type array */
131
- export declare type Param14<T extends any[]> = Param1<Tail13<T>>;
131
+ export type Param14<T extends any[]> = Param1<Tail13<T>>;
132
132
  /** Returns the type in position 15 of the type array */
133
- export declare type Param15<T extends any[]> = Param1<Tail14<T>>;
133
+ export type Param15<T extends any[]> = Param1<Tail14<T>>;
134
134
  /** Returns the type in position 16 of the type array */
135
- export declare type Param16<T extends any[]> = Param1<Tail15<T>>;
135
+ export type Param16<T extends any[]> = Param1<Tail15<T>>;
136
136
  /** Returns the type in position 17 of the type array */
137
- export declare type Param17<T extends any[]> = Param1<Tail16<T>>;
137
+ export type Param17<T extends any[]> = Param1<Tail16<T>>;
138
138
  /** Returns the type in position 18 of the type array */
139
- export declare type Param18<T extends any[]> = Param1<Tail17<T>>;
139
+ export type Param18<T extends any[]> = Param1<Tail17<T>>;
140
140
  /** Returns the type in position 19 of the type array */
141
- export declare type Param19<T extends any[]> = Param1<Tail18<T>>;
141
+ export type Param19<T extends any[]> = Param1<Tail18<T>>;
142
142
  /** Returns the type in position 20 of the type array */
143
- export declare type Param20<T extends any[]> = Param1<Tail19<T>>;
143
+ export type Param20<T extends any[]> = Param1<Tail19<T>>;
package/lib/index.d.ts CHANGED
@@ -9,8 +9,8 @@ export * from './curry.generated';
9
9
  export * from './inversify';
10
10
  export { CamelPrefixed } from './naming/camel';
11
11
  export { Prefixed } from './naming/none';
12
- export declare type BindingInWhenOnSyntax<T> = interfaces.BindingInWhenOnSyntax<T>;
13
- export declare const internalContainer: import("inversify/dts/container/container").Container;
12
+ export type BindingInWhenOnSyntax<T> = interfaces.BindingInWhenOnSyntax<T>;
13
+ export declare const internalContainer: import("inversify/lib/cjs/container/container").Container;
14
14
  /** @deprecated LEGACY: Use this helper function to provide container curry functions */
15
15
  export declare function containerRegisterFunctionResolver<T>(): {
16
16
  curry1<TFn extends import("./tail.generated").Func, K1 extends KeysOfType<T, import("./curry.generated").Param1<Parameters<TFn>>>>(fn: TFn, key1: K1): IFunctionResolver<import("./curry.generated").Curried1<TFn>>;
@@ -45,8 +45,8 @@ export declare function containerRegister<TContainer>(): {
45
45
  construct(keys: import("./types").TupleToKeysOfMapped<ConstructorParameters<C>, TContainer>): import("./inversify").BindingInWhenOnSyntax<InstanceType<C>>;
46
46
  };
47
47
  };
48
- export declare type ContainerBinder<T, TItem, TDep> = (item: Binder<T, TItem, TDep>) => interfaces.BindingOnSyntax<TItem>;
49
- export declare type ContainerBinding<T, TDep> = {
48
+ export type ContainerBinder<T, TItem, TDep> = (item: Binder<T, TItem, TDep>) => interfaces.BindingOnSyntax<TItem>;
49
+ export type ContainerBinding<T, TDep> = {
50
50
  [P in keyof T]-?: ContainerBinder<T, T[P], TDep>;
51
51
  };
52
52
  /** The definition of an IoC Container */
@@ -61,11 +61,11 @@ export declare function containerFactory<T>(): IContainer<T>;
61
61
  /** Register the bindings required for your container */
62
62
  export declare function register<TContainer>(binding: ContainerBinding<TContainer, {}>): IContainer<TContainer>;
63
63
  export declare function register<TContainer, TDep>(binding: ContainerBinding<TContainer, TDep>, dependent: IContainer<TDep>): IContainer<TContainer & TDep>;
64
- export declare type NamingConvention = 'none' | 'camel';
64
+ export type NamingConvention = 'none' | 'camel';
65
65
  /** Register the bindings required for your container */
66
66
  export declare function registerWithPrefix<TKeyPrefix extends string, TContainer>(convention: 'camel', prefix: TKeyPrefix, binding: ContainerBinding<TContainer, {}>): IContainer<CamelPrefixed<TContainer, TKeyPrefix>>;
67
67
  export declare function registerWithPrefix<TKeyPrefix extends string, TContainer, TDep>(convention: 'camel', prefix: TKeyPrefix, binding: ContainerBinding<TContainer, TDep>, dependent: IContainer<TDep>): IContainer<CamelPrefixed<TContainer, typeof prefix> & TDep>;
68
68
  export declare function registerWithPrefix<TKeyPrefix extends string, T>(convention: 'none', prefix: TKeyPrefix, binding: ContainerBinding<T, {}>): IContainer<Prefixed<T, TKeyPrefix>>;
69
69
  export declare function registerWithPrefix<TKeyPrefix extends string, TContainer, TDep>(convention: 'none', prefix: TKeyPrefix, binding: ContainerBinding<TContainer, TDep>, dependent: IContainer<TDep>): IContainer<Prefixed<TContainer, typeof prefix> & TDep>;
70
70
  /** Safely merge two containers */
71
- export declare function mergeContainers<T1, T2>(container1: IContainer<T1>, container2: IContainer<T2>): IContainer<T1 & T2>;
71
+ export declare function mergeContainers<T1, T2>(container1: IContainer<T1>, container2: IContainer<T2>, sharedKeys?: string[]): IContainer<T1 & T2>;
package/lib/index.js CHANGED
@@ -63,8 +63,8 @@ function containerFactory() {
63
63
  return createContainerOf([]);
64
64
  }
65
65
  exports.containerFactory = containerFactory;
66
- function getCombinedKeys(keys, dependent) {
67
- var duplicates = keys.filter(function (k) { return dependent.indexOf(k) > -1; });
66
+ function getCombinedKeys(keys, dependent, sharedKeys) {
67
+ var duplicates = keys.filter(function (k) { return (!sharedKeys || sharedKeys.indexOf(k) > -1) && dependent.indexOf(k) > -1; });
68
68
  if (duplicates.length) {
69
69
  throw new error_1.IocDuplicateKeyError(duplicates);
70
70
  }
@@ -76,6 +76,7 @@ function registerInternal(binding, transform, dependent) {
76
76
  var mappedKeys = keys.reduce(function (record, key) {
77
77
  var newKey = transform(key);
78
78
  newKeys.push(newKey);
79
+ // eslint-disable-next-line no-param-reassign
79
80
  record[key] = newKey;
80
81
  return record;
81
82
  }, {});
@@ -112,8 +113,8 @@ function registerWithPrefix(convention, prefix, binding, dependent) {
112
113
  }
113
114
  exports.registerWithPrefix = registerWithPrefix;
114
115
  /** Safely merge two containers */
115
- function mergeContainers(container1, container2) {
116
- var combinedKeys = getCombinedKeys(container1.keys, container2.keys);
116
+ function mergeContainers(container1, container2, sharedKeys) {
117
+ var combinedKeys = getCombinedKeys(container1.keys, container2.keys, sharedKeys);
117
118
  return createContainerOf(combinedKeys);
118
119
  }
119
120
  exports.mergeContainers = mergeContainers;
@@ -1,11 +1,7 @@
1
1
  import { Container, interfaces } from 'inversify';
2
2
  import { Newable } from './types';
3
3
  declare global {
4
- namespace NodeJS {
5
- interface Global {
6
- _rocketmakers_ioc: Container;
7
- }
8
- }
4
+ var _rocketmakers_ioc: Container;
9
5
  }
10
6
  export declare const reflectMetadataKeys: {
11
7
  injectable: string;
@@ -26,5 +22,5 @@ export declare function makeInjected(classType: any, index: number, serviceIdent
26
22
  export declare function makeParamUnmanaged(classType: any, parameterIndex: number): void;
27
23
  /** @deprecated Renamed to makeParamUnmanaged */
28
24
  export declare function makeUnmanaged(classType: any, parameterIndex: number): void;
29
- export declare type BindingInWhenOnSyntax<T> = interfaces.BindingInWhenOnSyntax<T>;
25
+ export type BindingInWhenOnSyntax<T> = interfaces.BindingInWhenOnSyntax<T>;
30
26
  export declare function registerClass<T extends Newable>(key: string, classType: T, ctorParams: string[]): BindingInWhenOnSyntax<InstanceType<T>>;
@@ -1,6 +1,6 @@
1
1
  import { StringKeyof } from '../tail.generated';
2
- export declare type CamelConvention<TPrefix extends string, TKey extends string> = `${TPrefix}${Capitalize<TKey>}`;
3
- export declare type CamelPrefixed<T, TPrefix extends string> = {
2
+ export type CamelConvention<TPrefix extends string, TKey extends string> = `${TPrefix}${Capitalize<TKey>}`;
3
+ export type CamelPrefixed<T, TPrefix extends string> = {
4
4
  [K in StringKeyof<T> as CamelConvention<TPrefix, K>]: T[K];
5
5
  };
6
6
  export declare function camelKeyTransform<TPrefix extends string>(prefix: TPrefix): <TKey extends string>(key: TKey) => CamelConvention<TPrefix, TKey>;
@@ -1,6 +1,6 @@
1
1
  import { StringKeyof } from '../tail.generated';
2
- export declare type Convention<TPrefix extends string, TKey extends string> = `${TPrefix}${TKey}`;
3
- export declare type Prefixed<T, TPrefix extends string> = {
2
+ export type Convention<TPrefix extends string, TKey extends string> = `${TPrefix}${TKey}`;
3
+ export type Prefixed<T, TPrefix extends string> = {
4
4
  [K in StringKeyof<T> as Convention<TPrefix, K>]: T[K];
5
5
  };
6
6
  export declare function keyTransform<TPrefix extends string>(prefix: TPrefix): <TKey extends string>(key: TKey) => Convention<TPrefix, TKey>;
@@ -2,11 +2,11 @@ import { Param1, Curried1, Curried2, Curried3, Curried4, Curried5, Curried6, Cur
2
2
  export interface IFunctionResolver<T> {
3
3
  resolved: () => T;
4
4
  }
5
- export declare type StringKeyof<T> = Extract<keyof T, string>;
6
- export declare type KeysOfType<TMap, TKey> = {
5
+ export type StringKeyof<T> = Extract<keyof T, string>;
6
+ export type KeysOfType<TMap, TKey> = {
7
7
  [P in StringKeyof<TMap>]: TMap[P] extends TKey ? P : never;
8
8
  }[StringKeyof<TMap>];
9
- export declare type Func = (...args: any) => any;
9
+ export type Func = (...args: any) => any;
10
10
  export declare function containerRegisterFunctionResolverInternal<T>(curryInner: <TFn extends Func>(fn: TFn, ...keys: PropertyKey[]) => IFunctionResolver<any>): {
11
11
  /** Curry out the first parameter from the method */
12
12
  curry1<TFn extends Func, K1 extends KeysOfType<T, Param1<Parameters<TFn>>>>(fn: TFn, key1: K1): IFunctionResolver<Curried1<TFn>>;
package/lib/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { KeysOfType, StringKeyof } from './tail.generated';
2
- export declare type KeysNotOfType<TMap, TKey> = {
2
+ export type KeysNotOfType<TMap, TKey> = {
3
3
  [P in StringKeyof<TMap>]: TMap[P] extends TKey ? never : P;
4
4
  }[StringKeyof<TMap>];
5
- export declare type NewableOf<T> = new (...args: any) => T;
6
- export declare type Newable = new (...args: any) => any;
7
- export declare type TupleToKeysOfMapped<TTuple extends Array<any>, TMapped> = {
5
+ export type NewableOf<T> = new (...args: any) => T;
6
+ export type Newable = new (...args: any) => any;
7
+ export type TupleToKeysOfMapped<TTuple extends Array<any>, TMapped> = {
8
8
  [K in keyof TTuple]: TTuple[K] extends TTuple[number] ? KeysOfType<TMapped, TTuple[K]> : never;
9
9
  };
package/package.json CHANGED
@@ -1,29 +1,33 @@
1
1
  {
2
2
  "name": "@rocketmakers/ioc",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
- "scripts": {
7
- "start-test": "npm run build && node lib/test.js",
8
- "start": "npm run build && node lib/index.js",
9
- "build": "tsc -p source",
10
- "test": "npm run build && ava --verbose"
11
- },
12
6
  "keywords": [],
13
7
  "author": "",
14
8
  "license": "ISC",
15
9
  "dependencies": {
16
- "inversify": "5.0.5",
17
- "reflect-metadata": "^0.1.13",
18
- "tslib": "^2.3.1"
10
+ "inversify": "6.1.6",
11
+ "reflect-metadata": "0.2.2",
12
+ "tslib": "2.8.1"
19
13
  },
20
14
  "devDependencies": {
21
- "@types/node": "^14.14.31",
22
- "ava": "^3.15.0",
23
- "typescript": "4.6.3",
24
- "typescript-json-schema": "0.43.0"
15
+ "@types/node": "20.17.9",
16
+ "ava": "3.15.0",
17
+ "eslint": "8.57.1",
18
+ "typescript": "4.9.5",
19
+ "typescript-json-schema": "0.65.1",
20
+ "eslint-config-ioc": "0.5.1",
21
+ "ioc-code-gen": "1.0.0",
22
+ "tsconfig-ioc": "0.5.1"
25
23
  },
26
24
  "publishConfig": {
27
25
  "access": "public"
26
+ },
27
+ "scripts": {
28
+ "lint": "eslint . --ext .ts",
29
+ "lint-fix": "pnpm lint --fix",
30
+ "start": "npm run build && node lib/index.js",
31
+ "build": "tsc -p ."
28
32
  }
29
- }
33
+ }