@navios/di 0.1.5 → 0.1.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.
@@ -180,39 +180,29 @@ declare const inject: Injectors['inject'];
180
180
  export { inject }
181
181
  export { inject as inject_alias_1 }
182
182
 
183
- declare function Injectable(): <T extends ClassType>(target: T, context: ClassDecoratorContext) => T & {
184
- [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined>;
185
- };
183
+ declare function Injectable(): <T extends ClassType>(target: T, context: ClassDecoratorContext) => T;
186
184
 
187
185
  declare function Injectable<R>(options: {
188
186
  scope?: InjectableScope;
189
187
  type: InjectableType.Factory;
190
- }): <T extends ClassTypeWithInstance<Factory<R>>>(target: T, context: ClassDecoratorContext) => T & {
191
- [InjectableTokenMeta]: InjectionToken<R, undefined>;
192
- };
188
+ }): <T extends ClassTypeWithInstance<Factory<R>>>(target: T, context: ClassDecoratorContext) => T;
193
189
 
194
190
  declare function Injectable<S extends AnyZodObject>(options: {
195
191
  scope?: InjectableScope;
196
192
  type?: InjectableType.Class;
197
193
  token: InjectionToken<undefined, S>;
198
- }): <T extends ClassTypeWithArgument<z.output<S>>>(target: T, context: ClassDecoratorContext) => T & {
199
- [InjectableTokenMeta]: InjectionToken<T, S>;
200
- };
194
+ }): <T extends ClassTypeWithArgument<z.output<S>>>(target: T, context: ClassDecoratorContext) => T;
201
195
 
202
196
  declare function Injectable<R, S extends AnyZodObject>(options: {
203
197
  scope?: InjectableScope;
204
198
  type?: InjectableType.Class;
205
199
  token: InjectionToken<R, S>;
206
- }): <T extends ClassTypeWithInstanceAndArgument<R, z.output<S>>>(target: T, context: ClassDecoratorContext) => T & {
207
- [InjectableTokenMeta]: InjectionToken<R, S>;
208
- };
200
+ }): <T extends ClassTypeWithInstanceAndArgument<R, z.output<S>>>(target: T, context: ClassDecoratorContext) => T;
209
201
 
210
202
  declare function Injectable<T extends ClassType>(options: {
211
203
  scope?: InjectableScope;
212
204
  token: InjectionToken<T, undefined>;
213
- }): (target: T, context: ClassDecoratorContext) => T & {
214
- [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined>;
215
- };
205
+ }): (target: T, context: ClassDecoratorContext) => T;
216
206
 
217
207
  declare function Injectable<R, S extends AnyZodObject>(options: {
218
208
  scope?: InjectableScope;
@@ -180,39 +180,29 @@ declare const inject: Injectors['inject'];
180
180
  export { inject }
181
181
  export { inject as inject_alias_1 }
182
182
 
183
- declare function Injectable(): <T extends ClassType>(target: T, context: ClassDecoratorContext) => T & {
184
- [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined>;
185
- };
183
+ declare function Injectable(): <T extends ClassType>(target: T, context: ClassDecoratorContext) => T;
186
184
 
187
185
  declare function Injectable<R>(options: {
188
186
  scope?: InjectableScope;
189
187
  type: InjectableType.Factory;
190
- }): <T extends ClassTypeWithInstance<Factory<R>>>(target: T, context: ClassDecoratorContext) => T & {
191
- [InjectableTokenMeta]: InjectionToken<R, undefined>;
192
- };
188
+ }): <T extends ClassTypeWithInstance<Factory<R>>>(target: T, context: ClassDecoratorContext) => T;
193
189
 
194
190
  declare function Injectable<S extends AnyZodObject>(options: {
195
191
  scope?: InjectableScope;
196
192
  type?: InjectableType.Class;
197
193
  token: InjectionToken<undefined, S>;
198
- }): <T extends ClassTypeWithArgument<z.output<S>>>(target: T, context: ClassDecoratorContext) => T & {
199
- [InjectableTokenMeta]: InjectionToken<T, S>;
200
- };
194
+ }): <T extends ClassTypeWithArgument<z.output<S>>>(target: T, context: ClassDecoratorContext) => T;
201
195
 
