@art-ws/di 2.0.27 → 2.0.29

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.
@@ -30,17 +30,14 @@ export type DIModuleDef = {
30
30
  imports?: DIModuleDef[];
31
31
  providers?: Provider[];
32
32
  };
33
- type Ctor<R = any, A extends any[] = any[]> = abstract new (...args: A) => R;
34
- type TokenFor<P> = Ctor<P, any[]>;
35
- type DepsFor<C extends Ctor> = {
33
+ export type Ctor<R = any, A extends any[] = any[]> = abstract new (...args: A) => R;
34
+ export type TokenFor<P> = Ctor<P> | P | Token<P>;
35
+ export type DepsFor<C extends Ctor> = {
36
36
  [K in keyof ConstructorParameters<C>]: TokenFor<ConstructorParameters<C>[K]>;
37
37
  } & {
38
38
  length: ConstructorParameters<C>["length"];
39
39
  };
40
- export type ProviderClassDef<T = unknown, C extends Ctor<T> = Ctor<T>> = {
40
+ export type ProviderClassDef<T = unknown, C extends Ctor = Ctor<T, T extends Ctor ? ConstructorParameters<T> : any[]>> = {
41
41
  useClass: C;
42
- deps?: ConstructorParameters<C> extends [] ? never : DepsFor<C>;
42
+ deps?: DepsFor<C>;
43
43
  };
44
- export declare class NoDeps {
45
- }
46
- export {};
package/dist/es/types.js CHANGED
@@ -7,5 +7,3 @@ export class InjectionToken {
7
7
  this.factory = factory;
8
8
  }
9
9
  }
10
- export class NoDeps {
11
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/di",
3
- "version": "2.0.27",
3
+ "version": "2.0.29",
4
4
  "description": "Dependency injection for TypeScript",
5
5
  "license": "UNLICENSED",
6
6
  "author": "art-ws Team",
@@ -15,8 +15,8 @@
15
15
  "eslint": "^9.34.0",
16
16
  "typescript": "^5.9.2",
17
17
  "vitest": "^3.2.4",
18
- "@art-ws/config-eslint": "2.0.3",
19
- "@art-ws/config-ts": "2.0.6"
18
+ "@art-ws/config-ts": "2.0.6",
19
+ "@art-ws/config-eslint": "2.0.3"
20
20
  },
21
21
  "scripts": {
22
22
  "build": "tsc",