We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a539d8 commit ecfc00cCopy full SHA for ecfc00c
packages/runtime/src/interfaces/iocModule.ts
@@ -1,7 +1,18 @@
1
-export interface IocContainer {
2
- get<T>(controller: { prototype: T }): T;
+export type Newable<
+ T = unknown,
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ TArgs extends unknown[] = any[],
5
+> = new (...args: TArgs) => T;
6
+
7
+export type ServiceIdentifier<T = unknown> =
8
+ | string
9
+ | symbol
10
+ | Newable<T>
11
+ // eslint-disable-next-line @typescript-eslint/ban-types
12
+ | Function;
13
- get<T>(controller: { prototype: T }): Promise<T>;
14
+export interface IocContainer {
15
+ get<T>(controller: ServiceIdentifier<T>): Promise<T>;
16
}
17
18
// eslint-disable-next-line @typescript-eslint/no-explicit-any
0 commit comments