202
196
  declare function Injectable<R, S extends AnyZodObject>(options: {
203
197
  scope?: InjectableScope;
204
198
  type?: InjectableType.Class;
205
199
  token: InjectionToken<R, S>;
206
- }): <T extends ClassTypeWithInstanceAndArgument<R, z.output<S>>>(target: T, context: ClassDecoratorContext) => T & {
207
- [InjectableTokenMeta]: InjectionToken<R, S>;
208
- };
200
+ }): <T extends ClassTypeWithInstanceAndArgument<R, z.output<S>>>(target: T, context: ClassDecoratorContext) => T;
209
201
 
210
202
  declare function Injectable<T extends ClassType>(options: {
211
203
  scope?: InjectableScope;
212
204
  token: InjectionToken<T, undefined>;
213
- }): (target: T, context: ClassDecoratorContext) => T & {
214
- [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined>;
215
- };
205
+ }): (target: T, context: ClassDecoratorContext) => T;
216
206
 
217
207
  declare function Injectable<R, S extends AnyZodObject>(options: {
218
208
  scope?: InjectableScope;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navios/di",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "author": {
5
5
  "name": "Oleksandr Hanzha",
6
6
  "email": "alex@granted.name"
@@ -29,14 +29,14 @@ export interface InjectableOptions {
29
29
  export function Injectable(): <T extends ClassType>(
30
30
  target: T,
31
31
  context: ClassDecoratorContext,
32
- ) => T & { [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined> }
32
+ ) => T
33
33
  export function Injectable<R>(options: {
34
34
  scope?: InjectableScope
35
35
  type: InjectableType.Factory
36
36
  }): <T extends ClassTypeWithInstance<Factory<R>>>(
37
37
  target: T,
38
38
  context: ClassDecoratorContext,
39
- ) => T & { [InjectableTokenMeta]: InjectionToken<R, undefined> }
39
+ ) => T
40
40
  export function Injectable<S extends AnyZodObject>(options: {
41
41
  scope?: InjectableScope
42
42
  type?: InjectableType.Class
@@ -44,7 +44,7 @@ export function Injectable<S extends AnyZodObject>(options: {
44
44
  }): <T extends ClassTypeWithArgument<z.output<S>>>(
45
45
  target: T,
46
46
  context: ClassDecoratorContext,
47
- ) => T & { [InjectableTokenMeta]: InjectionToken<T, S> }
47
+ ) => T
48
48
  export function Injectable<R, S extends AnyZodObject>(options: {
49
49
  scope?: InjectableScope
50
50
  type?: InjectableType.Class
@@ -52,16 +52,11 @@ export function Injectable<R, S extends AnyZodObject>(options: {
52
52
  }): <T extends ClassTypeWithInstanceAndArgument<R, z.output<S>>>(
53
53
  target: T,
54
54
  context: ClassDecoratorContext,
55
- ) => T & { [InjectableTokenMeta]: InjectionToken<R, S> }
55
+ ) => T
56
56
  export function Injectable<T extends ClassType>(options: {
57
57
  scope?: InjectableScope
58
58
  token: InjectionToken<T, undefined>
59
- }): (
60
- target: T,
61
- context: ClassDecoratorContext,
62
- ) => T & {
63
- [InjectableTokenMeta]: InjectionToken<InstanceType<T>, undefined>
64
- }
59
+ }): (target: T, context: ClassDecoratorContext) => T
65
60
 
66
61
  export function Injectable<R, S extends AnyZodObject>(options: {
67
62
  scope?: InjectableScope
@@ -88,9 +83,7 @@ export function Injectable({
88
83
  return <T extends ClassType>(
89
84
  target: T,
90
85
  context: ClassDecoratorContext,
91
- ): T & {
92
- [InjectableTokenMeta]: InjectionToken<any, any>
93
- } => {
86
+ ): T => {
94
87
  if (context.kind !== 'class') {
95
88
  throw new Error(
96
89
  '[ServiceLocator] @Injectable decorator can only be used on classes.',
@@ -123,8 +116,6 @@ export function Injectable({
123
116
  // @ts-expect-error
124
117
  target[InjectableTokenMeta] = injectableToken
125
118
 
126
- return target as T & {
127
- [InjectableTokenMeta]: InjectionToken<any, any>
128
- }
119
+ return target
129
120
  }
130
121
  }