@codefast/di 0.7.1 → 0.8.1

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.
Files changed (218) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +242 -159
  3. package/dist/ambient/active-container.d.ts +1 -2
  4. package/dist/ambient/active-container.js +1 -2
  5. package/dist/container/binding-builders.d.ts +1 -2
  6. package/dist/container/binding-builders.js +5 -7
  7. package/dist/container/container.d.ts +1 -2
  8. package/dist/container/container.js +4 -6
  9. package/dist/core/binding-scope.d.ts +1 -2
  10. package/dist/core/binding-scope.js +1 -2
  11. package/dist/core/binding.d.ts +16 -4
  12. package/dist/core/binding.js +30 -6
  13. package/dist/core/constraint-requirement.d.ts +1 -2
  14. package/dist/core/constraint-requirement.js +1 -2
  15. package/dist/core/constructor-type.d.ts +1 -2
  16. package/dist/core/constructor-type.js +1 -2
  17. package/dist/core/map-upsert.d.ts +1 -2
  18. package/dist/core/map-upsert.js +1 -2
  19. package/dist/core/module.d.ts +1 -2
  20. package/dist/core/module.js +1 -2
  21. package/dist/core/registry.d.ts +1 -5
  22. package/dist/core/registry.js +15 -63
  23. package/dist/core/tag.d.ts +27 -2
  24. package/dist/core/tag.js +55 -13
  25. package/dist/core/token.d.ts +1 -2
  26. package/dist/core/token.js +1 -2
  27. package/dist/core/types.d.ts +1 -2
  28. package/dist/core/types.js +1 -2
  29. package/dist/decorators/inject.d.ts +1 -2
  30. package/dist/decorators/inject.js +1 -2
  31. package/dist/decorators/injectable.d.ts +1 -2
  32. package/dist/decorators/injectable.js +1 -2
  33. package/dist/decorators/lifecycle-decorators.d.ts +1 -2
  34. package/dist/decorators/lifecycle-decorators.js +1 -2
  35. package/dist/errors/diagnostics.d.ts +1 -2
  36. package/dist/errors/diagnostics.js +1 -2
  37. package/dist/errors/errors.d.ts +1 -2
  38. package/dist/errors/errors.js +29 -5
  39. package/dist/index.d.ts +2 -3
  40. package/dist/index.js +2 -3
  41. package/dist/injection/descriptor.d.ts +1 -2
  42. package/dist/injection/descriptor.js +1 -2
  43. package/dist/injection/resolve-options.d.ts +18 -14
  44. package/dist/injection/resolve-options.js +70 -17
  45. package/dist/introspection/dependency-graph.d.ts +1 -2
  46. package/dist/introspection/dependency-graph.js +23 -11
  47. package/dist/introspection/graph-adapters/cytoscape.d.ts +1 -2
  48. package/dist/introspection/graph-adapters/cytoscape.js +1 -2
  49. package/dist/introspection/graph-adapters/dot.d.ts +1 -2
  50. package/dist/introspection/graph-adapters/dot.js +1 -2
  51. package/dist/introspection/graph-adapters/mermaid.d.ts +1 -2
  52. package/dist/introspection/graph-adapters/mermaid.js +1 -2
  53. package/dist/introspection/graph-adapters/reactflow.d.ts +1 -2
  54. package/dist/introspection/graph-adapters/reactflow.js +1 -2
  55. package/dist/introspection/inspector.d.ts +1 -2
  56. package/dist/introspection/inspector.js +1 -2
  57. package/dist/lifecycle/lifecycle-manager.d.ts +1 -2
  58. package/dist/lifecycle/lifecycle-manager.js +1 -2
  59. package/dist/lifecycle/scope-manager.d.ts +1 -2
  60. package/dist/lifecycle/scope-manager.js +1 -2
  61. package/dist/metadata/metadata-keys.d.ts +1 -2
  62. package/dist/metadata/metadata-keys.js +1 -2
  63. package/dist/metadata/metadata-reader-token.d.ts +1 -2
  64. package/dist/metadata/metadata-reader-token.js +1 -2
  65. package/dist/metadata/metadata-types.d.ts +1 -2
  66. package/dist/metadata/metadata-types.js +1 -2
  67. package/dist/metadata/symbol-metadata-reader.d.ts +1 -2
  68. package/dist/metadata/symbol-metadata-reader.js +1 -2
  69. package/dist/metadata/verifying-metadata-reader.d.ts +1 -2
  70. package/dist/metadata/verifying-metadata-reader.js +1 -2
  71. package/dist/resolution/cache/activation-need.d.ts +1 -2
  72. package/dist/resolution/cache/activation-need.js +1 -2
  73. package/dist/resolution/cache/binding-lookup-cache.d.ts +2 -5
  74. package/dist/resolution/cache/binding-lookup-cache.js +2 -40
  75. package/dist/resolution/cache/class-introspector.d.ts +1 -2
  76. package/dist/resolution/cache/class-introspector.js +1 -2
  77. package/dist/resolution/context.d.ts +1 -2
  78. package/dist/resolution/context.js +1 -2
  79. package/dist/resolution/path/resolution-path.d.ts +1 -2
  80. package/dist/resolution/path/resolution-path.js +1 -2
  81. package/dist/resolution/plan/instantiation-plan.d.ts +5 -14
  82. package/dist/resolution/plan/instantiation-plan.js +10 -29
  83. package/dist/resolution/resolver.d.ts +13 -7
  84. package/dist/resolution/resolver.js +107 -143
  85. package/dist/resolution/select/binding-select.d.ts +5 -7
  86. package/dist/resolution/select/binding-select.js +19 -22
  87. package/dist/resolution/select/constraints.d.ts +1 -2
  88. package/dist/resolution/select/constraints.js +1 -2
  89. package/package.json +6 -58
  90. package/dist/ambient/active-container.d.ts.map +0 -1
  91. package/dist/ambient/active-container.js.map +0 -1
  92. package/dist/container/binding-builders.d.ts.map +0 -1
  93. package/dist/container/binding-builders.js.map +0 -1
  94. package/dist/container/container.d.ts.map +0 -1
  95. package/dist/container/container.js.map +0 -1
  96. package/dist/core/binding-scope.d.ts.map +0 -1
  97. package/dist/core/binding-scope.js.map +0 -1
  98. package/dist/core/binding.d.ts.map +0 -1
  99. package/dist/core/binding.js.map +0 -1
  100. package/dist/core/constraint-requirement.d.ts.map +0 -1
  101. package/dist/core/constraint-requirement.js.map +0 -1
  102. package/dist/core/constructor-type.d.ts.map +0 -1
  103. package/dist/core/constructor-type.js.map +0 -1
  104. package/dist/core/map-upsert.d.ts.map +0 -1
  105. package/dist/core/map-upsert.js.map +0 -1
  106. package/dist/core/module.d.ts.map +0 -1
  107. package/dist/core/module.js.map +0 -1
  108. package/dist/core/registry.d.ts.map +0 -1
  109. package/dist/core/registry.js.map +0 -1
  110. package/dist/core/tag.d.ts.map +0 -1
  111. package/dist/core/tag.js.map +0 -1
  112. package/dist/core/token.d.ts.map +0 -1
  113. package/dist/core/token.js.map +0 -1
  114. package/dist/core/types.d.ts.map +0 -1
  115. package/dist/core/types.js.map +0 -1
  116. package/dist/decorators/inject.d.ts.map +0 -1
  117. package/dist/decorators/inject.js.map +0 -1
  118. package/dist/decorators/injectable.d.ts.map +0 -1
  119. package/dist/decorators/injectable.js.map +0 -1
  120. package/dist/decorators/lifecycle-decorators.d.ts.map +0 -1
  121. package/dist/decorators/lifecycle-decorators.js.map +0 -1
  122. package/dist/errors/diagnostics.d.ts.map +0 -1
  123. package/dist/errors/diagnostics.js.map +0 -1
  124. package/dist/errors/errors.d.ts.map +0 -1
  125. package/dist/errors/errors.js.map +0 -1
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/index.js.map +0 -1
  128. package/dist/injection/descriptor.d.ts.map +0 -1
  129. package/dist/injection/descriptor.js.map +0 -1
  130. package/dist/injection/resolve-options.d.ts.map +0 -1
  131. package/dist/injection/resolve-options.js.map +0 -1
  132. package/dist/introspection/dependency-graph.d.ts.map +0 -1
  133. package/dist/introspection/dependency-graph.js.map +0 -1
  134. package/dist/introspection/graph-adapters/cytoscape.d.ts.map +0 -1
  135. package/dist/introspection/graph-adapters/cytoscape.js.map +0 -1
  136. package/dist/introspection/graph-adapters/dot.d.ts.map +0 -1
  137. package/dist/introspection/graph-adapters/dot.js.map +0 -1
  138. package/dist/introspection/graph-adapters/mermaid.d.ts.map +0 -1
  139. package/dist/introspection/graph-adapters/mermaid.js.map +0 -1
  140. package/dist/introspection/graph-adapters/reactflow.d.ts.map +0 -1
  141. package/dist/introspection/graph-adapters/reactflow.js.map +0 -1
  142. package/dist/introspection/inspector.d.ts.map +0 -1
  143. package/dist/introspection/inspector.js.map +0 -1
  144. package/dist/lifecycle/lifecycle-manager.d.ts.map +0 -1
  145. package/dist/lifecycle/lifecycle-manager.js.map +0 -1
  146. package/dist/lifecycle/scope-manager.d.ts.map +0 -1
  147. package/dist/lifecycle/scope-manager.js.map +0 -1
  148. package/dist/metadata/metadata-keys.d.ts.map +0 -1
  149. package/dist/metadata/metadata-keys.js.map +0 -1
  150. package/dist/metadata/metadata-reader-token.d.ts.map +0 -1
  151. package/dist/metadata/metadata-reader-token.js.map +0 -1
  152. package/dist/metadata/metadata-types.d.ts.map +0 -1
  153. package/dist/metadata/metadata-types.js.map +0 -1
  154. package/dist/metadata/symbol-metadata-reader.d.ts.map +0 -1
  155. package/dist/metadata/symbol-metadata-reader.js.map +0 -1
  156. package/dist/metadata/verifying-metadata-reader.d.ts.map +0 -1
  157. package/dist/metadata/verifying-metadata-reader.js.map +0 -1
  158. package/dist/resolution/cache/activation-need.d.ts.map +0 -1
  159. package/dist/resolution/cache/activation-need.js.map +0 -1
  160. package/dist/resolution/cache/binding-lookup-cache.d.ts.map +0 -1
  161. package/dist/resolution/cache/binding-lookup-cache.js.map +0 -1
  162. package/dist/resolution/cache/class-introspector.d.ts.map +0 -1
  163. package/dist/resolution/cache/class-introspector.js.map +0 -1
  164. package/dist/resolution/context.d.ts.map +0 -1
  165. package/dist/resolution/context.js.map +0 -1
  166. package/dist/resolution/path/resolution-path.d.ts.map +0 -1
  167. package/dist/resolution/path/resolution-path.js.map +0 -1
  168. package/dist/resolution/plan/instantiation-plan.d.ts.map +0 -1
  169. package/dist/resolution/plan/instantiation-plan.js.map +0 -1
  170. package/dist/resolution/resolver.d.ts.map +0 -1
  171. package/dist/resolution/resolver.js.map +0 -1
  172. package/dist/resolution/select/binding-select.d.ts.map +0 -1
  173. package/dist/resolution/select/binding-select.js.map +0 -1
  174. package/dist/resolution/select/constraints.d.ts.map +0 -1
  175. package/dist/resolution/select/constraints.js.map +0 -1
  176. package/src/ambient/active-container.ts +0 -69
  177. package/src/container/binding-builders.ts +0 -332
  178. package/src/container/container.ts +0 -973
  179. package/src/core/binding-scope.ts +0 -15
  180. package/src/core/binding.ts +0 -477
  181. package/src/core/constraint-requirement.ts +0 -94
  182. package/src/core/constructor-type.ts +0 -18
  183. package/src/core/map-upsert.ts +0 -53
  184. package/src/core/module.ts +0 -117
  185. package/src/core/registry.ts +0 -371
  186. package/src/core/tag.ts +0 -158
  187. package/src/core/token.ts +0 -31
  188. package/src/core/types.ts +0 -149
  189. package/src/decorators/inject.ts +0 -101
  190. package/src/decorators/injectable.ts +0 -134
  191. package/src/decorators/lifecycle-decorators.ts +0 -43
  192. package/src/errors/diagnostics.ts +0 -45
  193. package/src/errors/errors.ts +0 -476
  194. package/src/index.ts +0 -139
  195. package/src/injection/descriptor.ts +0 -218
  196. package/src/injection/resolve-options.ts +0 -144
  197. package/src/introspection/dependency-graph.ts +0 -282
  198. package/src/introspection/graph-adapters/cytoscape.ts +0 -78
  199. package/src/introspection/graph-adapters/dot.ts +0 -32
  200. package/src/introspection/graph-adapters/mermaid.ts +0 -61
  201. package/src/introspection/graph-adapters/reactflow.ts +0 -84
  202. package/src/introspection/inspector.ts +0 -134
  203. package/src/lifecycle/lifecycle-manager.ts +0 -272
  204. package/src/lifecycle/scope-manager.ts +0 -158
  205. package/src/metadata/metadata-keys.ts +0 -28
  206. package/src/metadata/metadata-reader-token.ts +0 -10
  207. package/src/metadata/metadata-types.ts +0 -57
  208. package/src/metadata/symbol-metadata-reader.ts +0 -126
  209. package/src/metadata/verifying-metadata-reader.ts +0 -41
  210. package/src/resolution/cache/activation-need.ts +0 -87
  211. package/src/resolution/cache/binding-lookup-cache.ts +0 -209
  212. package/src/resolution/cache/class-introspector.ts +0 -256
  213. package/src/resolution/context.ts +0 -331
  214. package/src/resolution/path/resolution-path.ts +0 -167
  215. package/src/resolution/plan/instantiation-plan.ts +0 -617
  216. package/src/resolution/resolver.ts +0 -1675
  217. package/src/resolution/select/binding-select.ts +0 -210
  218. package/src/resolution/select/constraints.ts +0 -146
