@codefast/di 0.3.16-canary.3 → 0.4.0-canary.5

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.
package/src/scope.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { BindingIdentifier } from "#/types";
2
1
  import { MissingScopeContextError } from "#/errors";
2
+ import type { BindingIdentifier } from "#/types";
3
3
 
4
4
  /**
5
5
  * @since 0.3.16-canary.0
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Token } from "#/token";
2
1
  import type { Constructor } from "#/constructor-type";
2
+ import type { Token } from "#/token";
3
3
 
4
4
  // Re-export for consumers that import from `#/types`
5
5
  export type { Constructor } from "#/constructor-type";
@@ -38,24 +38,14 @@ export type BindingIdentifier = string & { readonly [BINDING_ID_BRAND]: true };
38
38
  /**
39
39
  * @since 0.3.16-canary.0
40
40
  */
41
- export type BindingKind =
42
- | "class"
43
- | "dynamic"
44
- | "dynamic-async"
45
- | "resolved"
46
- | "resolved-async"
47
- | "constant"
48
- | "alias";
41
+ export type BindingKind = "class" | "dynamic" | "dynamic-async" | "resolved" | "resolved-async" | "constant" | "alias";
49
42
 
50
43
  // ── Handlers ─────────────────────────────────────────────────────────────────
51
44
 
52
45
  /**
53
46
  * @since 0.3.16-canary.0
54
47
  */
55
- export type ActivationHandler<Value> = (
56
- ctx: ResolutionContext,
57
- instance: Value,
58
- ) => Value | Promise<Value>;
48
+ export type ActivationHandler<Value> = (ctx: ResolutionContext, instance: Value) => Value | Promise<Value>;
59
49
 
60
50
  /**
61
51
  * @since 0.3.16-canary.0
@@ -113,26 +103,14 @@ export interface ConstraintContext {
113
103
  */
114
104
  export interface ResolutionContext {
115
105
  resolve<const Value>(token: Token<Value> | Constructor<Value>, hint?: ResolveOptions): Value;
116
- resolveAsync<const Value>(
117
- token: Token<Value> | Constructor<Value>,
118
- hint?: ResolveOptions,
119
- ): Promise<Value>;
120
- resolveOptional<const Value>(
121
- token: Token<Value> | Constructor<Value>,
122
- hint?: ResolveOptions,
123
- ): Value | undefined;
106
+ resolveAsync<const Value>(token: Token<Value> | Constructor<Value>, hint?: ResolveOptions): Promise<Value>;
107
+ resolveOptional<const Value>(token: Token<Value> | Constructor<Value>, hint?: ResolveOptions): Value | undefined;
124
108
  resolveOptionalAsync<const Value>(
125
109
  token: Token<Value> | Constructor<Value>,
126
110
  hint?: ResolveOptions,
127
111
  ): Promise<Value | undefined>;
128
- resolveAll<const Value>(
129
- token: Token<Value> | Constructor<Value>,
130
- hint?: ResolveOptions,
131
- ): Array<Value>;
132
- resolveAllAsync<const Value>(
133
- token: Token<Value> | Constructor<Value>,
134
- hint?: ResolveOptions,
135
- ): Promise<Array<Value>>;
112
+ resolveAll<const Value>(token: Token<Value> | Constructor<Value>, hint?: ResolveOptions): Array<Value>;
113
+ resolveAllAsync<const Value>(token: Token<Value> | Constructor<Value>, hint?: ResolveOptions): Promise<Array<Value>>;
136
114
  readonly graph: ConstraintContext;
137
115
  }
138
116