@effect-app/vue 2.52.0 → 2.52.2
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 +12 -0
- package/dist/experimental/makeExperimental.d.ts +12 -51
- package/dist/experimental/makeExperimental.d.ts.map +1 -1
- package/dist/experimental/useCommand.d.ts +17 -51
- package/dist/experimental/useCommand.d.ts.map +1 -1
- package/dist/experimental/useCommand.js +84 -47
- package/dist/mutate.js +1 -1
- package/package.json +1 -1
- package/src/experimental/useCommand.ts +120 -72
- package/src/mutate.ts +1 -1
- package/test/Mutation.test.ts +324 -2
- package/test/dist/stubs.d.ts +12 -51
- package/test/dist/stubs.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @effect-app/vue
|
|
2
2
|
|
|
3
|
+
## 2.52.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ff81b46: fix typo
|
|
8
|
+
|
|
9
|
+
## 2.52.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 5157716: improve experimental, fix span stack, add alt implementation for useCommand.
|
|
14
|
+
|
|
3
15
|
## 2.52.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -10,58 +10,19 @@ export declare const makeExperimental: <Locale extends string, R>(_useIntl: Make
|
|
|
10
10
|
confirmOrInterrupt: (message?: string | undefined) => import("effect/Effect").Effect<void, never, import("./useCommand.js").CommandContext>;
|
|
11
11
|
withDefaultToast: <A, E>(self: import("effect/Effect").Effect<A, E, import("./useCommand.js").CommandContext>, errorRenderer?: ((e: E) => string | undefined) | undefined) => import("effect/Effect").Effect<A, E, import("./useCommand.js").CommandContext>;
|
|
12
12
|
fn: (actionName: string) => {
|
|
13
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: import("effect/Effect").Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): import("vue").ComputedRef<((...a: Args_2) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>, never>) & {
|
|
24
|
-
action: string;
|
|
25
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>;
|
|
26
|
-
waiting: boolean;
|
|
27
|
-
}>;
|
|
28
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: import("effect/Effect").Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): import("vue").ComputedRef<((...a: Args_3) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>, never>) & {
|
|
29
|
-
action: string;
|
|
30
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>;
|
|
31
|
-
waiting: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: import("effect/Effect").Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): import("vue").ComputedRef<((...a: Args_4) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>, never>) & {
|
|
34
|
-
action: string;
|
|
35
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>;
|
|
36
|
-
waiting: boolean;
|
|
37
|
-
}>;
|
|
38
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_1 extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: import("effect/Effect").Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_2, infer _R>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_1): import("vue").ComputedRef<((...a: Args_5) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>, never>) & {
|
|
39
|
-
action: string;
|
|
40
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>;
|
|
41
|
-
waiting: boolean;
|
|
42
|
-
}>;
|
|
43
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_2, F extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: import("effect/Effect").Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_3, infer _R>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_2, f: (_: E_2) => F): import("vue").ComputedRef<((...a: Args_6) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>, never>) & {
|
|
44
|
-
action: string;
|
|
45
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>;
|
|
46
|
-
waiting: boolean;
|
|
47
|
-
}>;
|
|
48
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_3, F_1, G extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: import("effect/Effect").Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_4, infer _R>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_3, f: (_: E_3) => F_1, g: (_: F_1) => G): import("vue").ComputedRef<((...a: Args_7) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>, never>) & {
|
|
49
|
-
action: string;
|
|
50
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>;
|
|
51
|
-
waiting: boolean;
|
|
52
|
-
}>;
|
|
53
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_4, F_2, G_1, H extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: import("effect/Effect").Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_5, infer _R>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_4, f: (_: E_4) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): import("vue").ComputedRef<((...a: Args_8) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>, never>) & {
|
|
54
|
-
action: string;
|
|
55
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>;
|
|
56
|
-
waiting: boolean;
|
|
57
|
-
}>;
|
|
58
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_5, F_3, G_2, H_1, I extends import("effect/Effect").Effect<any, any, import("./useCommand.js").CommandContext | R>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: import("effect/Effect").Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_6, infer _R>>] ? E_6 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_5, f: (_: E_5) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): import("vue").ComputedRef<((...a: Args_9) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>, never>) & {
|
|
59
|
-
action: string;
|
|
60
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>;
|
|
61
|
-
waiting: boolean;
|
|
62
|
-
}>;
|
|
13
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): import("vue").ComputedRef<((...a: Args) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) & import("./useCommand.js").CommandProps<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>>;
|
|
14
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_1, Args_1 extends Array<any>, A extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_1) => Generator<Eff, AEff_1, never>, a: (_: import("effect/Effect").Effect<AEff_1, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A): import("vue").ComputedRef<((...a: Args_1) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<A>, import("effect/Effect").Effect.Error<A>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<A>, import("effect/Effect").Effect.Error<A>>>;
|
|
15
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: import("effect/Effect").Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): import("vue").ComputedRef<((...a: Args_2) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>>;
|
|
16
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: import("effect/Effect").Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): import("vue").ComputedRef<((...a: Args_3) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>>;
|
|
17
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: import("effect/Effect").Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): import("vue").ComputedRef<((...a: Args_4) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>>;
|
|
18
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_1 extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: import("effect/Effect").Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_2, infer _R>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_1): import("vue").ComputedRef<((...a: Args_5) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>>;
|
|
19
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_2, F extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: import("effect/Effect").Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_3, infer _R>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_2, f: (_: E_2) => F): import("vue").ComputedRef<((...a: Args_6) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>>;
|
|
20
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_3, F_1, G extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: import("effect/Effect").Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_4, infer _R>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_3, f: (_: E_3) => F_1, g: (_: F_1) => G): import("vue").ComputedRef<((...a: Args_7) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>>;
|
|
21
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_4, F_2, G_1, H extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: import("effect/Effect").Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_5, infer _R>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_4, f: (_: E_4) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): import("vue").ComputedRef<((...a: Args_8) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>>;
|
|
22
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_5, F_3, G_2, H_1, I extends import("effect/Effect").Effect<any, any, R | import("./useCommand.js").CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: import("effect/Effect").Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_6, infer _R>>] ? E_6 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_5, f: (_: E_5) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): import("vue").ComputedRef<((...a: Args_9) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>, never>) & import("./useCommand.js").CommandProps<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>>;
|
|
63
23
|
};
|
|
24
|
+
alt: (actionName: string) => <Args_10 extends ReadonlyArray<any>, A_9, E_6, R_1 extends R | import("./useCommand.js").CommandContext>(handler: (...args: Args_10) => import("effect/Effect").Effect<A_9, E_6, R_1>) => import("vue").ComputedRef<((...a: Args_10) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<A_9, E_6>, never>) & import("./useCommand.js").CommandProps<A_9, E_6>>;
|
|
64
25
|
};
|
|
65
|
-
useWithToast: () => <
|
|
26
|
+
useWithToast: () => <A_10, E_7, Args_10 extends ReadonlyArray<unknown>, R_2>(options: import("./useWithToast.js").ToastOptions<A_10, E_7, Args_10>) => (self: import("effect/Effect").Effect<A_10, E_7, R_2>, ...args: Args_10) => import("effect/Effect").Effect<A_10, E_7, R_2>;
|
|
66
27
|
};
|
|
67
28
|
//# sourceMappingURL=makeExperimental.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeExperimental.d.ts","sourceRoot":"","sources":["../../src/experimental/makeExperimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEnE,eAAO,MAAM,gBAAgB,GAAI,MAAM,SAAS,MAAM,EAAE,CAAC,EAEvD,UAAU,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC3C,WAAW,QAAQ,EACnB,SAAS,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"makeExperimental.d.ts","sourceRoot":"","sources":["../../src/experimental/makeExperimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEnE,eAAO,MAAM,gBAAgB,GAAI,MAAM,SAAS,MAAM,EAAE,CAAC,EAEvD,UAAU,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC3C,WAAW,QAAQ,EACnB,SAAS,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;yBAiB0D,IAAC,EAAC,GAAE,EAAC,sCAAoC,EAAC,GAAE,EAAE,qEAAsC;CAD1K,CAAA"}
|
|
@@ -35,11 +35,16 @@ declare const CommandContext_base: Context.TagClass<CommandContext, "CommandCont
|
|
|
35
35
|
}>;
|
|
36
36
|
export declare class CommandContext extends CommandContext_base {
|
|
37
37
|
}
|
|
38
|
+
export interface CommandProps<A, E> {
|
|
39
|
+
action: string;
|
|
40
|
+
result: Result<A, E>;
|
|
41
|
+
waiting: boolean;
|
|
42
|
+
}
|
|
38
43
|
export declare const makeUseCommand: <Locale extends string, RT>(_useIntl: MakeIntlReturn<Locale>["useIntl"], _useConfirm: ReturnType<typeof makeUseConfirm>, _useWithToast: ReturnType<typeof makeUseWithToast>, runtime: Runtime.Runtime<RT>) => () => {
|
|
39
44
|
/** Version of confirmOrInterrupt that automatically includes the action name in the default messages */
|
|
40
45
|
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, CommandContext>;
|
|
41
46
|
/** Version of withDefaultToast that automatically includes the action name in the default messages and uses intl */
|
|
42
|
-
withDefaultToast: <
|
|
47
|
+
withDefaultToast: <A_10, E>(self: Effect.Effect<A_10, E, CommandContext>, errorRenderer?: (e: E) => string | undefined) => Effect.Effect<A_10, E, CommandContext>;
|
|
43
48
|
/**
|
|
44
49
|
* Define a Command
|
|
45
50
|
* @param actionName The internal name of the action. will be used as Span. will be used to lookup user facing name via intl. `action.${actionName}`
|
|
@@ -52,57 +57,18 @@ export declare const makeUseCommand: <Locale extends string, RT>(_useIntl: MakeI
|
|
|
52
57
|
* Reporting status to the user is recommended to use the `withDefaultToast` helper, or render the .result inline
|
|
53
58
|
*/
|
|
54
59
|
fn: (actionName: string) => {
|
|
55
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, RT | CommandContext>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): ComputedRef<((...a: Args) => RuntimeFiber<Exit.Exit<AEff, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) &
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: Effect.Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_3, infer _R_2>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_1, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): ComputedRef<((...a: Args_2) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<B>, Effect.Effect.Error<B>>, never>) & {
|
|
66
|
-
action: string;
|
|
67
|
-
result: Result<Effect.Effect.Success<B>, Effect.Effect.Error<B>>;
|
|
68
|
-
waiting: boolean;
|
|
69
|
-
}>;
|
|
70
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: Effect.Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_4, infer _R_3>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_2, infer R_2>>] ? R_2 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): ComputedRef<((...a: Args_3) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<C>, Effect.Effect.Error<C>>, never>) & {
|
|
71
|
-
action: string;
|
|
72
|
-
result: Result<Effect.Effect.Success<C>, Effect.Effect.Error<C>>;
|
|
73
|
-
waiting: boolean;
|
|
74
|
-
}>;
|
|
75
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: Effect.Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_5, infer _R_4>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_3, infer R_3>>] ? R_3 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): ComputedRef<((...a: Args_4) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<D>, Effect.Effect.Error<D>>, never>) & {
|
|
76
|
-
action: string;
|
|
77
|
-
result: Result<Effect.Effect.Success<D>, Effect.Effect.Error<D>>;
|
|
78
|
-
waiting: boolean;
|
|
79
|
-
}>;
|
|
80
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_6 extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: Effect.Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_7, infer _R_5>>] ? E_7 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_4, infer R_4>>] ? R_4 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_6): ComputedRef<((...a: Args_5) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<E_6>, Effect.Effect.Error<E_6>>, never>) & {
|
|
81
|
-
action: string;
|
|
82
|
-
result: Result<Effect.Effect.Success<E_6>, Effect.Effect.Error<E_6>>;
|
|
83
|
-
waiting: boolean;
|
|
84
|
-
}>;
|
|
85
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_8, F extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: Effect.Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_9, infer _R_6>>] ? E_9 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_5, infer R_5>>] ? R_5 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_8, f: (_: E_8) => F): ComputedRef<((...a: Args_6) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<F>, Effect.Effect.Error<F>>, never>) & {
|
|
86
|
-
action: string;
|
|
87
|
-
result: Result<Effect.Effect.Success<F>, Effect.Effect.Error<F>>;
|
|
88
|
-
waiting: boolean;
|
|
89
|
-
}>;
|
|
90
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_10, F_1, G extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: Effect.Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_11, infer _R_7>>] ? E_11 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_6, infer R_6>>] ? R_6 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_10, f: (_: E_10) => F_1, g: (_: F_1) => G): ComputedRef<((...a: Args_7) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<G>, Effect.Effect.Error<G>>, never>) & {
|
|
91
|
-
action: string;
|
|
92
|
-
result: Result<Effect.Effect.Success<G>, Effect.Effect.Error<G>>;
|
|
93
|
-
waiting: boolean;
|
|
94
|
-
}>;
|
|
95
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_12, F_2, G_1, H extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: Effect.Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_13, infer _R_8>>] ? E_13 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_7, infer R_7>>] ? R_7 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_12, f: (_: E_12) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): ComputedRef<((...a: Args_8) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<H>, Effect.Effect.Error<H>>, never>) & {
|
|
96
|
-
action: string;
|
|
97
|
-
result: Result<Effect.Effect.Success<H>, Effect.Effect.Error<H>>;
|
|
98
|
-
waiting: boolean;
|
|
99
|
-
}>;
|
|
100
|
-
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_14, F_3, G_2, H_1, I extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: Effect.Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_15, infer _R_9>>] ? E_15 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_8, infer R_8>>] ? R_8 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_14, f: (_: E_14) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): ComputedRef<((...a: Args_9) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<I>, Effect.Effect.Error<I>>, never>) & {
|
|
101
|
-
action: string;
|
|
102
|
-
result: Result<Effect.Effect.Success<I>, Effect.Effect.Error<I>>;
|
|
103
|
-
waiting: boolean;
|
|
104
|
-
}>;
|
|
60
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, RT | CommandContext>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): ComputedRef<((...a: Args) => RuntimeFiber<Exit.Exit<AEff, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) & CommandProps<AEff, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>>;
|
|
61
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_1, Args_1 extends Array<any>, A extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_1) => Generator<Eff, AEff_1, never>, a: (_: Effect.Effect<AEff_1, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_2, infer _R_1>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R : never>) => A): ComputedRef<((...a: Args_1) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<A>, Effect.Effect.Error<A>>, never>) & CommandProps<Effect.Effect.Success<A>, Effect.Effect.Error<A>>>;
|
|
62
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: Effect.Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_3, infer _R_2>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_1, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): ComputedRef<((...a: Args_2) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<B>, Effect.Effect.Error<B>>, never>) & CommandProps<Effect.Effect.Success<B>, Effect.Effect.Error<B>>>;
|
|
63
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: Effect.Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_4, infer _R_3>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_2, infer R_2>>] ? R_2 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): ComputedRef<((...a: Args_3) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<C>, Effect.Effect.Error<C>>, never>) & CommandProps<Effect.Effect.Success<C>, Effect.Effect.Error<C>>>;
|
|
64
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: Effect.Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_5, infer _R_4>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_3, infer R_3>>] ? R_3 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): ComputedRef<((...a: Args_4) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<D>, Effect.Effect.Error<D>>, never>) & CommandProps<Effect.Effect.Success<D>, Effect.Effect.Error<D>>>;
|
|
65
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_6 extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: Effect.Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_7, infer _R_5>>] ? E_7 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_4, infer R_4>>] ? R_4 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_6): ComputedRef<((...a: Args_5) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<E_6>, Effect.Effect.Error<E_6>>, never>) & CommandProps<Effect.Effect.Success<E_6>, Effect.Effect.Error<E_6>>>;
|
|
66
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_8, F extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: Effect.Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_9, infer _R_6>>] ? E_9 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_5, infer R_5>>] ? R_5 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_8, f: (_: E_8) => F): ComputedRef<((...a: Args_6) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<F>, Effect.Effect.Error<F>>, never>) & CommandProps<Effect.Effect.Success<F>, Effect.Effect.Error<F>>>;
|
|
67
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_10, F_1, G extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: Effect.Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_11, infer _R_7>>] ? E_11 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_6, infer R_6>>] ? R_6 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_10, f: (_: E_10) => F_1, g: (_: F_1) => G): ComputedRef<((...a: Args_7) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<G>, Effect.Effect.Error<G>>, never>) & CommandProps<Effect.Effect.Success<G>, Effect.Effect.Error<G>>>;
|
|
68
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_12, F_2, G_1, H extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: Effect.Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_13, infer _R_8>>] ? E_13 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_7, infer R_7>>] ? R_7 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_12, f: (_: E_12) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): ComputedRef<((...a: Args_8) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<H>, Effect.Effect.Error<H>>, never>) & CommandProps<Effect.Effect.Success<H>, Effect.Effect.Error<H>>>;
|
|
69
|
+
<Eff extends YieldWrap<Effect.Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_14, F_3, G_2, H_1, I extends Effect.Effect<any, any, RT | CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: Effect.Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E_15, infer _R_9>>] ? E_15 : never, [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E_8, infer R_8>>] ? R_8 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_14, f: (_: E_14) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): ComputedRef<((...a: Args_9) => RuntimeFiber<Exit.Exit<Effect.Effect.Success<I>, Effect.Effect.Error<I>>, never>) & CommandProps<Effect.Effect.Success<I>, Effect.Effect.Error<I>>>;
|
|
105
70
|
};
|
|
71
|
+
alt: (actionName: string) => <Args_10 extends ReadonlyArray<any>, A_9, E_16, R_9 extends RT | CommandContext>(handler: (...args: Args_10) => Effect.Effect<A_9, E_16, R_9>) => ComputedRef<((...a: Args_10) => RuntimeFiber<Exit.Exit<A_9, E_16>, never>) & CommandProps<A_9, E_16>>;
|
|
106
72
|
};
|
|
107
73
|
export {};
|
|
108
74
|
//# sourceMappingURL=useCommand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Toast, runtime) => () => {
|
|
|
38
38
|
const { intl } = _useIntl();
|
|
39
39
|
const { confirmOrInterrupt } = _useConfirm();
|
|
40
40
|
const runFork = Runtime.runFork(runtime);
|
|
41
|
+
const makeCommand = (actionName, errorDef) => (handler) => {
|
|
42
|
+
const limit = Error.stackTraceLimit;
|
|
43
|
+
Error.stackTraceLimit = 2;
|
|
44
|
+
const localErrorDef = new Error();
|
|
45
|
+
Error.stackTraceLimit = limit;
|
|
46
|
+
if (!errorDef) {
|
|
47
|
+
errorDef = localErrorDef;
|
|
48
|
+
}
|
|
49
|
+
const action = intl.value.formatMessage({
|
|
50
|
+
id: `action.${actionName}`,
|
|
51
|
+
defaultMessage: actionName
|
|
52
|
+
});
|
|
53
|
+
const context = { action };
|
|
54
|
+
const errorReporter = (self) => self.pipe(Effect.tapErrorCause(Effect.fnUntraced(function* (cause) {
|
|
55
|
+
if (Cause.isInterruptedOnly(cause)) {
|
|
56
|
+
console.info(`Interrupted while trying to ${actionName}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const fail = Cause.failureOption(cause);
|
|
60
|
+
if (Option.isSome(fail)) {
|
|
61
|
+
// if (fail.value._tag === "SuppressErrors") {
|
|
62
|
+
// console.info(
|
|
63
|
+
// `Suppressed error trying to ${action}`,
|
|
64
|
+
// fail.value,
|
|
65
|
+
// )
|
|
66
|
+
// return
|
|
67
|
+
// }
|
|
68
|
+
const message = `Failure trying to ${actionName}`;
|
|
69
|
+
yield* reportMessage(message, {
|
|
70
|
+
action: actionName,
|
|
71
|
+
error: fail.value
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const extra = {
|
|
76
|
+
action,
|
|
77
|
+
message: `Unexpected Error trying to ${actionName}`
|
|
78
|
+
};
|
|
79
|
+
yield* reportRuntimeError(cause, extra);
|
|
80
|
+
})));
|
|
81
|
+
const theHandler = flow(handler,
|
|
82
|
+
// all must be within the Effect.fn to fit within the Span
|
|
83
|
+
Effect.provideService(CommandContext, context), (_) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_)), errorReporter);
|
|
84
|
+
const [result, mut] = asResult(theHandler);
|
|
85
|
+
return computed(() => Object.assign((...args) => {
|
|
86
|
+
const limit = Error.stackTraceLimit;
|
|
87
|
+
Error.stackTraceLimit = 2;
|
|
88
|
+
const errorCall = new Error();
|
|
89
|
+
Error.stackTraceLimit = limit;
|
|
90
|
+
let cache = false;
|
|
91
|
+
const captureStackTrace = () => {
|
|
92
|
+
if (cache !== false) {
|
|
93
|
+
return cache;
|
|
94
|
+
}
|
|
95
|
+
if (errorCall.stack) {
|
|
96
|
+
const stackDef = errorDef.stack.trim().split("\n");
|
|
97
|
+
const stackCall = errorCall.stack.trim().split("\n");
|
|
98
|
+
let endStackDef = stackDef.slice(2).join("\n").trim();
|
|
99
|
+
if (!endStackDef.includes(`(`)) {
|
|
100
|
+
endStackDef = endStackDef.replace(/at (.*)/, "at ($1)");
|
|
101
|
+
}
|
|
102
|
+
let endStackCall = stackCall.slice(2).join("\n").trim();
|
|
103
|
+
if (!endStackCall.includes(`(`)) {
|
|
104
|
+
endStackCall = endStackCall.replace(/at (.*)/, "at ($1)");
|
|
105
|
+
}
|
|
106
|
+
cache = `${endStackDef}\n${endStackCall}`;
|
|
107
|
+
return cache;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return runFork(Effect.withSpan(mut(...args), actionName, { captureStackTrace }));
|
|
111
|
+
}, /* make sure always create a new one, or the state won't properly propagate */ {
|
|
112
|
+
action,
|
|
113
|
+
result: result.value,
|
|
114
|
+
waiting: result.value.waiting
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
41
117
|
return {
|
|
42
118
|
/** Version of confirmOrInterrupt that automatically includes the action name in the default messages */
|
|
43
119
|
confirmOrInterrupt: Effect.fnUntraced(function* (message = undefined) {
|
|
@@ -111,52 +187,13 @@ _useIntl, _useConfirm, _useWithToast, runtime) => () => {
|
|
|
111
187
|
(fn,
|
|
112
188
|
// TODO: combinators can freely take A, E, R and change it to whatever they want, as long as the end result Requires not more than CommandContext | R
|
|
113
189
|
...combinators) => {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
console.info(`Interrupted while trying to ${actionName}`);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const fail = Cause.failureOption(cause);
|
|
125
|
-
if (Option.isSome(fail)) {
|
|
126
|
-
// if (fail.value._tag === "SuppressErrors") {
|
|
127
|
-
// console.info(
|
|
128
|
-
// `Suppressed error trying to ${action}`,
|
|
129
|
-
// fail.value,
|
|
130
|
-
// )
|
|
131
|
-
// return
|
|
132
|
-
// }
|
|
133
|
-
const message = `Failure trying to ${actionName}`;
|
|
134
|
-
yield* reportMessage(message, {
|
|
135
|
-
action: actionName,
|
|
136
|
-
error: fail.value
|
|
137
|
-
});
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const extra = {
|
|
141
|
-
action,
|
|
142
|
-
message: `Unexpected Error trying to ${actionName}`
|
|
143
|
-
};
|
|
144
|
-
yield* reportRuntimeError(cause, extra);
|
|
145
|
-
})));
|
|
146
|
-
// TODO: override span stack set by Effect.fn as it points here instead of to the caller of Command.fn.
|
|
147
|
-
// perhaps copying Effect.fn implementation is better than using it?
|
|
148
|
-
const handler = Effect.fn(actionName)(fn, ...combinators,
|
|
149
|
-
// all must be within the Effect.fn to fit within the Span
|
|
150
|
-
Effect.provideService(CommandContext, context), /* TODO */ ((_) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_))), /* TODO */ errorReporter /* TODO */); // (...args: Args) => Effect.Effect<AEff, $WrappedEffectError, R>
|
|
151
|
-
const [result, mut] = asResult(handler);
|
|
152
|
-
return computed(() => Object.assign(flow(mut, runFork
|
|
153
|
-
// (_) => {}
|
|
154
|
-
), /* make sure always create a new one, or the state won't properly propagate */ {
|
|
155
|
-
action,
|
|
156
|
-
result: result.value,
|
|
157
|
-
waiting: result.value.waiting
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
190
|
+
const limit = Error.stackTraceLimit;
|
|
191
|
+
Error.stackTraceLimit = 2;
|
|
192
|
+
const errorDef = new Error();
|
|
193
|
+
Error.stackTraceLimit = limit;
|
|
194
|
+
return makeCommand(actionName, errorDef)(Effect.fnUntraced(fn, ...combinators));
|
|
195
|
+
},
|
|
196
|
+
alt: makeCommand
|
|
160
197
|
};
|
|
161
198
|
};
|
|
162
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
199
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ29tbWFuZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBlcmltZW50YWwvdXNlQ29tbWFuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFDdkQsT0FBTyxFQUFFLFFBQVEsRUFBdUIsa0JBQWtCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQTtBQUNuRixPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sK0JBQStCLENBQUE7QUFFN0QsT0FBTyxFQUFFLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxFQUFhLElBQUksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxZQUFZLENBQUE7QUFDL0YsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBQ25ELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHVCQUF1QixDQUFBO0FBRzFFLE9BQU8sRUFBRSxRQUFRLEVBQW9CLE1BQU0sS0FBSyxDQUFBO0FBSWhELE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRztJQUN6QixFQUFFLEVBQUU7U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UFFLE1BQU07NEJBQ2IsT0FBTyxFQUFFLGtCQUFrQixHQUFHLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLElBQUksR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFO3lCQUNoRTt3QkFDRCxDQUFDLENBQUMsR0FBRyxtQkFBbUIsS0FBSyxHQUFHLFdBQVcsQ0FBQyxDQUFDLENBQUM7aUJBQ25ELENBQUM7YUFDSCxDQUFDLENBQ0gsQ0FBQTtRQUNILENBQUMsQ0FBQztRQUNKOzs7Ozs7Ozs7O1dBVUc7UUFDSCxFQUFFLEVBQUUsQ0FBQyxVQUFrQixFQXNRckIsRUFBRTtRQUNKLGtDQUFrQztRQUNsQyxDQUNFLEVBQU87UUFDUCxxSkFBcUo7UUFDckosR0FBRyxXQUFrQixFQUNoQixFQUFFO1lBQ1AsTUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLGVBQWUsQ0FBQTtZQUNuQyxLQUFLLENBQUMsZUFBZSxHQUFHLENBQUMsQ0FBQTtZQUN6QixNQUFNLFFBQVEsR0FBRyxJQUFJLEtBQUssRUFBRSxDQUFBO1lBQzVCLEtBQUssQ0FBQyxlQUFlLEdBQUcsS0FBSyxDQUFBO1lBRTdCLE9BQU8sV0FBVyxDQUFDLFVBQVUsRUFBRSxRQUFRLENBQUMsQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLEVBQUUsRUFBRSxHQUFHLFdBQW9CLENBQVEsQ0FBQyxDQUFBO1FBQ2pHLENBQUM7UUFFRCxHQUFHLEVBQUUsV0FJd0Y7S0FDOUYsQ0FBQTtBQUNILENBQUMsQ0FBQSJ9
|
package/dist/mutate.js
CHANGED
|
@@ -51,7 +51,7 @@ export function make(self) {
|
|
|
51
51
|
// predicate: (_) => nses.includes(_.queryKey.filter((_) => _.startsWith("$")).join("/"))
|
|
52
52
|
// }))
|
|
53
53
|
/*
|
|
54
|
-
// const nses: string[] = []
|
|
54
|
+
// const nses: string[] = []`
|
|
55
55
|
// for (let i = 0; i < ns.length; i++) {
|
|
56
56
|
// nses.push(ns.slice(0, i + 1).join("/"))
|
|
57
57
|
// }
|
package/package.json
CHANGED
|
@@ -43,6 +43,12 @@ export class CommandContext extends Context.Tag("CommandContext")<
|
|
|
43
43
|
{ action: string }
|
|
44
44
|
>() {}
|
|
45
45
|
|
|
46
|
+
export interface CommandProps<A, E> {
|
|
47
|
+
action: string
|
|
48
|
+
result: Result<A, E>
|
|
49
|
+
waiting: boolean
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
export const makeUseCommand = <Locale extends string, RT>(
|
|
47
53
|
// NOTE: underscores to not collide with auto exports in nuxt apps
|
|
48
54
|
_useIntl: MakeIntlReturn<Locale>["useIntl"],
|
|
@@ -58,11 +64,7 @@ export const makeUseCommand = <Locale extends string, RT>(
|
|
|
58
64
|
const runFork = Runtime.runFork(runtime)
|
|
59
65
|
|
|
60
66
|
type CommandOut<Args extends Array<any>, A, E> = ComputedRef<
|
|
61
|
-
((...a: Args) => RuntimeFiber<Exit.Exit<A, E>, never>) &
|
|
62
|
-
action: string
|
|
63
|
-
result: Result<A, E>
|
|
64
|
-
waiting: boolean
|
|
65
|
-
}
|
|
67
|
+
((...a: Args) => RuntimeFiber<Exit.Exit<A, E>, never>) & CommandProps<A, E>
|
|
66
68
|
>
|
|
67
69
|
|
|
68
70
|
type CommandOutHelper<Args extends Array<any>, Eff extends Effect.Effect<any, any, any>> = CommandOut<
|
|
@@ -71,6 +73,108 @@ export const makeUseCommand = <Locale extends string, RT>(
|
|
|
71
73
|
Effect.Effect.Error<Eff>
|
|
72
74
|
>
|
|
73
75
|
|
|
76
|
+
const makeCommand =
|
|
77
|
+
(actionName: string, errorDef?: Error) =>
|
|
78
|
+
<Args extends ReadonlyArray<any>, A, E, R extends RT | CommandContext>(
|
|
79
|
+
handler: (...args: Args) => Effect.Effect<A, E, R>
|
|
80
|
+
) => {
|
|
81
|
+
const limit = Error.stackTraceLimit
|
|
82
|
+
Error.stackTraceLimit = 2
|
|
83
|
+
const localErrorDef = new Error()
|
|
84
|
+
Error.stackTraceLimit = limit
|
|
85
|
+
if (!errorDef) {
|
|
86
|
+
errorDef = localErrorDef
|
|
87
|
+
}
|
|
88
|
+
const action = intl.value.formatMessage({
|
|
89
|
+
id: `action.${actionName}`,
|
|
90
|
+
defaultMessage: actionName
|
|
91
|
+
})
|
|
92
|
+
const context = { action }
|
|
93
|
+
|
|
94
|
+
const errorReporter = <A, E, R>(self: Effect.Effect<A, E, R>) =>
|
|
95
|
+
self.pipe(
|
|
96
|
+
Effect.tapErrorCause(
|
|
97
|
+
Effect.fnUntraced(function*(cause) {
|
|
98
|
+
if (Cause.isInterruptedOnly(cause)) {
|
|
99
|
+
console.info(`Interrupted while trying to ${actionName}`)
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const fail = Cause.failureOption(cause)
|
|
104
|
+
if (Option.isSome(fail)) {
|
|
105
|
+
// if (fail.value._tag === "SuppressErrors") {
|
|
106
|
+
// console.info(
|
|
107
|
+
// `Suppressed error trying to ${action}`,
|
|
108
|
+
// fail.value,
|
|
109
|
+
// )
|
|
110
|
+
// return
|
|
111
|
+
// }
|
|
112
|
+
const message = `Failure trying to ${actionName}`
|
|
113
|
+
yield* reportMessage(message, {
|
|
114
|
+
action: actionName,
|
|
115
|
+
error: fail.value
|
|
116
|
+
})
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const extra = {
|
|
121
|
+
action,
|
|
122
|
+
message: `Unexpected Error trying to ${actionName}`
|
|
123
|
+
}
|
|
124
|
+
yield* reportRuntimeError(cause, extra)
|
|
125
|
+
})
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
const theHandler = flow(
|
|
130
|
+
handler,
|
|
131
|
+
// all must be within the Effect.fn to fit within the Span
|
|
132
|
+
Effect.provideService(CommandContext, context),
|
|
133
|
+
(_) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_)),
|
|
134
|
+
errorReporter
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
const [result, mut] = asResult(theHandler)
|
|
138
|
+
|
|
139
|
+
return computed(() =>
|
|
140
|
+
Object.assign(
|
|
141
|
+
(...args: Args) => {
|
|
142
|
+
const limit = Error.stackTraceLimit
|
|
143
|
+
Error.stackTraceLimit = 2
|
|
144
|
+
const errorCall = new Error()
|
|
145
|
+
Error.stackTraceLimit = limit
|
|
146
|
+
|
|
147
|
+
let cache: false | string = false
|
|
148
|
+
const captureStackTrace = () => {
|
|
149
|
+
if (cache !== false) {
|
|
150
|
+
return cache
|
|
151
|
+
}
|
|
152
|
+
if (errorCall.stack) {
|
|
153
|
+
const stackDef = errorDef!.stack!.trim().split("\n")
|
|
154
|
+
const stackCall = errorCall.stack.trim().split("\n")
|
|
155
|
+
let endStackDef = stackDef.slice(2).join("\n").trim()
|
|
156
|
+
if (!endStackDef.includes(`(`)) {
|
|
157
|
+
endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
|
|
158
|
+
}
|
|
159
|
+
let endStackCall = stackCall.slice(2).join("\n").trim()
|
|
160
|
+
if (!endStackCall.includes(`(`)) {
|
|
161
|
+
endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
|
|
162
|
+
}
|
|
163
|
+
cache = `${endStackDef}\n${endStackCall}`
|
|
164
|
+
return cache
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return runFork(Effect.withSpan(mut(...args), actionName, { captureStackTrace }))
|
|
168
|
+
}, /* make sure always create a new one, or the state won't properly propagate */
|
|
169
|
+
{
|
|
170
|
+
action,
|
|
171
|
+
result: result.value,
|
|
172
|
+
waiting: result.value.waiting
|
|
173
|
+
} as CommandProps<A, E>
|
|
174
|
+
)
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
74
178
|
return {
|
|
75
179
|
/** Version of confirmOrInterrupt that automatically includes the action name in the default messages */
|
|
76
180
|
confirmOrInterrupt: Effect.fnUntraced(function*(
|
|
@@ -440,74 +544,18 @@ export const makeUseCommand = <Locale extends string, RT>(
|
|
|
440
544
|
// TODO: combinators can freely take A, E, R and change it to whatever they want, as long as the end result Requires not more than CommandContext | R
|
|
441
545
|
...combinators: any[]
|
|
442
546
|
): any => {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
const context = { action }
|
|
547
|
+
const limit = Error.stackTraceLimit
|
|
548
|
+
Error.stackTraceLimit = 2
|
|
549
|
+
const errorDef = new Error()
|
|
550
|
+
Error.stackTraceLimit = limit
|
|
448
551
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
Effect.tapErrorCause(
|
|
452
|
-
Effect.fnUntraced(function*(cause) {
|
|
453
|
-
if (Cause.isInterruptedOnly(cause)) {
|
|
454
|
-
console.info(`Interrupted while trying to ${actionName}`)
|
|
455
|
-
return
|
|
456
|
-
}
|
|
552
|
+
return makeCommand(actionName, errorDef)(Effect.fnUntraced(fn, ...combinators as [any]) as any)
|
|
553
|
+
},
|
|
457
554
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
// fail.value,
|
|
464
|
-
// )
|
|
465
|
-
// return
|
|
466
|
-
// }
|
|
467
|
-
const message = `Failure trying to ${actionName}`
|
|
468
|
-
yield* reportMessage(message, {
|
|
469
|
-
action: actionName,
|
|
470
|
-
error: fail.value
|
|
471
|
-
})
|
|
472
|
-
return
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const extra = {
|
|
476
|
-
action,
|
|
477
|
-
message: `Unexpected Error trying to ${actionName}`
|
|
478
|
-
}
|
|
479
|
-
yield* reportRuntimeError(cause, extra)
|
|
480
|
-
})
|
|
481
|
-
)
|
|
482
|
-
)
|
|
483
|
-
|
|
484
|
-
// TODO: override span stack set by Effect.fn as it points here instead of to the caller of Command.fn.
|
|
485
|
-
// perhaps copying Effect.fn implementation is better than using it?
|
|
486
|
-
const handler = Effect.fn(actionName)(
|
|
487
|
-
fn,
|
|
488
|
-
...(combinators as [any]),
|
|
489
|
-
// all must be within the Effect.fn to fit within the Span
|
|
490
|
-
Effect.provideService(CommandContext, context) as any, /* TODO */
|
|
491
|
-
((_: any) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_))) as any, /* TODO */
|
|
492
|
-
errorReporter as any /* TODO */
|
|
493
|
-
) as any // (...args: Args) => Effect.Effect<AEff, $WrappedEffectError, R>
|
|
494
|
-
|
|
495
|
-
const [result, mut] = asResult(handler)
|
|
496
|
-
|
|
497
|
-
return computed(() =>
|
|
498
|
-
Object.assign(
|
|
499
|
-
flow(
|
|
500
|
-
mut as any,
|
|
501
|
-
runFork
|
|
502
|
-
// (_) => {}
|
|
503
|
-
), /* make sure always create a new one, or the state won't properly propagate */
|
|
504
|
-
{
|
|
505
|
-
action,
|
|
506
|
-
result: result.value,
|
|
507
|
-
waiting: result.value.waiting
|
|
508
|
-
}
|
|
509
|
-
)
|
|
510
|
-
)
|
|
511
|
-
}
|
|
555
|
+
alt: makeCommand as (
|
|
556
|
+
actionName: string
|
|
557
|
+
) => <Args extends ReadonlyArray<any>, A, E, R extends RT | CommandContext>(
|
|
558
|
+
handler: (...args: Args) => Effect.Effect<A, E, R>
|
|
559
|
+
) => ComputedRef<((...a: Args) => RuntimeFiber<Exit.Exit<A, E>, never>) & CommandProps<A, E>>
|
|
512
560
|
}
|
|
513
561
|
}
|
package/src/mutate.ts
CHANGED
|
@@ -88,7 +88,7 @@ export interface MutationOptions<A, E, R, A2 = A, E2 = E, R2 = R, I = void> {
|
|
|
88
88
|
// predicate: (_) => nses.includes(_.queryKey.filter((_) => _.startsWith("$")).join("/"))
|
|
89
89
|
// }))
|
|
90
90
|
/*
|
|
91
|
-
// const nses: string[] = []
|
|
91
|
+
// const nses: string[] = []`
|
|
92
92
|
// for (let i = 0; i < ns.length; i++) {
|
|
93
93
|
// nses.push(ns.slice(0, i + 1).join("/"))
|
|
94
94
|
// }
|
package/test/Mutation.test.ts
CHANGED
|
@@ -49,7 +49,10 @@ it.live("has custom action name", () =>
|
|
|
49
49
|
Effect
|
|
50
50
|
.gen(function*() {
|
|
51
51
|
const toasts: any[] = []
|
|
52
|
-
const { useCommand } = useExperimental({
|
|
52
|
+
const { useCommand } = useExperimental({
|
|
53
|
+
toasts,
|
|
54
|
+
messages: { "action.Test Action": "Test Action Translated" }
|
|
55
|
+
})
|
|
53
56
|
const Command = useCommand()
|
|
54
57
|
|
|
55
58
|
let executed = false
|
|
@@ -121,7 +124,10 @@ it.live("can replace the result", () =>
|
|
|
121
124
|
Effect
|
|
122
125
|
.gen(function*() {
|
|
123
126
|
const toasts: any[] = []
|
|
124
|
-
const { useCommand } = useExperimental({
|
|
127
|
+
const { useCommand } = useExperimental({
|
|
128
|
+
toasts,
|
|
129
|
+
messages: { "action.Test Action": "Test Action Translated" }
|
|
130
|
+
})
|
|
125
131
|
const Command = useCommand()
|
|
126
132
|
|
|
127
133
|
let executed = false
|
|
@@ -294,3 +300,319 @@ it.live("defect", () =>
|
|
|
294
300
|
expect(toasts.length).toBe(1) // toast should show error
|
|
295
301
|
expect(toasts[0].message).toBe("Test Action unexpected error, please try again shortly.")
|
|
296
302
|
}))
|
|
303
|
+
|
|
304
|
+
it.live("works with alt", () =>
|
|
305
|
+
Effect
|
|
306
|
+
.gen(function*() {
|
|
307
|
+
const toasts: any[] = []
|
|
308
|
+
const { useCommand } = useExperimental({ toasts })
|
|
309
|
+
const Command = useCommand()
|
|
310
|
+
|
|
311
|
+
let executed = false
|
|
312
|
+
|
|
313
|
+
const command = Command.alt("Test Action")(
|
|
314
|
+
Effect.fnUntraced(
|
|
315
|
+
function*() {
|
|
316
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
317
|
+
expect(command.value.waiting).toBe(true)
|
|
318
|
+
|
|
319
|
+
expect(yield* CommandContext).toEqual({ action: "Test Action" })
|
|
320
|
+
|
|
321
|
+
expect(toasts.length).toBe(0)
|
|
322
|
+
|
|
323
|
+
return "test-value"
|
|
324
|
+
},
|
|
325
|
+
Effect.tap(Effect.fnUntraced(function*() {
|
|
326
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
327
|
+
})),
|
|
328
|
+
Effect.tap(() =>
|
|
329
|
+
Effect.currentSpan.pipe(Effect.map((_) => _.name), Effect.tap((_) => expect(_).toBe("Test Action")))
|
|
330
|
+
),
|
|
331
|
+
Effect.tap(() => executed = true)
|
|
332
|
+
)
|
|
333
|
+
)
|
|
334
|
+
expect(command.value.action).toBe("Test Action")
|
|
335
|
+
|
|
336
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
337
|
+
expect(command.value.waiting).toBe(false)
|
|
338
|
+
|
|
339
|
+
expect(r).toBe("test-value") // to confirm that the initial function has ran.
|
|
340
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
341
|
+
|
|
342
|
+
expect(command.value.result.pipe(Result.value)).toEqual(Option.some("test-value"))
|
|
343
|
+
|
|
344
|
+
expect(toasts.length).toBe(0)
|
|
345
|
+
}))
|
|
346
|
+
|
|
347
|
+
it.live("has custom action name with alt", () =>
|
|
348
|
+
Effect
|
|
349
|
+
.gen(function*() {
|
|
350
|
+
const toasts: any[] = []
|
|
351
|
+
const { useCommand } = useExperimental({
|
|
352
|
+
toasts,
|
|
353
|
+
messages: { "action.Test Action": "Test Action Translated" }
|
|
354
|
+
})
|
|
355
|
+
const Command = useCommand()
|
|
356
|
+
|
|
357
|
+
let executed = false
|
|
358
|
+
|
|
359
|
+
const command = Command.alt("Test Action")(
|
|
360
|
+
Effect.fnUntraced(
|
|
361
|
+
function*() {
|
|
362
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
363
|
+
|
|
364
|
+
expect(yield* CommandContext).toEqual({ action: "Test Action Translated" })
|
|
365
|
+
return "test-value"
|
|
366
|
+
},
|
|
367
|
+
Effect.tap(() => executed = true)
|
|
368
|
+
)
|
|
369
|
+
)
|
|
370
|
+
expect(command.value.action).toBe("Test Action Translated")
|
|
371
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
372
|
+
|
|
373
|
+
expect(r).toBe("test-value") // to confirm that the initial function has ran.
|
|
374
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
375
|
+
}))
|
|
376
|
+
|
|
377
|
+
it.live("can map the result with alt", () =>
|
|
378
|
+
Effect
|
|
379
|
+
.gen(function*() {
|
|
380
|
+
const toasts: any[] = []
|
|
381
|
+
const { useCommand } = useExperimental({ toasts })
|
|
382
|
+
const Command = useCommand()
|
|
383
|
+
|
|
384
|
+
let executed = false
|
|
385
|
+
|
|
386
|
+
const command = Command.alt("Test Action")(Effect.fnUntraced(
|
|
387
|
+
function*() {
|
|
388
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
389
|
+
|
|
390
|
+
return "test-value"
|
|
391
|
+
},
|
|
392
|
+
Effect.map((_) => _ + _),
|
|
393
|
+
Effect.tap(() => executed = true)
|
|
394
|
+
))
|
|
395
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
396
|
+
|
|
397
|
+
expect(r).toBe("test-valuetest-value") // to confirm that the initial function and map has ran.
|
|
398
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
399
|
+
}))
|
|
400
|
+
|
|
401
|
+
it.live("can receive and use input with alt", () =>
|
|
402
|
+
Effect
|
|
403
|
+
.gen(function*() {
|
|
404
|
+
const toasts: any[] = []
|
|
405
|
+
const { useCommand } = useExperimental({ toasts })
|
|
406
|
+
const Command = useCommand()
|
|
407
|
+
|
|
408
|
+
let executed = false
|
|
409
|
+
|
|
410
|
+
const command = Command.alt("Test Action")(
|
|
411
|
+
Effect.fnUntraced(
|
|
412
|
+
function*(input1: number, input2: string) {
|
|
413
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
414
|
+
|
|
415
|
+
return { input1, input2 }
|
|
416
|
+
},
|
|
417
|
+
Effect.tap(() => executed = true)
|
|
418
|
+
)
|
|
419
|
+
)
|
|
420
|
+
const r = yield* Fiber.join(command.value(1, "2")).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
421
|
+
|
|
422
|
+
expect(r).toEqual({ input1: 1, input2: "2" }) // to confirm that the initial function has ran and received input.
|
|
423
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
424
|
+
}))
|
|
425
|
+
|
|
426
|
+
it.live("can replace the result with alt", () =>
|
|
427
|
+
Effect
|
|
428
|
+
.gen(function*() {
|
|
429
|
+
const toasts: any[] = []
|
|
430
|
+
const { useCommand } = useExperimental({
|
|
431
|
+
toasts,
|
|
432
|
+
messages: { "action.Test Action": "Test Action Translated" }
|
|
433
|
+
})
|
|
434
|
+
const Command = useCommand()
|
|
435
|
+
|
|
436
|
+
let executed = false
|
|
437
|
+
|
|
438
|
+
const command = Command.alt("Test Action")(
|
|
439
|
+
Effect.fnUntraced(
|
|
440
|
+
function*() {
|
|
441
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
442
|
+
|
|
443
|
+
return "test-value"
|
|
444
|
+
},
|
|
445
|
+
Effect.zipRight(Effect.succeed(42)),
|
|
446
|
+
Effect.tap(() => executed = true)
|
|
447
|
+
)
|
|
448
|
+
)
|
|
449
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
450
|
+
|
|
451
|
+
expect(r).toBe(42) // to confirm that the initial function and zipRight has ran.
|
|
452
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
453
|
+
}))
|
|
454
|
+
|
|
455
|
+
it.live("with toasts with alt", () =>
|
|
456
|
+
Effect
|
|
457
|
+
.gen(function*() {
|
|
458
|
+
const toasts: any[] = []
|
|
459
|
+
const { useCommand } = useExperimental({
|
|
460
|
+
toasts,
|
|
461
|
+
messages: DefaultIntl.en
|
|
462
|
+
})
|
|
463
|
+
const Command = useCommand()
|
|
464
|
+
|
|
465
|
+
let executed = false
|
|
466
|
+
|
|
467
|
+
const command = Command.alt("Test Action")(
|
|
468
|
+
Effect.fnUntraced(
|
|
469
|
+
function*() {
|
|
470
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
471
|
+
|
|
472
|
+
expect(toasts.length).toBe(1)
|
|
473
|
+
expect(toasts[0].message).toBe("Test Action executing...")
|
|
474
|
+
|
|
475
|
+
return "test-value"
|
|
476
|
+
},
|
|
477
|
+
Effect.tap(Effect.fnUntraced(function*() {
|
|
478
|
+
expect(yield* Effect.currentSpan.pipe(Effect.map((_) => _.name))).toBe("Test Action")
|
|
479
|
+
})),
|
|
480
|
+
Effect.tap(() =>
|
|
481
|
+
Effect.currentSpan.pipe(Effect.map((_) => _.name), Effect.tap((_) => expect(_).toBe("Test Action")))
|
|
482
|
+
),
|
|
483
|
+
Command.withDefaultToast,
|
|
484
|
+
Effect.tap(() => executed = true)
|
|
485
|
+
)
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed, so we flatten it.
|
|
489
|
+
|
|
490
|
+
expect(r).toBe("test-value") // to confirm that the initial function has ran.
|
|
491
|
+
expect(executed).toBe(true) // to confirm that the combinators have ran.
|
|
492
|
+
|
|
493
|
+
expect(toasts.length).toBe(1)
|
|
494
|
+
expect(toasts[0].message).toBe("Test Action Success")
|
|
495
|
+
}))
|
|
496
|
+
|
|
497
|
+
it.live("interrupted with alt", () =>
|
|
498
|
+
Effect
|
|
499
|
+
.gen(function*() {
|
|
500
|
+
let executed = false
|
|
501
|
+
const toasts: any[] = []
|
|
502
|
+
const { useCommand } = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
503
|
+
const Command = useCommand()
|
|
504
|
+
|
|
505
|
+
const command = Command.alt("Test Action")(
|
|
506
|
+
Effect.fnUntraced(
|
|
507
|
+
function*() {
|
|
508
|
+
expect(toasts.length).toBe(1)
|
|
509
|
+
// @effect-diagnostics-next-line missingReturnYieldStar:off
|
|
510
|
+
yield* Effect.interrupt
|
|
511
|
+
return "test-value"
|
|
512
|
+
},
|
|
513
|
+
Command.withDefaultToast,
|
|
514
|
+
Effect.tap(() => executed = true)
|
|
515
|
+
)
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
const r = yield* Fiber.join(command.value()) // we receive an Exit as errors/results are processed
|
|
519
|
+
|
|
520
|
+
expect(executed).toBe(false) // we were interrupted after all :)
|
|
521
|
+
expect(Exit.isInterrupted(r)).toBe(true) // to confirm that the initial function has interrupted
|
|
522
|
+
|
|
523
|
+
expect(command.value.waiting).toBe(false)
|
|
524
|
+
expect(Exit.isInterrupted(Result.toExit(command.value.result))).toBe(true)
|
|
525
|
+
expect(toasts.length).toBe(0) // toast is removed on interruption. TODO: maybe a nicer user experience can be had?
|
|
526
|
+
}))
|
|
527
|
+
|
|
528
|
+
it.live("fail with alt", () =>
|
|
529
|
+
Effect
|
|
530
|
+
.gen(function*() {
|
|
531
|
+
let executed = false
|
|
532
|
+
const toasts: any[] = []
|
|
533
|
+
const { useCommand } = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
534
|
+
const Command = useCommand()
|
|
535
|
+
|
|
536
|
+
const command = Command.alt("Test Action")(
|
|
537
|
+
Effect.fnUntraced(
|
|
538
|
+
function*() {
|
|
539
|
+
expect(toasts.length).toBe(1)
|
|
540
|
+
return yield* Effect.fail({ message: "Boom!" })
|
|
541
|
+
},
|
|
542
|
+
Command.withDefaultToast,
|
|
543
|
+
Effect.tap(() => executed = true)
|
|
544
|
+
)
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
const r = yield* Fiber.join(command.value()) // we receive an Exit as errors/results are processed
|
|
548
|
+
|
|
549
|
+
expect(executed).toBe(false) // we failed after all :)
|
|
550
|
+
expect(Exit.isFailure(r) && Cause.isFailure(r.cause)).toBe(true) // to confirm that the initial function has failed
|
|
551
|
+
|
|
552
|
+
expect(command.value.waiting).toBe(false)
|
|
553
|
+
expect(Exit.isFailure(Result.toExit(command.value.result))).toBe(true)
|
|
554
|
+
expect(toasts.length).toBe(1) // toast should show error
|
|
555
|
+
expect(toasts[0].message).toBe("Test Action Failed:\nBoom!")
|
|
556
|
+
}))
|
|
557
|
+
|
|
558
|
+
it.live("fail and recover with alt", () =>
|
|
559
|
+
Effect
|
|
560
|
+
.gen(function*() {
|
|
561
|
+
let executed = false
|
|
562
|
+
const toasts: any[] = []
|
|
563
|
+
const { useCommand } = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
564
|
+
const Command = useCommand()
|
|
565
|
+
|
|
566
|
+
const command = Command.alt("Test Action")(
|
|
567
|
+
Effect.fnUntraced(
|
|
568
|
+
function*() {
|
|
569
|
+
expect(toasts.length).toBe(1)
|
|
570
|
+
return yield* Effect.fail({ message: "Boom!" })
|
|
571
|
+
},
|
|
572
|
+
Effect.catchAll(() => Effect.succeed("recovered")), // we recover from the error here, so the final result is success
|
|
573
|
+
Command.withDefaultToast,
|
|
574
|
+
Effect.tap(() => executed = true)
|
|
575
|
+
)
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
const r = yield* Fiber.join(command.value()).pipe(Effect.flatten) // we receive an Exit as errors/results are processed
|
|
579
|
+
|
|
580
|
+
expect(executed).toBe(true) // we recovered after all :)
|
|
581
|
+
expect(r).toBe("recovered") // to confirm that the initial function has failed but we recovered
|
|
582
|
+
|
|
583
|
+
expect(command.value.waiting).toBe(false)
|
|
584
|
+
expect(Result.toExit(command.value.result)).toEqual(Exit.succeed("recovered"))
|
|
585
|
+
expect(toasts.length).toBe(1) // toast should show error
|
|
586
|
+
expect(toasts[0].message).toBe("Test Action Success")
|
|
587
|
+
}))
|
|
588
|
+
|
|
589
|
+
it.live("defect with alt", () =>
|
|
590
|
+
Effect
|
|
591
|
+
.gen(function*() {
|
|
592
|
+
let executed = false
|
|
593
|
+
const toasts: any[] = []
|
|
594
|
+
const { useCommand } = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
595
|
+
const Command = useCommand()
|
|
596
|
+
|
|
597
|
+
const command = Command.alt("Test Action")(
|
|
598
|
+
Effect.fnUntraced(
|
|
599
|
+
function*() {
|
|
600
|
+
expect(toasts.length).toBe(1)
|
|
601
|
+
return yield* Effect.die({ message: "Boom!" })
|
|
602
|
+
},
|
|
603
|
+
Command.withDefaultToast,
|
|
604
|
+
Effect.tap(() => executed = true)
|
|
605
|
+
)
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
const r = yield* Fiber.join(command.value()) // we receive an Exit as errors/results are processed
|
|
609
|
+
// TODO: confirm we reported error
|
|
610
|
+
|
|
611
|
+
expect(executed).toBe(false) // we died after all :)
|
|
612
|
+
expect(Exit.isFailure(r) && Cause.isDie(r.cause)).toBe(true) // to confirm that the initial function has died
|
|
613
|
+
|
|
614
|
+
expect(command.value.waiting).toBe(false)
|
|
615
|
+
expect(Exit.isFailure(Result.toExit(command.value.result))).toBe(true)
|
|
616
|
+
expect(toasts.length).toBe(1) // toast should show error
|
|
617
|
+
expect(toasts[0].message).toBe("Test Action unexpected error, please try again shortly.")
|
|
618
|
+
}))
|
package/test/dist/stubs.d.ts
CHANGED
|
@@ -11,58 +11,19 @@ export declare const useExperimental: (options?: {
|
|
|
11
11
|
confirmOrInterrupt: (message?: string | undefined) => import("effect/Effect").Effect<void, never, import("../src/experimental/useCommand.js").CommandContext>;
|
|
12
12
|
withDefaultToast: <A, E>(self: import("effect/Effect").Effect<A, E, import("../src/experimental/useCommand.js").CommandContext>, errorRenderer?: ((e: E) => string | undefined) | undefined) => import("effect/Effect").Effect<A, E, import("../src/experimental/useCommand.js").CommandContext>;
|
|
13
13
|
fn: (actionName: string) => {
|
|
14
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): import("vue").ComputedRef<((...a: Args) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) &
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: import("effect/Effect").Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): import("vue").ComputedRef<((...a: Args_2) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>, never>) & {
|
|
25
|
-
action: string;
|
|
26
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>;
|
|
27
|
-
waiting: boolean;
|
|
28
|
-
}>;
|
|
29
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: import("effect/Effect").Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): import("vue").ComputedRef<((...a: Args_3) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>, never>) & {
|
|
30
|
-
action: string;
|
|
31
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>;
|
|
32
|
-
waiting: boolean;
|
|
33
|
-
}>;
|
|
34
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: import("effect/Effect").Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): import("vue").ComputedRef<((...a: Args_4) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>, never>) & {
|
|
35
|
-
action: string;
|
|
36
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>;
|
|
37
|
-
waiting: boolean;
|
|
38
|
-
}>;
|
|
39
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_1 extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: import("effect/Effect").Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_2, infer _R>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_1): import("vue").ComputedRef<((...a: Args_5) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>, never>) & {
|
|
40
|
-
action: string;
|
|
41
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>;
|
|
42
|
-
waiting: boolean;
|
|
43
|
-
}>;
|
|
44
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_2, F extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: import("effect/Effect").Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_3, infer _R>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_2, f: (_: E_2) => F): import("vue").ComputedRef<((...a: Args_6) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>, never>) & {
|
|
45
|
-
action: string;
|
|
46
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>;
|
|
47
|
-
waiting: boolean;
|
|
48
|
-
}>;
|
|
49
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_3, F_1, G extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: import("effect/Effect").Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_4, infer _R>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_3, f: (_: E_3) => F_1, g: (_: F_1) => G): import("vue").ComputedRef<((...a: Args_7) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>, never>) & {
|
|
50
|
-
action: string;
|
|
51
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>;
|
|
52
|
-
waiting: boolean;
|
|
53
|
-
}>;
|
|
54
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_4, F_2, G_1, H extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: import("effect/Effect").Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_5, infer _R>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_4, f: (_: E_4) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): import("vue").ComputedRef<((...a: Args_8) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>, never>) & {
|
|
55
|
-
action: string;
|
|
56
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>;
|
|
57
|
-
waiting: boolean;
|
|
58
|
-
}>;
|
|
59
|
-
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_5, F_3, G_2, H_1, I extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: import("effect/Effect").Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_6, infer _R>>] ? E_6 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_5, f: (_: E_5) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): import("vue").ComputedRef<((...a: Args_9) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>, never>) & {
|
|
60
|
-
action: string;
|
|
61
|
-
result: import("@effect-atom/atom/Result").Result<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>;
|
|
62
|
-
waiting: boolean;
|
|
63
|
-
}>;
|
|
14
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): import("vue").ComputedRef<((...a: Args) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) & import("../src/experimental/useCommand.js").CommandProps<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>>;
|
|
15
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_1, Args_1 extends Array<any>, A extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_1) => Generator<Eff, AEff_1, never>, a: (_: import("effect/Effect").Effect<AEff_1, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A): import("vue").ComputedRef<((...a: Args_1) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<A>, import("effect/Effect").Effect.Error<A>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<A>, import("effect/Effect").Effect.Error<A>>>;
|
|
16
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_1, B extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: import("effect/Effect").Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_1, b: (_: A_1) => B): import("vue").ComputedRef<((...a: Args_2) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<B>, import("effect/Effect").Effect.Error<B>>>;
|
|
17
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_2, B_1, C extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: import("effect/Effect").Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_2, b: (_: A_2) => B_1, c: (_: B_1) => C): import("vue").ComputedRef<((...a: Args_3) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<C>, import("effect/Effect").Effect.Error<C>>>;
|
|
18
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_3, B_2, C_1, D extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: import("effect/Effect").Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_3, b: (_: A_3) => B_2, c: (_: B_2) => C_1, d: (_: C_1) => D): import("vue").ComputedRef<((...a: Args_4) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<D>, import("effect/Effect").Effect.Error<D>>>;
|
|
19
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_4, B_3, C_2, D_1, E_1 extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: import("effect/Effect").Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_2, infer _R>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_4, b: (_: A_4) => B_3, c: (_: B_3) => C_2, d: (_: C_2) => D_1, e: (_: D_1) => E_1): import("vue").ComputedRef<((...a: Args_5) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<E_1>, import("effect/Effect").Effect.Error<E_1>>>;
|
|
20
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_5, B_4, C_3, D_2, E_2, F extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: import("effect/Effect").Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_3, infer _R>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_5, b: (_: A_5) => B_4, c: (_: B_4) => C_3, d: (_: C_3) => D_2, e: (_: D_2) => E_2, f: (_: E_2) => F): import("vue").ComputedRef<((...a: Args_6) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<F>, import("effect/Effect").Effect.Error<F>>>;
|
|
21
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_6, B_5, C_4, D_3, E_3, F_1, G extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: import("effect/Effect").Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_4, infer _R>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_6, b: (_: A_6) => B_5, c: (_: B_5) => C_4, d: (_: C_4) => D_3, e: (_: D_3) => E_3, f: (_: E_3) => F_1, g: (_: F_1) => G): import("vue").ComputedRef<((...a: Args_7) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<G>, import("effect/Effect").Effect.Error<G>>>;
|
|
22
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_7, B_6, C_5, D_4, E_4, F_2, G_1, H extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: import("effect/Effect").Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_5, infer _R>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_7, b: (_: A_7) => B_6, c: (_: B_6) => C_5, d: (_: C_5) => D_4, e: (_: D_4) => E_4, f: (_: E_4) => F_2, g: (_: F_2) => G_1, h: (_: G_1) => H): import("vue").ComputedRef<((...a: Args_8) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<H>, import("effect/Effect").Effect.Error<H>>>;
|
|
23
|
+
<Eff extends import("effect/Utils").YieldWrap<import("effect/Effect").Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_8, B_7, C_6, D_5, E_5, F_3, G_2, H_1, I extends import("effect/Effect").Effect<any, any, import("../src/experimental/useCommand.js").CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: import("effect/Effect").Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A, infer E_6, infer _R>>] ? E_6 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<import("effect/Effect").Effect<infer _A_1, infer _E, infer R_1>>] ? R_1 : never>) => A_8, b: (_: A_8) => B_7, c: (_: B_7) => C_6, d: (_: C_6) => D_5, e: (_: D_5) => E_5, f: (_: E_5) => F_3, g: (_: F_3) => G_2, h: (_: G_2) => H_1, i: (_: H_1) => I): import("vue").ComputedRef<((...a: Args_9) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>, never>) & import("../src/experimental/useCommand.js").CommandProps<import("effect/Effect").Effect.Success<I>, import("effect/Effect").Effect.Error<I>>>;
|
|
64
24
|
};
|
|
25
|
+
alt: (actionName: string) => <Args_10 extends ReadonlyArray<any>, A_9, E_6, R_1 extends import("../src/experimental/useCommand.js").CommandContext>(handler: (...args: Args_10) => import("effect/Effect").Effect<A_9, E_6, R_1>) => import("vue").ComputedRef<((...a: Args_10) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<A_9, E_6>, never>) & import("../src/experimental/useCommand.js").CommandProps<A_9, E_6>>;
|
|
65
26
|
};
|
|
66
|
-
useWithToast: () => <
|
|
27
|
+
useWithToast: () => <A_10, E_7, Args_10 extends ReadonlyArray<unknown>, R_2>(options: import("../src/experimental/useWithToast.js").ToastOptions<A_10, E_7, Args_10>) => (self: import("effect/Effect").Effect<A_10, E_7, R_2>, ...args: Args_10) => import("effect/Effect").Effect<A_10, E_7, R_2>;
|
|
67
28
|
};
|
|
68
29
|
//# sourceMappingURL=stubs.d.ts.map
|
package/test/dist/stubs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../stubs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AA0B9E,eAAO,MAAM,eAAe,GAC1B,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,CAAA;CAAE;;yBAnBlG,CAAC;oCAEuC,CAAC;;;oCAGd,CAAC;sJAM7B,CAAC
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../stubs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AA0B9E,eAAO,MAAM,eAAe,GAC1B,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,CAAA;CAAE;;yBAnBlG,CAAC;oCAEuC,CAAC;;;oCAGd,CAAC;sJAM7B,CAAC;;;;;;;;;;;;;;;oOAwD4lT,GAAI;CADtmT,CAAA"}
|