@@ -6,13 +6,9 @@ import { getOrInsertComputed } from "#/core/map-upsert";
6
6
  * @since 0.5.0-canary.8
7
7
  */
8
8
  export const ALIAS_HOP_LIMIT = 32;
9
- /**
10
- * @since 0.5.0-canary.8
11
- */
12
- const newNameToEntryMap = () => new Map();
13
9
  const newTagToEntryMap = () => new Map();
14
10
  /**
15
- * A version-stamped cache of binding lookups by token, name, and tag across the container chain.
11
+ * A version-stamped cache of binding lookups by token and criterion across the container chain.
16
12
  *
17
13
  * @since 0.5.0-canary.9
18
14
  */
@@ -24,8 +20,6 @@ export class BindingLookupCache {
24
20
  // is tracked by the token slot rather than by the entry.
25
21
  #lastToken;
26
22
  #lastEntry = null;
27
- #byTokenAndName = new Map();
28
- #namedVersion = -1;
29
23
  #byTokenAndTag = new Map();
30
24
  #taggedVersion = -1;
31
25
  // One entry in front of the tag map, and the map is not written until a second distinct request
@@ -70,23 +64,6 @@ export class BindingLookupCache {
70
64
  this.#lastEntry = entry;
71
65
  return entry;
72
66
  }
73
- /** `null` when the name's shape needs the full selection path. */
74
- namedEntry(token, name) {
75
- const version = this.chainVersion();
76
- if (version !== this.#namedVersion) {
77
- this.#byTokenAndName.clear();
78
- this.#namedVersion = version;
79
- }
80
- // Computed, not eager: this runs on every named resolve, and the eager form would allocate a
81
- // Map per call only to discard it on the hit that follows.
82
- const byName = getOrInsertComputed(this.#byTokenAndName, token, newNameToEntryMap);
83
- let entry = byName.get(name);
84
- if (entry === undefined) {
85
- entry = this.#findNamedInChain(token, name);
86
- byName.set(name, entry);
87
- }
88
- return entry;
89
- }
90
67
  /** `null` when the tag's shape needs the full selection path. */
91
68
  taggedEntry(token, tag) {
92
69
  const version = this.chainVersion();
@@ -144,20 +121,6 @@ export class BindingLookupCache {
144
121
  }
145
122
  return this.#parent === undefined ? null : this.#parent.#findDefaultInChain(token);
146
123
  }
147
- #findNamedInChain(token, name) {
148
- const named = this.#registry.getSimpleNamed(token, name);
149
- if (named !== undefined) {
150
- // Predicates need a live context; aliases carry options through the full path.
151
- if (named.predicate !== undefined || named.kind === "alias") {
152
- return null;
153
- }
154
- return { binding: named, owner: this.#owner };
155
- }
156
- if (this.#registry.has(token)) {
157
- return null;
158
- }
159
- return this.#parent === undefined ? null : this.#parent.#findNamedInChain(token, name);
160
- }
161
124
  #findTaggedInChain(token, tag) {
162
125
  const tagged = this.#registry.getSimpleTagged(token, tag);
163
126
  if (tagged !== undefined) {
@@ -172,5 +135,4 @@ export class BindingLookupCache {
172
135
  }
173
136
  return this.#parent === undefined ? null : this.#parent.#findTaggedInChain(token, tag);
174
137
  }
175
- }
176
- //# sourceMappingURL=binding-lookup-cache.js.map
138
+ }
@@ -64,5 +64,4 @@ export declare class ClassIntrospector {
64
64
  /** True when the class has accessor injection, which reads the container during construction. */
65
65
  needsActiveContainer(target: Constructor): boolean;
66
66
  instantiate(target: Constructor, deps: Array<unknown>, resolution?: AmbientResolution): unknown;
67
- }
68
- //# sourceMappingURL=class-introspector.d.ts.map
67
+ }
@@ -192,5 +192,4 @@ export class ClassIntrospector {
192
192
  }
