@systemfsoftware/effect-atom 0.5.3

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.
@@ -0,0 +1,491 @@
1
+ import * as Cause from "effect/Cause";
2
+ import * as Exit from "effect/Exit";
3
+ import { LazyArg } from "effect/Function";
4
+ import * as Option from "effect/Option";
5
+ import * as Schema_ from "effect/Schema";
6
+ import { Pipeable } from "effect/Pipeable";
7
+ import { Predicate, Refinement } from "effect/Predicate";
8
+ import * as Types from "effect/Types";
9
+ //#region src/internal/ResultValues.d.ts
10
+ /**
11
+ * Type-level identifier used to recognize `Result` values.
12
+ *
13
+ * @category type IDs
14
+ * @since 4.0.0
15
+ */
16
+ type TypeId = '~effect-atom/atom/Result';
17
+ /**
18
+ * Runtime identifier attached to `Result` values and used by `isResult`.
19
+ *
20
+ * @category type IDs
21
+ * @since 4.0.0
22
+ */
23
+ declare const TypeId: TypeId;
24
+ /**
25
+ * Namespace containing the shared prototype shape and type-level helpers for
26
+ * `Result` values. The interface members are declared ahead of their use in
27
+ * the variant interfaces below.
28
+ *
29
+ * @since 4.0.0
30
+ */
31
+ declare namespace Result {
32
+ /**
33
+ * Common prototype fields implemented by every `Result` variant, including
34
+ * pipeability, the type marker, phantom type members, and the `waiting` flag.
35
+ *
36
+ * @category models
37
+ * @since 4.0.0
38
+ */
39
+ interface Proto<A, E> extends Pipeable {
40
+ readonly [TypeId]: {
41
+ readonly E: (_: never) => E;
42
+ readonly A: (_: never) => A;
43
+ };
44
+ readonly waiting: boolean;
45
+ }
46
+ /**
47
+ * Extracts the success value type from an `Result`.
48
+ *
49
+ * @category utility types
50
+ * @since 4.0.0
51
+ */
52
+ type Success<R> = R extends Result<infer A, infer _> ? A : never;
53
+ /**
54
+ * Extracts the failure error type from an `Result`.
55
+ *
56
+ * @category utility types
57
+ * @since 4.0.0
58
+ */
59
+ type Failure<R> = R extends Result<infer _, infer E> ? E : never;
60
+ }
61
+ /**
62
+ * Represents the state of an asynchronous value as `Initial`, `Success`, or
63
+ * `Failure`, with a `waiting` flag for in-flight refreshes.
64
+ *
65
+ * @category models
66
+ * @since 4.0.0
67
+ */
68
+ type Result<A, E = never> = Initial<A, E> | Success<A, E> | Failure<A, E>;
69
+ /**
70
+ * Initial `Result` state before a success value or failure cause is available.
71
+ *
72
+ * @category models
73
+ * @since 4.0.0
74
+ */
75
+ interface Initial<A, E = never> extends Result.Proto<A, E> {
76
+ readonly _tag: 'Initial';
77
+ }
78
+ /**
79
+ * Successful `Result` containing the current value, its timestamp, and the
80
+ * shared waiting flag.
81
+ *
82
+ * @category models
83
+ * @since 4.0.0
84
+ */
85
+ interface Success<A, E = never> extends Result.Proto<A, E> {
86
+ readonly _tag: 'Success';
87
+ readonly value: A;
88
+ readonly timestamp: number;
89
+ }
90
+ /**
91
+ * Failed `Result` containing a failure cause and the latest previous success
92
+ * when one is available.
93
+ *
94
+ * @category models
95
+ * @since 4.0.0
96
+ */
97
+ interface Failure<A, E = never> extends Result.Proto<A, E> {
98
+ readonly _tag: 'Failure';
99
+ readonly cause: Cause.Cause<E>;
100
+ readonly previousSuccess: Option.Option<Success<A, E>>;
101
+ }
102
+ /**
103
+ * Returns `true` when a value is an `Result`.
104
+ *
105
+ * @category guards
106
+ * @since 4.0.0
107
+ */
108
+ declare const isResult: (u: unknown) => u is Result<unknown, unknown>;
109
+ /**
110
+ * Creates an `Initial` result, optionally marking it as waiting.
111
+ *
112
+ * @category constructors
113
+ * @since 4.0.0
114
+ */
115
+ declare const initial: <A = never, E = never>(waiting?: boolean) => Initial<A, E>;
116
+ /**
117
+ * Creates a `Success` result with a value and optional `waiting` flag or
118
+ * timestamp override.
119
+ *
120
+ * @category constructors
121
+ * @since 4.0.0
122
+ */
123
+ declare const success: <A, E = never>(value: A, options?: {
124
+ readonly waiting?: boolean | undefined;
125
+ readonly timestamp?: number | undefined;
126
+ }) => Success<A, E>;
127
+ /**
128
+ * Creates a `Failure` result from a `Cause`, optionally preserving a previous
129
+ * success and marking the result as waiting.
130
+ *
131
+ * @category constructors
132
+ * @since 4.0.0
133
+ */
134
+ declare const failure: <A, E = never>(cause: Cause.Cause<E>, options?: {
135
+ readonly previousSuccess?: Option.Option<Success<A, E>> | undefined;
136
+ readonly waiting?: boolean | undefined;
137
+ }) => Failure<A, E>;
138
+ //#endregion
139
+ //#region src/internal/ResultSchema.d.ts
140
+ /**
141
+ * Schema interface for `Result` values, retaining the schemas used for
142
+ * success values and failure errors.
143
+ *
144
+ * @category schemas
145
+ * @since 4.0.0
146
+ */
147
+ interface Schema<Success extends Schema_.Constraint, Error extends Schema_.Constraint> extends Schema_.declareConstructor<Result<(Success | typeof Schema_.Never)['Type'], (Error | typeof Schema_.Never)['Type']>, Result<(Success | typeof Schema_.Never)['Encoded'], (Error | typeof Schema_.Never)['Encoded']>, readonly [Success | typeof Schema_.Never, Schema_.Cause<Error | typeof Schema_.Never, Schema_.Defect>]> {
148
+ readonly success: Success | typeof Schema_.Never;
149
+ readonly error: Error | typeof Schema_.Never;
150
+ }
151
+ /**
152
+ * Creates a schema for `Result` values using optional schemas for success values and failure errors.
153
+ *
154
+ * @category schemas
155
+ * @since 4.0.0
156
+ */
157
+ declare const Schema: <A extends Schema_.Constraint = typeof Schema_.Never, E extends Schema_.Constraint = typeof Schema_.Never>(options: {
158
+ readonly success?: A | undefined;
159
+ readonly error?: E | undefined;
160
+ }) => Schema<A, E>;
161
+ declare namespace Result_d_exports {
162
+ export { Builder, Defect, Failure, Initial, Interrupt, Result, Schema, Success, TypeId, With, all, builder, cause, error, fail, failWithPrevious, failure, failureWithPrevious, flatMap, fromExit, fromExitWithPrevious, getOrElse, getOrThrow, initial, isResult as isAsyncResult, isFailure, isInitial, isInterrupted, isNotInitial, isResult, isSuccess, isWaiting, map, match, matchWithError, matchWithWaiting, replacePrevious, success, toExit, touch, value, waiting, waitingFrom };
163
+ }
164
+ /**
165
+ * Rebuilds an `Result` with new success and failure types while preserving the variant of another result.
166
+ *
167
+ * @category utility types
168
+ * @since 4.0.0
169
+ */
170
+ type With<R extends Result<unknown, unknown>, A, E> = R extends Initial<infer _A, infer _E> ? Initial<A, E> : R extends Success<infer _A, infer _E> ? Success<A, E> : R extends Failure<infer _A, infer _E> ? Failure<A, E> : never;
171
+ /**
172
+ * Returns whether an `Result` is currently waiting for an asynchronous computation or refresh to finish.
173
+ *
174
+ * @category predicates
175
+ * @since 4.0.0
176
+ */
177
+ declare const isWaiting: <A, E>(result: Result<A, E>) => boolean;
178
+ /**
179
+ * Converts an `Exit` into a `Success` when it succeeds or a `Failure` carrying the exit cause when it fails.
180
+ *
181
+ * @category constructors
182
+ * @since 4.0.0
183
+ */
184
+ declare const fromExit: <A, E>(exit: Exit.Exit<A, E>) => Success<A, E> | Failure<A, E>;
185
+ /**
186
+ * Converts an `Exit` to a result, preserving the latest previous success when the exit is a failure.
187
+ *
188
+ * @category constructors
189
+ * @since 4.0.0
190
+ */
191
+ declare const fromExitWithPrevious: <A, E>(exit: Exit.Exit<A, E>, previous: Option.Option<Result<A, E>>) => Success<A, E> | Failure<A, E>;
192
+ /**
193
+ * Creates a waiting result from an optional previous result, using `Initial(true)` when no previous result exists.
194
+ *
195
+ * @category constructors
196
+ * @since 4.0.0
197
+ */
198
+ declare const waitingFrom: <A, E>(previous: Option.Option<Result<A, E>>) => Result<A, E>;
199
+ /**
200
+ * Returns `true` when an `Result` is in the `Initial` state.
201
+ *
202
+ * @category guards
203
+ * @since 4.0.0
204
+ */
205
+ declare const isInitial: <A, E>(result: Result<A, E>) => result is Initial<A, E>;
206
+ /**
207
+ * Returns `true` when an `Result` is either `Success` or `Failure`.
208
+ *
209
+ * @category guards
210
+ * @since 4.0.0
211
+ */
212
+ declare const isNotInitial: <A, E>(result: Result<A, E>) => result is Success<A, E> | Failure<A, E>;
213
+ /**
214
+ * Returns `true` when an `Result` is a `Success`.
215
+ *
216
+ * @category guards
217
+ * @since 4.0.0
218
+ */
219
+ declare const isSuccess: <A, E>(result: Result<A, E>) => result is Success<A, E>;
220
+ /**
221
+ * Returns `true` when an `Result` is a `Failure`.
222
+ *
223
+ * @category guards
224
+ * @since 4.0.0
225
+ */
226
+ declare const isFailure: <A, E>(result: Result<A, E>) => result is Failure<A, E>;
227
+ /**
228
+ * Returns `true` when an `Result` is a `Failure` whose cause contains only interruptions.
229
+ *
230
+ * @category guards
231
+ * @since 4.0.0
232
+ */
233
+ declare const isInterrupted: <A, E>(result: Result<A, E>) => result is Failure<A, E>;
234
+ /**
235
+ * Creates a `Failure` result from a `Cause`, carrying forward the latest success stored in a previous result.
236
+ *
237
+ * @category constructors
238
+ * @since 4.0.0
239
+ */
240
+ declare const failureWithPrevious: <A, E>(cause: Cause.Cause<E>, options: {
241
+ readonly previous: Option.Option<Result<A, E>>;
242
+ readonly waiting?: boolean | undefined;
243
+ }) => Failure<A, E>;
244
+ /**
245
+ * Creates a `Failure` result from a typed error, wrapping it in `Cause.fail`.
246
+ *
247
+ * @category constructors
248
+ * @since 4.0.0
249
+ */
250
+ declare const fail: <E, A = never>(error: E, options?: {
251
+ readonly previousSuccess?: Option.Option<Success<A, E>> | undefined;
252
+ readonly waiting?: boolean | undefined;
253
+ }) => Failure<A, E>;
254
+ /**
255
+ * Creates a `Failure` result from a typed error while carrying forward the latest success stored in a previous result.
256
+ *
257
+ * @category constructors
258
+ * @since 4.0.0
259
+ */
260
+ declare const failWithPrevious: <A, E>(error: E, options: {
261
+ readonly previous: Option.Option<Result<A, E>>;
262
+ readonly waiting?: boolean | undefined;
263
+ }) => Failure<A, E>;
264
+ /**
265
+ * Marks an `Result` as waiting, optionally touching the timestamp when the result is a `Success`.
266
+ *
267
+ * @category constructors
268
+ * @since 4.0.0
269
+ */
270
+ declare const waiting: <R extends Result<unknown, unknown>>(self: R, options?: {
271
+ readonly touch?: boolean | undefined;
272
+ }) => R;
273
+ /**
274
+ * Refreshes the timestamp of a `Success` result while preserving its value and waiting flag; non-success results are returned unchanged.
275
+ *
276
+ * @category combinators
277
+ * @since 4.0.0
278
+ */
279
+ declare const touch: <A extends Result<unknown, unknown>>(result: A) => A;
280
+ /**
281
+ * Replaces a `Failure` value's stored previous success with the latest success
282
+ * found in another result.
283
+ *
284
+ * @category combinators
285
+ * @since 4.0.0
286
+ */
287
+ declare function replacePrevious<R extends Result<unknown, unknown>, XE, A>(self: R, previous: Option.Option<Result<A, XE>>): With<R, A, Result.Failure<R>>;
288
+ /**
289
+ * Returns the current success value, or the previous success value stored in a failure, as an `Option`.
290
+ *
291
+ * @category accessors
292
+ * @since 4.0.0
293
+ */
294
+ declare const value: <A, E>(self: Result<A, E>) => Option.Option<A>;
295
+ /**
296
+ * Returns the available value from `value`, or evaluates the fallback when no current or previous success exists.
297
+ *
298
+ * @category accessors
299
+ * @since 4.0.0
300
+ */
301
+ declare const getOrElse: {
302
+ <B>(orElse: LazyArg<B>): <A, E>(self: Result<A, E>) => A | B;
303
+ <A, E, B>(self: Result<A, E>, orElse: LazyArg<B>): A | B;
304
+ };
305
+ /**
306
+ * Returns the available value from `value`, or throws `NoSuchElementError` when no current or previous success exists.
307
+ *
308
+ * @category accessors
309
+ * @since 4.0.0
310
+ */
311
+ declare const getOrThrow: <A, E>(self: Result<A, E>) => A;
312
+ /**
313
+ * Returns the failure cause when the result is a `Failure`, otherwise `None`.
314
+ *
315
+ * @category accessors
316
+ * @since 4.0.0
317
+ */
318
+ declare const cause: <A, E>(self: Result<A, E>) => Option.Option<Cause.Cause<E>>;
319
+ /**
320
+ * Returns the first typed error from a failure cause, or `None` for successes, initial results, defects, and interrupt-only causes.
321
+ *
322
+ * @category accessors
323
+ * @since 4.0.0
324
+ */
325
+ declare const error: <A, E>(self: Result<A, E>) => Option.Option<E>;
326
+ /**
327
+ * Converts a result to an `Exit`, succeeding with a success value, failing with a failure cause, or failing with `NoSuchElementError` for `Initial`.
328
+ *
329
+ * @category combinators
330
+ * @since 4.0.0
331
+ */
332
+ declare const toExit: {
333
+ <A, E>(self: Success<A, E> | Failure<A, E>): Exit.Exit<A, E>;
334
+ <A, E>(self: Result<A, E>): Exit.Exit<A, E | Cause.NoSuchElementError>;
335
+ };
336
+ /**
337
+ * Maps the success value of an `Result`, also mapping any previous success stored in a failure while leaving initial results unchanged.
338
+ *
339
+ * @category combinators
340
+ * @since 4.0.0
341
+ */
342
+ declare const map: {
343
+ <A, B>(f: (a: A) => B): <E>(self: Result<A, E>) => Result<B, E>;
344
+ <E, A, B>(self: Result<A, E>, f: (a: A) => B): Result<B, E>;
345
+ };
346
+ /**
347
+ * Maps the success value of an `Result` and flattens the result.
348
+ *
349
+ * **When to use**
350
+ *
351
+ * Use to sequence computations that may return another `Result` while
352
+ * preserving initial and failure states.
353
+ *
354
+ * **Details**
355
+ *
356
+ * Initial results are left unchanged. Failures preserve their cause and remap
357
+ * the stored previous success when the mapping function returns a success.
358
+ *
359
+ * @category combinators
360
+ * @since 4.0.0
361
+ */
362
+ declare const flatMap: {
363
+ <A, E, B, E2>(f: (a: A, prev: Success<A, E>) => Result<B, E2>): (self: Result<A, E>) => Result<B, E | E2>;
364
+ <E, A, B, E2>(self: Result<A, E>, f: (a: A, prev: Success<A, E>) => Result<B, E2>): Result<B, E | E2>;
365
+ };
366
+ /**
367
+ * Pattern matches an `Result` by calling the handler for `Initial`, `Failure`, or `Success`.
368
+ *
369
+ * @category combinators
370
+ * @since 4.0.0
371
+ */
372
+ declare const match: {
373
+ <A, E, X, Y, Z>(options: {
374
+ readonly onInitial: (_: Initial<A, E>) => X;
375
+ readonly onFailure: (_: Failure<A, E>) => Y;
376
+ readonly onSuccess: (_: Success<A, E>) => Z;
377
+ }): (self: Result<A, E>) => X | Y | Z;
378
+ <A, E, X, Y, Z>(self: Result<A, E>, options: {
379
+ readonly onInitial: (_: Initial<A, E>) => X;
380
+ readonly onFailure: (_: Failure<A, E>) => Y;
381
+ readonly onSuccess: (_: Success<A, E>) => Z;
382
+ }): X | Y | Z;
383
+ };
384
+ /**
385
+ * Pattern matches a result, handling successes and initials directly while splitting failures into typed errors or squashed non-error causes passed to `onDefect`.
386
+ *
387
+ * @category combinators
388
+ * @since 4.0.0
389
+ */
390
+ declare const matchWithError: {
391
+ <A, E, W, X, Y, Z>(options: {
392
+ readonly onInitial: (_: Initial<A, E>) => W;
393
+ readonly onError: (error: E, _: Failure<A, E>) => X;
394
+ readonly onDefect: (defect: unknown, _: Failure<A, E>) => Y;
395
+ readonly onSuccess: (_: Success<A, E>) => Z;
396
+ }): (self: Result<A, E>) => W | X | Y | Z;
397
+ <A, E, W, X, Y, Z>(self: Result<A, E>, options: {
398
+ readonly onInitial: (_: Initial<A, E>) => W;
399
+ readonly onError: (error: E, _: Failure<A, E>) => X;
400
+ readonly onDefect: (defect: unknown, _: Failure<A, E>) => Y;
401
+ readonly onSuccess: (_: Success<A, E>) => Z;
402
+ }): W | X | Y | Z;
403
+ };
404
+ /**
405
+ * Pattern matches a result by calling `onWaiting` for waiting or initial states, otherwise handling successes and splitting failures into typed errors or squashed non-error causes.
406
+ *
407
+ * @category combinators
408
+ * @since 4.0.0
409
+ */
410
+ declare const matchWithWaiting: {
411
+ <A, E, W, X, Y, Z>(options: {
412
+ readonly onWaiting: (_: Result<A, E>) => W;
413
+ readonly onError: (error: E, _: Failure<A, E>) => X;
414
+ readonly onDefect: (defect: unknown, _: Failure<A, E>) => Y;
415
+ readonly onSuccess: (_: Success<A, E>) => Z;
416
+ }): (self: Result<A, E>) => W | X | Y | Z;
417
+ <A, E, W, X, Y, Z>(self: Result<A, E>, options: {
418
+ readonly onWaiting: (_: Result<A, E>) => W;
419
+ readonly onError: (error: E, _: Failure<A, E>) => X;
420
+ readonly onDefect: (defect: unknown, _: Failure<A, E>) => Y;
421
+ readonly onSuccess: (_: Success<A, E>) => Z;
422
+ }): W | X | Y | Z;
423
+ };
424
+ /**
425
+ * Combines an iterable or record of `Result` and plain values into one `Result`, returning the first non-success result or a success of the collected values marked waiting when any input success is waiting.
426
+ *
427
+ * @category combinators
428
+ * @since 4.0.0
429
+ */
430
+ type AllSuccess<Arg> = [Arg] extends [readonly unknown[]] ? { -readonly [K in keyof Arg]: [Arg[K]] extends [Result<infer _A, infer _E>] ? _A : Arg[K]; } : [Arg] extends [Iterable<infer _A>] ? _A extends Result<infer _AA, infer _E> ? _AA : _A : [Arg] extends [Record<string, unknown>] ? { -readonly [K in keyof Arg]: [Arg[K]] extends [Result<infer _A, infer _E>] ? _A : Arg[K]; } : never;
431
+ type AllError<Arg> = [Arg] extends [readonly unknown[]] ? Result.Failure<Arg[number]> : [Arg] extends [Iterable<infer _A>] ? Result.Failure<_A> : [Arg] extends [Record<string, unknown>] ? Result.Failure<Arg[keyof Arg]> : never;
432
+ declare function all<const Arg extends Iterable<unknown> | Record<string, unknown>>(results: Arg): Result<AllSuccess<Arg>, AllError<Arg>>;
433
+ type BuilderFor<A extends Result<unknown, unknown>> = Builder<never, A extends Success<infer _A, infer _E> ? _A : never, A extends Failure<infer _A, infer _E> ? _E : never, A extends Initial<infer _A, infer _E> ? true : never, A extends Failure<infer _A, infer _E> ? Defect | Interrupt : never>;
434
+ /**
435
+ * Creates a typed builder for rendering an `Result` by handling waiting, initial, success, error, defect, interrupt, and failure cases.
436
+ *
437
+ * @category constructors
438
+ * @since 4.0.0
439
+ */
440
+ declare function builder<A extends Result<unknown, unknown>>(self: A): BuilderFor<A>;
441
+ /**
442
+ * Type marker used by `Builder` to track whether defect failures still need to be handled.
443
+ *
444
+ * @category utility types
445
+ * @since 4.0.0
446
+ */
447
+ interface Defect {
448
+ readonly _: unique symbol;
449
+ }
450
+ /**
451
+ * Type marker used by `Builder` to track whether interrupt failures still need to be handled.
452
+ *
453
+ * @category utility types
454
+ * @since 4.0.0
455
+ */
456
+ interface Interrupt {
457
+ readonly _: unique symbol;
458
+ }
459
+ /**
460
+ * Fluent renderer for `Result` values that tracks unhandled cases at the type level and exposes `exhaustive` only after all possible cases are handled.
461
+ *
462
+ * @category models
463
+ * @since 4.0.0
464
+ */
465
+ type Builder<Out, A, E, I, F> = Pipeable & {
466
+ onWaiting<B>(f: (result: Result<A, E>) => B): Builder<Out | B, A, E, I, F>;
467
+ orElse<B>(orElse: LazyArg<B>): Out | B;
468
+ orNull(): Out | null;
469
+ render(): [A | I] extends [never] ? Out : Out | null;
470
+ } & ([A | E | I | F] extends [never] ? {
471
+ exhaustive(): Out;
472
+ } : unknown) & ([I] extends [never] ? unknown : {
473
+ onInitial<B>(f: (result: Initial<A, E>) => B): Builder<Out | B, A, E, never, F>;
474
+ onInitialOrWaiting<B>(f: (result: Result<A, E>) => B): Builder<Out | B, A, E, never, F>;
475
+ }) & ([A] extends [never] ? unknown : {
476
+ onSuccess<B>(f: (value: A, result: Success<A, E>) => B): Builder<Out | B, never, E, I, F>;
477
+ }) & ([E] extends [never] ? unknown : {
478
+ onError<B>(f: (error: E, result: Failure<A, E>) => B): Builder<Out | B, A, never, I, F>;
479
+ onErrorIf<B extends E, C>(refinement: Refinement<E, B>, f: (error: B, result: Failure<A, E>) => C): Builder<Out | C, A, Types.EqualsWith<E, B, E, Exclude<E, B>>, I, F>;
480
+ onErrorIf<C>(predicate: Predicate<E>, f: (error: E, result: Failure<A, E>) => C): Builder<Out | C, A, E, I, F>;
481
+ onErrorTag<const Tags extends readonly Types.Tags<E>[], B>(tags: Tags, f: (error: Types.ExtractTag<E, Tags[number]>, result: Failure<A, E>) => B): Builder<Out | B, A, Types.ExcludeTag<E, Tags[number]>, I, F>;
482
+ onErrorTag<const Tag extends Types.Tags<E>, B>(tag: Tag, f: (error: Types.ExtractTag<E, Tag>, result: Failure<A, E>) => B): Builder<Out | B, A, Types.ExcludeTag<E, Tag>, I, F>;
483
+ }) & ([E | F] extends [never] ? unknown : {
484
+ onFailure<B>(f: (cause: Cause.Cause<E>, result: Failure<A, E>) => B): Builder<Out | B, A, never, I, never>;
485
+ }) & (Interrupt extends F ? {
486
+ onInterrupt<B>(f: (interruptors: ReadonlySet<number>, result: Failure<A, E>) => B): Builder<Out | B, A, E, I, Exclude<F, Interrupt>>;
487
+ } : unknown) & (Defect extends F ? {
488
+ onDefect<B>(f: (defect: unknown, result: Failure<A, E>) => B): Builder<Out | B, A, E, I, Exclude<F, Defect>>;
489
+ } : unknown);
490
+ //#endregion
491
+ export { touch as A, failure as B, isWaiting as C, matchWithWaiting as D, matchWithError as E, Failure as F, isResult as H, Initial as I, Result as L, waiting as M, waitingFrom as N, replacePrevious as O, Schema as P, Success as R, isSuccess as S, match as T, success as U, initial as V, getOrThrow as _, With as a, isInterrupted as b, cause as c, failWithPrevious as d, failureWithPrevious as f, getOrElse as g, fromExitWithPrevious as h, Result_d_exports as i, value as j, toExit as k, error as l, fromExit as m, Defect as n, all as o, flatMap as p, Interrupt as r, builder as s, Builder as t, fail as u, isFailure as v, map as w, isNotInitial as x, isInitial as y, TypeId as z };