Skip to content

Commit ecfc00c

Browse files
committed
compatibiity with inversify
1 parent 0a539d8 commit ecfc00c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/runtime/src/interfaces/iocModule.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
export interface IocContainer {
2-
get<T>(controller: { prototype: T }): T;
1+
export type Newable<
2+
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;
313

4-
get<T>(controller: { prototype: T }): Promise<T>;
14+
export interface IocContainer {
15+
get<T>(controller: ServiceIdentifier<T>): Promise<T>;
516
}
617

718
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)