193
193
  return runWithAmbientResolution(this.#container, resolution, () => new invokable(...deps));
194
194
  }
195
- }
196
- //# sourceMappingURL=class-introspector.js.map
195
+ }
@@ -86,5 +86,4 @@ export declare class AsyncCascadeContext implements ResolutionContext {
86
86
  *
87
87
  * @since 0.3.16-canary.0
88
88
  */
89
- export declare function buildResolutionFrame(tokenName: string, scope: BindingScope, bindingId: BindingIdentifier, kind: BindingKind, slot: ResolutionFrame["slot"]): ResolutionFrame;
90
- //# sourceMappingURL=context.d.ts.map
89
+ export declare function buildResolutionFrame(tokenName: string, scope: BindingScope, bindingId: BindingIdentifier, kind: BindingKind, slot: ResolutionFrame["slot"]): ResolutionFrame;
@@ -203,5 +203,4 @@ class DefaultConstraintContext {
203
203
  */
204
204
  export function buildResolutionFrame(tokenName, scope, bindingId, kind, slot) {
205
205
  return { tokenName, scope, bindingId, kind, slot };
206
- }
207
- //# sourceMappingURL=context.js.map
206
+ }
@@ -90,5 +90,4 @@ export declare function branchDepthOf(branch: OwnedBranchStack): OwnedBranchDept
90
90
  * @since 0.5.0-canary.9
91
91
  */
92
92
  export declare function extendResolutionBranch(resolutionStack: Array<ResolutionFrame>, branchDepth: BranchDepth, frame: ResolutionFrame): OwnedBranchStack;
93
- export {};
94
- //# sourceMappingURL=resolution-path.d.ts.map
93
+ export {};
@@ -113,5 +113,4 @@ export function extendResolutionBranch(resolutionStack, branchDepth, frame) {
113
113
  const branch = resolutionStack.slice(0, depth);
114
114
  branch.push(frame);
115
115
  return branch;
116
- }
117
- //# sourceMappingURL=resolution-path.js.map
116
+ }
@@ -45,21 +45,13 @@ export interface InstantiationPlanHost {
45
45
  /** Options-less lookup with alias hops folded; `null` when the fast lane can't answer. */
46
46
  lookupDependencyEntry(token: Token<unknown> | Constructor): InstantiationPlanDependencyEntry | null;
47
47
  /**
48
- * A name-only lookup a plan may bake in, or `null` when the answer is not the compiler's to make.
48
+ * A single-criterion lookup a plan may bake in, or `null` when the answer is not the compiler's
49
+ * to make.
49
50
  *
50
- * @remarks Selection for a named request is an index hit *and* a predicate, and a predicate reads
51
+ * @remarks Selection for such a request is an index hit *and* a predicate, and a predicate reads
51
52
  * the resolution path — so only a candidate carrying none of one can be decided ahead of time.
52
53
  */
53
- lookupPathIndependentNamedEntry(token: Token<unknown> | Constructor, options: ResolveOptions & {
54
- name: string;
55
- }): InstantiationPlanDependencyEntry | null;
56
- /**
57
- * The named lookup's single-tag twin, or `null` under the same rule.
58
- *
59
- * @remarks Optional so a host predating it stays a valid host — a compiler given none simply
60
- * escapes the dependency, which is exactly the pre-settlement behavior.
61
- */
62
- lookupPathIndependentTaggedEntry?(token: Token<unknown> | Constructor, options: ResolveOptions): InstantiationPlanDependencyEntry | null;
54
+ lookupPathIndependentEntry(token: Token<unknown> | Constructor, options: ResolveOptions): InstantiationPlanDependencyEntry | null;
63
55
  /** The frame the interpreted path pushes for this binding, so escapes can replay it. */
64
56
  getResolutionFrame(binding: Binding): ResolutionFrame;
65
57
  /** Runtime resolve for an escaped dependency, seeded with the ancestor frames above it. */
@@ -95,5 +87,4 @@ export declare class InstantiationPlanCompiler {
95
87
  compileAsync(binding: Binding & {
96
88
  kind: "class" | "resolved" | "resolved-async";
97
89
  }): InstantiationPlanCompileResult;
98
- }
99
- //# sourceMappingURL=instantiation-plan.d.ts.map
90
+ }
@@ -1,7 +1,7 @@
1
1
  import { NO_INSTANCE } from "#/core/binding";
