@art-ws/di 2.0.16 → 2.0.17

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.
@@ -1,15 +1,14 @@
1
1
  import type { DIModuleDef, Func, Provider, Token } from "./types.js";
2
- type ScopeContext = {
3
- injector: Injector;
4
- };
5
2
  export type InjectorInstance = InstanceType<typeof Injector>;
6
- type OnScope = (context: ScopeContext) => void;
3
+ export type OnScopeHandler = (options: {
4
+ injector: Injector;
5
+ }) => void;
7
6
  export declare class Injector {
8
7
  #private;
9
8
  static get root(): Injector;
10
9
  static set root(value: Injector);
11
- static get onScope(): OnScope | undefined;
12
- static set onScope(value: OnScope | undefined);
10
+ static get onScope(): OnScopeHandler | undefined;
11
+ static set onScope(value: OnScopeHandler | undefined);
13
12
  parent: Injector | null;
14
13
  addFactory<T>(token: Token<T>, factory?: Func<T>): void;
15
14
  addValue<T>(token: Token<T>, value: T): void;
@@ -26,4 +25,3 @@ export declare class Injector {
26
25
  }>): Promise<T>;
27
26
  }
28
27
  export declare function inject<T>(token: Token<T>): T;
29
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/di",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "Dependency injection for TypeScript",
5
5
  "license": "UNLICENSED",
6
6
  "author": "art-ws Team",