@effect-app/vue 2.52.4 → 2.52.5
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 +6 -0
- package/dist/experimental/commander.d.ts +120 -0
- package/dist/experimental/commander.d.ts.map +1 -0
- package/dist/experimental/commander.js +206 -0
- package/dist/experimental/confirm.d.ts +12 -0
- package/dist/experimental/confirm.d.ts.map +1 -0
- package/dist/experimental/confirm.js +14 -0
- package/dist/experimental/intl.d.ts +32 -0
- package/dist/experimental/intl.d.ts.map +1 -0
- package/dist/experimental/intl.js +4 -0
- package/dist/experimental/makeExperimental.d.ts +59 -26
- package/dist/experimental/makeExperimental.d.ts.map +1 -1
- package/dist/experimental/makeExperimental.js +8 -16
- package/dist/experimental/toast.d.ts +54 -0
- package/dist/experimental/toast.d.ts.map +1 -0
- package/dist/experimental/toast.js +4 -0
- package/dist/experimental/withToast.d.ts +17 -0
- package/dist/experimental/withToast.d.ts.map +1 -0
- package/dist/experimental/withToast.js +36 -0
- package/dist/makeClient.js +6 -6
- package/dist/makeIntl.d.ts +1 -1
- package/dist/makeIntl.d.ts.map +1 -1
- package/dist/makeIntl.js +9 -4
- package/package.json +19 -11
- package/src/experimental/commander.ts +567 -0
- package/src/experimental/confirm.ts +20 -0
- package/src/experimental/intl.ts +5 -0
- package/src/experimental/makeExperimental.ts +7 -25
- package/src/experimental/toast.ts +14 -0
- package/src/experimental/withToast.ts +58 -0
- package/src/makeClient.ts +5 -5
- package/src/makeIntl.ts +8 -3
- package/test/Mutation.test.ts +21 -41
- package/test/dist/stubs.d.ts +58 -21
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +28 -22
- package/test/stubs.ts +65 -61
- package/dist/experimental/useCommand.d.ts +0 -75
- package/dist/experimental/useCommand.d.ts.map +0 -1
- package/dist/experimental/useCommand.js +0 -198
- package/dist/experimental/useConfirm.d.ts +0 -7
- package/dist/experimental/useConfirm.d.ts.map +0 -1
- package/dist/experimental/useConfirm.js +0 -9
- package/dist/experimental/useWithToast.d.ts +0 -23
- package/dist/experimental/useWithToast.d.ts.map +0 -1
- package/dist/experimental/useWithToast.js +0 -31
- package/src/experimental/useCommand.ts +0 -564
- package/src/experimental/useConfirm.ts +0 -17
- package/src/experimental/useWithToast.ts +0 -65
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Cause, Effect, type Option } from "effect-app"
|
|
2
|
+
import { ToastSvc } from "./toast.js"
|
|
3
|
+
|
|
4
|
+
export interface ToastOptions<A, E, Args extends ReadonlyArray<unknown>> {
|
|
5
|
+
onWaiting: string | ((...args: Args) => string)
|
|
6
|
+
onSuccess: string | ((a: A, ...args: Args) => string)
|
|
7
|
+
onFailure:
|
|
8
|
+
| string
|
|
9
|
+
| ((
|
|
10
|
+
error: Option.Option<E>,
|
|
11
|
+
...args: Args
|
|
12
|
+
) => string | { level: "warn" | "error"; message: string })
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// @effect-diagnostics-next-line missingEffectServiceDependency:off
|
|
16
|
+
export class WithToastSvc extends Effect.Service<WithToastSvc>()("WithToastSvc", {
|
|
17
|
+
effect: Effect.gen(function*() {
|
|
18
|
+
const toast = yield* ToastSvc
|
|
19
|
+
return <A, E, Args extends ReadonlyArray<unknown>, R>(
|
|
20
|
+
options: ToastOptions<A, E, Args>
|
|
21
|
+
) =>
|
|
22
|
+
Effect.fnUntraced(function*(self: Effect.Effect<A, E, R>, ...args: Args) {
|
|
23
|
+
const toastId = toast.info(
|
|
24
|
+
// .loading
|
|
25
|
+
typeof options.onWaiting === "string"
|
|
26
|
+
? options.onWaiting
|
|
27
|
+
: options.onWaiting(...args)
|
|
28
|
+
)
|
|
29
|
+
return yield* self.pipe(
|
|
30
|
+
Effect.tap((a) => {
|
|
31
|
+
toast.success(
|
|
32
|
+
typeof options.onSuccess === "string"
|
|
33
|
+
? options.onSuccess
|
|
34
|
+
: options.onSuccess(a, ...args),
|
|
35
|
+
{ id: toastId, timeout: 3_000 }
|
|
36
|
+
)
|
|
37
|
+
}),
|
|
38
|
+
Effect.tapErrorCause((cause) =>
|
|
39
|
+
Effect.sync(() => {
|
|
40
|
+
if (Cause.isInterruptedOnly(cause)) {
|
|
41
|
+
toast.dismiss(toastId)
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
const t = typeof options.onFailure === "string"
|
|
45
|
+
? options.onFailure
|
|
46
|
+
: options.onFailure(Cause.failureOption(cause), ...args)
|
|
47
|
+
if (typeof t === "object") {
|
|
48
|
+
return t.level === "warn"
|
|
49
|
+
? toast.warning(t.message, { id: toastId, timeout: 5_000 })
|
|
50
|
+
: toast.error(t.message, { id: toastId, timeout: 5_000 })
|
|
51
|
+
}
|
|
52
|
+
toast.error(t, { id: toastId, timeout: 5_000 })
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}) {}
|
package/src/makeClient.ts
CHANGED
|
@@ -282,15 +282,15 @@ export const makeClient = <Locale extends string, R>(
|
|
|
282
282
|
options: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect> = {}
|
|
283
283
|
) {
|
|
284
284
|
const actionMessage = messages[action] ?? action
|
|
285
|
-
const defaultWarnMessage = intl.
|
|
285
|
+
const defaultWarnMessage = intl.formatMessage(
|
|
286
286
|
{ id: "handle.with_warnings" },
|
|
287
287
|
{ action: actionMessage }
|
|
288
288
|
)
|
|
289
|
-
const defaultSuccessMessage = intl.
|
|
289
|
+
const defaultSuccessMessage = intl.formatMessage(
|
|
290
290
|
{ id: "handle.success" },
|
|
291
291
|
{ action: actionMessage }
|
|
292
292
|
)
|
|
293
|
-
const defaultErrorMessage = intl.
|
|
293
|
+
const defaultErrorMessage = intl.formatMessage(
|
|
294
294
|
{ id: "handle.with_errors" },
|
|
295
295
|
{ action: actionMessage }
|
|
296
296
|
)
|
|
@@ -325,7 +325,7 @@ export const makeClient = <Locale extends string, R>(
|
|
|
325
325
|
onDefect: Effect.fnUntraced(function*(cause, i) {
|
|
326
326
|
const message = options.defectMessage
|
|
327
327
|
? yield* options.defectMessage(cause, i)
|
|
328
|
-
: intl.
|
|
328
|
+
: intl.formatMessage(
|
|
329
329
|
{ id: "handle.unexpected_error" },
|
|
330
330
|
{
|
|
331
331
|
action: actionMessage,
|
|
@@ -378,7 +378,7 @@ export const makeClient = <Locale extends string, R>(
|
|
|
378
378
|
// ),
|
|
379
379
|
ParseError: (e) => {
|
|
380
380
|
console.warn(e.toString())
|
|
381
|
-
return intl.
|
|
381
|
+
return intl.formatMessage({ id: "validation.failed" })
|
|
382
382
|
}
|
|
383
383
|
}),
|
|
384
384
|
Match.orElse((e) => `${e.message ?? e._tag ?? e}`)
|
package/src/makeIntl.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createIntl, createIntlCache, type Formatters, type IntlFormatters, type ResolvedIntlConfig } from "@formatjs/intl"
|
|
3
3
|
import { typedKeysOf } from "effect-app/utils"
|
|
4
4
|
import type { FormatXMLElementFn, PrimitiveType } from "intl-messageformat"
|
|
5
|
-
import {
|
|
5
|
+
import { type Ref, ref, watch } from "vue"
|
|
6
6
|
import { translate } from "./form.js"
|
|
7
7
|
import { makeContext } from "./makeContext.js"
|
|
8
8
|
|
|
@@ -48,7 +48,6 @@ export const makeIntl = <Locale extends string>(
|
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
49
49
|
) => intls[locale.value].formatMessage({ id: id as any }, values)
|
|
50
50
|
|
|
51
|
-
const intl = computed(() => intls[locale.value])
|
|
52
51
|
watch(
|
|
53
52
|
locale,
|
|
54
53
|
(locale) => {
|
|
@@ -58,7 +57,13 @@ export const makeIntl = <Locale extends string>(
|
|
|
58
57
|
{ immediate: true }
|
|
59
58
|
)
|
|
60
59
|
|
|
61
|
-
return {
|
|
60
|
+
return {
|
|
61
|
+
locale,
|
|
62
|
+
trans,
|
|
63
|
+
get intl() {
|
|
64
|
+
return intls[locale.value] as IntlShape<Locale>
|
|
65
|
+
}
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
return { useIntl, LocaleContext }
|
|
64
69
|
}
|
package/test/Mutation.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { it } from "@effect/vitest"
|
|
3
3
|
import { Cause, Effect, Exit, Fiber, Option } from "effect-app"
|
|
4
|
-
import { CommandContext, DefaultIntl } from "../src/experimental/
|
|
4
|
+
import { CommandContext, DefaultIntl } from "../src/experimental/commander.js"
|
|
5
5
|
import { Result } from "../src/lib.js"
|
|
6
6
|
import { useExperimental } from "./stubs.js"
|
|
7
7
|
|
|
@@ -9,8 +9,7 @@ it.live("works", () =>
|
|
|
9
9
|
Effect
|
|
10
10
|
.gen(function*() {
|
|
11
11
|
const toasts: any[] = []
|
|
12
|
-
const
|
|
13
|
-
const Command = useCommand()
|
|
12
|
+
const Command = useExperimental({ toasts })
|
|
14
13
|
|
|
15
14
|
let executed = false
|
|
16
15
|
|
|
@@ -50,11 +49,10 @@ it.live("has custom action name", () =>
|
|
|
50
49
|
Effect
|
|
51
50
|
.gen(function*() {
|
|
52
51
|
const toasts: any[] = []
|
|
53
|
-
const
|
|
52
|
+
const Command = useExperimental({
|
|
54
53
|
toasts,
|
|
55
54
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
56
55
|
})
|
|
57
|
-
const Command = useCommand()
|
|
58
56
|
|
|
59
57
|
let executed = false
|
|
60
58
|
|
|
@@ -78,8 +76,7 @@ it.live("can map the result", () =>
|
|
|
78
76
|
Effect
|
|
79
77
|
.gen(function*() {
|
|
80
78
|
const toasts: any[] = []
|
|
81
|
-
const
|
|
82
|
-
const Command = useCommand()
|
|
79
|
+
const Command = useExperimental({ toasts })
|
|
83
80
|
|
|
84
81
|
let executed = false
|
|
85
82
|
|
|
@@ -102,8 +99,7 @@ it.live("can receive and use input", () =>
|
|
|
102
99
|
Effect
|
|
103
100
|
.gen(function*() {
|
|
104
101
|
const toasts: any[] = []
|
|
105
|
-
const
|
|
106
|
-
const Command = useCommand()
|
|
102
|
+
const Command = useExperimental({ toasts })
|
|
107
103
|
|
|
108
104
|
let executed = false
|
|
109
105
|
|
|
@@ -125,11 +121,10 @@ it.live("can replace the result", () =>
|
|
|
125
121
|
Effect
|
|
126
122
|
.gen(function*() {
|
|
127
123
|
const toasts: any[] = []
|
|
128
|
-
const
|
|
124
|
+
const Command = useExperimental({
|
|
129
125
|
toasts,
|
|
130
126
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
131
127
|
})
|
|
132
|
-
const Command = useCommand()
|
|
133
128
|
|
|
134
129
|
let executed = false
|
|
135
130
|
|
|
@@ -152,11 +147,10 @@ it.live("with toasts", () =>
|
|
|
152
147
|
Effect
|
|
153
148
|
.gen(function*() {
|
|
154
149
|
const toasts: any[] = []
|
|
155
|
-
const
|
|
150
|
+
const Command = useExperimental({
|
|
156
151
|
toasts,
|
|
157
152
|
messages: DefaultIntl.en
|
|
158
153
|
})
|
|
159
|
-
const Command = useCommand()
|
|
160
154
|
|
|
161
155
|
let executed = false
|
|
162
156
|
|
|
@@ -193,8 +187,7 @@ it.live("interrupted", () =>
|
|
|
193
187
|
.gen(function*() {
|
|
194
188
|
let executed = false
|
|
195
189
|
const toasts: any[] = []
|
|
196
|
-
const
|
|
197
|
-
const Command = useCommand()
|
|
190
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
198
191
|
|
|
199
192
|
const command = Command.fn("Test Action")(
|
|
200
193
|
function*() {
|
|
@@ -221,8 +214,7 @@ it.live("fail", () =>
|
|
|
221
214
|
.gen(function*() {
|
|
222
215
|
let executed = false
|
|
223
216
|
const toasts: any[] = []
|
|
224
|
-
const
|
|
225
|
-
const Command = useCommand()
|
|
217
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
226
218
|
|
|
227
219
|
const command = Command.fn("Test Action")(
|
|
228
220
|
function*() {
|
|
@@ -249,8 +241,7 @@ it.live("fail and recover", () =>
|
|
|
249
241
|
.gen(function*() {
|
|
250
242
|
let executed = false
|
|
251
243
|
const toasts: any[] = []
|
|
252
|
-
const
|
|
253
|
-
const Command = useCommand()
|
|
244
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
254
245
|
|
|
255
246
|
const command = Command.fn("Test Action")(
|
|
256
247
|
function*() {
|
|
@@ -278,8 +269,7 @@ it.live("defect", () =>
|
|
|
278
269
|
.gen(function*() {
|
|
279
270
|
let executed = false
|
|
280
271
|
const toasts: any[] = []
|
|
281
|
-
const
|
|
282
|
-
const Command = useCommand()
|
|
272
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
283
273
|
|
|
284
274
|
const command = Command.fn("Test Action")(
|
|
285
275
|
function*() {
|
|
@@ -306,8 +296,7 @@ it.live("works with alt", () =>
|
|
|
306
296
|
Effect
|
|
307
297
|
.gen(function*() {
|
|
308
298
|
const toasts: any[] = []
|
|
309
|
-
const
|
|
310
|
-
const Command = useCommand()
|
|
299
|
+
const Command = useExperimental({ toasts })
|
|
311
300
|
|
|
312
301
|
let executed = false
|
|
313
302
|
|
|
@@ -349,11 +338,10 @@ it.live("has custom action name with alt", () =>
|
|
|
349
338
|
Effect
|
|
350
339
|
.gen(function*() {
|
|
351
340
|
const toasts: any[] = []
|
|
352
|
-
const
|
|
341
|
+
const Command = useExperimental({
|
|
353
342
|
toasts,
|
|
354
343
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
355
344
|
})
|
|
356
|
-
const Command = useCommand()
|
|
357
345
|
|
|
358
346
|
let executed = false
|
|
359
347
|
|
|
@@ -379,8 +367,7 @@ it.live("can map the result with alt", () =>
|
|
|
379
367
|
Effect
|
|
380
368
|
.gen(function*() {
|
|
381
369
|
const toasts: any[] = []
|
|
382
|
-
const
|
|
383
|
-
const Command = useCommand()
|
|
370
|
+
const Command = useExperimental({ toasts })
|
|
384
371
|
|
|
385
372
|
let executed = false
|
|
386
373
|
|
|
@@ -403,8 +390,7 @@ it.live("can receive and use input with alt", () =>
|
|
|
403
390
|
Effect
|
|
404
391
|
.gen(function*() {
|
|
405
392
|
const toasts: any[] = []
|
|
406
|
-
const
|
|
407
|
-
const Command = useCommand()
|
|
393
|
+
const Command = useExperimental({ toasts })
|
|
408
394
|
|
|
409
395
|
let executed = false
|
|
410
396
|
|
|
@@ -428,11 +414,10 @@ it.live("can replace the result with alt", () =>
|
|
|
428
414
|
Effect
|
|
429
415
|
.gen(function*() {
|
|
430
416
|
const toasts: any[] = []
|
|
431
|
-
const
|
|
417
|
+
const Command = useExperimental({
|
|
432
418
|
toasts,
|
|
433
419
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
434
420
|
})
|
|
435
|
-
const Command = useCommand()
|
|
436
421
|
|
|
437
422
|
let executed = false
|
|
438
423
|
|
|
@@ -457,11 +442,10 @@ it.live("with toasts with alt", () =>
|
|
|
457
442
|
Effect
|
|
458
443
|
.gen(function*() {
|
|
459
444
|
const toasts: any[] = []
|
|
460
|
-
const
|
|
445
|
+
const Command = useExperimental({
|
|
461
446
|
toasts,
|
|
462
447
|
messages: DefaultIntl.en
|
|
463
448
|
})
|
|
464
|
-
const Command = useCommand()
|
|
465
449
|
|
|
466
450
|
let executed = false
|
|
467
451
|
|
|
@@ -500,8 +484,7 @@ it.live("interrupted with alt", () =>
|
|
|
500
484
|
.gen(function*() {
|
|
501
485
|
let executed = false
|
|
502
486
|
const toasts: any[] = []
|
|
503
|
-
const
|
|
504
|
-
const Command = useCommand()
|
|
487
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
505
488
|
|
|
506
489
|
const command = Command.alt("Test Action")(
|
|
507
490
|
Effect.fnUntraced(
|
|
@@ -531,8 +514,7 @@ it.live("fail with alt", () =>
|
|
|
531
514
|
.gen(function*() {
|
|
532
515
|
let executed = false
|
|
533
516
|
const toasts: any[] = []
|
|
534
|
-
const
|
|
535
|
-
const Command = useCommand()
|
|
517
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
536
518
|
|
|
537
519
|
const command = Command.alt("Test Action")(
|
|
538
520
|
Effect.fnUntraced(
|
|
@@ -561,8 +543,7 @@ it.live("fail and recover with alt", () =>
|
|
|
561
543
|
.gen(function*() {
|
|
562
544
|
let executed = false
|
|
563
545
|
const toasts: any[] = []
|
|
564
|
-
const
|
|
565
|
-
const Command = useCommand()
|
|
546
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
566
547
|
|
|
567
548
|
const command = Command.alt("Test Action")(
|
|
568
549
|
Effect.fnUntraced(
|
|
@@ -592,8 +573,7 @@ it.live("defect with alt", () =>
|
|
|
592
573
|
.gen(function*() {
|
|
593
574
|
let executed = false
|
|
594
575
|
const toasts: any[] = []
|
|
595
|
-
const
|
|
596
|
-
const Command = useCommand()
|
|
576
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
597
577
|
|
|
598
578
|
const command = Command.alt("Test Action")(
|
|
599
579
|
Effect.fnUntraced(
|
package/test/dist/stubs.d.ts
CHANGED
|
@@ -1,29 +1,66 @@
|
|
|
1
1
|
import { type MessageFormatElement } from "@formatjs/icu-messageformat-parser";
|
|
2
|
+
import { Effect, Layer } from "effect-app";
|
|
3
|
+
import { IntlSvc } from "../src/experimental/intl.js";
|
|
4
|
+
export declare const fakeIntlLayer: (messages?: Record<string, string> | Record<string, MessageFormatElement[]>) => Layer.Layer<IntlSvc, never, never>;
|
|
2
5
|
export declare const useExperimental: (options?: {
|
|
3
6
|
messages?: Record<string, string> | Record<string, MessageFormatElement[]>;
|
|
4
7
|
toasts: any[];
|
|
5
8
|
}) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
alt: (actionName: string) => <Args extends ReadonlyArray<any>, A, E, R_1 extends import("../src/experimental/commander.js").CommandContext>(handler: (...args: Args) => Effect.Effect<A, E, R_1>) => import("vue").ComputedRef<((...a: Args) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<A, E>, never>) & import("../src/experimental/commander.js").CommandProps<A, E>>;
|
|
10
|
+
fn: (actionName: string) => {
|
|
11
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, import("../src/experimental/commander.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<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>, never>) & {
|
|
12
|
+
action: string;
|
|
13
|
+
result: import("@effect-atom/atom/Result").Result<AEff, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never>;
|
|
14
|
+
waiting: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_1, Args_1 extends Array<any>, A_1 extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_1) => Generator<Eff, AEff_1, never>, a: (_: Effect.Effect<AEff_1, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_1>) => A_1): import("vue").ComputedRef<((...a: Args_1) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<A_1>, Effect.Effect.Error<A_1>>, never>) & {
|
|
17
|
+
action: string;
|
|
18
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<A_1>, Effect.Effect.Error<A_1>>;
|
|
19
|
+
waiting: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_2, Args_2 extends Array<any>, A_2, B extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_2) => Generator<Eff, AEff_2, never>, a: (_: Effect.Effect<AEff_2, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_2>) => A_2, b: (_: A_2, ...args: import("effect/Types").NoInfer<Args_2>) => B): import("vue").ComputedRef<((...a: Args_2) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<B>, Effect.Effect.Error<B>>, never>) & {
|
|
22
|
+
action: string;
|
|
23
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<B>, Effect.Effect.Error<B>>;
|
|
24
|
+
waiting: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_3, Args_3 extends Array<any>, A_3, B_1, C extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_3) => Generator<Eff, AEff_3, never>, a: (_: Effect.Effect<AEff_3, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_3>) => A_3, b: (_: A_3, ...args: import("effect/Types").NoInfer<Args_3>) => B_1, c: (_: B_1, ...args: import("effect/Types").NoInfer<Args_3>) => C): import("vue").ComputedRef<((...a: Args_3) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<C>, Effect.Effect.Error<C>>, never>) & {
|
|
27
|
+
action: string;
|
|
28
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<C>, Effect.Effect.Error<C>>;
|
|
29
|
+
waiting: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_4, Args_4 extends Array<any>, A_4, B_2, C_1, D extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_4) => Generator<Eff, AEff_4, never>, a: (_: Effect.Effect<AEff_4, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_1, infer _R>>] ? E_1 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_4>) => A_4, b: (_: A_4, ...args: import("effect/Types").NoInfer<Args_4>) => B_2, c: (_: B_2, ...args: import("effect/Types").NoInfer<Args_4>) => C_1, d: (_: C_1, ...args: import("effect/Types").NoInfer<Args_4>) => D): import("vue").ComputedRef<((...a: Args_4) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<D>, Effect.Effect.Error<D>>, never>) & {
|
|
32
|
+
action: string;
|
|
33
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<D>, Effect.Effect.Error<D>>;
|
|
34
|
+
waiting: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_5, Args_5 extends Array<any>, A_5, B_3, C_2, D_1, E_1 extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_5) => Generator<Eff, AEff_5, never>, a: (_: Effect.Effect<AEff_5, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_2, infer _R>>] ? E_2 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_5>) => A_5, b: (_: A_5, ...args: import("effect/Types").NoInfer<Args_5>) => B_3, c: (_: B_3, ...args: import("effect/Types").NoInfer<Args_5>) => C_2, d: (_: C_2, ...args: import("effect/Types").NoInfer<Args_5>) => D_1, e: (_: D_1, ...args: import("effect/Types").NoInfer<Args_5>) => E_1): import("vue").ComputedRef<((...a: Args_5) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<E_1>, Effect.Effect.Error<E_1>>, never>) & {
|
|
37
|
+
action: string;
|
|
38
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<E_1>, Effect.Effect.Error<E_1>>;
|
|
39
|
+
waiting: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_6, Args_6 extends Array<any>, A_6, B_4, C_3, D_2, E_2, F extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_6) => Generator<Eff, AEff_6, never>, a: (_: Effect.Effect<AEff_6, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_3, infer _R>>] ? E_3 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_6>) => A_6, b: (_: A_6, ...args: import("effect/Types").NoInfer<Args_6>) => B_4, c: (_: B_4, ...args: import("effect/Types").NoInfer<Args_6>) => C_3, d: (_: C_3, ...args: import("effect/Types").NoInfer<Args_6>) => D_2, e: (_: D_2, ...args: import("effect/Types").NoInfer<Args_6>) => E_2, f: (_: E_2, ...args: import("effect/Types").NoInfer<Args_6>) => F): import("vue").ComputedRef<((...a: Args_6) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<F>, Effect.Effect.Error<F>>, never>) & {
|
|
42
|
+
action: string;
|
|
43
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<F>, Effect.Effect.Error<F>>;
|
|
44
|
+
waiting: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_7, Args_7 extends Array<any>, A_7, B_5, C_4, D_3, E_3, F_1, G extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_7) => Generator<Eff, AEff_7, never>, a: (_: Effect.Effect<AEff_7, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_4, infer _R>>] ? E_4 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_7>) => A_7, b: (_: A_7, ...args: import("effect/Types").NoInfer<Args_7>) => B_5, c: (_: B_5, ...args: import("effect/Types").NoInfer<Args_7>) => C_4, d: (_: C_4, ...args: import("effect/Types").NoInfer<Args_7>) => D_3, e: (_: D_3, ...args: import("effect/Types").NoInfer<Args_7>) => E_3, f: (_: E_3, ...args: import("effect/Types").NoInfer<Args_7>) => F_1, g: (_: F_1, ...args: import("effect/Types").NoInfer<Args_7>) => G): import("vue").ComputedRef<((...a: Args_7) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<G>, Effect.Effect.Error<G>>, never>) & {
|
|
47
|
+
action: string;
|
|
48
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<G>, Effect.Effect.Error<G>>;
|
|
49
|
+
waiting: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_8, Args_8 extends Array<any>, A_8, B_6, C_5, D_4, E_4, F_2, G_1, H extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_8) => Generator<Eff, AEff_8, never>, a: (_: Effect.Effect<AEff_8, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_5, infer _R>>] ? E_5 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_8>) => A_8, b: (_: A_8, ...args: import("effect/Types").NoInfer<Args_8>) => B_6, c: (_: B_6, ...args: import("effect/Types").NoInfer<Args_8>) => C_5, d: (_: C_5, ...args: import("effect/Types").NoInfer<Args_8>) => D_4, e: (_: D_4, ...args: import("effect/Types").NoInfer<Args_8>) => E_4, f: (_: E_4, ...args: import("effect/Types").NoInfer<Args_8>) => F_2, g: (_: F_2, ...args: import("effect/Types").NoInfer<Args_8>) => G_1, h: (_: G_1, ...args: import("effect/Types").NoInfer<Args_8>) => H): import("vue").ComputedRef<((...a: Args_8) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<H>, Effect.Effect.Error<H>>, never>) & {
|
|
52
|
+
action: string;
|
|
53
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<H>, Effect.Effect.Error<H>>;
|
|
54
|
+
waiting: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
<Eff extends import("effect/Utils").YieldWrap<Effect.Effect<any, any, any>>, AEff_9, Args_9 extends Array<any>, A_9, B_7, C_6, D_5, E_5, F_3, G_2, H_1, I extends Effect.Effect<any, any, import("../src/experimental/commander.js").CommandContext>>(body: (...args: Args_9) => Generator<Eff, AEff_9, never>, a: (_: Effect.Effect<AEff_9, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A, infer E_6, infer _R>>] ? E_6 : never, [Eff] extends [never] ? never : [Eff] extends [import("effect/Utils").YieldWrap<Effect.Effect<infer _A_1, infer _E, infer R_2>>] ? R_2 : never>, ...args: import("effect/Types").NoInfer<Args_9>) => A_9, b: (_: A_9, ...args: import("effect/Types").NoInfer<Args_9>) => B_7, c: (_: B_7, ...args: import("effect/Types").NoInfer<Args_9>) => C_6, d: (_: C_6, ...args: import("effect/Types").NoInfer<Args_9>) => D_5, e: (_: D_5, ...args: import("effect/Types").NoInfer<Args_9>) => E_5, f: (_: E_5, ...args: import("effect/Types").NoInfer<Args_9>) => F_3, g: (_: F_3, ...args: import("effect/Types").NoInfer<Args_9>) => G_2, h: (_: G_2, ...args: import("effect/Types").NoInfer<Args_9>) => H_1, i: (_: H_1, ...args: import("effect/Types").NoInfer<Args_9>) => I): import("vue").ComputedRef<((...a: Args_9) => import("effect/Fiber").RuntimeFiber<import("effect/Exit").Exit<Effect.Effect.Success<I>, Effect.Effect.Error<I>>, never>) & {
|
|
57
|
+
action: string;
|
|
58
|
+
result: import("@effect-atom/atom/Result").Result<Effect.Effect.Success<I>, Effect.Effect.Error<I>>;
|
|
59
|
+
waiting: boolean;
|
|
60
|
+
}>;
|
|
9
61
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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>) & 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>, ...args: import("effect/Types").NoInfer<Args_1>) => 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>, ...args: import("effect/Types").NoInfer<Args_2>) => A_1, b: (_: A_1, ...args: import("effect/Types").NoInfer<Args_2>) => 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>, ...args: import("effect/Types").NoInfer<Args_3>) => A_2, b: (_: A_2, ...args: import("effect/Types").NoInfer<Args_3>) => B_1, c: (_: B_1, ...args: import("effect/Types").NoInfer<Args_3>) => 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>, ...args: import("effect/Types").NoInfer<Args_4>) => A_3, b: (_: A_3, ...args: import("effect/Types").NoInfer<Args_4>) => B_2, c: (_: B_2, ...args: import("effect/Types").NoInfer<Args_4>) => C_1, d: (_: C_1, ...args: import("effect/Types").NoInfer<Args_4>) => 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>, ...args: import("effect/Types").NoInfer<Args_5>) => A_4, b: (_: A_4, ...args: import("effect/Types").NoInfer<Args_5>) => B_3, c: (_: B_3, ...args: import("effect/Types").NoInfer<Args_5>) => C_2, d: (_: C_2, ...args: import("effect/Types").NoInfer<Args_5>) => D_1, e: (_: D_1, ...args: import("effect/Types").NoInfer<Args_5>) => 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>, ...args: import("effect/Types").NoInfer<Args_6>) => A_5, b: (_: A_5, ...args: import("effect/Types").NoInfer<Args_6>) => B_4, c: (_: B_4, ...args: import("effect/Types").NoInfer<Args_6>) => C_3, d: (_: C_3, ...args: import("effect/Types").NoInfer<Args_6>) => D_2, e: (_: D_2, ...args: import("effect/Types").NoInfer<Args_6>) => E_2, f: (_: E_2, ...args: import("effect/Types").NoInfer<Args_6>) => 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>, ...args: import("effect/Types").NoInfer<Args_7>) => A_6, b: (_: A_6, ...args: import("effect/Types").NoInfer<Args_7>) => B_5, c: (_: B_5, ...args: import("effect/Types").NoInfer<Args_7>) => C_4, d: (_: C_4, ...args: import("effect/Types").NoInfer<Args_7>) => D_3, e: (_: D_3, ...args: import("effect/Types").NoInfer<Args_7>) => E_3, f: (_: E_3, ...args: import("effect/Types").NoInfer<Args_7>) => F_1, g: (_: F_1, ...args: import("effect/Types").NoInfer<Args_7>) => 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>, ...args: import("effect/Types").NoInfer<Args_8>) => A_7, b: (_: A_7, ...args: import("effect/Types").NoInfer<Args_8>) => B_6, c: (_: B_6, ...args: import("effect/Types").NoInfer<Args_8>) => C_5, d: (_: C_5, ...args: import("effect/Types").NoInfer<Args_8>) => D_4, e: (_: D_4, ...args: import("effect/Types").NoInfer<Args_8>) => E_4, f: (_: E_4, ...args: import("effect/Types").NoInfer<Args_8>) => F_2, g: (_: F_2, ...args: import("effect/Types").NoInfer<Args_8>) => G_1, h: (_: G_1, ...args: import("effect/Types").NoInfer<Args_8>) => 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>, ...args: import("effect/Types").NoInfer<Args_9>) => A_8, b: (_: A_8, ...args: import("effect/Types").NoInfer<Args_9>) => B_7, c: (_: B_7, ...args: import("effect/Types").NoInfer<Args_9>) => C_6, d: (_: C_6, ...args: import("effect/Types").NoInfer<Args_9>) => D_5, e: (_: D_5, ...args: import("effect/Types").NoInfer<Args_9>) => E_5, f: (_: E_5, ...args: import("effect/Types").NoInfer<Args_9>) => F_3, g: (_: F_3, ...args: import("effect/Types").NoInfer<Args_9>) => G_2, h: (_: G_2, ...args: import("effect/Types").NoInfer<Args_9>) => H_1, i: (_: H_1, ...args: import("effect/Types").NoInfer<Args_9>) => 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>>>;
|
|
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>>;
|
|
26
|
-
};
|
|
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>;
|
|
62
|
+
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, import("../src/experimental/commander.js").CommandContext>;
|
|
63
|
+
withDefaultToast: <A_10, E_6>(errorRenderer?: ((e: E_6) => string | undefined) | undefined) => (self: Effect.Effect<A_10, E_6, import("../src/experimental/commander.js").CommandContext>) => Effect.Effect<A_10, E_6, import("../src/experimental/commander.js").CommandContext>;
|
|
64
|
+
_tag: "Commander";
|
|
28
65
|
};
|
|
29
66
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../stubs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAE9E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AA8CrD,eAAO,MAAM,aAAa,GAAI,WAAU,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAM,uCAgBzG,CAAA;AAEH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAQ0uT,CAAC;+CAA6I,CAAC;;CADj+T,CAAA"}
|
package/test/dist/stubs.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
import * as Intl from "@formatjs/intl";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Effect, Layer } from "effect-app";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
import { Commander } from "../src/experimental/commander.js";
|
|
5
|
+
import { IntlSvc } from "../src/experimental/intl.js";
|
|
4
6
|
import { makeExperimental } from "../src/experimental/makeExperimental.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// trans: (id: string) => id,
|
|
8
|
-
// intl: ref({ formatMessage: (msg: { id: string }) => msg.id })
|
|
9
|
-
// } as unknown as ReturnType<ReturnType<typeof makeIntl<string>>["useIntl"]>
|
|
10
|
-
const makeUseIntl = (messages) => () => {
|
|
11
|
-
const locale = ref("en");
|
|
12
|
-
const intlCache = Intl.createIntlCache();
|
|
13
|
-
const intl = Intl.createIntl({
|
|
14
|
-
locale: locale.value,
|
|
15
|
-
messages
|
|
16
|
-
}, intlCache);
|
|
17
|
-
return { locale, intl: computed(() => intl), trans: (id, values) => intl.formatMessage({ id }, values) };
|
|
18
|
-
};
|
|
19
|
-
export const useExperimental = (options) => {
|
|
20
|
-
const toasts = options?.toasts ?? [];
|
|
21
|
-
const useIntl = makeUseIntl({ ...options?.messages });
|
|
7
|
+
import { ToastSvc } from "../src/experimental/toast.js";
|
|
8
|
+
const fakeToastLayer = (toasts = []) => ToastSvc.toLayer(Effect.sync(() => {
|
|
22
9
|
const dismiss = (id) => {
|
|
23
10
|
const idx = toasts.findIndex((_) => _.id === id);
|
|
24
11
|
if (idx > -1) {
|
|
@@ -49,12 +36,31 @@ export const useExperimental = (options) => {
|
|
|
49
36
|
}
|
|
50
37
|
return id;
|
|
51
38
|
};
|
|
52
|
-
return
|
|
39
|
+
return {
|
|
53
40
|
error: fakeToast,
|
|
54
41
|
warning: fakeToast,
|
|
55
42
|
success: fakeToast,
|
|
56
43
|
info: fakeToast,
|
|
57
44
|
dismiss
|
|
58
|
-
}
|
|
45
|
+
};
|
|
46
|
+
}));
|
|
47
|
+
export const fakeIntlLayer = (messages = {}) => IntlSvc.toLayer(Effect.sync(() => {
|
|
48
|
+
const locale = ref("en");
|
|
49
|
+
const intlCache = Intl.createIntlCache();
|
|
50
|
+
const intl = Intl.createIntl({
|
|
51
|
+
locale: locale.value,
|
|
52
|
+
messages
|
|
53
|
+
}, intlCache);
|
|
54
|
+
return {
|
|
55
|
+
locale,
|
|
56
|
+
intl,
|
|
57
|
+
trans: (id, values) => intl.formatMessage({ id }, values)
|
|
58
|
+
};
|
|
59
|
+
}));
|
|
60
|
+
export const useExperimental = (options) => {
|
|
61
|
+
const FakeIntlLayer = fakeIntlLayer(options?.messages);
|
|
62
|
+
const FakeToastLayer = fakeToastLayer(options?.toasts);
|
|
63
|
+
const CommanderLayer = Commander.Default.pipe(Layer.provide([FakeIntlLayer, FakeToastLayer]));
|
|
64
|
+
return Effect.runSync(makeExperimental().pipe(Effect.provide(CommanderLayer)));
|
|
59
65
|
};
|
|
60
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
66
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R1YnMuanMiLCJzb3V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