2
2
  import { tokenName } from "#/core/token";
3
3
  import { AsyncResolutionError } from "#/errors/errors";
4
- import { injectionSlotToResolveOptions, isNameOnlyOptions } from "#/injection/resolve-options";
4
+ import { injectionSlotToResolveOptions } from "#/injection/resolve-options";
5
5
  // Past this depth a dependency escapes to the runtime path rather than inlining further —
6
6
  // compiled closures nest one JS frame per level, and pathological graphs are the runtime's job.
7
7
  const PLAN_DEPTH_LIMIT = 32;
@@ -126,20 +126,11 @@ export class InstantiationPlanCompiler {
126
126
  return this.#compileEscapeThunk(token, ancestors, "optional", options);
127
127
  }
128
128
  if (options !== undefined) {
129
- // A name the registry can settle without reading a path is a dependency like any other: it
130
- // escapes only because it carries a criterion, not because anything about it is opaque.
131
- if (isNameOnlyOptions(options)) {
132
- const named = this.#host.lookupPathIndependentNamedEntry(token, options);
133
- if (named !== null) {
134
- return this.#compileDepThunk(named, compileStack, depth, ancestors, options);
135
- }
136
- }
137
- else {
138
- // The host owns the whole single-tag decision, including whether the options qualify.
139
- const tagged = this.#host.lookupPathIndependentTaggedEntry?.(token, options);
140
- if (tagged !== null && tagged !== undefined) {
141
- return this.#compileDepThunk(tagged, compileStack, depth, ancestors, options);
142
- }
129
+ // A criterion the registry can settle without reading a path is a dependency like any other:
130
+ // it escapes only because the host cannot decide it ahead of time.
131
+ const indexed = this.#host.lookupPathIndependentEntry(token, options);
132
+ if (indexed !== null) {
133
+ return this.#compileDepThunk(indexed, compileStack, depth, ancestors, options);
143
134
  }
144
135
  return this.#compileEscapeThunk(token, ancestors, "single", options);
145
136
  }
@@ -359,18 +350,9 @@ export class InstantiationPlanCompiler {
359
350
  return this.#compileAsyncEscapeThunk(token, ancestors, "optional", options);
360
351
  }
361
352
  if (options !== undefined) {
362
- if (isNameOnlyOptions(options)) {
363
- const named = this.#host.lookupPathIndependentNamedEntry(token, options);
364
- if (named !== null) {
365
- return this.#compileAsyncDepThunk(named, compileStack, depth, ancestors, options);
366
- }
367
- }
368
- else {
369
- // The host owns the whole single-tag decision, including whether the options qualify.
370
- const tagged = this.#host.lookupPathIndependentTaggedEntry?.(token, options);
371
- if (tagged !== null && tagged !== undefined) {
372
- return this.#compileAsyncDepThunk(tagged, compileStack, depth, ancestors, options);
373
- }
353
+ const indexed = this.#host.lookupPathIndependentEntry(token, options);
354
+ if (indexed !== null) {
355
+ return this.#compileAsyncDepThunk(indexed, compileStack, depth, ancestors, options);
374
356
  }
375
357
  return this.#compileAsyncEscapeThunk(token, ancestors, "single", options);
376
358
  }
@@ -417,5 +399,4 @@ export class InstantiationPlanCompiler {
417
399
  }
418
400
  return this.#compileAsyncEscapeThunk(binding.token, ancestors, "single", options);
419
401
  }
420
- }
421
- //# sourceMappingURL=instantiation-plan.js.map
402
+ }
@@ -2,7 +2,7 @@ import type { Container } from "#/container/container";
2
2
  import type { Binding } from "#/core/binding";
