@effect-app/vue 4.0.0-beta.16 → 4.0.0-beta.160
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 +1016 -0
- package/dist/commander.d.ts +370 -0
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +587 -0
- package/dist/confirm.d.ts +19 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +24 -0
- package/dist/errorReporter.d.ts +4 -4
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +12 -18
- package/dist/form.d.ts +13 -4
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +41 -12
- package/dist/index.d.ts +1 -1
- package/dist/intl.d.ts +15 -0
- package/dist/intl.d.ts.map +1 -0
- package/dist/intl.js +9 -0
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/makeClient.d.ts +97 -276
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +94 -353
- package/dist/makeContext.d.ts +1 -1
- package/dist/makeContext.d.ts.map +1 -1
- package/dist/makeIntl.d.ts +1 -1
- package/dist/makeIntl.d.ts.map +1 -1
- package/dist/makeUseCommand.d.ts +8 -0
- package/dist/makeUseCommand.d.ts.map +1 -0
- package/dist/makeUseCommand.js +13 -0
- package/dist/mutate.d.ts +2 -2
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +1 -1
- package/dist/query.d.ts +11 -15
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +17 -26
- package/dist/routeParams.d.ts +1 -1
- package/dist/runtime.d.ts +5 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +27 -17
- package/dist/toast.d.ts +46 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +32 -0
- package/dist/withToast.d.ts +26 -0
- package/dist/withToast.d.ts.map +1 -0
- package/dist/withToast.js +49 -0
- package/eslint.config.mjs +2 -2
- package/package.json +48 -48
- package/src/{experimental/commander.ts → commander.ts} +922 -249
- package/src/{experimental/confirm.ts → confirm.ts} +10 -14
- package/src/errorReporter.ts +60 -72
- package/src/form.ts +55 -16
- package/src/intl.ts +12 -0
- package/src/makeClient.ts +305 -1015
- package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +3 -3
- package/src/query.ts +37 -48
- package/src/runtime.ts +39 -18
- package/src/{experimental/toast.ts → toast.ts} +11 -25
- package/src/{experimental/withToast.ts → withToast.ts} +15 -6
- package/test/Mutation.test.ts +130 -10
- package/test/dist/form.test.d.ts.map +1 -1
- package/test/dist/stubs.d.ts +1103 -118
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +56 -23
- package/test/form-validation-errors.test.ts +23 -19
- package/test/form.test.ts +20 -2
- package/test/makeClient.test.ts +93 -39
- package/test/stubs.ts +83 -41
- package/tsconfig.json +0 -1
- package/tsconfig.json.bak +2 -2
- package/tsconfig.src.json +34 -34
- package/tsconfig.test.json +2 -2
- package/vitest.config.ts +5 -5
- package/dist/experimental/commander.d.ts +0 -359
- package/dist/experimental/commander.d.ts.map +0 -1
- package/dist/experimental/commander.js +0 -557
- package/dist/experimental/confirm.d.ts +0 -19
- package/dist/experimental/confirm.d.ts.map +0 -1
- package/dist/experimental/confirm.js +0 -28
- package/dist/experimental/intl.d.ts +0 -16
- package/dist/experimental/intl.d.ts.map +0 -1
- package/dist/experimental/intl.js +0 -5
- package/dist/experimental/makeUseCommand.d.ts +0 -8
- package/dist/experimental/makeUseCommand.d.ts.map +0 -1
- package/dist/experimental/makeUseCommand.js +0 -13
- package/dist/experimental/toast.d.ts +0 -47
- package/dist/experimental/toast.d.ts.map +0 -1
- package/dist/experimental/toast.js +0 -41
- package/dist/experimental/withToast.d.ts +0 -25
- package/dist/experimental/withToast.d.ts.map +0 -1
- package/dist/experimental/withToast.js +0 -45
- package/src/experimental/intl.ts +0 -9
package/tsconfig.src.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
],
|
|
8
|
-
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
// keep in here, cause madge can't detect it from extended tsconfig
|
|
12
|
-
"moduleResolution": "Node16",
|
|
13
|
-
"outDir": "./dist"
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"./src/**/*.ts"
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"esnext",
|
|
6
|
+
"DOM"
|
|
17
7
|
],
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
8
|
+
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"rootDir": "./src",
|
|
11
|
+
// keep in here, cause madge can't detect it from extended tsconfig
|
|
12
|
+
"moduleResolution": "Node16",
|
|
13
|
+
"outDir": "./dist"
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"./src/**/*.ts"
|
|
17
|
+
],
|
|
18
|
+
"exclude": [
|
|
19
|
+
"./dist",
|
|
20
|
+
"*.test.ts",
|
|
21
|
+
"node_modules",
|
|
22
|
+
"build",
|
|
23
|
+
"lib",
|
|
24
|
+
"dist",
|
|
25
|
+
"**/*.d.ts.map",
|
|
26
|
+
".git",
|
|
27
|
+
".data",
|
|
28
|
+
"**/.*",
|
|
29
|
+
"**/*.tmp"
|
|
30
|
+
],
|
|
31
|
+
"references": [
|
|
32
|
+
{
|
|
33
|
+
"path": "../effect-app"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
package/tsconfig.test.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="vitest" />
|
|
2
|
+
import vue from "@vitejs/plugin-vue"
|
|
2
3
|
import { defineConfig } from "vitest/config"
|
|
3
|
-
import vue from '@vitejs/plugin-vue'
|
|
4
4
|
import makeConfig from "../../vite.config.base"
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
...makeConfig(__dirname),
|
|
8
8
|
plugins: [vue()],
|
|
9
9
|
test: {
|
|
10
|
-
environment:
|
|
11
|
-
include: [
|
|
12
|
-
exclude: [
|
|
10
|
+
environment: "jsdom",
|
|
11
|
+
include: ["src/**/*.test.{ts,tsx}", "**/test/**/*.test.{ts,tsx}", "**/__tests__/**/*.test.{ts,tsx}"],
|
|
12
|
+
exclude: ["node_modules/**", "dist/**"],
|
|
13
13
|
globals: true
|
|
14
14
|
},
|
|
15
15
|
optimizeDeps: {
|
|
16
|
-
exclude: [
|
|
16
|
+
exclude: ["**/__tests__/**", "**/test/**", "**/*.test.*"]
|
|
17
17
|
}
|
|
18
18
|
})
|
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { type MissingDependencies } from "@effect-app/vue";
|
|
2
|
-
import { Effect, type Exit, type Fiber, Layer, Option, ServiceMap } from "effect-app";
|
|
3
|
-
import { type AsyncResult } from "effect/unstable/reactivity/AsyncResult";
|
|
4
|
-
import { type FormatXMLElementFn, type PrimitiveType } from "intl-messageformat";
|
|
5
|
-
import { type ComputedRef } from "vue";
|
|
6
|
-
import { Confirm } from "./confirm.js";
|
|
7
|
-
import { I18n } from "./intl.js";
|
|
8
|
-
import { WithToast } from "./withToast.js";
|
|
9
|
-
type IntlRecord = Record<string, PrimitiveType | FormatXMLElementFn<string, string>>;
|
|
10
|
-
type FnOptions<Id extends string, I18nCustomKey extends string, State extends IntlRecord | undefined> = {
|
|
11
|
-
i18nCustomKey?: I18nCustomKey;
|
|
12
|
-
/**
|
|
13
|
-
* passed to the i18n formatMessage calls so you can use it in translation messagee
|
|
14
|
-
* including the Command `action` string.
|
|
15
|
-
* Automatically wrapped with Computed if just a thunk.
|
|
16
|
-
* provided as Command.state tag, so you can access it in the function.
|
|
17
|
-
*/
|
|
18
|
-
state?: ComputedRef<State> | (() => State);
|
|
19
|
-
blockKey?: (id: Id) => string | undefined;
|
|
20
|
-
waitKey?: (id: Id) => string | undefined;
|
|
21
|
-
allowed?: (id: Id, state: ComputedRef<State>) => boolean;
|
|
22
|
-
};
|
|
23
|
-
type FnOptionsInternal<I18nCustomKey extends string> = {
|
|
24
|
-
i18nCustomKey?: I18nCustomKey | undefined;
|
|
25
|
-
state?: IntlRecord | undefined;
|
|
26
|
-
};
|
|
27
|
-
export declare const DefaultIntl: {
|
|
28
|
-
de: {
|
|
29
|
-
"handle.confirmation": string;
|
|
30
|
-
"handle.waiting": string;
|
|
31
|
-
"handle.success": string;
|
|
32
|
-
"handle.with_errors": string;
|
|
33
|
-
"handle.with_warnings": string;
|
|
34
|
-
"handle.error_response": string;
|
|
35
|
-
"handle.response_error": string;
|
|
36
|
-
"handle.request_error": string;
|
|
37
|
-
"handle.unexpected_error2": string;
|
|
38
|
-
"handle.unexpected_error": string;
|
|
39
|
-
"handle.not_found": string;
|
|
40
|
-
};
|
|
41
|
-
en: {
|
|
42
|
-
"handle.confirmation": string;
|
|
43
|
-
"handle.waiting": string;
|
|
44
|
-
"handle.success": string;
|
|
45
|
-
"handle.with_errors": string;
|
|
46
|
-
"handle.with_warnings": string;
|
|
47
|
-
"handle.error_response": string;
|
|
48
|
-
"handle.request_error": string;
|
|
49
|
-
"handle.response_error": string;
|
|
50
|
-
"handle.unexpected_error2": string;
|
|
51
|
-
"handle.unexpected_error": string;
|
|
52
|
-
"handle.not_found": string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
declare const CommandContext_base: ServiceMap.ServiceClass<CommandContext, "CommandContext", {
|
|
56
|
-
id: string;
|
|
57
|
-
i18nKey: string;
|
|
58
|
-
action: string;
|
|
59
|
-
label: string;
|
|
60
|
-
namespace: string;
|
|
61
|
-
namespaced: (key: string) => string;
|
|
62
|
-
state?: IntlRecord | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
export declare class CommandContext extends CommandContext_base {
|
|
65
|
-
}
|
|
66
|
-
export type EmitWithCallback<A, Event extends string> = (event: Event, value: A, onDone: () => void) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Use to wrap emit calls with a callback to signal completion.
|
|
69
|
-
* Useful when the publisher wants to wait for the subscriber to finish processing.
|
|
70
|
-
*/
|
|
71
|
-
export declare const wrapEmit: <A, Event extends string>(emit: EmitWithCallback<A, NoInfer<Event>>, event: Event) => (value: A) => Promise<void>;
|
|
72
|
-
export declare namespace Commander {
|
|
73
|
-
type CommanderBase<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = Gen<RT, Id, I18nKey, State> & NonGen<RT, Id, I18nKey, State> & CommandContextLocal<Id, I18nKey> & {
|
|
74
|
-
state: ServiceMap.Service<`Commander.Command.${Id}.state`, State>;
|
|
75
|
-
};
|
|
76
|
-
type CommanderFn<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = CommanderBase<RT, Id, I18nKey, State>;
|
|
77
|
-
type CommanderWrap<RT, Id extends string, I18nCustomKey extends string, State extends IntlRecord | undefined, I, A, E, R> = CommandContextLocal<Id, I18nCustomKey> & GenWrap<RT, Id, I18nCustomKey, I, A, E, R, State> & NonGenWrap<RT, Id, I18nCustomKey, I, A, E, R, State> & {
|
|
78
|
-
state: ServiceMap.Service<`Commander.Command.${Id}.state`, State>;
|
|
79
|
-
};
|
|
80
|
-
interface CommandContextLocal<Id extends string, I18nKey extends string> {
|
|
81
|
-
id: Id;
|
|
82
|
-
i18nKey: I18nKey;
|
|
83
|
-
namespace: `action.${I18nKey}`;
|
|
84
|
-
namespaced: <K extends string>(k: K) => `action.${I18nKey}.${K}`;
|
|
85
|
-
}
|
|
86
|
-
interface CommandProps<A, E, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandContextLocal<Id, I18nKey> {
|
|
87
|
-
/** reactive */
|
|
88
|
-
action: string;
|
|
89
|
-
/** reactive */
|
|
90
|
-
label: string;
|
|
91
|
-
/** reactive */
|
|
92
|
-
result: AsyncResult<A, E>;
|
|
93
|
-
/** reactive */
|
|
94
|
-
waiting: boolean;
|
|
95
|
-
/** reactive */
|
|
96
|
-
blocked: boolean;
|
|
97
|
-
/** reactive */
|
|
98
|
-
allowed: boolean;
|
|
99
|
-
/** reactive */
|
|
100
|
-
state: State;
|
|
101
|
-
}
|
|
102
|
-
interface CommandOut<Arg, A, E, R, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandProps<A, E, Id, I18nKey, State> {
|
|
103
|
-
new (): {};
|
|
104
|
-
/** click handlers */
|
|
105
|
-
handle: ((arg: Arg) => Fiber.Fiber<Exit.Exit<A, E>, never>) & {
|
|
106
|
-
/** @deprecated don't exist */
|
|
107
|
-
effect: (arg: Arg) => Effect.Effect<A, E, R>;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
interface CommandContextLocal2<Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandContextLocal<Id, I18nKey> {
|
|
111
|
-
state: State;
|
|
112
|
-
}
|
|
113
|
-
type CommandOutHelper<Arg, Eff extends Effect.Effect<any, any, any>, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = CommandOut<Arg, Effect.Success<Eff>, Effect.Error<Eff>, Effect.Services<Eff>, Id, I18nKey, State>;
|
|
114
|
-
type Gen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
|
|
115
|
-
<Eff extends Effect.Yieldable<any, any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, AEff, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>): CommandOut<Arg, AEff, [
|
|
116
|
-
Eff
|
|
117
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
118
|
-
Eff
|
|
119
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never, Id, I18nKey, State>;
|
|
120
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
121
|
-
Eff
|
|
122
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
123
|
-
Eff
|
|
124
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOutHelper<Arg, A, Id, I18nKey, State>;
|
|
125
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
126
|
-
Eff
|
|
127
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
128
|
-
Eff
|
|
129
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): CommandOutHelper<Arg, B, Id, I18nKey, State>;
|
|
130
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
131
|
-
Eff
|
|
132
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
133
|
-
Eff
|
|
134
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C): CommandOutHelper<Arg, C, Id, I18nKey, State>;
|
|
135
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
136
|
-
Eff
|
|
137
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
138
|
-
Eff
|
|
139
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D): CommandOutHelper<Arg, D, Id, I18nKey, State>;
|
|
140
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D, E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
141
|
-
Eff
|
|
142
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
143
|
-
Eff
|
|
144
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E): CommandOutHelper<Arg, E, Id, I18nKey, State>;
|
|
145
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D, E, F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
146
|
-
Eff
|
|
147
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
148
|
-
Eff
|
|
149
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F): CommandOutHelper<Arg, F, Id, I18nKey, State>;
|
|
150
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D, E, F, G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
151
|
-
Eff
|
|
152
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
153
|
-
Eff
|
|
154
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G): CommandOutHelper<Arg, G, Id, I18nKey, State>;
|
|
155
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D, E, F, G, H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
156
|
-
Eff
|
|
157
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
158
|
-
Eff
|
|
159
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H): CommandOutHelper<Arg, H, Id, I18nKey, State>;
|
|
160
|
-
<Eff extends Effect.Yieldable<any, any, any, any>, AEff, A, B, C, D, E, F, G, H, I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
|
|
161
|
-
Eff
|
|
162
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer E, infer _R>] ? E : never, [
|
|
163
|
-
Eff
|
|
164
|
-
] extends [never] ? never : [Eff] extends [Effect.Yieldable<any, infer _A, infer _E, infer R>] ? R : never>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I): CommandOutHelper<Arg, I, Id, I18nKey, State>;
|
|
165
|
-
};
|
|
166
|
-
type NonGen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
|
|
167
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
168
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
169
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
170
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
171
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
172
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
173
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
174
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
175
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, H, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
176
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, H, I, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I, i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
177
|
-
};
|
|
178
|
-
type GenWrap<RT, Id extends string, I18nKey extends string, Arg, AEff, EEff, REff, State extends IntlRecord | undefined> = {
|
|
179
|
-
(): Exclude<REff, RT> extends never ? CommandOut<Arg, AEff, EEff, REff, Id, I18nKey, State> : MissingDependencies<RT, REff> & {};
|
|
180
|
-
<A extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOutHelper<Arg, A, Id, I18nKey, State>;
|
|
181
|
-
<A, B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): CommandOutHelper<Arg, B, Id, I18nKey, State>;
|
|
182
|
-
<A, B, C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C): CommandOutHelper<Arg, C, Id, I18nKey, State>;
|
|
183
|
-
<A, B, C, D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D): CommandOutHelper<Arg, D, Id, I18nKey, State>;
|
|
184
|
-
<A, B, C, D, E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E): CommandOutHelper<Arg, E, Id, I18nKey, State>;
|
|
185
|
-
<A, B, C, D, E, F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F): CommandOutHelper<Arg, F, Id, I18nKey, State>;
|
|
186
|
-
<A, B, C, D, E, F, G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G): CommandOutHelper<Arg, G, Id, I18nKey, State>;
|
|
187
|
-
<A, B, C, D, E, F, G, H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H): CommandOutHelper<Arg, H, Id, I18nKey, State>;
|
|
188
|
-
<A, B, C, D, E, F, G, H, I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I): CommandOutHelper<Arg, I, Id, I18nKey, State>;
|
|
189
|
-
};
|
|
190
|
-
type NonGenWrap<RT, Id extends string, I18nKey extends string, Arg, AEff, EEff, REff, State extends IntlRecord | undefined> = {
|
|
191
|
-
(): Exclude<REff, RT> extends never ? CommandOutHelper<Arg, Effect.Effect<AEff, EEff, REff>, Id, I18nKey, State> : MissingDependencies<RT, REff> & {};
|
|
192
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
193
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
194
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
195
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
196
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
197
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
198
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
199
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, H, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
200
|
-
<Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, H, I, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I, i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
type ErrorRenderer<E, Args extends readonly any[]> = (e: E, action: string, ...args: Args) => string | undefined;
|
|
204
|
-
export declare const CommanderStatic: {
|
|
205
|
-
accessArgs: <In, Out, Arg2, Arg = void>(cb: (a: NoInfer<Arg>, b: NoInfer<Arg2>) => (self: NoInfer<In>) => Out) => (self: In, arg: Arg, arg2: Arg2) => Out;
|
|
206
|
-
/** Version of @see confirmOrInterrupt that automatically includes the action name in the default messages */
|
|
207
|
-
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, I18n | Confirm | CommandContext>;
|
|
208
|
-
/** Version of @see confirm that automatically includes the action name in the default messages */
|
|
209
|
-
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, I18n | Confirm | CommandContext>;
|
|
210
|
-
updateAction: <Args extends Array<unknown>>(update: (currentActionId: string, ...args: Args) => string) => <A, E, R>(_: Effect.Effect<A, E, R>, ...input: Args) => Effect.Effect<A, E, CommandContext | R>;
|
|
211
|
-
defaultFailureMessageHandler: <E, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: Option.Option<E>, ...args: Args) => string) | ((o: Option.Option<E>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: ErrorRenderer<E, Args>) => (o: Option.Option<E>, ...args: Args) => Effect.Effect<string | {
|
|
212
|
-
level: "warn";
|
|
213
|
-
message: string;
|
|
214
|
-
}, AME, I18n | AMR>;
|
|
215
|
-
renderError: Effect.Effect<(<E, Args extends readonly any[]>(action: string, errorRenderer?: ErrorRenderer<E, Args>) => (e: E, ...args: Args) => string), never, I18n>;
|
|
216
|
-
/**
|
|
217
|
-
* Version of withDefaultToast that automatically includes the action name in the default messages and uses intl.
|
|
218
|
-
* uses the Command id as i18n namespace. `action.{id}` is the main action name,
|
|
219
|
-
* and `action.{id}.waiting`, `action.{id}.success`, `action.{id}.failure` can be used to override the default messages for the respective states.
|
|
220
|
-
*
|
|
221
|
-
* the computed `state` provided to the Command can be used for interpolation in the i18n messages. (the state is captured at the start of each command execution and remains stable throughout)
|
|
222
|
-
*
|
|
223
|
-
* Note: if you provide `onWaiting` or `onSuccess` as `null`, no toast will be shown for that state.
|
|
224
|
-
* If you provide a string or function, it will be used instead of the i18n message.
|
|
225
|
-
* If you provide an `errorRenderer`, it will be used to render errors in the failure message.
|
|
226
|
-
*/
|
|
227
|
-
withDefaultToast: <A, E, R, Args extends Array<unknown>>(options?: {
|
|
228
|
-
/**
|
|
229
|
-
* if true, previous toasts with this key will be replaced
|
|
230
|
-
*/
|
|
231
|
-
stableToastId?: undefined | true | string | ((id: string, ...args: Args) => true | string | undefined);
|
|
232
|
-
errorRenderer?: ErrorRenderer<E, Args>;
|
|
233
|
-
onWaiting?: null | undefined | string | ((id: string, ...args: Args) => string | null | undefined);
|
|
234
|
-
onSuccess?: null | undefined | string | ((a: A, action: string, ...args: Args) => string | null | undefined);
|
|
235
|
-
}) => (self: Effect.Effect<A, E, R>, ...args: Args) => Effect.Effect<A, E, I18n | WithToast | CommandContext | R>;
|
|
236
|
-
/** borrowing the idea from Families in Effect Atom */
|
|
237
|
-
family: <T extends object, Arg, ArgIn = Arg>(maker: (arg: Arg) => T, keyMaker?: (arg: ArgIn) => Arg) => (arg: ArgIn) => T;
|
|
238
|
-
};
|
|
239
|
-
export declare class CommanderImpl<RT, RTHooks> {
|
|
240
|
-
private readonly rt;
|
|
241
|
-
private readonly intl;
|
|
242
|
-
private readonly hooks;
|
|
243
|
-
constructor(rt: ServiceMap.ServiceMap<RT>, intl: I18n, hooks: Layer.Layer<RTHooks, never, RT>);
|
|
244
|
-
readonly makeContext: <const Id extends string, const I18nKey extends string = Id>(id: Id, options?: FnOptionsInternal<I18nKey>) => {
|
|
245
|
-
id: string;
|
|
246
|
-
i18nKey: string;
|
|
247
|
-
action: string;
|
|
248
|
-
label: string;
|
|
249
|
-
namespace: string;
|
|
250
|
-
namespaced: (key: string) => string;
|
|
251
|
-
state?: IntlRecord | undefined;
|
|
252
|
-
};
|
|
253
|
-
readonly makeCommand: <const Id extends string, const State extends IntlRecord | undefined, const I18nKey extends string = Id>(id_: Id | {
|
|
254
|
-
id: Id;
|
|
255
|
-
}, options?: FnOptions<Id, I18nKey, State>, errorDef?: Error) => (<Arg, A, E, R extends RT | RTHooks | CommandContext | `Commander.Command.${Id}.state`>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => {
|
|
256
|
-
id: import("vue").UnwrapRef<Id>;
|
|
257
|
-
i18nKey: string;
|
|
258
|
-
namespace: string;
|
|
259
|
-
namespaced: (key: string) => string;
|
|
260
|
-
result: AsyncResult<A, E>;
|
|
261
|
-
waiting: boolean;
|
|
262
|
-
blocked: boolean;
|
|
263
|
-
allowed: boolean;
|
|
264
|
-
action: string;
|
|
265
|
-
label: string;
|
|
266
|
-
state: State;
|
|
267
|
-
handle: ((arg: Arg) => Fiber.Fiber<Exit.Exit<A, E>, never>) & {
|
|
268
|
-
action: ComputedRef<string>;
|
|
269
|
-
label: ComputedRef<string>;
|
|
270
|
-
};
|
|
271
|
-
}) & {
|
|
272
|
-
id: Id;
|
|
273
|
-
};
|
|
274
|
-
/**
|
|
275
|
-
* Define a Command for handling user actions with built-in error reporting and state management.
|
|
276
|
-
*
|
|
277
|
-
* @param id The internal identifier for the action. Used as a tracing span and to lookup
|
|
278
|
-
* the user-facing name via internationalization (`action.${id}`).
|
|
279
|
-
* @param options Optional configuration for internationalization and state.
|
|
280
|
-
* @param options.i18nCustomKey Custom i18n key to use instead of `id` (e.g., for grouping similar actions)
|
|
281
|
-
* @param options.state Optional reactive state object (or function returning one) that is
|
|
282
|
-
* made available to the command effects and can be used for i18n interpolation.
|
|
283
|
-
* The state is captured at the start of each command execution and remains stable throughout.
|
|
284
|
-
* @returns A function that executes the command when called (e.g., directly in `@click` handlers).
|
|
285
|
-
* Built-in error reporting handles failures automatically.
|
|
286
|
-
*
|
|
287
|
-
* **Effect Context**: Effects have access to the `CommandContext` service, which provides
|
|
288
|
-
* the user-facing action name.
|
|
289
|
-
*
|
|
290
|
-
* **Returned Properties**:
|
|
291
|
-
* - `action`: User-facing action name from intl messages (useful for button labels)
|
|
292
|
-
* - `result`: The command result state
|
|
293
|
-
* - `waiting`: Boolean indicating if the command is in progress (shorthand for `result.waiting`)
|
|
294
|
-
* - `handle`: Function to execute the command
|
|
295
|
-
* - `exec`: The raw Effect that will be executed when calling `handle` (for advanced use cases)
|
|
296
|
-
* - `i18nKey`, `namespace`, `namespaced`: Helpers for internationalization keys
|
|
297
|
-
*
|
|
298
|
-
* **User Feedback**: Use the `withDefaultToast` helper for status notifications, or render
|
|
299
|
-
* the `result` inline for custom UI feedback.
|
|
300
|
-
*/
|
|
301
|
-
fn: <const Id extends string, const State extends IntlRecord = IntlRecord, const I18nKey extends string = Id>(id: Id | {
|
|
302
|
-
id: Id;
|
|
303
|
-
}, options?: FnOptions<Id, I18nKey, State>) => Commander.Gen<RT | RTHooks, Id, I18nKey, State> & Commander.NonGen<RT | RTHooks, Id, I18nKey, State> & {
|
|
304
|
-
state: ServiceMap.Service<`Commander.Command.${Id}.state`, State>;
|
|
305
|
-
};
|
|
306
|
-
/** @experimental @deprecated */
|
|
307
|
-
alt2: <const Id extends string, MutArg, MutA, MutE, MutR, const I18nKey extends string = Id, State extends IntlRecord | undefined = undefined>(id: Id | {
|
|
308
|
-
id: Id;
|
|
309
|
-
mutate: (arg: MutArg) => Effect.Effect<MutA, MutE, MutR>;
|
|
310
|
-
} | (((arg: MutArg) => Effect.Effect<MutA, MutE, MutR>) & {
|
|
311
|
-
id: Id;
|
|
312
|
-
}), options?: FnOptions<Id, I18nKey, State>) => Commander.CommandContextLocal<Id, I18nKey> & (<A, E, R extends RT | RTHooks | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(handler: (ctx: Effect.fn.Traced & Effect.fn.Untraced & Commander.CommandContextLocal<Id, I18nKey> & {
|
|
313
|
-
mutate: (arg: Arg) => Effect.Effect<MutA, MutE, MutR>;
|
|
314
|
-
}) => (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>);
|
|
315
|
-
/** @experimental */
|
|
316
|
-
alt: <const Id extends string, const I18nKey extends string = Id, State extends IntlRecord | undefined = undefined>(id: Id, customI18nKey?: I18nKey) => Commander.CommandContextLocal<Id, I18nKey> & (<A, E, R extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>);
|
|
317
|
-
/**
|
|
318
|
-
* Define a Command for handling user actions with built-in error reporting and state management.
|
|
319
|
-
*
|
|
320
|
-
* @param mutation The mutation function to take the identifier and initial handler from. Used as a tracing span and to lookup
|
|
321
|
-
* the user-facing name via internationalization (`action.${id}`).
|
|
322
|
-
* @param options Optional configuration for internationalization and state.
|
|
323
|
-
* @param options.i18nCustomKey Custom i18n key to use instead of `id` (e.g., for grouping similar actions)
|
|
324
|
-
* @param options.state Optional reactive state object (or function returning one) that is
|
|
325
|
-
* made available to the command effects and can be used for i18n interpolation.
|
|
326
|
-
* The state is captured at the start of each command execution and remains stable throughout.
|
|
327
|
-
* @returns A function that executes the command when called (e.g., directly in `@click` handlers).
|
|
328
|
-
* Built-in error reporting handles failures automatically.
|
|
329
|
-
*
|
|
330
|
-
* **Effect Context**: Effects have access to the `CommandContext` service, which provides
|
|
331
|
-
* the user-facing action name.
|
|
332
|
-
*
|
|
333
|
-
* **Returned Properties**:
|
|
334
|
-
* - `action`: User-facing action name from intl messages (useful for button labels)
|
|
335
|
-
* - `result`: The command result state
|
|
336
|
-
* - `waiting`: Boolean indicating if the command is in progress (shorthand for `result.waiting`)
|
|
337
|
-
* - `handle`: Function to execute the command
|
|
338
|
-
* - `exec`: The raw Effect that will be executed when calling `handle` (for advanced use cases)
|
|
339
|
-
* - `i18nKey`, `namespace`, `namespaced`: Helpers for internationalization keys
|
|
340
|
-
*
|
|
341
|
-
* **User Feedback**: Use the `withDefaultToast` helper for status notifications, or render
|
|
342
|
-
* the `result` inline for custom UI feedback.
|
|
343
|
-
*/
|
|
344
|
-
wrap: <const Id extends string, Arg, A, E, R, const State extends IntlRecord = IntlRecord, I18nKey extends string = Id>(mutation: {
|
|
345
|
-
mutate: (arg: Arg) => Effect.Effect<A, E, R>;
|
|
346
|
-
id: Id;
|
|
347
|
-
} | (((arg: Arg) => Effect.Effect<A, E, R>) & {
|
|
348
|
-
id: Id;
|
|
349
|
-
}), options?: FnOptions<Id, I18nKey, State>) => Commander.CommanderWrap<RT | RTHooks, Id, I18nKey, State, Arg, A, E, R>;
|
|
350
|
-
}
|
|
351
|
-
declare const Commander_base: ServiceMap.ServiceClass<Commander, "Commander", <RT, RTHooks>(rt: ServiceMap.ServiceMap<RT>, rtHooks: Layer.Layer<RTHooks, never, RT>) => CommanderImpl<RT, RTHooks>> & {
|
|
352
|
-
readonly make: Effect.Effect<(<RT, RTHooks>(rt: ServiceMap.ServiceMap<RT>, rtHooks: Layer.Layer<RTHooks, never, RT>) => CommanderImpl<RT, RTHooks>), never, I18n>;
|
|
353
|
-
};
|
|
354
|
-
export declare class Commander extends Commander_base {
|
|
355
|
-
static readonly DefaultWithoutDependencies: Layer.Layer<Commander, never, I18n>;
|
|
356
|
-
static readonly Default: Layer.Layer<Commander, never, I18n>;
|
|
357
|
-
}
|
|
358
|
-
export {};
|
|
359
|
-
//# sourceMappingURL=commander.d.ts.map
|