@effect-app/vue 2.84.5 → 2.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/experimental/commander.d.ts +79 -72
- package/dist/experimental/commander.d.ts.map +1 -1
- package/dist/experimental/commander.js +26 -8
- package/dist/experimental/withToast.d.ts +1 -0
- package/dist/experimental/withToast.d.ts.map +1 -1
- package/dist/experimental/withToast.js +5 -2
- package/dist/makeClient.d.ts +8 -8
- package/package.json +1 -1
- package/src/experimental/commander.ts +371 -319
- package/src/experimental/withToast.ts +8 -2
- package/test/Mutation.test.ts +24 -15
- package/test/dist/stubs.d.ts +8 -8
|
@@ -6,7 +6,7 @@ import { Cause, Context, Effect, type Exit, flow, Match, Option, Runtime, S } fr
|
|
|
6
6
|
import { SupportedErrors } from "effect-app/client"
|
|
7
7
|
import { OperationFailure, OperationSuccess } from "effect-app/Operations"
|
|
8
8
|
import { wrapEffect } from "effect-app/utils"
|
|
9
|
-
import { type RuntimeFiber } from "effect/Fiber"
|
|
9
|
+
import { id, type RuntimeFiber } from "effect/Fiber"
|
|
10
10
|
import { type NoInfer } from "effect/Types"
|
|
11
11
|
import { isGeneratorFunction, type YieldWrap } from "effect/Utils"
|
|
12
12
|
import { type FormatXMLElementFn, type PrimitiveType } from "intl-messageformat"
|
|
@@ -93,9 +93,9 @@ export const wrapEmit = <A, Event extends string>(
|
|
|
93
93
|
|
|
94
94
|
export declare namespace Commander {
|
|
95
95
|
export type CommanderBase<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> =
|
|
96
|
-
&
|
|
97
|
-
&
|
|
98
|
-
&
|
|
96
|
+
& Gen<RT, Id, I18nKey, State>
|
|
97
|
+
& NonGen<RT, Id, I18nKey, State>
|
|
98
|
+
& CommandContextLocal<Id, I18nKey>
|
|
99
99
|
& {
|
|
100
100
|
state: Context.Tag<`Commander.Command.${Id}.state`, State>
|
|
101
101
|
}
|
|
@@ -108,7 +108,7 @@ export declare namespace Commander {
|
|
|
108
108
|
Id extends string,
|
|
109
109
|
I18nCustomKey extends string,
|
|
110
110
|
State extends IntlRecord | undefined,
|
|
111
|
-
I
|
|
111
|
+
I,
|
|
112
112
|
A,
|
|
113
113
|
E,
|
|
114
114
|
R
|
|
@@ -147,7 +147,7 @@ export declare namespace Commander {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export interface CommandOut<
|
|
150
|
-
|
|
150
|
+
Arg,
|
|
151
151
|
A,
|
|
152
152
|
E,
|
|
153
153
|
R,
|
|
@@ -158,35 +158,41 @@ export declare namespace Commander {
|
|
|
158
158
|
new(): {}
|
|
159
159
|
|
|
160
160
|
/** click handlers */
|
|
161
|
-
handle: ((
|
|
161
|
+
handle: ((arg: Arg) => RuntimeFiber<Exit.Exit<A, E>, never>) & {
|
|
162
162
|
/** @deprecated don't exist */
|
|
163
|
-
effect: (
|
|
163
|
+
effect: (arg: Arg) => Effect.Effect<A, E, R>
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// // TODO: if we keep them, it would probably be nicer as an option api, deciding the return value like in Atom?
|
|
167
167
|
// /** @experimental */
|
|
168
|
-
// compose: (
|
|
168
|
+
// compose: (arg: Arg) => Effect.Effect<Exit.Exit<A, E>, R>
|
|
169
169
|
// /** @experimental */
|
|
170
|
-
// compose2: (
|
|
170
|
+
// compose2: (arg: Arg) => Effect.Effect<A, E, R>
|
|
171
171
|
// /**
|
|
172
172
|
// * @experimental
|
|
173
173
|
// * captures the current span and returns an Effect that when run will execute the command
|
|
174
174
|
// */
|
|
175
|
-
// handleEffect: (
|
|
175
|
+
// handleEffect: (arg: Arg) => Effect.Effect<RuntimeFiber<Exit.Exit<A, E>, never>>
|
|
176
176
|
// /**
|
|
177
177
|
// * @experimental
|
|
178
178
|
// */
|
|
179
|
-
// exec: (
|
|
179
|
+
// exec: (arg: Arg) => Effect.Effect<Exit.Exit<A, E>, never, Exclude<R, CommandContext>>
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface CommandContextLocal2<Id extends string, I18nKey extends string, State extends IntlRecord | undefined>
|
|
183
|
+
extends CommandContextLocal<Id, I18nKey>
|
|
184
|
+
{
|
|
185
|
+
state: State
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
type CommandOutHelper<
|
|
183
|
-
|
|
189
|
+
Arg,
|
|
184
190
|
Eff extends Effect.Effect<any, any, any>,
|
|
185
191
|
Id extends string,
|
|
186
192
|
I18nKey extends string,
|
|
187
193
|
State extends IntlRecord | undefined
|
|
188
194
|
> = CommandOut<
|
|
189
|
-
|
|
195
|
+
Arg,
|
|
190
196
|
Effect.Effect.Success<Eff>,
|
|
191
197
|
Effect.Effect.Error<Eff>,
|
|
192
198
|
Effect.Effect.Context<Eff>,
|
|
@@ -199,11 +205,11 @@ export declare namespace Commander {
|
|
|
199
205
|
<
|
|
200
206
|
Eff extends YieldWrap<Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>,
|
|
201
207
|
AEff,
|
|
202
|
-
|
|
208
|
+
Arg = void
|
|
203
209
|
>(
|
|
204
|
-
body: (
|
|
210
|
+
body: (arg: Arg) => Generator<Eff, AEff, never>
|
|
205
211
|
): CommandOut<
|
|
206
|
-
|
|
212
|
+
Arg,
|
|
207
213
|
AEff,
|
|
208
214
|
[Eff] extends [never] ? never
|
|
209
215
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer E, infer _R>>] ? E
|
|
@@ -218,10 +224,10 @@ export declare namespace Commander {
|
|
|
218
224
|
<
|
|
219
225
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
220
226
|
AEff,
|
|
221
|
-
|
|
222
|
-
|
|
227
|
+
A extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
228
|
+
Arg = void
|
|
223
229
|
>(
|
|
224
|
-
body: (
|
|
230
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
225
231
|
a: (
|
|
226
232
|
_: Effect.Effect<
|
|
227
233
|
AEff,
|
|
@@ -232,17 +238,18 @@ export declare namespace Commander {
|
|
|
232
238
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
233
239
|
: never
|
|
234
240
|
>,
|
|
235
|
-
|
|
241
|
+
arg: NoInfer<Arg>,
|
|
242
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
236
243
|
) => A
|
|
237
|
-
): CommandOutHelper<
|
|
244
|
+
): CommandOutHelper<Arg, A, Id, I18nKey, State>
|
|
238
245
|
<
|
|
239
246
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
240
247
|
AEff,
|
|
241
|
-
Args extends Array<unknown>,
|
|
242
248
|
A,
|
|
243
|
-
B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
249
|
+
B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
250
|
+
Arg = void
|
|
244
251
|
>(
|
|
245
|
-
body: (
|
|
252
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
246
253
|
a: (
|
|
247
254
|
_: Effect.Effect<
|
|
248
255
|
AEff,
|
|
@@ -253,19 +260,20 @@ export declare namespace Commander {
|
|
|
253
260
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
254
261
|
: never
|
|
255
262
|
>,
|
|
256
|
-
|
|
263
|
+
arg: NoInfer<Arg>,
|
|
264
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
257
265
|
) => A,
|
|
258
|
-
b: (_: A,
|
|
259
|
-
): CommandOutHelper<
|
|
266
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B
|
|
267
|
+
): CommandOutHelper<Arg, B, Id, I18nKey, State>
|
|
260
268
|
<
|
|
261
269
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
262
270
|
AEff,
|
|
263
|
-
Args extends Array<unknown>,
|
|
264
271
|
A,
|
|
265
272
|
B,
|
|
266
|
-
C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
273
|
+
C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
274
|
+
Arg = void
|
|
267
275
|
>(
|
|
268
|
-
body: (
|
|
276
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
269
277
|
a: (
|
|
270
278
|
_: Effect.Effect<
|
|
271
279
|
AEff,
|
|
@@ -276,21 +284,22 @@ export declare namespace Commander {
|
|
|
276
284
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
277
285
|
: never
|
|
278
286
|
>,
|
|
279
|
-
|
|
287
|
+
arg: NoInfer<Arg>,
|
|
288
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
280
289
|
) => A,
|
|
281
|
-
b: (_: A,
|
|
282
|
-
c: (_: B,
|
|
283
|
-
): CommandOutHelper<
|
|
290
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
291
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C
|
|
292
|
+
): CommandOutHelper<Arg, C, Id, I18nKey, State>
|
|
284
293
|
<
|
|
285
294
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
286
295
|
AEff,
|
|
287
|
-
Args extends Array<unknown>,
|
|
288
296
|
A,
|
|
289
297
|
B,
|
|
290
298
|
C,
|
|
291
|
-
D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
299
|
+
D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
300
|
+
Arg = void
|
|
292
301
|
>(
|
|
293
|
-
body: (
|
|
302
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
294
303
|
a: (
|
|
295
304
|
_: Effect.Effect<
|
|
296
305
|
AEff,
|
|
@@ -301,23 +310,24 @@ export declare namespace Commander {
|
|
|
301
310
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
302
311
|
: never
|
|
303
312
|
>,
|
|
304
|
-
|
|
313
|
+
arg: NoInfer<Arg>,
|
|
314
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
305
315
|
) => A,
|
|
306
|
-
b: (_: A,
|
|
307
|
-
c: (_: B,
|
|
308
|
-
d: (_: C,
|
|
309
|
-
): CommandOutHelper<
|
|
316
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
317
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
318
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D
|
|
319
|
+
): CommandOutHelper<Arg, D, Id, I18nKey, State>
|
|
310
320
|
<
|
|
311
321
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
312
322
|
AEff,
|
|
313
|
-
Args extends Array<unknown>,
|
|
314
323
|
A,
|
|
315
324
|
B,
|
|
316
325
|
C,
|
|
317
326
|
D,
|
|
318
|
-
E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
327
|
+
E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
328
|
+
Arg = void
|
|
319
329
|
>(
|
|
320
|
-
body: (
|
|
330
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
321
331
|
a: (
|
|
322
332
|
_: Effect.Effect<
|
|
323
333
|
AEff,
|
|
@@ -328,25 +338,26 @@ export declare namespace Commander {
|
|
|
328
338
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
329
339
|
: never
|
|
330
340
|
>,
|
|
331
|
-
|
|
341
|
+
arg: NoInfer<Arg>,
|
|
342
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
332
343
|
) => A,
|
|
333
|
-
b: (_: A,
|
|
334
|
-
c: (_: B,
|
|
335
|
-
d: (_: C,
|
|
336
|
-
e: (_: D,
|
|
337
|
-
): CommandOutHelper<
|
|
344
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
345
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
346
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
347
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E
|
|
348
|
+
): CommandOutHelper<Arg, E, Id, I18nKey, State>
|
|
338
349
|
<
|
|
339
350
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
340
351
|
AEff,
|
|
341
|
-
Args extends Array<unknown>,
|
|
342
352
|
A,
|
|
343
353
|
B,
|
|
344
354
|
C,
|
|
345
355
|
D,
|
|
346
356
|
E,
|
|
347
|
-
F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
357
|
+
F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
358
|
+
Arg = void
|
|
348
359
|
>(
|
|
349
|
-
body: (
|
|
360
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
350
361
|
a: (
|
|
351
362
|
_: Effect.Effect<
|
|
352
363
|
AEff,
|
|
@@ -357,27 +368,28 @@ export declare namespace Commander {
|
|
|
357
368
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
358
369
|
: never
|
|
359
370
|
>,
|
|
360
|
-
|
|
371
|
+
arg: NoInfer<Arg>,
|
|
372
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
361
373
|
) => A,
|
|
362
|
-
b: (_: A,
|
|
363
|
-
c: (_: B,
|
|
364
|
-
d: (_: C,
|
|
365
|
-
e: (_: D,
|
|
366
|
-
f: (_: E,
|
|
367
|
-
): CommandOutHelper<
|
|
374
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
375
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
376
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
377
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
378
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F
|
|
379
|
+
): CommandOutHelper<Arg, F, Id, I18nKey, State>
|
|
368
380
|
<
|
|
369
381
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
370
382
|
AEff,
|
|
371
|
-
Args extends Array<unknown>,
|
|
372
383
|
A,
|
|
373
384
|
B,
|
|
374
385
|
C,
|
|
375
386
|
D,
|
|
376
387
|
E,
|
|
377
388
|
F,
|
|
378
|
-
G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
389
|
+
G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
390
|
+
Arg = void
|
|
379
391
|
>(
|
|
380
|
-
body: (
|
|
392
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
381
393
|
a: (
|
|
382
394
|
_: Effect.Effect<
|
|
383
395
|
AEff,
|
|
@@ -388,19 +400,19 @@ export declare namespace Commander {
|
|
|
388
400
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
389
401
|
: never
|
|
390
402
|
>,
|
|
391
|
-
|
|
403
|
+
arg: NoInfer<Arg>,
|
|
404
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
392
405
|
) => A,
|
|
393
|
-
b: (_: A,
|
|
394
|
-
c: (_: B,
|
|
395
|
-
d: (_: C,
|
|
396
|
-
e: (_: D,
|
|
397
|
-
f: (_: E,
|
|
398
|
-
g: (_: F,
|
|
399
|
-
): CommandOutHelper<
|
|
406
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
407
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
408
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
409
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
410
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
411
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G
|
|
412
|
+
): CommandOutHelper<Arg, G, Id, I18nKey, State>
|
|
400
413
|
<
|
|
401
414
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
402
415
|
AEff,
|
|
403
|
-
Args extends Array<unknown>,
|
|
404
416
|
A,
|
|
405
417
|
B,
|
|
406
418
|
C,
|
|
@@ -408,9 +420,10 @@ export declare namespace Commander {
|
|
|
408
420
|
E,
|
|
409
421
|
F,
|
|
410
422
|
G,
|
|
411
|
-
H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
423
|
+
H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
424
|
+
Arg = void
|
|
412
425
|
>(
|
|
413
|
-
body: (
|
|
426
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
414
427
|
a: (
|
|
415
428
|
_: Effect.Effect<
|
|
416
429
|
AEff,
|
|
@@ -421,20 +434,20 @@ export declare namespace Commander {
|
|
|
421
434
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
422
435
|
: never
|
|
423
436
|
>,
|
|
424
|
-
|
|
437
|
+
arg: NoInfer<Arg>,
|
|
438
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
425
439
|
) => A,
|
|
426
|
-
b: (_: A,
|
|
427
|
-
c: (_: B,
|
|
428
|
-
d: (_: C,
|
|
429
|
-
e: (_: D,
|
|
430
|
-
f: (_: E,
|
|
431
|
-
g: (_: F,
|
|
432
|
-
h: (_: G,
|
|
433
|
-
): CommandOutHelper<
|
|
440
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
441
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
442
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
443
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
444
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
445
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
446
|
+
h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H
|
|
447
|
+
): CommandOutHelper<Arg, H, Id, I18nKey, State>
|
|
434
448
|
<
|
|
435
449
|
Eff extends YieldWrap<Effect.Effect<any, any, any>>,
|
|
436
450
|
AEff,
|
|
437
|
-
Args extends Array<unknown>,
|
|
438
451
|
A,
|
|
439
452
|
B,
|
|
440
453
|
C,
|
|
@@ -443,9 +456,10 @@ export declare namespace Commander {
|
|
|
443
456
|
F,
|
|
444
457
|
G,
|
|
445
458
|
H,
|
|
446
|
-
I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state
|
|
459
|
+
I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
460
|
+
Arg = void
|
|
447
461
|
>(
|
|
448
|
-
body: (
|
|
462
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>,
|
|
449
463
|
a: (
|
|
450
464
|
_: Effect.Effect<
|
|
451
465
|
AEff,
|
|
@@ -456,70 +470,71 @@ export declare namespace Commander {
|
|
|
456
470
|
: [Eff] extends [YieldWrap<Effect.Effect<infer _A, infer _E, infer R>>] ? R
|
|
457
471
|
: never
|
|
458
472
|
>,
|
|
459
|
-
|
|
473
|
+
arg: NoInfer<Arg>,
|
|
474
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
460
475
|
) => A,
|
|
461
|
-
b: (_: A,
|
|
462
|
-
c: (_: B,
|
|
463
|
-
d: (_: C,
|
|
464
|
-
e: (_: D,
|
|
465
|
-
f: (_: E,
|
|
466
|
-
g: (_: F,
|
|
467
|
-
h: (_: G,
|
|
468
|
-
i: (_: H,
|
|
469
|
-
): CommandOutHelper<
|
|
476
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
477
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
478
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
479
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
480
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
481
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
482
|
+
h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
483
|
+
i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I
|
|
484
|
+
): CommandOutHelper<Arg, I, Id, I18nKey, State>
|
|
470
485
|
}
|
|
471
486
|
|
|
472
487
|
export type NonGen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
|
|
473
488
|
<
|
|
474
489
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
475
|
-
|
|
490
|
+
Arg = void
|
|
476
491
|
>(
|
|
477
|
-
body: (
|
|
478
|
-
): CommandOutHelper<
|
|
492
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Eff
|
|
493
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
479
494
|
<
|
|
480
495
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
481
496
|
A,
|
|
482
|
-
|
|
497
|
+
Arg = void
|
|
483
498
|
>(
|
|
484
|
-
body: (
|
|
485
|
-
a: (_: A,
|
|
486
|
-
): CommandOutHelper<
|
|
499
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
500
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
501
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
487
502
|
<
|
|
488
503
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
489
504
|
A,
|
|
490
505
|
B,
|
|
491
|
-
|
|
506
|
+
Arg = void
|
|
492
507
|
>(
|
|
493
|
-
body: (
|
|
494
|
-
a: (_: A,
|
|
495
|
-
b: (_: B,
|
|
496
|
-
): CommandOutHelper<
|
|
508
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
509
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
510
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
511
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
497
512
|
<
|
|
498
513
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
499
514
|
A,
|
|
500
515
|
B,
|
|
501
516
|
C,
|
|
502
|
-
|
|
517
|
+
Arg = void
|
|
503
518
|
>(
|
|
504
|
-
body: (
|
|
505
|
-
a: (_: A,
|
|
506
|
-
b: (_: B,
|
|
507
|
-
c: (_: C,
|
|
508
|
-
): CommandOutHelper<
|
|
519
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
520
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
521
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
522
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
523
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
509
524
|
<
|
|
510
525
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
511
526
|
A,
|
|
512
527
|
B,
|
|
513
528
|
C,
|
|
514
529
|
D,
|
|
515
|
-
|
|
530
|
+
Arg = void
|
|
516
531
|
>(
|
|
517
|
-
body: (
|
|
518
|
-
a: (_: A,
|
|
519
|
-
b: (_: B,
|
|
520
|
-
c: (_: C,
|
|
521
|
-
d: (_: D,
|
|
522
|
-
): CommandOutHelper<
|
|
532
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
533
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
534
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
535
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
536
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
537
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
523
538
|
<
|
|
524
539
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
525
540
|
A,
|
|
@@ -527,15 +542,15 @@ export declare namespace Commander {
|
|
|
527
542
|
C,
|
|
528
543
|
D,
|
|
529
544
|
E,
|
|
530
|
-
|
|
545
|
+
Arg = void
|
|
531
546
|
>(
|
|
532
|
-
body: (
|
|
533
|
-
a: (_: A,
|
|
534
|
-
b: (_: B,
|
|
535
|
-
c: (_: C,
|
|
536
|
-
d: (_: D,
|
|
537
|
-
e: (_: E,
|
|
538
|
-
): CommandOutHelper<
|
|
547
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
548
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
549
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
550
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
551
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
552
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
553
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
539
554
|
<
|
|
540
555
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
541
556
|
A,
|
|
@@ -544,16 +559,16 @@ export declare namespace Commander {
|
|
|
544
559
|
D,
|
|
545
560
|
E,
|
|
546
561
|
F,
|
|
547
|
-
|
|
562
|
+
Arg = void
|
|
548
563
|
>(
|
|
549
|
-
body: (
|
|
550
|
-
a: (_: A,
|
|
551
|
-
b: (_: B,
|
|
552
|
-
c: (_: C,
|
|
553
|
-
d: (_: D,
|
|
554
|
-
e: (_: E,
|
|
555
|
-
f: (_: F,
|
|
556
|
-
): CommandOutHelper<
|
|
564
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
565
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
566
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
567
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
568
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
569
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
570
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
571
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
557
572
|
<
|
|
558
573
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
559
574
|
A,
|
|
@@ -563,17 +578,17 @@ export declare namespace Commander {
|
|
|
563
578
|
E,
|
|
564
579
|
F,
|
|
565
580
|
G,
|
|
566
|
-
|
|
581
|
+
Arg = void
|
|
567
582
|
>(
|
|
568
|
-
body: (
|
|
569
|
-
a: (_: A,
|
|
570
|
-
b: (_: B,
|
|
571
|
-
c: (_: C,
|
|
572
|
-
d: (_: D,
|
|
573
|
-
e: (_: E,
|
|
574
|
-
f: (_: F,
|
|
575
|
-
g: (_: G,
|
|
576
|
-
): CommandOutHelper<
|
|
583
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
584
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
585
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
586
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
587
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
588
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
589
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
590
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
591
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
577
592
|
<
|
|
578
593
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
579
594
|
A,
|
|
@@ -584,18 +599,18 @@ export declare namespace Commander {
|
|
|
584
599
|
F,
|
|
585
600
|
G,
|
|
586
601
|
H,
|
|
587
|
-
|
|
602
|
+
Arg = void
|
|
588
603
|
>(
|
|
589
|
-
body: (
|
|
590
|
-
a: (_: A,
|
|
591
|
-
b: (_: B,
|
|
592
|
-
c: (_: C,
|
|
593
|
-
d: (_: D,
|
|
594
|
-
e: (_: E,
|
|
595
|
-
f: (_: F,
|
|
596
|
-
g: (_: G,
|
|
597
|
-
h: (_: H,
|
|
598
|
-
): CommandOutHelper<
|
|
604
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
605
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
606
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
607
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
608
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
609
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
610
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
611
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
612
|
+
h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
613
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
599
614
|
<
|
|
600
615
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
601
616
|
A,
|
|
@@ -607,33 +622,33 @@ export declare namespace Commander {
|
|
|
607
622
|
G,
|
|
608
623
|
H,
|
|
609
624
|
I,
|
|
610
|
-
|
|
625
|
+
Arg = void
|
|
611
626
|
>(
|
|
612
|
-
body: (
|
|
613
|
-
a: (_: A,
|
|
614
|
-
b: (_: B,
|
|
615
|
-
c: (_: C,
|
|
616
|
-
d: (_: D,
|
|
617
|
-
e: (_: E,
|
|
618
|
-
f: (_: F,
|
|
619
|
-
g: (_: G,
|
|
620
|
-
h: (_: H,
|
|
621
|
-
i: (_: H,
|
|
622
|
-
): CommandOutHelper<
|
|
627
|
+
body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A,
|
|
628
|
+
a: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
629
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
630
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
631
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
632
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
633
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
634
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
635
|
+
h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I,
|
|
636
|
+
i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
637
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
623
638
|
}
|
|
624
639
|
|
|
625
640
|
export type GenWrap<
|
|
626
641
|
RT,
|
|
627
642
|
Id extends string,
|
|
628
643
|
I18nKey extends string,
|
|
629
|
-
|
|
644
|
+
Arg,
|
|
630
645
|
AEff,
|
|
631
646
|
EEff,
|
|
632
647
|
REff,
|
|
633
648
|
State extends IntlRecord | undefined
|
|
634
649
|
> = {
|
|
635
650
|
(): Exclude<REff, RT> extends never ? CommandOut<
|
|
636
|
-
|
|
651
|
+
Arg,
|
|
637
652
|
AEff,
|
|
638
653
|
EEff,
|
|
639
654
|
REff,
|
|
@@ -651,9 +666,10 @@ export declare namespace Commander {
|
|
|
651
666
|
EEff,
|
|
652
667
|
REff
|
|
653
668
|
>,
|
|
654
|
-
|
|
669
|
+
arg: NoInfer<Arg>,
|
|
670
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
655
671
|
) => A
|
|
656
|
-
): CommandOutHelper<
|
|
672
|
+
): CommandOutHelper<Arg, A, Id, I18nKey, State>
|
|
657
673
|
<
|
|
658
674
|
A,
|
|
659
675
|
B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>
|
|
@@ -664,10 +680,11 @@ export declare namespace Commander {
|
|
|
664
680
|
EEff,
|
|
665
681
|
REff
|
|
666
682
|
>,
|
|
667
|
-
|
|
683
|
+
arg: NoInfer<Arg>,
|
|
684
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
668
685
|
) => A,
|
|
669
|
-
b: (_: A,
|
|
670
|
-
): CommandOutHelper<
|
|
686
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B
|
|
687
|
+
): CommandOutHelper<Arg, B, Id, I18nKey, State>
|
|
671
688
|
<
|
|
672
689
|
A,
|
|
673
690
|
B,
|
|
@@ -679,11 +696,12 @@ export declare namespace Commander {
|
|
|
679
696
|
EEff,
|
|
680
697
|
REff
|
|
681
698
|
>,
|
|
682
|
-
|
|
699
|
+
arg: NoInfer<Arg>,
|
|
700
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
683
701
|
) => A,
|
|
684
|
-
b: (_: A,
|
|
685
|
-
c: (_: B,
|
|
686
|
-
): CommandOutHelper<
|
|
702
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
703
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C
|
|
704
|
+
): CommandOutHelper<Arg, C, Id, I18nKey, State>
|
|
687
705
|
<
|
|
688
706
|
A,
|
|
689
707
|
B,
|
|
@@ -696,12 +714,13 @@ export declare namespace Commander {
|
|
|
696
714
|
EEff,
|
|
697
715
|
REff
|
|
698
716
|
>,
|
|
699
|
-
|
|
717
|
+
arg: NoInfer<Arg>,
|
|
718
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
700
719
|
) => A,
|
|
701
|
-
b: (_: A,
|
|
702
|
-
c: (_: B,
|
|
703
|
-
d: (_: C,
|
|
704
|
-
): CommandOutHelper<
|
|
720
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
721
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
722
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D
|
|
723
|
+
): CommandOutHelper<Arg, D, Id, I18nKey, State>
|
|
705
724
|
<
|
|
706
725
|
A,
|
|
707
726
|
B,
|
|
@@ -715,13 +734,14 @@ export declare namespace Commander {
|
|
|
715
734
|
EEff,
|
|
716
735
|
REff
|
|
717
736
|
>,
|
|
718
|
-
|
|
737
|
+
arg: NoInfer<Arg>,
|
|
738
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
719
739
|
) => A,
|
|
720
|
-
b: (_: A,
|
|
721
|
-
c: (_: B,
|
|
722
|
-
d: (_: C,
|
|
723
|
-
e: (_: D,
|
|
724
|
-
): CommandOutHelper<
|
|
740
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
741
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
742
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
743
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E
|
|
744
|
+
): CommandOutHelper<Arg, E, Id, I18nKey, State>
|
|
725
745
|
<
|
|
726
746
|
A,
|
|
727
747
|
B,
|
|
@@ -736,14 +756,15 @@ export declare namespace Commander {
|
|
|
736
756
|
EEff,
|
|
737
757
|
REff
|
|
738
758
|
>,
|
|
739
|
-
|
|
759
|
+
arg: NoInfer<Arg>,
|
|
760
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
740
761
|
) => A,
|
|
741
|
-
b: (_: A,
|
|
742
|
-
c: (_: B,
|
|
743
|
-
d: (_: C,
|
|
744
|
-
e: (_: D,
|
|
745
|
-
f: (_: E,
|
|
746
|
-
): CommandOutHelper<
|
|
762
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
763
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
764
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
765
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
766
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F
|
|
767
|
+
): CommandOutHelper<Arg, F, Id, I18nKey, State>
|
|
747
768
|
<
|
|
748
769
|
A,
|
|
749
770
|
B,
|
|
@@ -759,15 +780,16 @@ export declare namespace Commander {
|
|
|
759
780
|
EEff,
|
|
760
781
|
REff
|
|
761
782
|
>,
|
|
762
|
-
|
|
783
|
+
arg: NoInfer<Arg>,
|
|
784
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
763
785
|
) => A,
|
|
764
|
-
b: (_: A,
|
|
765
|
-
c: (_: B,
|
|
766
|
-
d: (_: C,
|
|
767
|
-
e: (_: D,
|
|
768
|
-
f: (_: E,
|
|
769
|
-
g: (_: F,
|
|
770
|
-
): CommandOutHelper<
|
|
786
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
787
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
788
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
789
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
790
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
791
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G
|
|
792
|
+
): CommandOutHelper<Arg, G, Id, I18nKey, State>
|
|
771
793
|
<A, B, C, D, E, F, G, H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(
|
|
772
794
|
a: (
|
|
773
795
|
_: Effect.Effect<
|
|
@@ -775,16 +797,17 @@ export declare namespace Commander {
|
|
|
775
797
|
EEff,
|
|
776
798
|
REff
|
|
777
799
|
>,
|
|
778
|
-
|
|
800
|
+
arg: NoInfer<Arg>,
|
|
801
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
779
802
|
) => A,
|
|
780
|
-
b: (_: A,
|
|
781
|
-
c: (_: B,
|
|
782
|
-
d: (_: C,
|
|
783
|
-
e: (_: D,
|
|
784
|
-
f: (_: E,
|
|
785
|
-
g: (_: F,
|
|
786
|
-
h: (_: G,
|
|
787
|
-
): CommandOutHelper<
|
|
803
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
804
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
805
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
806
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
807
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
808
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
809
|
+
h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H
|
|
810
|
+
): CommandOutHelper<Arg, H, Id, I18nKey, State>
|
|
788
811
|
<A, B, C, D, E, F, G, H, I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(
|
|
789
812
|
a: (
|
|
790
813
|
_: Effect.Effect<
|
|
@@ -792,34 +815,35 @@ export declare namespace Commander {
|
|
|
792
815
|
EEff,
|
|
793
816
|
REff
|
|
794
817
|
>,
|
|
795
|
-
|
|
818
|
+
arg: NoInfer<Arg>,
|
|
819
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
796
820
|
) => A,
|
|
797
|
-
b: (_: A,
|
|
798
|
-
c: (_: B,
|
|
799
|
-
d: (_: C,
|
|
800
|
-
e: (_: D,
|
|
801
|
-
f: (_: E,
|
|
802
|
-
g: (_: F,
|
|
803
|
-
h: (_: G,
|
|
804
|
-
i: (_: H,
|
|
805
|
-
): CommandOutHelper<
|
|
821
|
+
b: (_: A, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B,
|
|
822
|
+
c: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
823
|
+
d: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
824
|
+
e: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
825
|
+
f: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
826
|
+
g: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
827
|
+
h: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
828
|
+
i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I
|
|
829
|
+
): CommandOutHelper<Arg, I, Id, I18nKey, State>
|
|
806
830
|
}
|
|
807
831
|
|
|
808
832
|
export type NonGenWrap<
|
|
809
833
|
RT,
|
|
810
834
|
Id extends string,
|
|
811
835
|
I18nKey extends string,
|
|
812
|
-
|
|
836
|
+
Arg,
|
|
813
837
|
AEff,
|
|
814
838
|
EEff,
|
|
815
839
|
REff,
|
|
816
840
|
State extends IntlRecord | undefined
|
|
817
841
|
> = {
|
|
818
|
-
(): Exclude<REff, RT> extends never ? CommandOutHelper<
|
|
842
|
+
(): Exclude<REff, RT> extends never ? CommandOutHelper<Arg, Effect.Effect<AEff, EEff, REff>, Id, I18nKey, State>
|
|
819
843
|
: MissingDependencies<RT, REff> & {}
|
|
820
844
|
<
|
|
821
845
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
822
|
-
|
|
846
|
+
Arg
|
|
823
847
|
>(
|
|
824
848
|
a: (
|
|
825
849
|
_: Effect.Effect<
|
|
@@ -827,13 +851,14 @@ export declare namespace Commander {
|
|
|
827
851
|
EEff,
|
|
828
852
|
REff
|
|
829
853
|
>,
|
|
830
|
-
|
|
854
|
+
arg: NoInfer<Arg>,
|
|
855
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
831
856
|
) => Eff
|
|
832
|
-
): CommandOutHelper<
|
|
857
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
833
858
|
<
|
|
834
859
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
835
860
|
B,
|
|
836
|
-
|
|
861
|
+
Arg
|
|
837
862
|
>(
|
|
838
863
|
a: (
|
|
839
864
|
_: Effect.Effect<
|
|
@@ -841,15 +866,16 @@ export declare namespace Commander {
|
|
|
841
866
|
EEff,
|
|
842
867
|
REff
|
|
843
868
|
>,
|
|
844
|
-
|
|
869
|
+
arg: NoInfer<Arg>,
|
|
870
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
845
871
|
) => B,
|
|
846
|
-
b: (_: B,
|
|
847
|
-
): CommandOutHelper<
|
|
872
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
873
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
848
874
|
<
|
|
849
875
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
850
876
|
B,
|
|
851
877
|
C,
|
|
852
|
-
|
|
878
|
+
Arg
|
|
853
879
|
>(
|
|
854
880
|
a: (
|
|
855
881
|
_: Effect.Effect<
|
|
@@ -857,17 +883,18 @@ export declare namespace Commander {
|
|
|
857
883
|
EEff,
|
|
858
884
|
REff
|
|
859
885
|
>,
|
|
860
|
-
|
|
886
|
+
arg: NoInfer<Arg>,
|
|
887
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
861
888
|
) => B,
|
|
862
|
-
b: (_: B,
|
|
863
|
-
c: (_: C,
|
|
864
|
-
): CommandOutHelper<
|
|
889
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
890
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
891
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
865
892
|
<
|
|
866
893
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
867
894
|
B,
|
|
868
895
|
C,
|
|
869
896
|
D,
|
|
870
|
-
|
|
897
|
+
Arg
|
|
871
898
|
>(
|
|
872
899
|
a: (
|
|
873
900
|
_: Effect.Effect<
|
|
@@ -875,19 +902,20 @@ export declare namespace Commander {
|
|
|
875
902
|
EEff,
|
|
876
903
|
REff
|
|
877
904
|
>,
|
|
878
|
-
|
|
905
|
+
arg: NoInfer<Arg>,
|
|
906
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
879
907
|
) => B,
|
|
880
|
-
b: (_: B,
|
|
881
|
-
c: (_: C,
|
|
882
|
-
d: (_: D,
|
|
883
|
-
): CommandOutHelper<
|
|
908
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
909
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
910
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
911
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
884
912
|
<
|
|
885
913
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
886
914
|
B,
|
|
887
915
|
C,
|
|
888
916
|
D,
|
|
889
917
|
E,
|
|
890
|
-
|
|
918
|
+
Arg
|
|
891
919
|
>(
|
|
892
920
|
a: (
|
|
893
921
|
_: Effect.Effect<
|
|
@@ -895,13 +923,14 @@ export declare namespace Commander {
|
|
|
895
923
|
EEff,
|
|
896
924
|
REff
|
|
897
925
|
>,
|
|
898
|
-
|
|
926
|
+
arg: NoInfer<Arg>,
|
|
927
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
899
928
|
) => B,
|
|
900
|
-
b: (_: B,
|
|
901
|
-
c: (_: C,
|
|
902
|
-
d: (_: D,
|
|
903
|
-
e: (_: E,
|
|
904
|
-
): CommandOutHelper<
|
|
929
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
930
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
931
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
932
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
933
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
905
934
|
<
|
|
906
935
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
907
936
|
B,
|
|
@@ -909,7 +938,7 @@ export declare namespace Commander {
|
|
|
909
938
|
D,
|
|
910
939
|
E,
|
|
911
940
|
F,
|
|
912
|
-
|
|
941
|
+
Arg
|
|
913
942
|
>(
|
|
914
943
|
a: (
|
|
915
944
|
_: Effect.Effect<
|
|
@@ -917,14 +946,15 @@ export declare namespace Commander {
|
|
|
917
946
|
EEff,
|
|
918
947
|
REff
|
|
919
948
|
>,
|
|
920
|
-
|
|
949
|
+
arg: NoInfer<Arg>,
|
|
950
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
921
951
|
) => B,
|
|
922
|
-
b: (_: B,
|
|
923
|
-
c: (_: C,
|
|
924
|
-
d: (_: D,
|
|
925
|
-
e: (_: E,
|
|
926
|
-
f: (_: F,
|
|
927
|
-
): CommandOutHelper<
|
|
952
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
953
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
954
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
955
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
956
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
957
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
928
958
|
<
|
|
929
959
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
930
960
|
B,
|
|
@@ -933,7 +963,7 @@ export declare namespace Commander {
|
|
|
933
963
|
E,
|
|
934
964
|
F,
|
|
935
965
|
G,
|
|
936
|
-
|
|
966
|
+
Arg
|
|
937
967
|
>(
|
|
938
968
|
a: (
|
|
939
969
|
_: Effect.Effect<
|
|
@@ -941,15 +971,16 @@ export declare namespace Commander {
|
|
|
941
971
|
EEff,
|
|
942
972
|
REff
|
|
943
973
|
>,
|
|
944
|
-
|
|
974
|
+
arg: NoInfer<Arg>,
|
|
975
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
945
976
|
) => B,
|
|
946
|
-
b: (_: B,
|
|
947
|
-
c: (_: C,
|
|
948
|
-
d: (_: D,
|
|
949
|
-
e: (_: E,
|
|
950
|
-
f: (_: F,
|
|
951
|
-
g: (_: G,
|
|
952
|
-
): CommandOutHelper<
|
|
977
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
978
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
979
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
980
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
981
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
982
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
983
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
953
984
|
<
|
|
954
985
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
955
986
|
B,
|
|
@@ -959,7 +990,7 @@ export declare namespace Commander {
|
|
|
959
990
|
F,
|
|
960
991
|
G,
|
|
961
992
|
H,
|
|
962
|
-
|
|
993
|
+
Arg
|
|
963
994
|
>(
|
|
964
995
|
a: (
|
|
965
996
|
_: Effect.Effect<
|
|
@@ -967,16 +998,17 @@ export declare namespace Commander {
|
|
|
967
998
|
EEff,
|
|
968
999
|
REff
|
|
969
1000
|
>,
|
|
970
|
-
|
|
1001
|
+
arg: NoInfer<Arg>,
|
|
1002
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
971
1003
|
) => B,
|
|
972
|
-
b: (_: B,
|
|
973
|
-
c: (_: C,
|
|
974
|
-
d: (_: D,
|
|
975
|
-
e: (_: E,
|
|
976
|
-
f: (_: F,
|
|
977
|
-
g: (_: G,
|
|
978
|
-
h: (_: H,
|
|
979
|
-
): CommandOutHelper<
|
|
1004
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
1005
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
1006
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
1007
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
1008
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
1009
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
1010
|
+
h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
1011
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
980
1012
|
<
|
|
981
1013
|
Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>,
|
|
982
1014
|
B,
|
|
@@ -987,7 +1019,7 @@ export declare namespace Commander {
|
|
|
987
1019
|
G,
|
|
988
1020
|
H,
|
|
989
1021
|
I,
|
|
990
|
-
|
|
1022
|
+
Arg
|
|
991
1023
|
>(
|
|
992
1024
|
a: (
|
|
993
1025
|
_: Effect.Effect<
|
|
@@ -995,17 +1027,18 @@ export declare namespace Commander {
|
|
|
995
1027
|
EEff,
|
|
996
1028
|
REff
|
|
997
1029
|
>,
|
|
998
|
-
|
|
1030
|
+
arg: NoInfer<Arg>,
|
|
1031
|
+
ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>
|
|
999
1032
|
) => B,
|
|
1000
|
-
b: (_: B,
|
|
1001
|
-
c: (_: C,
|
|
1002
|
-
d: (_: D,
|
|
1003
|
-
e: (_: E,
|
|
1004
|
-
f: (_: F,
|
|
1005
|
-
g: (_: G,
|
|
1006
|
-
h: (_: H,
|
|
1007
|
-
i: (_: H,
|
|
1008
|
-
): CommandOutHelper<
|
|
1033
|
+
b: (_: B, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C,
|
|
1034
|
+
c: (_: C, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D,
|
|
1035
|
+
d: (_: D, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E,
|
|
1036
|
+
e: (_: E, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F,
|
|
1037
|
+
f: (_: F, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G,
|
|
1038
|
+
g: (_: G, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H,
|
|
1039
|
+
h: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I,
|
|
1040
|
+
i: (_: H, arg: NoInfer<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff
|
|
1041
|
+
): CommandOutHelper<Arg, Eff, Id, I18nKey, State>
|
|
1009
1042
|
}
|
|
1010
1043
|
}
|
|
1011
1044
|
|
|
@@ -1142,8 +1175,12 @@ export const CommanderStatic = {
|
|
|
1142
1175
|
*/
|
|
1143
1176
|
withDefaultToast: <A, E, R, Args extends Array<unknown>>(
|
|
1144
1177
|
options?: {
|
|
1178
|
+
/**
|
|
1179
|
+
* if true, previous toasts with this key will be replaced
|
|
1180
|
+
*/
|
|
1181
|
+
stableToastId?: undefined | true | string | ((id: string, ...args: Args) => true | string | undefined)
|
|
1145
1182
|
errorRenderer?: ErrorRenderer<E, Args>
|
|
1146
|
-
onWaiting?: null | undefined | string | ((
|
|
1183
|
+
onWaiting?: null | undefined | string | ((id: string, ...args: Args) => string | null | undefined)
|
|
1147
1184
|
onSuccess?: null | undefined | string | ((a: A, action: string, ...args: Args) => string | null | undefined)
|
|
1148
1185
|
}
|
|
1149
1186
|
) =>
|
|
@@ -1161,6 +1198,20 @@ export const CommanderStatic = {
|
|
|
1161
1198
|
const hasCustomSuccess = !!intl.messages[customSuccess]
|
|
1162
1199
|
const customFailure = cc.namespaced("failure")
|
|
1163
1200
|
const hasCustomFailure = !!intl.messages[customFailure]
|
|
1201
|
+
const stableToastId = options?.stableToastId
|
|
1202
|
+
? typeof options.stableToastId === "string"
|
|
1203
|
+
? options.stableToastId
|
|
1204
|
+
: typeof options.stableToastId === "boolean"
|
|
1205
|
+
? cc.id
|
|
1206
|
+
: typeof options.stableToastId === "function"
|
|
1207
|
+
? (...args: Args) => {
|
|
1208
|
+
const r = (options.stableToastId as any)(id, ...args)
|
|
1209
|
+
if (typeof r === "string") return r
|
|
1210
|
+
if (r === true) return cc.id
|
|
1211
|
+
return undefined
|
|
1212
|
+
}
|
|
1213
|
+
: undefined
|
|
1214
|
+
: undefined
|
|
1164
1215
|
return yield* self.pipe(
|
|
1165
1216
|
(_) =>
|
|
1166
1217
|
withToast<A, E, Args, R, never, never, I18n>({
|
|
@@ -1185,7 +1236,8 @@ export const CommanderStatic = {
|
|
|
1185
1236
|
onFailure: defaultFailureMessageHandler(
|
|
1186
1237
|
hasCustomFailure ? intl.formatMessage({ id: customFailure }, cc.state) : cc.action,
|
|
1187
1238
|
options?.errorRenderer
|
|
1188
|
-
)
|
|
1239
|
+
),
|
|
1240
|
+
stableToastId
|
|
1189
1241
|
})(_, ...args)
|
|
1190
1242
|
)
|
|
1191
1243
|
})
|
|
@@ -1289,8 +1341,8 @@ export class CommanderImpl<RT> {
|
|
|
1289
1341
|
const state = getStateValues(options)
|
|
1290
1342
|
|
|
1291
1343
|
return Object.assign(
|
|
1292
|
-
<
|
|
1293
|
-
handler: (
|
|
1344
|
+
<Arg, A, E, R extends RT | CommandContext | `Commander.Command.${Id}.state`>(
|
|
1345
|
+
handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>
|
|
1294
1346
|
) => {
|
|
1295
1347
|
// we capture the definition stack here, so we can append it to later stack traces
|
|
1296
1348
|
const limit = Error.stackTraceLimit
|
|
@@ -1368,7 +1420,7 @@ export class CommanderImpl<RT> {
|
|
|
1368
1420
|
const exec = options?.disableSharedWaiting
|
|
1369
1421
|
? exec_
|
|
1370
1422
|
: Effect
|
|
1371
|
-
.fnUntraced(function*(...args:
|
|
1423
|
+
.fnUntraced(function*(...args: [any, any]) {
|
|
1372
1424
|
registerWait(id)
|
|
1373
1425
|
return yield* exec_(...args)
|
|
1374
1426
|
}, Effect.onExit(() => Effect.sync(() => unregisterWait(id))))
|
|
@@ -1377,7 +1429,7 @@ export class CommanderImpl<RT> {
|
|
|
1377
1429
|
? computed(() => result.value.waiting)
|
|
1378
1430
|
: computed(() => result.value.waiting || (waitState.value[id] ?? 0) > 0)
|
|
1379
1431
|
|
|
1380
|
-
const handle = Object.assign((
|
|
1432
|
+
const handle = Object.assign((arg: Arg) => {
|
|
1381
1433
|
// we capture the call site stack here
|
|
1382
1434
|
const limit = Error.stackTraceLimit
|
|
1383
1435
|
Error.stackTraceLimit = 2
|
|
@@ -1410,12 +1462,12 @@ export class CommanderImpl<RT> {
|
|
|
1410
1462
|
|
|
1411
1463
|
const command = currentState.pipe(Effect.flatMap((state) =>
|
|
1412
1464
|
Effect.withSpan(
|
|
1413
|
-
exec(...
|
|
1465
|
+
exec(arg, { ...context.value, state } as any),
|
|
1414
1466
|
id,
|
|
1415
1467
|
{
|
|
1416
1468
|
captureStackTrace,
|
|
1417
1469
|
attributes: {
|
|
1418
|
-
input:
|
|
1470
|
+
input: arg,
|
|
1419
1471
|
state,
|
|
1420
1472
|
action: initialContext.action,
|
|
1421
1473
|
label: initialContext.label,
|
|
@@ -1576,10 +1628,10 @@ export class CommanderImpl<RT> {
|
|
|
1576
1628
|
}
|
|
1577
1629
|
)
|
|
1578
1630
|
|
|
1579
|
-
/** @experimental */
|
|
1631
|
+
/** @experimental @deprecated */
|
|
1580
1632
|
alt2: <
|
|
1581
1633
|
const Id extends string,
|
|
1582
|
-
|
|
1634
|
+
MutArg,
|
|
1583
1635
|
MutA,
|
|
1584
1636
|
MutE,
|
|
1585
1637
|
MutR,
|
|
@@ -1588,19 +1640,19 @@ export class CommanderImpl<RT> {
|
|
|
1588
1640
|
>(
|
|
1589
1641
|
id:
|
|
1590
1642
|
| Id
|
|
1591
|
-
| { id: Id; mutate: (
|
|
1592
|
-
| ((
|
|
1643
|
+
| { id: Id; mutate: (arg: MutArg) => Effect.Effect<MutA, MutE, MutR> }
|
|
1644
|
+
| ((arg: MutArg) => Effect.Effect<MutA, MutE, MutR>) & { id: Id },
|
|
1593
1645
|
options?: FnOptions<I18nKey, State>
|
|
1594
1646
|
) =>
|
|
1595
1647
|
& Commander.CommandContextLocal<Id, I18nKey>
|
|
1596
|
-
& (<
|
|
1648
|
+
& (<A, E, R extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(
|
|
1597
1649
|
handler: (
|
|
1598
1650
|
ctx: Effect.fn.Gen & Effect.fn.NonGen & Commander.CommandContextLocal<Id, I18nKey> & {
|
|
1599
1651
|
// todo: only if we passed in one
|
|
1600
|
-
mutate: (
|
|
1652
|
+
mutate: (arg: Arg) => Effect.Effect<MutA, MutE, MutR>
|
|
1601
1653
|
}
|
|
1602
|
-
) => (
|
|
1603
|
-
) => Commander.CommandOut<
|
|
1654
|
+
) => (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>
|
|
1655
|
+
) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>) = (
|
|
1604
1656
|
_id,
|
|
1605
1657
|
options?
|
|
1606
1658
|
) => {
|
|
@@ -1638,9 +1690,9 @@ export class CommanderImpl<RT> {
|
|
|
1638
1690
|
customI18nKey?: I18nKey
|
|
1639
1691
|
) =>
|
|
1640
1692
|
& Commander.CommandContextLocal<Id, I18nKey>
|
|
1641
|
-
& (<
|
|
1642
|
-
handler: (
|
|
1643
|
-
) => Commander.CommandOut<
|
|
1693
|
+
& (<A, E, R extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(
|
|
1694
|
+
handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>
|
|
1695
|
+
) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>)
|
|
1644
1696
|
|
|
1645
1697
|
/**
|
|
1646
1698
|
* Define a Command for handling user actions with built-in error reporting and state management.
|
|
@@ -1671,7 +1723,7 @@ export class CommanderImpl<RT> {
|
|
|
1671
1723
|
*/
|
|
1672
1724
|
wrap = <
|
|
1673
1725
|
const Id extends string,
|
|
1674
|
-
|
|
1726
|
+
Arg,
|
|
1675
1727
|
A,
|
|
1676
1728
|
E,
|
|
1677
1729
|
R,
|
|
@@ -1679,10 +1731,10 @@ export class CommanderImpl<RT> {
|
|
|
1679
1731
|
I18nKey extends string = Id
|
|
1680
1732
|
>(
|
|
1681
1733
|
mutation:
|
|
1682
|
-
| { mutate: (
|
|
1683
|
-
| ((
|
|
1734
|
+
| { mutate: (arg: Arg) => Effect.Effect<A, E, R>; id: Id }
|
|
1735
|
+
| ((arg: Arg) => Effect.Effect<A, E, R>) & { id: Id },
|
|
1684
1736
|
options?: FnOptions<I18nKey, State>
|
|
1685
|
-
): Commander.CommanderWrap<RT, Id, I18nKey, State,
|
|
1737
|
+
): Commander.CommanderWrap<RT, Id, I18nKey, State, Arg, A, E, R> =>
|
|
1686
1738
|
Object.assign(
|
|
1687
1739
|
(
|
|
1688
1740
|
...combinators: any[]
|
|
@@ -1698,8 +1750,8 @@ export class CommanderImpl<RT> {
|
|
|
1698
1750
|
return this.makeCommand(mutation.id, options, errorDef)(
|
|
1699
1751
|
Effect.fnUntraced(
|
|
1700
1752
|
// fnUntraced only supports generators as first arg, so we convert to generator if needed
|
|
1701
|
-
isGeneratorFunction(mutate) ? mutate : function*(
|
|
1702
|
-
return yield* mutate(
|
|
1753
|
+
isGeneratorFunction(mutate) ? mutate : function*(arg: Arg) {
|
|
1754
|
+
return yield* mutate(arg)
|
|
1703
1755
|
},
|
|
1704
1756
|
...combinators as [any]
|
|
1705
1757
|
) as any
|