better-effect 0.4.0 → 0.5.0
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/README.md +32 -5
- package/dist/adapters/iti.d.mts +11 -3
- package/dist/adapters/iti.d.mts.map +1 -1
- package/dist/adapters/iti.mjs +34 -14
- package/dist/adapters/iti.mjs.map +1 -1
- package/dist/errors-GR3K_nRu.mjs +74 -0
- package/dist/errors-GR3K_nRu.mjs.map +1 -0
- package/dist/index-D77AvuBl.d.mts +510 -0
- package/dist/index-D77AvuBl.d.mts.map +1 -0
- package/dist/index.d.mts +217 -20
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +429 -153
- package/dist/index.mjs.map +1 -1
- package/dist/internal-identity-BnZC3Au-.mjs +26 -0
- package/dist/internal-identity-BnZC3Au-.mjs.map +1 -0
- package/dist/testing.d.mts +11 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +33 -12
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/errors-DlHCwICc.mjs +0 -67
- package/dist/errors-DlHCwICc.mjs.map +0 -1
- package/dist/index-BYQKfyeJ.d.mts +0 -235
- package/dist/index-BYQKfyeJ.d.mts.map +0 -1
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { Err, InferErr, InferOk, Result } from "better-result";
|
|
2
|
+
//#region src/service/types.d.ts
|
|
3
|
+
type ServiceStatics<Tag extends string, Instance> = {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly serviceTag: Tag;
|
|
6
|
+
/** Type-check a structural implementation and return it unchanged. */
|
|
7
|
+
of(this: void, implementation: Instance): Instance;
|
|
8
|
+
};
|
|
9
|
+
/** A class constructor carrying a Service tag and its instance contract. */
|
|
10
|
+
type ServiceToken<Tag extends string = string, Instance = any> = (abstract new (...args: any[]) => Instance) & ServiceStatics<Tag, Instance>;
|
|
11
|
+
/** The widened token constraint used by generic Service infrastructure. */
|
|
12
|
+
type AnyServiceToken = ServiceToken<string, any>;
|
|
13
|
+
/** A concrete, constructible Service class accepted by a Layer provider. */
|
|
14
|
+
type ServiceClass<Tag extends string = string, Instance = any> = (new (...args: any[]) => Instance) & ServiceStatics<Tag, Instance>;
|
|
15
|
+
/** Extract the instance type represented by a Service token. */
|
|
16
|
+
type ServiceInstance<T extends AnyServiceToken> = InstanceType<T>;
|
|
17
|
+
/** Extract the literal identity tag represented by a Service token. */
|
|
18
|
+
type ServiceTag<T extends AnyServiceToken> = T['serviceTag'];
|
|
19
|
+
type MethodRequirements<T> = { [K in keyof T]: T[K] extends ((...args: any[]) => infer Return) ? EffectRequirements<Return> : never; }[keyof T];
|
|
20
|
+
/**
|
|
21
|
+
* Services required by the Effect-returning methods of a Service class.
|
|
22
|
+
*
|
|
23
|
+
* This type is used automatically by `Layer.make`, `Layer.gen`, and the other
|
|
24
|
+
* provider constructors.
|
|
25
|
+
*/
|
|
26
|
+
type ServiceRequirements<T extends AnyServiceToken> = MethodRequirements<InstanceType<T>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/effect/types.d.ts
|
|
29
|
+
/**
|
|
30
|
+
* Type-only identity for a Service requirement yielded by a generator.
|
|
31
|
+
*
|
|
32
|
+
* The declaration has no runtime value. Service iterators return their
|
|
33
|
+
* resolved instances without yielding a marker at runtime.
|
|
34
|
+
*/
|
|
35
|
+
declare const ServiceRequirementTypeId: unique symbol;
|
|
36
|
+
/** Type-only identity for requirement metadata attached to Effect results. */
|
|
37
|
+
declare const EffectRequirementsTypeId: unique symbol;
|
|
38
|
+
/**
|
|
39
|
+
* Metadata carried by the yield type of a Service token.
|
|
40
|
+
*
|
|
41
|
+
* This interface is intentionally phantom: it is used only while TypeScript
|
|
42
|
+
* infers a generator's yielded values.
|
|
43
|
+
*/
|
|
44
|
+
interface ServiceRequirement<T extends AnyServiceToken> {
|
|
45
|
+
readonly [ServiceRequirementTypeId]: T;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A `better-result` Result with phantom metadata for required Services.
|
|
49
|
+
*
|
|
50
|
+
* @typeParam A The successful value.
|
|
51
|
+
* @typeParam E The error value.
|
|
52
|
+
* @typeParam Requirements The tagged Service contracts required to produce it.
|
|
53
|
+
*/
|
|
54
|
+
type EffectResult<A, E, Requirements = never> = Result<A, E> & {
|
|
55
|
+
readonly [EffectRequirementsTypeId]?: Requirements;
|
|
56
|
+
};
|
|
57
|
+
/** An Effect result with unknown success, error, and Service requirements. */
|
|
58
|
+
type AnyEffectResult = EffectResult<unknown, unknown, any>;
|
|
59
|
+
/** Values that an Effect generator may yield. */
|
|
60
|
+
type EffectYield = Err<never, unknown> | ServiceRequirement<AnyServiceToken>;
|
|
61
|
+
/** Extract the error channel from Result values yielded by a generator. */
|
|
62
|
+
type InferYieldError<Y> = Y extends Err<never, infer E> ? E : never;
|
|
63
|
+
/** Extract Service tokens carried by yielded Service requirements. */
|
|
64
|
+
type InferYieldRequirements<Y> = Y extends ServiceRequirement<infer Requirement> ? Requirement : never;
|
|
65
|
+
type InferEffectRequirements<T> = T extends unknown ? typeof EffectRequirementsTypeId extends keyof T ? T extends {
|
|
66
|
+
readonly [EffectRequirementsTypeId]?: infer Requirements;
|
|
67
|
+
} ? Requirements : never : never : never;
|
|
68
|
+
/** Extract phantom Service requirements from an Effect result or Promise. */
|
|
69
|
+
type EffectRequirements<T> = InferEffectRequirements<Awaited<T>>;
|
|
70
|
+
/** Extract the success value from an Effect result or Promise. */
|
|
71
|
+
type EffectSuccess<T> = Awaited<T> extends Result<infer A, unknown> ? A : never;
|
|
72
|
+
/** Extract the error value from an Effect result or Promise. */
|
|
73
|
+
type EffectError<T> = Awaited<T> extends Result<unknown, infer E> ? E : never;
|
|
74
|
+
/** Build the public result type produced from an Effect generator. */
|
|
75
|
+
type EffectFromGenerator<Yield, Returned extends Result<any, any>> = EffectResult<InferOk<Returned>, InferYieldError<Yield> | InferErr<Returned>, InferYieldRequirements<Yield> | EffectRequirements<Returned>>;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/service/service.d.ts
|
|
78
|
+
type ServiceTagLiteral<Tag extends string> = string extends Tag ? never : Tag extends '' ? never : Tag;
|
|
79
|
+
/**
|
|
80
|
+
* Declare a class-backed Service with a stable string-literal identity.
|
|
81
|
+
*
|
|
82
|
+
* The returned class is simultaneously the implementation type, the runtime
|
|
83
|
+
* dependency token, and the value yielded by `yield*` in an Effect generator.
|
|
84
|
+
* The explicit self type preserves exact instance inference, while the second
|
|
85
|
+
* call captures the tag as a literal for Layer composition and diagnostics.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* class Database extends Service<Database>()('Database') {
|
|
90
|
+
* query(): string {
|
|
91
|
+
* return 'ok'
|
|
92
|
+
* }
|
|
93
|
+
* }
|
|
94
|
+
*
|
|
95
|
+
* const database = yield* Database
|
|
96
|
+
* database.query()
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @typeParam Self The instance type implemented by the declared Service.
|
|
100
|
+
*/
|
|
101
|
+
declare function Service<Self>(): <const Tag extends string>(tag: ServiceTagLiteral<Tag>) => (abstract new () => {}) & {
|
|
102
|
+
/** The stable logical identity used by Layers and resolver backends. */
|
|
103
|
+
readonly serviceTag: Tag;
|
|
104
|
+
/**
|
|
105
|
+
* Type-check a structural implementation of this Service.
|
|
106
|
+
*
|
|
107
|
+
* This is an identity helper. It returns the supplied value unchanged
|
|
108
|
+
* and does not invoke a constructor or modify its prototype.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* class Database extends Service<Database>()('Database') {
|
|
113
|
+
* query(sql: string): string {
|
|
114
|
+
* return sql
|
|
115
|
+
* }
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* const database = Database.of({
|
|
119
|
+
* query: (sql) => `Result: ${sql}`
|
|
120
|
+
* })
|
|
121
|
+
*
|
|
122
|
+
* database.query('SELECT 1')
|
|
123
|
+
* // 'Result: SELECT 1'
|
|
124
|
+
* // database is the original object, not an instance of Database
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
of(this: void, implementation: Self): Self;
|
|
128
|
+
/** Resolve this Service from the resolver active in the current runtime. */
|
|
129
|
+
[Symbol.asyncIterator](this: ServiceToken<Tag, Self>): AsyncGenerator<ServiceRequirement<ServiceToken<Tag, Self>>, Self, unknown>;
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/service/runtime.d.ts
|
|
133
|
+
/** Resolves class-backed Service tokens for a runtime execution. */
|
|
134
|
+
interface ServiceResolver {
|
|
135
|
+
/** Resolve a token to its corresponding Service instance. */
|
|
136
|
+
resolve<T extends AnyServiceToken>(token: T): InstanceType<T> | PromiseLike<InstanceType<T>>;
|
|
137
|
+
}
|
|
138
|
+
/** Provides the resolver context used by Service tokens during execution. */
|
|
139
|
+
declare class ServiceRuntime {
|
|
140
|
+
/**
|
|
141
|
+
* Run a callback with a resolver available to `yield* Service` expressions.
|
|
142
|
+
*
|
|
143
|
+
* The context is scoped to the callback and is restored afterward.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* const value = ServiceRuntime.run(resolver, () => {
|
|
148
|
+
* return ServiceRuntime.resolve(Database)
|
|
149
|
+
* })
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
static run<A>(resolver: ServiceResolver, program: () => A): A;
|
|
153
|
+
/** Return the resolver active in the current execution context. */
|
|
154
|
+
static current(): ServiceResolver;
|
|
155
|
+
/** Resolve a Service token using the active resolver. */
|
|
156
|
+
static resolve<T extends AnyServiceToken>(token: T): Promise<InstanceType<T>>;
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/service/errors.d.ts
|
|
160
|
+
/** Thrown when a Service is accessed without an active runtime resolver. */
|
|
161
|
+
declare class ServiceRuntimeNotConfiguredError extends Error {
|
|
162
|
+
constructor();
|
|
163
|
+
}
|
|
164
|
+
/** Thrown when a runtime has no provider for the requested Service tag. */
|
|
165
|
+
declare class ServiceNotFoundError extends Error {
|
|
166
|
+
readonly service: AnyServiceToken;
|
|
167
|
+
constructor(service: AnyServiceToken);
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/scope/errors.d.ts
|
|
171
|
+
/** Thrown when Scope context is accessed outside an active Scope execution. */
|
|
172
|
+
declare class ScopeRuntimeNotConfiguredError extends Error {
|
|
173
|
+
constructor();
|
|
174
|
+
}
|
|
175
|
+
/** Thrown when a resource or finalizer is added after Scope closure begins. */
|
|
176
|
+
declare class ScopeClosedError extends Error {
|
|
177
|
+
constructor();
|
|
178
|
+
}
|
|
179
|
+
/** Aggregates finalizer failures encountered while closing a Scope. */
|
|
180
|
+
declare class ScopeCloseError extends Error {
|
|
181
|
+
readonly causes: readonly unknown[];
|
|
182
|
+
constructor(causes: readonly unknown[]);
|
|
183
|
+
}
|
|
184
|
+
/** Thrown when a value has neither Symbol.dispose nor Symbol.asyncDispose. */
|
|
185
|
+
declare class ResourceNotDisposableError extends Error {
|
|
186
|
+
constructor();
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/scope/types.d.ts
|
|
190
|
+
/** A value that may be returned synchronously or asynchronously. */
|
|
191
|
+
type MaybePromise$1<T> = T | PromiseLike<T>;
|
|
192
|
+
/** Final outcome supplied to Scope finalizers and resource releases. */
|
|
193
|
+
type ScopeOutcome = {
|
|
194
|
+
/** Indicates that the owning program completed successfully. */
|
|
195
|
+
readonly status: 'success';
|
|
196
|
+
} | {
|
|
197
|
+
/** Indicates that the owning program failed or was interrupted. */
|
|
198
|
+
readonly status: 'failure';
|
|
199
|
+
/** The original program or execution failure. */
|
|
200
|
+
readonly cause: unknown;
|
|
201
|
+
};
|
|
202
|
+
/** Cleanup callback registered with a Scope. */
|
|
203
|
+
type ScopeFinalizer = (outcome: ScopeOutcome) => MaybePromise$1<void>;
|
|
204
|
+
/** Aggregated cleanup information reported at an execution boundary. */
|
|
205
|
+
type CleanupFailureDiagnostic = {
|
|
206
|
+
/** Outcome used for the Scope close that triggered cleanup. */
|
|
207
|
+
readonly outcome: ScopeOutcome;
|
|
208
|
+
/** Aggregated finalizer failure. */
|
|
209
|
+
readonly error: ScopeCloseError;
|
|
210
|
+
};
|
|
211
|
+
type SyncDisposableResource = {
|
|
212
|
+
[Symbol.dispose]: () => void;
|
|
213
|
+
[Symbol.asyncDispose]?: () => MaybePromise$1<void>;
|
|
214
|
+
};
|
|
215
|
+
type AsyncDisposableResource = {
|
|
216
|
+
[Symbol.dispose]?: () => void;
|
|
217
|
+
[Symbol.asyncDispose]: () => MaybePromise$1<void>;
|
|
218
|
+
};
|
|
219
|
+
/** A value implementing at least one JavaScript disposal protocol. */
|
|
220
|
+
type DisposableResource = SyncDisposableResource | AsyncDisposableResource;
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/utils/types.d.ts
|
|
223
|
+
type MaybePromise<T> = T | PromiseLike<T>;
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/layer/types.d.ts
|
|
226
|
+
/** Runtime-facing provider registration supplied by a Layer backend. */
|
|
227
|
+
interface LayerRegistration {
|
|
228
|
+
/** The class-backed Service token provided by this registration. */
|
|
229
|
+
readonly service: ServiceClass<any, any>;
|
|
230
|
+
/** Lazily acquire the Service instance. */
|
|
231
|
+
readonly acquire: () => MaybePromise<unknown>;
|
|
232
|
+
}
|
|
233
|
+
/** Type-level description of one Layer provider and its Service requirements. */
|
|
234
|
+
type LayerSpec<Provided extends AnyServiceToken, Required extends AnyServiceToken = never> = {
|
|
235
|
+
/** Service constructor provided by the Layer. */
|
|
236
|
+
readonly provided: Provided;
|
|
237
|
+
/** Service constructors required while acquiring the provider. */
|
|
238
|
+
readonly required: Required;
|
|
239
|
+
};
|
|
240
|
+
/** Widened Layer specification used by generic Layer utilities. */
|
|
241
|
+
type AnyLayerSpec = LayerSpec<AnyServiceToken, AnyServiceToken>;
|
|
242
|
+
/** Generator shape used by `Layer.gen` and `Layer.scopedGen`. */
|
|
243
|
+
type LayerGenerator<S extends ServiceClass<any, any>, Yield extends ServiceRequirement<AnyServiceToken> = ServiceRequirement<AnyServiceToken>> = () => AsyncGenerator<Yield, InstanceType<S>, unknown>;
|
|
244
|
+
/** Service requirements inferred from a provider's methods and generator. */
|
|
245
|
+
type LayerGeneratorRequirements<S extends ServiceClass<any, any>, Yield extends ServiceRequirement<AnyServiceToken>> = ServiceRequirements<S> | InferYieldRequirements<Yield>;
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/layer/inference.d.ts
|
|
248
|
+
/** Any Layer shape accepted by type-level inference helpers. */
|
|
249
|
+
type AnyLayer = Layer<any, any>;
|
|
250
|
+
/** Extract the provider specification union from a Layer. */
|
|
251
|
+
type LayerSpecs<L extends AnyLayer> = L extends Layer<infer Specs, any> ? Specs : never;
|
|
252
|
+
/** Extract the Service constructor union provided by a Layer. */
|
|
253
|
+
type LayerProvided<L extends AnyLayer> = LayerSpecs<L> extends LayerSpec<infer Provided, any> ? Provided : never;
|
|
254
|
+
/** Extract all raw Service requirements declared by a Layer's providers. */
|
|
255
|
+
type LayerRawRequired<L extends AnyLayer> = LayerSpecs<L> extends LayerSpec<any, infer Required> ? Required : never;
|
|
256
|
+
type LayerSpecProvided<Specs extends AnyLayerSpec> = Specs extends LayerSpec<infer Provided, any> ? Provided : never;
|
|
257
|
+
type SameServiceTag<Left extends AnyServiceToken, Right extends AnyServiceToken> = string extends ServiceTag<Left> ? true : string extends ServiceTag<Right> ? true : [ServiceTag<Left>] extends [ServiceTag<Right>] ? [ServiceTag<Right>] extends [ServiceTag<Left>] ? true : false : false;
|
|
258
|
+
type SameServiceContract<Left extends AnyServiceToken, Right extends AnyServiceToken> = [InstanceType<Left>] extends [InstanceType<Right>] ? [InstanceType<Right>] extends [InstanceType<Left>] ? true : false : false;
|
|
259
|
+
type SameServiceToken<Left extends AnyServiceToken, Right extends AnyServiceToken> = SameServiceTag<Left, Right> extends true ? SameServiceContract<Left, Right> : false;
|
|
260
|
+
type IsOverridden<Provided extends AnyServiceToken, Replacements extends AnyServiceToken> = Replacements extends AnyServiceToken ? SameServiceToken<Provided, Replacements> : false;
|
|
261
|
+
type RemoveOverriddenSpecs<Specs extends AnyLayerSpec, Replacements extends AnyServiceToken> = Specs extends LayerSpec<infer Provided, any> ? true extends IsOverridden<Provided, Replacements> ? never : Specs : never;
|
|
262
|
+
type ReplaceLayerSpecs<Current extends AnyLayerSpec, Replacement extends AnyLayerSpec> = RemoveOverriddenSpecs<Current, LayerSpecProvided<Replacement>> | Replacement;
|
|
263
|
+
type OverrideLayerSpecs<Current extends AnyLayerSpec, Overrides extends readonly AnyLayer[]> = Overrides extends readonly [infer Head extends AnyLayer, ...infer Tail extends readonly AnyLayer[]] ? OverrideLayerSpecs<ReplaceLayerSpecs<Current, LayerSpecs<Head>>, Tail> : Current;
|
|
264
|
+
type IncompatibleServicePair<Left extends AnyServiceToken, Right extends AnyServiceToken> = SameServiceTag<Left, Right> extends true ? SameServiceContract<Left, Right> extends true ? never : Right : never;
|
|
265
|
+
type IncompatibleServicePairs<Left, Right> = Left extends AnyServiceToken ? Right extends AnyServiceToken ? IncompatibleServicePair<Left, Right> : never : never;
|
|
266
|
+
type IncompatibleLayerSpecs<Current extends AnyLayerSpec, Replacement extends AnyLayerSpec> = IncompatibleServicePairs<LayerSpecProvided<Current>, LayerSpecProvided<Replacement>>;
|
|
267
|
+
/** Same-tag replacements with incompatible instance contracts. */
|
|
268
|
+
type OverrideLayerCollisions<Current extends AnyLayerSpec, Overrides extends readonly AnyLayer[]> = Overrides extends readonly [infer Head extends AnyLayer, ...infer Tail extends readonly AnyLayer[]] ? IncompatibleLayerSpecs<Current, LayerSpecs<Head>> | OverrideLayerCollisions<ReplaceLayerSpecs<Current, LayerSpecs<Head>>, Tail> : never;
|
|
269
|
+
type RequirementProvided<Requirement extends AnyServiceToken, Provided extends AnyServiceToken> = Provided extends AnyServiceToken ? SameServiceTag<Requirement, Provided> extends true ? SameServiceContract<Requirement, Provided> : false : false;
|
|
270
|
+
type MissingRequirement<Requirement extends AnyServiceToken, Provided extends AnyServiceToken> = true extends RequirementProvided<Requirement, Provided> ? never : Requirement;
|
|
271
|
+
/** Service tokens from `Required` that are not supplied by `Provided`. */
|
|
272
|
+
type MissingServices<Required, Provided extends AnyServiceToken> = Required extends AnyServiceToken ? MissingRequirement<Required, Provided> : never;
|
|
273
|
+
/** Extract the requirements missing from a Layer's provided environment. */
|
|
274
|
+
type LayerMissing<L extends AnyLayer> = MissingServices<LayerRawRequired<L>, LayerProvided<L>>;
|
|
275
|
+
/** Extract incompatible same-tag override contracts from a Layer. */
|
|
276
|
+
type LayerCollisions<L extends AnyLayer> = L extends Layer<any, infer Collisions> ? Collisions : never;
|
|
277
|
+
type MissingLayerServices<Missing extends AnyServiceToken> = {
|
|
278
|
+
readonly __betterEffectMissingServices: Missing;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Put the missing Service tags in the required property name itself. This is
|
|
282
|
+
* intentionally separate from the stable marker above so TypeScript reports a
|
|
283
|
+
* useful diagnostic while existing type-level consumers can still inspect the
|
|
284
|
+
* missing-token union.
|
|
285
|
+
*/
|
|
286
|
+
type MissingLayerServiceDiagnostic<Missing extends AnyServiceToken> = { readonly [K in `__betterEffectMissingService__${ServiceTag<Missing>}`]: never; };
|
|
287
|
+
type LayerCollisionServices<Collisions extends AnyServiceToken> = {
|
|
288
|
+
readonly __betterEffectLayerOverrideCollisions: Collisions;
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* A Layer accepted by Runtime boundaries after completeness validation.
|
|
292
|
+
*
|
|
293
|
+
* Incomplete Layers retain readable per-tag diagnostic properties so compiler
|
|
294
|
+
* errors identify the missing Services directly.
|
|
295
|
+
*/
|
|
296
|
+
type CompleteLayer<L extends AnyLayer> = [LayerMissing<L>] extends [never] ? [LayerCollisions<L>] extends [never] ? L : L & LayerCollisionServices<LayerCollisions<L>> : L & MissingLayerServiceDiagnostic<LayerMissing<L>> & MissingLayerServices<LayerMissing<L>> & ([LayerCollisions<L>] extends [never] ? unknown : LayerCollisionServices<LayerCollisions<L>>);
|
|
297
|
+
/** Services required by an execution result that are not in its environment. */
|
|
298
|
+
type ExecutionMissing<Provided extends AnyServiceToken, ProgramResult> = MissingServices<EffectRequirements<ProgramResult>, Provided>;
|
|
299
|
+
/** Named diagnostic contract for an execution with unavailable Services. */
|
|
300
|
+
type MissingRuntimeServices<Missing extends AnyServiceToken> = {
|
|
301
|
+
readonly __betterEffectMissingRuntimeServices: Missing;
|
|
302
|
+
};
|
|
303
|
+
/** Readable per-tag diagnostics for execution boundaries. */
|
|
304
|
+
type MissingRuntimeServiceDiagnostic<Missing extends AnyServiceToken> = { readonly [K in `__betterEffectMissingRuntimeService__${ServiceTag<Missing>}`]: never; };
|
|
305
|
+
type ExecutionProgram<A> = () => A | PromiseLike<A>;
|
|
306
|
+
/** Keep execution callbacks unchanged when their Effect requirements are met. */
|
|
307
|
+
type CompleteExecution<Provided extends AnyServiceToken, A> = [ExecutionMissing<Provided, A>] extends [never] ? ExecutionProgram<A> : ExecutionProgram<A> & MissingRuntimeServiceDiagnostic<ExecutionMissing<Provided, A>> & MissingRuntimeServices<ExecutionMissing<Provided, A>>;
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/layer/layer.d.ts
|
|
310
|
+
declare const LayerTypeId: unique symbol;
|
|
311
|
+
declare const LayerCollisionTypeId: unique symbol;
|
|
312
|
+
interface LayerProvider extends LayerRegistration {
|
|
313
|
+
readonly release?: (instance: unknown, outcome: ScopeOutcome) => MaybePromise<void>;
|
|
314
|
+
}
|
|
315
|
+
/** A Service class whose constructor can be called without arguments. */
|
|
316
|
+
type DefaultConstructibleServiceClass<Tag extends string = string, Instance = any> = ServiceClass<Tag, Instance> & (new () => Instance);
|
|
317
|
+
/**
|
|
318
|
+
* Declarative collection of Service providers.
|
|
319
|
+
*
|
|
320
|
+
* A Layer describes how to acquire implementations; it does not execute
|
|
321
|
+
* providers until a `Runtime` is created. Use `merge` to compose distinct
|
|
322
|
+
* providers and `override` when replacing an existing provider intentionally.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```ts
|
|
326
|
+
* const AppLive = Layer.merge(
|
|
327
|
+
* Layer.succeed(Database, database),
|
|
328
|
+
* Layer.make(UserRepository)
|
|
329
|
+
* )
|
|
330
|
+
*
|
|
331
|
+
* const runtime = await Runtime.make(AppLive, backend)
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
declare class Layer<Specs extends AnyLayerSpec = AnyLayerSpec, Collisions extends AnyServiceToken = never> {
|
|
335
|
+
readonly [LayerTypeId]: Specs;
|
|
336
|
+
readonly [LayerCollisionTypeId]: Collisions;
|
|
337
|
+
/** The provider registrations retained by this Layer. */
|
|
338
|
+
readonly providers: readonly LayerProvider[];
|
|
339
|
+
private constructor();
|
|
340
|
+
/**
|
|
341
|
+
* Create a Layer that lazily acquires a Service instance.
|
|
342
|
+
*
|
|
343
|
+
* When the acquire callback is omitted, the Service must be constructible
|
|
344
|
+
* without required constructor arguments and is instantiated with `new`.
|
|
345
|
+
* Supplying an acquire callback remains available for custom construction.
|
|
346
|
+
*
|
|
347
|
+
* The acquire callback runs when the provider is first resolved by a
|
|
348
|
+
* Runtime. Dependencies declared by Effect-returning Service methods are
|
|
349
|
+
* tracked in the Layer's type.
|
|
350
|
+
*
|
|
351
|
+
* @example
|
|
352
|
+
* ```ts
|
|
353
|
+
* const DatabaseLive = Layer.make(Database)
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* const DatabaseLive = Layer.make(Database, () => new Database(config))
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
static make<S extends DefaultConstructibleServiceClass<any, any>>(service: S): Layer<LayerSpec<S, ServiceRequirements<S>>>;
|
|
362
|
+
static make<S extends ServiceClass<any, any>>(service: S, acquire: () => MaybePromise<InstanceType<S>>): Layer<LayerSpec<S, ServiceRequirements<S>>>;
|
|
363
|
+
/**
|
|
364
|
+
* Create a Layer from an already-constructed Service instance.
|
|
365
|
+
*
|
|
366
|
+
* The instance is returned as-is whenever the Service is resolved.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```ts
|
|
370
|
+
* const DatabaseLive = Layer.succeed(Database, database)
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
static succeed<S extends ServiceClass<any, any>>(service: S, instance: InstanceType<S>): Layer<LayerSpec<S, ServiceRequirements<S>>>;
|
|
374
|
+
/**
|
|
375
|
+
* Define a provider with Runtime-root cleanup.
|
|
376
|
+
*
|
|
377
|
+
* The release callback intentionally keeps its compatibility-friendly
|
|
378
|
+
* one-argument shape and runs when the owning Runtime is disposed. Use
|
|
379
|
+
* `scopedGen` when acquisition needs contextual Services or cleanup needs
|
|
380
|
+
* `ScopeOutcome`.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* const DatabaseLive = Layer.scoped(
|
|
385
|
+
* Database,
|
|
386
|
+
* () => openDatabase(),
|
|
387
|
+
* (database) => database.close()
|
|
388
|
+
* )
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
391
|
+
static scoped<S extends ServiceClass<any, any>>(service: S, acquire: () => MaybePromise<InstanceType<S>>, release: (instance: InstanceType<S>) => MaybePromise<void>): Layer<LayerSpec<S, ServiceRequirements<S>>>;
|
|
392
|
+
/**
|
|
393
|
+
* Define a provider whose acquisition can yield contextual Services.
|
|
394
|
+
*
|
|
395
|
+
* The release callback receives the acquired instance and the final
|
|
396
|
+
* `ScopeOutcome` selected by the owning Runtime.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```ts
|
|
400
|
+
* const RepositoryLive = Layer.scopedGen(
|
|
401
|
+
* UserRepository,
|
|
402
|
+
* async function* () {
|
|
403
|
+
* const database = yield* Database
|
|
404
|
+
* return new UserRepository(database)
|
|
405
|
+
* },
|
|
406
|
+
* (repository, outcome) => repository.close(outcome)
|
|
407
|
+
* )
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
static scopedGen<S extends ServiceClass<any, any>, Yield extends ServiceRequirement<AnyServiceToken>>(service: S, factory: LayerGenerator<S, Yield>, release: (instance: InstanceType<S>, outcome: ScopeOutcome) => MaybePromise<void>): Layer<LayerSpec<S, LayerGeneratorRequirements<S, Yield>>>;
|
|
411
|
+
/**
|
|
412
|
+
* Define a provider whose acquisition can yield contextual Services.
|
|
413
|
+
*
|
|
414
|
+
* Unlike `scopedGen`, this variant has no release callback. Use it for
|
|
415
|
+
* providers whose lifetime is managed elsewhere or that need no cleanup.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```ts
|
|
419
|
+
* const RepositoryLive = Layer.gen(UserRepository, async function* () {
|
|
420
|
+
* const database = yield* Database
|
|
421
|
+
* return new UserRepository(database)
|
|
422
|
+
* })
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
static gen<S extends ServiceClass<any, any>, Yield extends ServiceRequirement<AnyServiceToken>>(service: S, factory: LayerGenerator<S, Yield>): Layer<LayerSpec<S, LayerGeneratorRequirements<S, Yield>>>;
|
|
426
|
+
/**
|
|
427
|
+
* Compose Layers without replacing providers.
|
|
428
|
+
*
|
|
429
|
+
* Each Service tag may appear only once. Duplicate tags are rejected at
|
|
430
|
+
* runtime; use `override` when replacement is intentional.
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```ts
|
|
434
|
+
* const AppLive = Layer.merge(DatabaseLive, RepositoryLive)
|
|
435
|
+
* ```
|
|
436
|
+
*/
|
|
437
|
+
static merge<const Layers extends readonly Layer<any, any>[]>(...layers: Layers): Layer<Layers[number] extends Layer<infer Specs, any> ? Specs : never, Layers[number] extends Layer<any, infer Collisions> ? Collisions : never>;
|
|
438
|
+
/**
|
|
439
|
+
* Replace providers in a base Layer, using tag identity and compatible
|
|
440
|
+
* instance contracts.
|
|
441
|
+
*
|
|
442
|
+
* Overrides are applied from left to right; the last compatible provider for
|
|
443
|
+
* a tag wins. Incompatible same-tag replacements remain visible as a type
|
|
444
|
+
* diagnostic and cannot be passed as a complete Layer.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* const TestLive = Layer.override(AppLive, Layer.succeed(Database, fakeDb))
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
static override<Base extends Layer<any, any>, const Overrides extends readonly Layer<any, any>[]>(base: Base, ...overrides: Overrides): Layer<OverrideLayerSpecs<Base extends Layer<infer Specs, any> ? Specs : never, Overrides>, (Base extends Layer<any, infer Collisions> ? Collisions : never) | (Overrides[number] extends Layer<any, infer Collisions> ? Collisions : never) | OverrideLayerCollisions<Base extends Layer<infer Specs, any> ? Specs : never, Overrides>>;
|
|
452
|
+
}
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/layer/errors.d.ts
|
|
455
|
+
/** Thrown when a Layer registers the same Service tag more than once. */
|
|
456
|
+
declare class DuplicateServiceError extends Error {
|
|
457
|
+
readonly service: ServiceClass<any>;
|
|
458
|
+
constructor(service: ServiceClass<any>);
|
|
459
|
+
}
|
|
460
|
+
/** Thrown when one Service tag is associated with incompatible constructors. */
|
|
461
|
+
declare class ServiceTagCollisionError extends Error {
|
|
462
|
+
readonly existing: AnyServiceToken;
|
|
463
|
+
readonly incoming: AnyServiceToken;
|
|
464
|
+
constructor(existing: AnyServiceToken, incoming: AnyServiceToken);
|
|
465
|
+
}
|
|
466
|
+
/** Thrown when a backend fails while registering a Layer provider. */
|
|
467
|
+
declare class LayerRegistrationError extends Error {
|
|
468
|
+
readonly service: ServiceClass<any> | undefined;
|
|
469
|
+
readonly registrationCause: unknown;
|
|
470
|
+
readonly cleanupCause?: unknown;
|
|
471
|
+
constructor(service: ServiceClass<any> | undefined, registrationCause: unknown, cleanupCause?: unknown);
|
|
472
|
+
}
|
|
473
|
+
/** Thrown when one or more Layer-owned resources fail during disposal. */
|
|
474
|
+
declare class LayerDisposeError extends Error {
|
|
475
|
+
readonly causes: readonly unknown[];
|
|
476
|
+
constructor(causes: readonly unknown[]);
|
|
477
|
+
}
|
|
478
|
+
/** Thrown when a Layer generator yields a value other than a Service requirement. */
|
|
479
|
+
declare class LayerGeneratorYieldError extends Error {
|
|
480
|
+
readonly service: ServiceClass<any>;
|
|
481
|
+
constructor(service: ServiceClass<any>);
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region src/runtime/outcome.d.ts
|
|
485
|
+
/** Aggregated cleanup information reported during Runtime shutdown. */
|
|
486
|
+
type RuntimeShutdownDiagnostic = {
|
|
487
|
+
/** Final outcome supplied to the Runtime root Scope. */
|
|
488
|
+
readonly outcome: ScopeOutcome;
|
|
489
|
+
/** Aggregated root-Scope and backend cleanup failure. */
|
|
490
|
+
readonly error: LayerDisposeError;
|
|
491
|
+
};
|
|
492
|
+
/** Observer notified about cleanup failures without changing primary results. */
|
|
493
|
+
type CleanupFailureObserver = (diagnostic: CleanupFailureDiagnostic | RuntimeShutdownDiagnostic) => MaybePromise$1<void>;
|
|
494
|
+
/** Optional Runtime configuration for cleanup diagnostics. */
|
|
495
|
+
type RuntimeOptions = {
|
|
496
|
+
/** Optional observer for best-effort cleanup diagnostics. */
|
|
497
|
+
readonly onCleanupFailure?: CleanupFailureObserver;
|
|
498
|
+
};
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/layer/backend.d.ts
|
|
501
|
+
/** Runtime adapter responsible for registering, resolving, and disposing Layer providers. */
|
|
502
|
+
interface LayerBackend extends ServiceResolver {
|
|
503
|
+
/** Register one Service provider with the backend. */
|
|
504
|
+
register(registration: LayerRegistration): MaybePromise<void>;
|
|
505
|
+
/** Dispose all backend-owned instances and provider registrations. */
|
|
506
|
+
disposeAll(): MaybePromise<void>;
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
export { ServiceResolver as A, ServiceRequirement as B, ScopeOutcome as C, ScopeRuntimeNotConfiguredError as D, ScopeClosedError as E, EffectFromGenerator as F, ServiceTag as G, ServiceClass as H, EffectRequirements as I, ServiceToken as K, EffectResult as L, Service as M, AnyEffectResult as N, ServiceNotFoundError as O, EffectError as P, EffectSuccess as R, ScopeFinalizer as S, ScopeCloseError as T, ServiceInstance as U, AnyServiceToken as V, ServiceRequirements as W, LayerSpecs as _, DuplicateServiceError as a, DisposableResource as b, LayerRegistrationError as c, AnyLayer as d, CompleteExecution as f, LayerRawRequired as g, LayerProvided as h, RuntimeShutdownDiagnostic as i, ServiceRuntime as j, ServiceRuntimeNotConfiguredError as k, ServiceTagCollisionError as l, LayerMissing as m, CleanupFailureObserver as n, LayerDisposeError as o, CompleteLayer as p, RuntimeOptions as r, LayerGeneratorYieldError as s, LayerBackend as t, Layer as u, LayerRegistration as v, ResourceNotDisposableError as w, MaybePromise$1 as x, CleanupFailureDiagnostic as y, EffectYield as z };
|
|
510
|
+
//# sourceMappingURL=index-D77AvuBl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D77AvuBl.d.mts","names":[],"sources":["../src/service/types.ts","../src/effect/types.ts","../src/service/service.ts","../src/service/runtime.ts","../src/service/errors.ts","../src/scope/errors.ts","../src/scope/types.ts","../src/utils/types.ts","../src/layer/types.ts","../src/layer/inference.ts","../src/layer/layer.ts","../src/layer/errors.ts","../src/runtime/outcome.ts","../src/layer/backend.ts"],"mappings":";;KAEK,eAAe,oBAAoB;WAC7B;WACA,YAAY;;EAGrB,GAAG,YAAY,gBAAgB,WAAW;;;KAIhC,aAAa,6BAA6B,oCACjD,gBACA,YACH,eAAe,KAAK;;KAGV,kBAAkB;;KAGlB,aAAa,6BAA6B,2BACjD,gBACA,YACH,eAAe,KAAK;;KAGV,gBAAgB,UAAU,mBAAmB,aAAa;;KAG1D,WAAW,UAAU,mBAAmB;KAE/C,mBAAmB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