3
3
  import type { BindingRegistry } from "#/core/registry";
4
4
  import type { Token } from "#/core/token";
5
- import type { Constructor, ResolutionFrame, ResolveOptions } from "#/core/types";
5
+ import type { BindingTag, Constructor, ResolutionFrame, ResolveOptions } from "#/core/types";
6
6
  import type { ResolutionDiagnostics } from "#/errors/diagnostics";
7
7
  import type { LifecycleManager } from "#/lifecycle/lifecycle-manager";
8
8
  import type { ScopeManager } from "#/lifecycle/scope-manager";
@@ -40,12 +40,19 @@ export declare class DependencyResolver implements ResolverCallbacks {
40
40
  */
41
41
  peekCandidateBindingsForValidate(token: Token<unknown> | Constructor, options: ResolveOptions | undefined): ReadonlyArray<Binding>;
42
42
  resolveFromContext<Value>(token: Token<Value> | Constructor<Value>, resolutionStack: Array<ResolutionFrame>): Value;
43
- resolve<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>): Value;
44
- resolveOptional<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>): Value | undefined;
43
+ resolve<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, precomputedCriterion?: BindingTag | null): Value;
44
+ resolveOptional<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, precomputedCriterion?: BindingTag | null): Value | undefined;
45
45
  resolveAll<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>): Array<Value>;
