@effect-app/vue 2.52.3 → 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 +12 -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 +22 -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 -74
- 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 -563
- 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,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { it } from "@effect/vitest"
|
|
2
3
|
import { Cause, Effect, Exit, Fiber, Option } from "effect-app"
|
|
3
|
-
import { CommandContext, DefaultIntl } from "../src/experimental/
|
|
4
|
+
import { CommandContext, DefaultIntl } from "../src/experimental/commander.js"
|
|
4
5
|
import { Result } from "../src/lib.js"
|
|
5
6
|
import { useExperimental } from "./stubs.js"
|
|
6
7
|
|
|
@@ -8,8 +9,7 @@ it.live("works", () =>
|
|
|
8
9
|
Effect
|
|
9
10
|
.gen(function*() {
|
|
10
11
|
const toasts: any[] = []
|
|
11
|
-
const
|
|
12
|
-
const Command = useCommand()
|
|
12
|
+
const Command = useExperimental({ toasts })
|
|
13
13
|
|
|
14
14
|
let executed = false
|
|
15
15
|
|
|
@@ -49,11 +49,10 @@ it.live("has custom action name", () =>
|
|
|
49
49
|
Effect
|
|
50
50
|
.gen(function*() {
|
|
51
51
|
const toasts: any[] = []
|
|
52
|
-
const
|
|
52
|
+
const Command = useExperimental({
|
|
53
53
|
toasts,
|
|
54
54
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
55
55
|
})
|
|
56
|
-
const Command = useCommand()
|
|
57
56
|
|
|
58
57
|
let executed = false
|
|
59
58
|
|
|
@@ -77,8 +76,7 @@ it.live("can map the result", () =>
|
|
|
77
76
|
Effect
|
|
78
77
|
.gen(function*() {
|
|
79
78
|
const toasts: any[] = []
|
|
80
|
-
const
|
|
81
|
-
const Command = useCommand()
|
|
79
|
+
const Command = useExperimental({ toasts })
|
|
82
80
|
|
|
83
81
|
let executed = false
|
|
84
82
|
|
|
@@ -101,8 +99,7 @@ it.live("can receive and use input", () =>
|
|
|
101
99
|
Effect
|
|
102
100
|
.gen(function*() {
|
|
103
101
|
const toasts: any[] = []
|
|
104
|
-
const
|
|
105
|
-
const Command = useCommand()
|
|
102
|
+
const Command = useExperimental({ toasts })
|
|
106
103
|
|
|
107
104
|
let executed = false
|
|
108
105
|
|
|
@@ -124,11 +121,10 @@ it.live("can replace the result", () =>
|
|
|
124
121
|
Effect
|
|
125
122
|
.gen(function*() {
|
|
126
123
|
const toasts: any[] = []
|
|
127
|
-
const
|
|
124
|
+
const Command = useExperimental({
|
|
128
125
|
toasts,
|
|
129
126
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
130
127
|
})
|
|
131
|
-
const Command = useCommand()
|
|
132
128
|
|
|
133
129
|
let executed = false
|
|
134
130
|
|
|
@@ -151,11 +147,10 @@ it.live("with toasts", () =>
|
|
|
151
147
|
Effect
|
|
152
148
|
.gen(function*() {
|
|
153
149
|
const toasts: any[] = []
|
|
154
|
-
const
|
|
150
|
+
const Command = useExperimental({
|
|
155
151
|
toasts,
|
|
156
152
|
messages: DefaultIntl.en
|
|
157
153
|
})
|
|
158
|
-
const Command = useCommand()
|
|
159
154
|
|
|
160
155
|
let executed = false
|
|
161
156
|
|
|
@@ -192,8 +187,7 @@ it.live("interrupted", () =>
|
|
|
192
187
|
.gen(function*() {
|
|
193
188
|
let executed = false
|
|
194
189
|
const toasts: any[] = []
|
|
195
|
-
const
|
|
196
|
-
const Command = useCommand()
|
|
190
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
197
191
|
|
|
198
192
|
const command = Command.fn("Test Action")(
|
|
199
193
|
function*() {
|
|
@@ -220,8 +214,7 @@ it.live("fail", () =>
|
|
|
220
214
|
.gen(function*() {
|
|
221
215
|
let executed = false
|
|
222
216
|
const toasts: any[] = []
|
|
223
|
-
const
|
|
224
|
-
const Command = useCommand()
|
|
217
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
225
218
|
|
|
226
219
|
const command = Command.fn("Test Action")(
|
|
227
220
|
function*() {
|
|
@@ -248,8 +241,7 @@ it.live("fail and recover", () =>
|
|
|
248
241
|
.gen(function*() {
|
|
249
242
|
let executed = false
|
|
250
243
|
const toasts: any[] = []
|
|
251
|
-
const
|
|
252
|
-
const Command = useCommand()
|
|
244
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
253
245
|
|
|
254
246
|
const command = Command.fn("Test Action")(
|
|
255
247
|
function*() {
|
|
@@ -277,8 +269,7 @@ it.live("defect", () =>
|
|
|
277
269
|
.gen(function*() {
|
|
278
270
|
let executed = false
|
|
279
271
|
const toasts: any[] = []
|
|
280
|
-
const
|
|
281
|
-
const Command = useCommand()
|
|
272
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
282
273
|
|
|
283
274
|
const command = Command.fn("Test Action")(
|
|
284
275
|
function*() {
|
|
@@ -305,8 +296,7 @@ it.live("works with alt", () =>
|
|
|
305
296
|
Effect
|
|
306
297
|
.gen(function*() {
|
|
307
298
|
const toasts: any[] = []
|
|
308
|
-
const
|
|
309
|
-
const Command = useCommand()
|
|
299
|
+
const Command = useExperimental({ toasts })
|
|
310
300
|
|
|
311
301
|
let executed = false
|
|
312
302
|
|
|
@@ -348,11 +338,10 @@ it.live("has custom action name with alt", () =>
|
|
|
348
338
|
Effect
|
|
349
339
|
.gen(function*() {
|
|
350
340
|
const toasts: any[] = []
|
|
351
|
-
const
|
|
341
|
+
const Command = useExperimental({
|
|
352
342
|
toasts,
|
|
353
343
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
354
344
|
})
|
|
355
|
-
const Command = useCommand()
|
|
356
345
|
|
|
357
346
|
let executed = false
|
|
358
347
|
|
|
@@ -378,8 +367,7 @@ it.live("can map the result with alt", () =>
|
|
|
378
367
|
Effect
|
|
379
368
|
.gen(function*() {
|
|
380
369
|
const toasts: any[] = []
|
|
381
|
-
const
|
|
382
|
-
const Command = useCommand()
|
|
370
|
+
const Command = useExperimental({ toasts })
|
|
383
371
|
|
|
384
372
|
let executed = false
|
|
385
373
|
|
|
@@ -402,8 +390,7 @@ it.live("can receive and use input with alt", () =>
|
|
|
402
390
|
Effect
|
|
403
391
|
.gen(function*() {
|
|
404
392
|
const toasts: any[] = []
|
|
405
|
-
const
|
|
406
|
-
const Command = useCommand()
|
|
393
|
+
const Command = useExperimental({ toasts })
|
|
407
394
|
|
|
408
395
|
let executed = false
|
|
409
396
|
|
|
@@ -427,11 +414,10 @@ it.live("can replace the result with alt", () =>
|
|
|
427
414
|
Effect
|
|
428
415
|
.gen(function*() {
|
|
429
416
|
const toasts: any[] = []
|
|
430
|
-
const
|
|
417
|
+
const Command = useExperimental({
|
|
431
418
|
toasts,
|
|
432
419
|
messages: { "action.Test Action": "Test Action Translated" }
|
|
433
420
|
})
|
|
434
|
-
const Command = useCommand()
|
|
435
421
|
|
|
436
422
|
let executed = false
|
|
437
423
|
|
|
@@ -456,11 +442,10 @@ it.live("with toasts with alt", () =>
|
|
|
456
442
|
Effect
|
|
457
443
|
.gen(function*() {
|
|
458
444
|
const toasts: any[] = []
|
|
459
|
-
const
|
|
445
|
+
const Command = useExperimental({
|
|
460
446
|
toasts,
|
|
461
447
|
messages: DefaultIntl.en
|
|
462
448
|
})
|
|
463
|
-
const Command = useCommand()
|
|
464
449
|
|
|
465
450
|
let executed = false
|
|
466
451
|
|
|
@@ -499,8 +484,7 @@ it.live("interrupted with alt", () =>
|
|
|
499
484
|
.gen(function*() {
|
|
500
485
|
let executed = false
|
|
501
486
|
const toasts: any[] = []
|
|
502
|
-
const
|
|
503
|
-
const Command = useCommand()
|
|
487
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
504
488
|
|
|
505
489
|
const command = Command.alt("Test Action")(
|
|
506
490
|
Effect.fnUntraced(
|
|
@@ -530,8 +514,7 @@ it.live("fail with alt", () =>
|
|
|
530
514
|
.gen(function*() {
|
|
531
515
|
let executed = false
|
|
532
516
|
const toasts: any[] = []
|
|
533
|
-
const
|
|
534
|
-
const Command = useCommand()
|
|
517
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
535
518
|
|
|
536
519
|
const command = Command.alt("Test Action")(
|
|
537
520
|
Effect.fnUntraced(
|
|
@@ -560,8 +543,7 @@ it.live("fail and recover with alt", () =>
|
|
|
560
543
|
.gen(function*() {
|
|
561
544
|
let executed = false
|
|
562
545
|
const toasts: any[] = []
|
|
563
|
-
const
|
|
564
|
-
const Command = useCommand()
|
|
546
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
565
547
|
|
|
566
548
|
const command = Command.alt("Test Action")(
|
|
567
549
|
Effect.fnUntraced(
|
|
@@ -591,8 +573,7 @@ it.live("defect with alt", () =>
|
|
|
591
573
|
.gen(function*() {
|
|
592
574
|
let executed = false
|
|
593
575
|
const toasts: any[] = []
|
|
594
|
-
const
|
|
595
|
-
const Command = useCommand()
|
|
576
|
+
const Command = useExperimental({ toasts, messages: DefaultIntl.en })
|
|
596
577
|
|
|
597
578
|
const command = Command.alt("Test Action")(
|
|
598
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>) => 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>>>;
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R1YnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zdHVicy50cyJdLCJuYW1lcyI6W10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