effect 3.15.4 → 3.16.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/ExecutionPlan/package.json +6 -0
- package/dist/cjs/Array.js +67 -5
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/BigDecimal.js +150 -1
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/Chunk.js +16 -3
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Config.js +16 -2
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Effect.js +31 -3
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/ExecutionPlan.js +108 -0
- package/dist/cjs/ExecutionPlan.js.map +1 -0
- package/dist/cjs/HashMap.js +18 -1
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/Iterable.js +27 -1
- package/dist/cjs/Iterable.js.map +1 -1
- package/dist/cjs/LayerMap.js +86 -64
- package/dist/cjs/LayerMap.js.map +1 -1
- package/dist/cjs/Schedule.js +7 -1
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/Stream.js +15 -2
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/config.js +18 -1
- package/dist/cjs/internal/config.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +1 -4
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/executionPlan.js +68 -0
- package/dist/cjs/internal/executionPlan.js.map +1 -0
- package/dist/cjs/internal/hashMap.js +3 -1
- package/dist/cjs/internal/hashMap.js.map +1 -1
- package/dist/cjs/internal/metric/polling.js +3 -4
- package/dist/cjs/internal/metric/polling.js.map +1 -1
- package/dist/cjs/internal/schedule.js +66 -25
- package/dist/cjs/internal/schedule.js.map +1 -1
- package/dist/cjs/internal/stream.js +60 -10
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Array.d.ts +110 -0
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/BigDecimal.d.ts +235 -0
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +13 -0
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +38 -1
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +99 -27
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/ExecutionPlan.d.ts +213 -0
- package/dist/dts/ExecutionPlan.d.ts.map +1 -0
- package/dist/dts/HashMap.d.ts +52 -0
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/Iterable.d.ts +49 -0
- package/dist/dts/Iterable.d.ts.map +1 -1
- package/dist/dts/LayerMap.d.ts +79 -72
- package/dist/dts/LayerMap.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +26 -0
- package/dist/dts/Schedule.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +57 -2
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/index.d.ts +5 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/executionPlan.d.ts +2 -0
- package/dist/dts/internal/executionPlan.d.ts.map +1 -0
- package/dist/dts/internal/hashMap.d.ts.map +1 -1
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/Array.js +65 -3
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/BigDecimal.js +148 -0
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/Chunk.js +15 -2
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Config.js +15 -1
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Effect.js +29 -1
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/ExecutionPlan.js +99 -0
- package/dist/esm/ExecutionPlan.js.map +1 -0
- package/dist/esm/HashMap.js +17 -0
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/Iterable.js +26 -0
- package/dist/esm/Iterable.js.map +1 -1
- package/dist/esm/LayerMap.js +86 -64
- package/dist/esm/LayerMap.js.map +1 -1
- package/dist/esm/Schedule.js +5 -0
- package/dist/esm/Schedule.js.map +1 -1
- package/dist/esm/Stream.js +13 -0
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/config.js +16 -0
- package/dist/esm/internal/config.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +0 -3
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/executionPlan.js +59 -0
- package/dist/esm/internal/executionPlan.js.map +1 -0
- package/dist/esm/internal/hashMap.js +2 -0
- package/dist/esm/internal/hashMap.js.map +1 -1
- package/dist/esm/internal/metric/polling.js +3 -4
- package/dist/esm/internal/metric/polling.js.map +1 -1
- package/dist/esm/internal/schedule.js +61 -23
- package/dist/esm/internal/schedule.js.map +1 -1
- package/dist/esm/internal/stream.js +57 -7
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +9 -1
- package/src/Array.ts +147 -4
- package/src/BigDecimal.ts +355 -0
- package/src/Chunk.ts +28 -3
- package/src/Config.ts +40 -1
- package/src/Effect.ts +145 -36
- package/src/ExecutionPlan.ts +302 -0
- package/src/HashMap.ts +56 -0
- package/src/Iterable.ts +66 -0
- package/src/LayerMap.ts +126 -114
- package/src/Schedule.ts +32 -0
- package/src/Stream.ts +51 -2
- package/src/index.ts +6 -0
- package/src/internal/config.ts +55 -0
- package/src/internal/effect/circular.ts +0 -15
- package/src/internal/executionPlan.ts +114 -0
- package/src/internal/hashMap.ts +6 -0
- package/src/internal/metric/polling.ts +3 -4
- package/src/internal/schedule.ts +169 -50
- package/src/internal/stream.ts +140 -15
- package/src/internal/version.ts +1 -1
package/src/Effect.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type * as Deferred from "./Deferred.js"
|
|
|
12
12
|
import type * as Duration from "./Duration.js"
|
|
13
13
|
import type * as Either from "./Either.js"
|
|
14
14
|
import type { Equivalence } from "./Equivalence.js"
|
|
15
|
+
import type { ExecutionPlan } from "./ExecutionPlan.js"
|
|
15
16
|
import type { ExecutionStrategy } from "./ExecutionStrategy.js"
|
|
16
17
|
import type * as Exit from "./Exit.js"
|
|
17
18
|
import type * as Fiber from "./Fiber.js"
|
|
@@ -32,6 +33,7 @@ import * as effect from "./internal/core-effect.js"
|
|
|
32
33
|
import * as core from "./internal/core.js"
|
|
33
34
|
import * as defaultServices from "./internal/defaultServices.js"
|
|
34
35
|
import * as circular from "./internal/effect/circular.js"
|
|
36
|
+
import * as internalExecutionPlan from "./internal/executionPlan.js"
|
|
35
37
|
import * as fiberRuntime from "./internal/fiberRuntime.js"
|
|
36
38
|
import * as layer from "./internal/layer.js"
|
|
37
39
|
import * as option_ from "./internal/option.js"
|
|
@@ -253,6 +255,15 @@ export declare namespace Effect {
|
|
|
253
255
|
* @category Effect Type Extractors
|
|
254
256
|
*/
|
|
255
257
|
export type Success<T extends Effect<any, any, any>> = [T] extends [Effect<infer _A, infer _E, infer _R>] ? _A : never
|
|
258
|
+
/**
|
|
259
|
+
* @since 3.15.5
|
|
260
|
+
* @category Effect Type Extractors
|
|
261
|
+
*/
|
|
262
|
+
export type AsEffect<T extends Effect<any, any, any>> = Effect<
|
|
263
|
+
T extends Effect<infer _A, infer _E, infer _R> ? _A : never,
|
|
264
|
+
T extends Effect<infer _A, infer _E, infer _R> ? _E : never,
|
|
265
|
+
T extends Effect<infer _A, infer _E, infer _R> ? _R : never
|
|
266
|
+
>
|
|
256
267
|
}
|
|
257
268
|
|
|
258
269
|
/**
|
|
@@ -8111,9 +8122,7 @@ export const retry: {
|
|
|
8111
8122
|
* @since 2.0.0
|
|
8112
8123
|
* @category Error handling
|
|
8113
8124
|
*/
|
|
8114
|
-
<E, O extends NoExcessProperties<Retry.Options<E>, O>>(options: O): <A, R>(
|
|
8115
|
-
self: Effect<A, E, R>
|
|
8116
|
-
) => Retry.Return<R, E, A, O>
|
|
8125
|
+
<E, O extends NoExcessProperties<Retry.Options<E>, O>>(options: O): <A, R>(self: Effect<A, E, R>) => Retry.Return<R, E, A, O>
|
|
8117
8126
|
/**
|
|
8118
8127
|
* Retries a failing effect based on a defined retry policy.
|
|
8119
8128
|
*
|
|
@@ -8470,9 +8479,43 @@ export const retry: {
|
|
|
8470
8479
|
* @since 2.0.0
|
|
8471
8480
|
* @category Error handling
|
|
8472
8481
|
*/
|
|
8473
|
-
<A, E, R, B, R1>(self: Effect<A, E, R>, policy: Schedule.Schedule<B, E
|
|
8482
|
+
<A, E, R, B, R1>(self: Effect<A, E, R>, policy: Schedule.Schedule<B, NoInfer<E>, R1>): Effect<A, E, R1 | R>
|
|
8474
8483
|
} = schedule_.retry_combined
|
|
8475
8484
|
|
|
8485
|
+
/**
|
|
8486
|
+
* Apply an `ExecutionPlan` to the effect, which allows you to fallback to
|
|
8487
|
+
* different resources in case of failure.
|
|
8488
|
+
*
|
|
8489
|
+
* @since 3.16.0
|
|
8490
|
+
* @category Error handling
|
|
8491
|
+
* @experimental
|
|
8492
|
+
*/
|
|
8493
|
+
export const withExecutionPlan: {
|
|
8494
|
+
/**
|
|
8495
|
+
* Apply an `ExecutionPlan` to the effect, which allows you to fallback to
|
|
8496
|
+
* different resources in case of failure.
|
|
8497
|
+
*
|
|
8498
|
+
* @since 3.16.0
|
|
8499
|
+
* @category Error handling
|
|
8500
|
+
* @experimental
|
|
8501
|
+
*/
|
|
8502
|
+
<Input, Provides, PlanE, PlanR>(
|
|
8503
|
+
plan: ExecutionPlan<{ provides: Provides; input: Input; error: PlanE; requirements: PlanR }>
|
|
8504
|
+
): <A, E extends Input, R>(effect: Effect<A, E, R>) => Effect<A, E | PlanE, Exclude<R, Provides> | PlanR>
|
|
8505
|
+
/**
|
|
8506
|
+
* Apply an `ExecutionPlan` to the effect, which allows you to fallback to
|
|
8507
|
+
* different resources in case of failure.
|
|
8508
|
+
*
|
|
8509
|
+
* @since 3.16.0
|
|
8510
|
+
* @category Error handling
|
|
8511
|
+
* @experimental
|
|
8512
|
+
*/
|
|
8513
|
+
<A, E extends Input, R, Provides, Input, PlanE, PlanR>(
|
|
8514
|
+
effect: Effect<A, E, R>,
|
|
8515
|
+
plan: ExecutionPlan<{ provides: Provides; input: Input; error: PlanE; requirements: PlanR }>
|
|
8516
|
+
): Effect<A, E | PlanE, Exclude<R, Provides> | PlanR>
|
|
8517
|
+
} = internalExecutionPlan.withExecutionPlan
|
|
8518
|
+
|
|
8476
8519
|
/**
|
|
8477
8520
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
8478
8521
|
*
|
|
@@ -22262,7 +22305,7 @@ export const scheduleForked: {
|
|
|
22262
22305
|
* @category Repetition / Recursion
|
|
22263
22306
|
*/
|
|
22264
22307
|
<A, E, R, Out, R2>(self: Effect<A, E, R>, schedule: Schedule.Schedule<Out, unknown, R2>): Effect<Fiber.RuntimeFiber<Out, E>, never, Scope.Scope | R | R2>
|
|
22265
|
-
} =
|
|
22308
|
+
} = schedule_.scheduleForked
|
|
22266
22309
|
|
|
22267
22310
|
/**
|
|
22268
22311
|
* Runs an effect repeatedly according to a schedule, starting from a specified
|
|
@@ -27753,14 +27796,18 @@ export const Service: <Self = never>() => [Self] extends [never] ? MissingSelfGe
|
|
|
27753
27796
|
const Key extends string,
|
|
27754
27797
|
const Make extends
|
|
27755
27798
|
| {
|
|
27756
|
-
readonly scoped:
|
|
27799
|
+
readonly scoped:
|
|
27800
|
+
| Effect<Service.AllowedType<Key, Make>, any, any>
|
|
27801
|
+
| ((...args: any) => Effect<Service.AllowedType<Key, Make>, any, any>)
|
|
27757
27802
|
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
|
|
27758
27803
|
readonly accessors?: boolean
|
|
27759
27804
|
/** @deprecated */
|
|
27760
27805
|
readonly ಠ_ಠ: never
|
|
27761
27806
|
}
|
|
27762
27807
|
| {
|
|
27763
|
-
readonly effect:
|
|
27808
|
+
readonly effect:
|
|
27809
|
+
| Effect<Service.AllowedType<Key, Make>, any, any>
|
|
27810
|
+
| ((...args: any) => Effect<Service.AllowedType<Key, Make>, any, any>)
|
|
27764
27811
|
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
|
|
27765
27812
|
readonly accessors?: boolean
|
|
27766
27813
|
/** @deprecated */
|
|
@@ -27787,7 +27834,9 @@ export const Service: <Self = never>() => [Self] extends [never] ? MissingSelfGe
|
|
|
27787
27834
|
<
|
|
27788
27835
|
const Key extends string,
|
|
27789
27836
|
const Make extends NoExcessProperties<{
|
|
27790
|
-
readonly scoped:
|
|
27837
|
+
readonly scoped:
|
|
27838
|
+
| Effect<Service.AllowedType<Key, Make>, any, any>
|
|
27839
|
+
| ((...args: any) => Effect<Service.AllowedType<Key, Make>, any, any>)
|
|
27791
27840
|
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
|
|
27792
27841
|
readonly accessors?: boolean
|
|
27793
27842
|
}, Make>
|
|
@@ -27798,7 +27847,9 @@ export const Service: <Self = never>() => [Self] extends [never] ? MissingSelfGe
|
|
|
27798
27847
|
<
|
|
27799
27848
|
const Key extends string,
|
|
27800
27849
|
const Make extends NoExcessProperties<{
|
|
27801
|
-
readonly effect:
|
|
27850
|
+
readonly effect:
|
|
27851
|
+
| Effect<Service.AllowedType<Key, Make>, any, any>
|
|
27852
|
+
| ((...args: any) => Effect<Service.AllowedType<Key, Make>, any, any>)
|
|
27802
27853
|
readonly dependencies?: ReadonlyArray<Layer.Layer.Any>
|
|
27803
27854
|
readonly accessors?: boolean
|
|
27804
27855
|
}, Make>
|
|
@@ -27881,15 +27932,28 @@ export const Service: <Self = never>() => [Self] extends [never] ? MissingSelfGe
|
|
|
27881
27932
|
const hasDeps = "dependencies" in maker && maker.dependencies.length > 0
|
|
27882
27933
|
const layerName = hasDeps ? "DefaultWithoutDependencies" : "Default"
|
|
27883
27934
|
let layerCache: Layer.Layer.Any | undefined
|
|
27935
|
+
let isFunction = false
|
|
27884
27936
|
if ("effect" in maker) {
|
|
27937
|
+
isFunction = typeof maker.effect === "function"
|
|
27885
27938
|
Object.defineProperty(TagClass, layerName, {
|
|
27886
27939
|
get(this: any) {
|
|
27940
|
+
if (isFunction) {
|
|
27941
|
+
return function(this: typeof TagClass) {
|
|
27942
|
+
return layer.fromEffect(TagClass, map(maker.effect.apply(null, arguments), (_) => new this(_)))
|
|
27943
|
+
}.bind(this)
|
|
27944
|
+
}
|
|
27887
27945
|
return layerCache ??= layer.fromEffect(TagClass, map(maker.effect, (_) => new this(_)))
|
|
27888
27946
|
}
|
|
27889
27947
|
})
|
|
27890
27948
|
} else if ("scoped" in maker) {
|
|
27949
|
+
isFunction = typeof maker.scoped === "function"
|
|
27891
27950
|
Object.defineProperty(TagClass, layerName, {
|
|
27892
27951
|
get(this: any) {
|
|
27952
|
+
if (isFunction) {
|
|
27953
|
+
return function(this: typeof TagClass) {
|
|
27954
|
+
return layer.scoped(TagClass, map(maker.scoped.apply(null, arguments), (_) => new this(_)))
|
|
27955
|
+
}.bind(this)
|
|
27956
|
+
}
|
|
27893
27957
|
return layerCache ??= layer.scoped(TagClass, map(maker.scoped, (_) => new this(_)))
|
|
27894
27958
|
}
|
|
27895
27959
|
})
|
|
@@ -27911,6 +27975,14 @@ export const Service: <Self = never>() => [Self] extends [never] ? MissingSelfGe
|
|
|
27911
27975
|
let layerWithDepsCache: Layer.Layer.Any | undefined
|
|
27912
27976
|
Object.defineProperty(TagClass, "Default", {
|
|
27913
27977
|
get(this: any) {
|
|
27978
|
+
if (isFunction) {
|
|
27979
|
+
return function(this: typeof TagClass) {
|
|
27980
|
+
return layer.provide(
|
|
27981
|
+
this.DefaultWithoutDependencies.apply(null, arguments),
|
|
27982
|
+
maker.dependencies
|
|
27983
|
+
)
|
|
27984
|
+
}
|
|
27985
|
+
}
|
|
27914
27986
|
return layerWithDepsCache ??= layer.provide(
|
|
27915
27987
|
this.DefaultWithoutDependencies,
|
|
27916
27988
|
maker.dependencies
|
|
@@ -27983,16 +28055,27 @@ export declare namespace Service {
|
|
|
27983
28055
|
& { key: Key }
|
|
27984
28056
|
& (MakeAccessors<Make> extends true ? Tag.Proxy<Self, MakeService<Make>> : {})
|
|
27985
28057
|
& (MakeDeps<Make> extends never ? {
|
|
27986
|
-
readonly Default:
|
|
28058
|
+
readonly Default: HasArguments<Make> extends true ?
|
|
28059
|
+
(...args: MakeArguments<Make>) => Layer.Layer<Self, MakeError<Make>, MakeContext<Make>>
|
|
28060
|
+
: Layer.Layer<Self, MakeError<Make>, MakeContext<Make>>
|
|
27987
28061
|
} :
|
|
27988
28062
|
{
|
|
27989
|
-
readonly DefaultWithoutDependencies:
|
|
27990
|
-
|
|
27991
|
-
Self,
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
28063
|
+
readonly DefaultWithoutDependencies: HasArguments<Make> extends true
|
|
28064
|
+
? (...args: MakeArguments<Make>) => Layer.Layer<Self, MakeError<Make>, MakeContext<Make>>
|
|
28065
|
+
: Layer.Layer<Self, MakeError<Make>, MakeContext<Make>>
|
|
28066
|
+
|
|
28067
|
+
readonly Default: HasArguments<Make> extends true ? (...args: MakeArguments<Make>) => Layer.Layer<
|
|
28068
|
+
Self,
|
|
28069
|
+
MakeError<Make> | MakeDepsE<Make>,
|
|
28070
|
+
| Exclude<MakeContext<Make>, MakeDepsOut<Make>>
|
|
28071
|
+
| MakeDepsIn<Make>
|
|
28072
|
+
> :
|
|
28073
|
+
Layer.Layer<
|
|
28074
|
+
Self,
|
|
28075
|
+
MakeError<Make> | MakeDepsE<Make>,
|
|
28076
|
+
| Exclude<MakeContext<Make>, MakeDepsOut<Make>>
|
|
28077
|
+
| MakeDepsIn<Make>
|
|
28078
|
+
>
|
|
27996
28079
|
})
|
|
27997
28080
|
|
|
27998
28081
|
/**
|
|
@@ -28000,6 +28083,8 @@ export declare namespace Service {
|
|
|
28000
28083
|
*/
|
|
28001
28084
|
export type MakeService<Make> = Make extends { readonly effect: Effect<infer _A, infer _E, infer _R> } ? _A
|
|
28002
28085
|
: Make extends { readonly scoped: Effect<infer _A, infer _E, infer _R> } ? _A
|
|
28086
|
+
: Make extends { readonly effect: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ? _A
|
|
28087
|
+
: Make extends { readonly scoped: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ? _A
|
|
28003
28088
|
: Make extends { readonly sync: LazyArg<infer A> } ? A
|
|
28004
28089
|
: Make extends { readonly succeed: infer A } ? A
|
|
28005
28090
|
: never
|
|
@@ -28009,6 +28094,8 @@ export declare namespace Service {
|
|
|
28009
28094
|
*/
|
|
28010
28095
|
export type MakeError<Make> = Make extends { readonly effect: Effect<infer _A, infer _E, infer _R> } ? _E
|
|
28011
28096
|
: Make extends { readonly scoped: Effect<infer _A, infer _E, infer _R> } ? _E
|
|
28097
|
+
: Make extends { readonly effect: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ? _E
|
|
28098
|
+
: Make extends { readonly scoped: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ? _E
|
|
28012
28099
|
: never
|
|
28013
28100
|
|
|
28014
28101
|
/**
|
|
@@ -28016,6 +28103,9 @@ export declare namespace Service {
|
|
|
28016
28103
|
*/
|
|
28017
28104
|
export type MakeContext<Make> = Make extends { readonly effect: Effect<infer _A, infer _E, infer _R> } ? _R
|
|
28018
28105
|
: Make extends { readonly scoped: Effect<infer _A, infer _E, infer _R> } ? Exclude<_R, Scope.Scope>
|
|
28106
|
+
: Make extends { readonly effect: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ? _R
|
|
28107
|
+
: Make extends { readonly scoped: (...args: infer _Args) => Effect<infer _A, infer _E, infer _R> } ?
|
|
28108
|
+
Exclude<_R, Scope.Scope>
|
|
28019
28109
|
: never
|
|
28020
28110
|
|
|
28021
28111
|
/**
|
|
@@ -28045,6 +28135,25 @@ export declare namespace Service {
|
|
|
28045
28135
|
*/
|
|
28046
28136
|
export type MakeAccessors<Make> = Make extends { readonly accessors: true } ? true
|
|
28047
28137
|
: false
|
|
28138
|
+
|
|
28139
|
+
/**
|
|
28140
|
+
* @since 3.16.0
|
|
28141
|
+
*/
|
|
28142
|
+
export type MakeArguments<Make> = Make extends
|
|
28143
|
+
{ readonly effect: (...args: infer Args) => Effect<infer _A, infer _E, infer _R> } ? Args
|
|
28144
|
+
: Make extends { readonly scoped: (...args: infer Args) => Effect<infer _A, infer _E, infer _R> } ? Args
|
|
28145
|
+
: never
|
|
28146
|
+
|
|
28147
|
+
/**
|
|
28148
|
+
* @since 3.16.0
|
|
28149
|
+
*/
|
|
28150
|
+
export type HasArguments<Make> = Make extends {
|
|
28151
|
+
readonly scoped: (...args: ReadonlyArray<any>) => Effect<infer _A, infer _E, infer _R>
|
|
28152
|
+
} ? true :
|
|
28153
|
+
Make extends {
|
|
28154
|
+
readonly effect: (...args: ReadonlyArray<any>) => Effect<infer _A, infer _E, infer _R>
|
|
28155
|
+
} ? true :
|
|
28156
|
+
false
|
|
28048
28157
|
}
|
|
28049
28158
|
|
|
28050
28159
|
/**
|
|
@@ -28080,7 +28189,7 @@ export namespace fn {
|
|
|
28080
28189
|
>,
|
|
28081
28190
|
...args: NoInfer<Args>
|
|
28082
28191
|
) => A
|
|
28083
|
-
): (this: Self, ...args: Args) => A
|
|
28192
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<A>
|
|
28084
28193
|
<
|
|
28085
28194
|
Self,
|
|
28086
28195
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28099,7 +28208,7 @@ export namespace fn {
|
|
|
28099
28208
|
...args: NoInfer<Args>
|
|
28100
28209
|
) => A,
|
|
28101
28210
|
b: (_: A, ...args: NoInfer<Args>) => B
|
|
28102
|
-
): (this: Self, ...args: Args) => B
|
|
28211
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<B>
|
|
28103
28212
|
<
|
|
28104
28213
|
Self,
|
|
28105
28214
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28120,7 +28229,7 @@ export namespace fn {
|
|
|
28120
28229
|
) => A,
|
|
28121
28230
|
b: (_: A, ...args: NoInfer<Args>) => B,
|
|
28122
28231
|
c: (_: B, ...args: NoInfer<Args>) => C
|
|
28123
|
-
): (this: Self, ...args: Args) => C
|
|
28232
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<C>
|
|
28124
28233
|
<
|
|
28125
28234
|
Self,
|
|
28126
28235
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28143,7 +28252,7 @@ export namespace fn {
|
|
|
28143
28252
|
b: (_: A, ...args: NoInfer<Args>) => B,
|
|
28144
28253
|
c: (_: B, ...args: NoInfer<Args>) => C,
|
|
28145
28254
|
d: (_: C, ...args: NoInfer<Args>) => D
|
|
28146
|
-
): (this: Self, ...args: Args) => D
|
|
28255
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<D>
|
|
28147
28256
|
<
|
|
28148
28257
|
Self,
|
|
28149
28258
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28168,7 +28277,7 @@ export namespace fn {
|
|
|
28168
28277
|
c: (_: B, ...args: NoInfer<Args>) => C,
|
|
28169
28278
|
d: (_: C, ...args: NoInfer<Args>) => D,
|
|
28170
28279
|
e: (_: D, ...args: NoInfer<Args>) => E
|
|
28171
|
-
): (this: Self, ...args: Args) => E
|
|
28280
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<E>
|
|
28172
28281
|
<
|
|
28173
28282
|
Self,
|
|
28174
28283
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28195,7 +28304,7 @@ export namespace fn {
|
|
|
28195
28304
|
d: (_: C, ...args: NoInfer<Args>) => D,
|
|
28196
28305
|
e: (_: D, ...args: NoInfer<Args>) => E,
|
|
28197
28306
|
f: (_: E, ...args: NoInfer<Args>) => F
|
|
28198
|
-
): (this: Self, ...args: Args) => F
|
|
28307
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<F>
|
|
28199
28308
|
<
|
|
28200
28309
|
Self,
|
|
28201
28310
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28224,7 +28333,7 @@ export namespace fn {
|
|
|
28224
28333
|
e: (_: D, ...args: NoInfer<Args>) => E,
|
|
28225
28334
|
f: (_: E, ...args: NoInfer<Args>) => F,
|
|
28226
28335
|
g: (_: F, ...args: NoInfer<Args>) => G
|
|
28227
|
-
): (this: Self, ...args: Args) => G
|
|
28336
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<G>
|
|
28228
28337
|
<
|
|
28229
28338
|
Self,
|
|
28230
28339
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28255,7 +28364,7 @@ export namespace fn {
|
|
|
28255
28364
|
f: (_: E, ...args: NoInfer<Args>) => F,
|
|
28256
28365
|
g: (_: F, ...args: NoInfer<Args>) => G,
|
|
28257
28366
|
h: (_: G, ...args: NoInfer<Args>) => H
|
|
28258
|
-
): (this: Self, ...args: Args) => H
|
|
28367
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<H>
|
|
28259
28368
|
<
|
|
28260
28369
|
Self,
|
|
28261
28370
|
Eff extends YieldWrap<Effect<any, any, any>>,
|
|
@@ -28288,7 +28397,7 @@ export namespace fn {
|
|
|
28288
28397
|
g: (_: F, ...args: NoInfer<Args>) => G,
|
|
28289
28398
|
h: (_: G, ...args: NoInfer<Args>) => H,
|
|
28290
28399
|
i: (_: H, ...args: NoInfer<Args>) => I
|
|
28291
|
-
): (this: Self, ...args: Args) => I
|
|
28400
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<I>
|
|
28292
28401
|
}
|
|
28293
28402
|
|
|
28294
28403
|
/**
|
|
@@ -28298,29 +28407,29 @@ export namespace fn {
|
|
|
28298
28407
|
export type NonGen = {
|
|
28299
28408
|
<Self, Eff extends Effect<any, any, any>, Args extends Array<any>>(
|
|
28300
28409
|
body: (this: Self, ...args: Args) => Eff
|
|
28301
|
-
): (this: Self, ...args: Args) => Eff
|
|
28410
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28302
28411
|
<Self, Eff extends Effect<any, any, any>, A, Args extends Array<any>>(
|
|
28303
28412
|
body: (this: Self, ...args: Args) => A,
|
|
28304
28413
|
a: (_: A, ...args: NoInfer<Args>) => Eff
|
|
28305
|
-
): (this: Self, ...args: Args) => Eff
|
|
28414
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28306
28415
|
<Self, Eff extends Effect<any, any, any>, A, B, Args extends Array<any>>(
|
|
28307
28416
|
body: (this: Self, ...args: Args) => A,
|
|
28308
28417
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
28309
28418
|
b: (_: B, ...args: NoInfer<Args>) => Eff
|
|
28310
|
-
): (this: Self, ...args: Args) => Eff
|
|
28419
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28311
28420
|
<Self, Eff extends Effect<any, any, any>, A, B, C, Args extends Array<any>>(
|
|
28312
28421
|
body: (this: Self, ...args: Args) => A,
|
|
28313
28422
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
28314
28423
|
b: (_: B, ...args: NoInfer<Args>) => C,
|
|
28315
28424
|
c: (_: C, ...args: NoInfer<Args>) => Eff
|
|
28316
|
-
): (this: Self, ...args: Args) => Eff
|
|
28425
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28317
28426
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, Args extends Array<any>>(
|
|
28318
28427
|
body: (this: Self, ...args: Args) => A,
|
|
28319
28428
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
28320
28429
|
b: (_: B, ...args: NoInfer<Args>) => C,
|
|
28321
28430
|
c: (_: C, ...args: NoInfer<Args>) => D,
|
|
28322
28431
|
d: (_: D, ...args: NoInfer<Args>) => Eff
|
|
28323
|
-
): (this: Self, ...args: Args) => Eff
|
|
28432
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28324
28433
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, E, Args extends Array<any>>(
|
|
28325
28434
|
body: (this: Self, ...args: Args) => A,
|
|
28326
28435
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
@@ -28328,7 +28437,7 @@ export namespace fn {
|
|
|
28328
28437
|
c: (_: C, ...args: NoInfer<Args>) => D,
|
|
28329
28438
|
d: (_: D, ...args: NoInfer<Args>) => E,
|
|
28330
28439
|
e: (_: E, ...args: NoInfer<Args>) => Eff
|
|
28331
|
-
): (this: Self, ...args: Args) => Eff
|
|
28440
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28332
28441
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, E, F, Args extends Array<any>>(
|
|
28333
28442
|
body: (this: Self, ...args: Args) => A,
|
|
28334
28443
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
@@ -28337,7 +28446,7 @@ export namespace fn {
|
|
|
28337
28446
|
d: (_: D, ...args: NoInfer<Args>) => E,
|
|
28338
28447
|
e: (_: E, ...args: NoInfer<Args>) => F,
|
|
28339
28448
|
f: (_: F, ...args: NoInfer<Args>) => Eff
|
|
28340
|
-
): (this: Self, ...args: Args) => Eff
|
|
28449
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28341
28450
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, Args extends Array<any>>(
|
|
28342
28451
|
body: (this: Self, ...args: Args) => A,
|
|
28343
28452
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
@@ -28347,7 +28456,7 @@ export namespace fn {
|
|
|
28347
28456
|
e: (_: E, ...args: NoInfer<Args>) => F,
|
|
28348
28457
|
f: (_: F, ...args: NoInfer<Args>) => G,
|
|
28349
28458
|
g: (_: G, ...args: NoInfer<Args>) => Eff
|
|
28350
|
-
): (this: Self, ...args: Args) => Eff
|
|
28459
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28351
28460
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, H, Args extends Array<any>>(
|
|
28352
28461
|
body: (this: Self, ...args: Args) => A,
|
|
28353
28462
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
@@ -28358,7 +28467,7 @@ export namespace fn {
|
|
|
28358
28467
|
f: (_: F, ...args: NoInfer<Args>) => G,
|
|
28359
28468
|
g: (_: G, ...args: NoInfer<Args>) => H,
|
|
28360
28469
|
h: (_: H, ...args: NoInfer<Args>) => Eff
|
|
28361
|
-
): (this: Self, ...args: Args) => Eff
|
|
28470
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28362
28471
|
<Self, Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, H, I, Args extends Array<any>>(
|
|
28363
28472
|
body: (this: Self, ...args: Args) => A,
|
|
28364
28473
|
a: (_: A, ...args: NoInfer<Args>) => B,
|
|
@@ -28370,7 +28479,7 @@ export namespace fn {
|
|
|
28370
28479
|
g: (_: G, ...args: NoInfer<Args>) => H,
|
|
28371
28480
|
h: (_: H, ...args: NoInfer<Args>) => I,
|
|
28372
28481
|
i: (_: H, ...args: NoInfer<Args>) => Eff
|
|
28373
|
-
): (this: Self, ...args: Args) => Eff
|
|
28482
|
+
): (this: Self, ...args: Args) => Effect.AsEffect<Eff>
|
|
28374
28483
|
}
|
|
28375
28484
|
|
|
28376
28485
|
/**
|