@nmtjs/core 0.15.0-beta.15 → 0.15.0-beta.16

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,4 +1,4 @@
1
- import type { Async } from '@nmtjs/common';
1
+ import type { MaybePromise } from '@nmtjs/common';
2
2
  import type { Logger } from './logger.ts';
3
3
  import { kFactoryInjectable, kInjectable, kLazyInjectable, kOptionalDependency, kValueInjectable } from './constants.ts';
4
4
  import { Scope } from './enums.ts';
@@ -20,7 +20,7 @@ export type DependencyContext<Deps extends Dependencies> = {
20
20
  } & {
21
21
  readonly [K in keyof Deps as Deps[K] extends DependencyOptional ? K : never]?: Deps[K] extends DependencyOptional ? ResolveInjectableType<Deps[K]['injectable']> : never;
22
22
  };
23
- export type InjectableFactoryType<InjectableType, InjectableDeps extends Dependencies> = (context: DependencyContext<InjectableDeps>) => Async<InjectableType>;
23
+ export type InjectableFactoryType<InjectableType, InjectableDeps extends Dependencies> = (context: DependencyContext<InjectableDeps>) => MaybePromise<InjectableType>;
24
24
  export type InjectablePickType<Input, Output> = (injectable: Input) => Output;
25
25
  export type InjectableDisposeType<InjectableType, InjectableDeps extends Dependencies> = (instance: InjectableType, context: DependencyContext<InjectableDeps>) => any;
26
26
  export interface LazyInjectable<T, S extends Scope = Scope.Global> extends Dependant<{}> {
package/dist/plugin.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Async } from '@nmtjs/common';
1
+ import type { MaybePromise } from '@nmtjs/common';
2
2
  import { kPlugin } from './constants.ts';
3
3
  export interface Plugin<Type = void, Context = unknown> {
4
4
  name: string;
5
- factory: (context: Context) => Async<Type>;
5
+ factory: (context: Context) => MaybePromise<Type>;
6
6
  [kPlugin]: any;
7
7
  }
8
8
  export declare const createPlugin: <Type = void, Context = unknown>(name: string, factory: Plugin<Type, Context>["factory"]) => Plugin<Type, Context>;
package/package.json CHANGED
@@ -8,15 +8,15 @@
8
8
  "peerDependencies": {
9
9
  "pino": "^9.6.0",
10
10
  "pino-pretty": "^13.0.0",
11
- "@nmtjs/common": "0.15.0-beta.15",
12
- "@nmtjs/type": "0.15.0-beta.15"
11
+ "@nmtjs/common": "0.15.0-beta.16",
12
+ "@nmtjs/type": "0.15.0-beta.16"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^24",
16
16
  "pino": "^9.6.0",
17
17
  "pino-pretty": "^13.0.0",
18
- "@nmtjs/common": "0.15.0-beta.15",
19
- "@nmtjs/type": "0.15.0-beta.15"
18
+ "@nmtjs/type": "0.15.0-beta.16",
19
+ "@nmtjs/common": "0.15.0-beta.16"
20
20
  },
21
21
  "files": [
22
22
  "dist",
@@ -28,7 +28,7 @@
28
28
  "hookable": "6.0.0-rc.1",
29
29
  "pino-std-serializers": "^7.0.0"
30
30
  },
31
- "version": "0.15.0-beta.15",
31
+ "version": "0.15.0-beta.16",
32
32
  "scripts": {
33
33
  "clean-build": "rm -rf ./dist",
34
34
  "build": "tsc --declaration --sourcemap",
@@ -1,4 +1,4 @@
1
- import type { Async } from '@nmtjs/common'
1
+ import type { MaybePromise } from '@nmtjs/common'
2
2
  import { tryCaptureStackTrace } from '@nmtjs/common'
3
3
 
4
4
  import type { DisposeFn, InjectFn } from './container.ts'
@@ -60,7 +60,7 @@ export type DependencyContext<Deps extends Dependencies> = {
60
60
  export type InjectableFactoryType<
61
61
  InjectableType,
62
62
  InjectableDeps extends Dependencies,
63
- > = (context: DependencyContext<InjectableDeps>) => Async<InjectableType>
63
+ > = (context: DependencyContext<InjectableDeps>) => MaybePromise<InjectableType>
64
64
 
65
65
  export type InjectablePickType<Input, Output> = (injectable: Input) => Output
66
66
 
package/src/plugin.ts CHANGED
@@ -1,10 +1,10 @@
1
- import type { Async } from '@nmtjs/common'
1
+ import type { MaybePromise } from '@nmtjs/common'
2
2
 
3
3
  import { kPlugin } from './constants.ts'
4
4
 
5
5
  export interface Plugin<Type = void, Context = unknown> {
6
6
  name: string
7
- factory: (context: Context) => Async<Type>
7
+ factory: (context: Context) => MaybePromise<Type>
8
8
  [kPlugin]: any
9
9
  }
10
10