46
46
  resolveAsyncFromContext<Value>(token: Token<Value> | Constructor<Value>, resolutionStack: Array<ResolutionFrame>, branchDepth: BranchDepth): Promise<Value>;
47
- resolveAsync<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, branchDepth?: BranchDepth): Promise<Value>;
48
- resolveOptionalAsync<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, branchDepth?: BranchDepth): Promise<Value | undefined>;
47
+ /**
48
+ * Instantiates one owned binding directly, bypassing selection.
49
+ *
50
+ * @remarks Warm-up must build the binding it inspected: re-selecting by the slot's own criteria
51
+ * could pick a different candidate whose criteria are a subset of them.
52
+ */
53
+ warmBindingAsync(binding: Binding, options: ResolveOptions | undefined): Promise<unknown>;
54
+ resolveAsync<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, branchDepth?: BranchDepth, precomputedCriterion?: BindingTag | null): Promise<Value>;
55
+ resolveOptionalAsync<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, branchDepth?: BranchDepth, precomputedCriterion?: BindingTag | null): Promise<Value | undefined>;
49
56
  resolveAllAsync<Value>(token: Token<Value> | Constructor<Value>, options: ResolveOptions | undefined, resolutionStack: Array<ResolutionFrame>, branchDepth?: BranchDepth): Promise<Array<Value>>;
50
57
  /**
51
58
  * Entry for a request a factory makes from inside an open synchronous cascade.
@@ -56,5 +63,4 @@ export declare class DependencyResolver implements ResolverCallbacks {
56
63
  resolveAsyncFromCascade(token: Token<unknown> | Constructor): Promise<unknown>;
57
64
  /** Entry for a resolve the container starts, which opens the cascade rather than joining one. */
58
65
  resolveAsyncFromRoot(token: Token<unknown> | Constructor): Promise<unknown>;
59
- }
60
- //# sourceMappingURL=resolver.d.ts.map
66
+ }