@codefast/di 0.5.0-canary.2 → 0.5.0-canary.4
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/CHANGELOG.md +8 -0
- package/README.md +3 -3
- package/dist/binding-select.d.mts +3 -3
- package/dist/binding-select.mjs +32 -32
- package/dist/container.d.mts +8 -8
- package/dist/container.mjs +32 -32
- package/dist/decorators/inject.mjs +2 -2
- package/dist/environment.d.mts +15 -15
- package/dist/environment.mjs +23 -23
- package/dist/errors.d.mts +2 -2
- package/dist/errors.mjs +5 -5
- package/dist/inspector.d.mts +3 -3
- package/dist/inspector.mjs +7 -7
- package/dist/resolve-options.d.mts +1 -1
- package/dist/resolve-options.mjs +1 -1
- package/dist/resolver.d.mts +9 -9
- package/dist/resolver.mjs +110 -110
- package/dist/types.d.mts +8 -8
- package/package.json +4 -4
- package/src/binding-select.ts +46 -39
- package/src/container.ts +48 -42
- package/src/decorators/inject.ts +4 -2
- package/src/environment.ts +32 -29
- package/src/errors.ts +5 -5
- package/src/inspector.ts +8 -8
- package/src/resolve-options.ts +1 -1
- package/src/resolver.ts +138 -121
- package/src/types.ts +11 -8
package/src/types.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Token } from "#/token";
|
|
|
5
5
|
export type { Constructor } from "#/constructor-type";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* A single [tag, value] pair used in slot constraints and resolve
|
|
8
|
+
* A single [tag, value] pair used in slot constraints and resolve options.
|
|
9
9
|
*
|
|
10
10
|
* @since 0.3.16-canary.0
|
|
11
11
|
*/
|
|
@@ -93,7 +93,7 @@ export interface ConstraintContext {
|
|
|
93
93
|
readonly resolutionStack: ReadonlyArray<ResolutionFrame>;
|
|
94
94
|
readonly parent: ResolutionFrame | undefined;
|
|
95
95
|
readonly ancestors: ReadonlyArray<ResolutionFrame>;
|
|
96
|
-
readonly
|
|
96
|
+
readonly currentResolveOptions: ResolveOptions | undefined;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// ── ResolutionContext ─────────────────────────────────────────────────────────
|
|
@@ -102,15 +102,18 @@ export interface ConstraintContext {
|
|
|
102
102
|
* @since 0.3.16-canary.0
|
|
103
103
|
*/
|
|
104
104
|
export interface ResolutionContext {
|
|
105
|
-
resolve<const Value>(token: Token<Value> | Constructor<Value>,
|
|
106
|
-
resolveAsync<const Value>(token: Token<Value> | Constructor<Value>,
|
|
107
|
-
resolveOptional<const Value>(token: Token<Value> | Constructor<Value>,
|
|
105
|
+
resolve<const Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Value;
|
|
106
|
+
resolveAsync<const Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Promise<Value>;
|
|
107
|
+
resolveOptional<const Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Value | undefined;
|
|
108
108
|
resolveOptionalAsync<const Value>(
|
|
109
109
|
token: Token<Value> | Constructor<Value>,
|
|
110
|
-
|
|
110
|
+
options?: ResolveOptions,
|
|
111
111
|
): Promise<Value | undefined>;
|
|
112
|
-
resolveAll<const Value>(token: Token<Value> | Constructor<Value>,
|
|
113
|
-
resolveAllAsync<const Value>(
|
|
112
|
+
resolveAll<const Value>(token: Token<Value> | Constructor<Value>, options?: ResolveOptions): Array<Value>;
|
|
113
|
+
resolveAllAsync<const Value>(
|
|
114
|
+
token: Token<Value> | Constructor<Value>,
|
|
115
|
+
options?: ResolveOptions,
|
|
116
|
+
): Promise<Array<Value>>;
|
|
114
117
|
readonly graph: ConstraintContext;
|
|
115
118
|
}
|
|
116
119
|
|