Eric Bower
·
2025-06-06
api-types.ts
1import type { Operation } from "effection";
2import type { Next, Payload } from "../types.js";
3/**
4 * This is an auto-generated file, do not edit directly!
5 * Run "yarn template" to generate this file.
6 */
7import type { ThunksApi } from "./thunk.js";
8import type {
9 ApiCtx,
10 CreateAction,
11 CreateActionWithPayload,
12 FetchJson,
13 MiddlewareApiCo,
14 Supervisor,
15} from "./types.js";
16
17export type ApiName = string | string[];
18
19export interface QueryApi<Ctx extends ApiCtx = ApiCtx> extends ThunksApi<Ctx> {
20 request: (
21 r: Partial<RequestInit>,
22 ) => (ctx: Ctx, next: Next) => Operation<unknown>;
23 cache: () => (ctx: Ctx, next: Next) => Operation<unknown>;
24
25 uri: (uri: string) => {
26 /**
27 * Options only
28 */
29 get(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
30 get<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
31 Omit<Ctx, "payload"> & Payload<P>,
32 P
33 >;
34 get<P extends never, ApiSuccess, ApiError = unknown>(req: {
35 supervisor?: Supervisor;
36 }): CreateAction<
37 Omit<Ctx, "json"> &
38 FetchJson<
39 ApiSuccess,
40 ApiError extends unknown ? Ctx["_error"] : ApiError
41 >,
42 ApiSuccess
43 >;
44 get<P, ApiSuccess, ApiError = unknown>(req: {
45 supervisor?: Supervisor;
46 }): CreateActionWithPayload<
47 Omit<Ctx, "payload" | "json"> &
48 Payload<P> &
49 FetchJson<
50 ApiSuccess,
51 ApiError extends unknown ? Ctx["_error"] : ApiError
52 >,
53 P,
54 ApiSuccess
55 >;
56
57 /**
58 * Middleware only
59 */
60 get(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
61 get<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
62 get<P>(
63 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
64 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
65 get<P, Gtx extends Ctx = Ctx>(
66 fn: MiddlewareApiCo<Gtx>,
67 ): CreateActionWithPayload<Gtx, P>;
68 get<P extends never, ApiSuccess, ApiError = unknown>(
69 fn: MiddlewareApiCo<
70 Omit<Ctx, "json"> &
71 FetchJson<
72 ApiSuccess,
73 ApiError extends unknown ? Ctx["_error"] : ApiError
74 >
75 >,
76 ): CreateAction<
77 Omit<Ctx, "json"> &
78 FetchJson<
79 ApiSuccess,
80 ApiError extends unknown ? Ctx["_error"] : ApiError
81 >,
82 ApiSuccess
83 >;
84 get<P, ApiSuccess, ApiError = unknown>(
85 fn: MiddlewareApiCo<Ctx>,
86 ): CreateActionWithPayload<
87 Omit<Ctx, "payload" | "json"> &
88 Payload<P> &
89 FetchJson<
90 ApiSuccess,
91 ApiError extends unknown ? Ctx["_error"] : ApiError
92 >,
93 P,
94 ApiSuccess
95 >;
96
97 /**
98 * Options and Middleware
99 */
100 get(
101 req: { supervisor?: Supervisor },
102 fn: MiddlewareApiCo<Ctx>,
103 ): CreateAction<Ctx>;
104 get<Gtx extends Ctx = Ctx>(
105 req: { supervisor?: Supervisor },
106 fn: MiddlewareApiCo<Gtx>,
107 ): CreateAction<Gtx>;
108 get<P>(
109 req: { supervisor?: Supervisor },
110 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
111 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
112 get<P, Gtx extends Ctx = Ctx>(
113 req: { supervisor?: Supervisor },
114 fn: MiddlewareApiCo<Gtx>,
115 ): CreateActionWithPayload<Gtx, P>;
116 get<P extends never, ApiSuccess, ApiError = unknown>(
117 req: { supervisor?: Supervisor },
118 fn: MiddlewareApiCo<
119 Omit<Ctx, "json"> &
120 FetchJson<
121 ApiSuccess,
122 ApiError extends unknown ? Ctx["_error"] : ApiError
123 >
124 >,
125 ): CreateAction<
126 Omit<Ctx, "json"> &
127 FetchJson<
128 ApiSuccess,
129 ApiError extends unknown ? Ctx["_error"] : ApiError
130 >,
131 ApiSuccess
132 >;
133 get<P, ApiSuccess, ApiError = unknown>(
134 req: { supervisor?: Supervisor },
135 fn: MiddlewareApiCo<Ctx>,
136 ): CreateActionWithPayload<
137 Omit<Ctx, "payload" | "json"> &
138 Payload<P> &
139 FetchJson<
140 ApiSuccess,
141 ApiError extends unknown ? Ctx["_error"] : ApiError
142 >,
143 P,
144 ApiSuccess
145 >;
146
147 /**
148 * Options only
149 */
150 post(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
151 post<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
152 Omit<Ctx, "payload"> & Payload<P>,
153 P
154 >;
155 post<P extends never, ApiSuccess, ApiError = unknown>(req: {
156 supervisor?: Supervisor;
157 }): CreateAction<
158 Omit<Ctx, "json"> &
159 FetchJson<
160 ApiSuccess,
161 ApiError extends unknown ? Ctx["_error"] : ApiError
162 >,
163 ApiSuccess
164 >;
165 post<P, ApiSuccess, ApiError = unknown>(req: {
166 supervisor?: Supervisor;
167 }): CreateActionWithPayload<
168 Omit<Ctx, "payload" | "json"> &
169 Payload<P> &
170 FetchJson<
171 ApiSuccess,
172 ApiError extends unknown ? Ctx["_error"] : ApiError
173 >,
174 P,
175 ApiSuccess
176 >;
177
178 /**
179 * Middleware only
180 */
181 post(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
182 post<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
183 post<P>(
184 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
185 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
186 post<P, Gtx extends Ctx = Ctx>(
187 fn: MiddlewareApiCo<Gtx>,
188 ): CreateActionWithPayload<Gtx, P>;
189 post<P extends never, ApiSuccess, ApiError = unknown>(
190 fn: MiddlewareApiCo<
191 Omit<Ctx, "json"> &
192 FetchJson<
193 ApiSuccess,
194 ApiError extends unknown ? Ctx["_error"] : ApiError
195 >
196 >,
197 ): CreateAction<
198 Omit<Ctx, "json"> &
199 FetchJson<
200 ApiSuccess,
201 ApiError extends unknown ? Ctx["_error"] : ApiError
202 >,
203 ApiSuccess
204 >;
205 post<P, ApiSuccess, ApiError = unknown>(
206 fn: MiddlewareApiCo<Ctx>,
207 ): CreateActionWithPayload<
208 Omit<Ctx, "payload" | "json"> &
209 Payload<P> &
210 FetchJson<
211 ApiSuccess,
212 ApiError extends unknown ? Ctx["_error"] : ApiError
213 >,
214 P,
215 ApiSuccess
216 >;
217
218 /**
219 * Options and Middleware
220 */
221 post(
222 req: { supervisor?: Supervisor },
223 fn: MiddlewareApiCo<Ctx>,
224 ): CreateAction<Ctx>;
225 post<Gtx extends Ctx = Ctx>(
226 req: { supervisor?: Supervisor },
227 fn: MiddlewareApiCo<Gtx>,
228 ): CreateAction<Gtx>;
229 post<P>(
230 req: { supervisor?: Supervisor },
231 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
232 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
233 post<P, Gtx extends Ctx = Ctx>(
234 req: { supervisor?: Supervisor },
235 fn: MiddlewareApiCo<Gtx>,
236 ): CreateActionWithPayload<Gtx, P>;
237 post<P extends never, ApiSuccess, ApiError = unknown>(
238 req: { supervisor?: Supervisor },
239 fn: MiddlewareApiCo<
240 Omit<Ctx, "json"> &
241 FetchJson<
242 ApiSuccess,
243 ApiError extends unknown ? Ctx["_error"] : ApiError
244 >
245 >,
246 ): CreateAction<
247 Omit<Ctx, "json"> &
248 FetchJson<
249 ApiSuccess,
250 ApiError extends unknown ? Ctx["_error"] : ApiError
251 >,
252 ApiSuccess
253 >;
254 post<P, ApiSuccess, ApiError = unknown>(
255 req: { supervisor?: Supervisor },
256 fn: MiddlewareApiCo<Ctx>,
257 ): CreateActionWithPayload<
258 Omit<Ctx, "payload" | "json"> &
259 Payload<P> &
260 FetchJson<
261 ApiSuccess,
262 ApiError extends unknown ? Ctx["_error"] : ApiError
263 >,
264 P,
265 ApiSuccess
266 >;
267
268 /**
269 * Options only
270 */
271 put(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
272 put<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
273 Omit<Ctx, "payload"> & Payload<P>,
274 P
275 >;
276 put<P extends never, ApiSuccess, ApiError = unknown>(req: {
277 supervisor?: Supervisor;
278 }): CreateAction<
279 Omit<Ctx, "json"> &
280 FetchJson<
281 ApiSuccess,
282 ApiError extends unknown ? Ctx["_error"] : ApiError
283 >,
284 ApiSuccess
285 >;
286 put<P, ApiSuccess, ApiError = unknown>(req: {
287 supervisor?: Supervisor;
288 }): CreateActionWithPayload<
289 Omit<Ctx, "payload" | "json"> &
290 Payload<P> &
291 FetchJson<
292 ApiSuccess,
293 ApiError extends unknown ? Ctx["_error"] : ApiError
294 >,
295 P,
296 ApiSuccess
297 >;
298
299 /**
300 * Middleware only
301 */
302 put(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
303 put<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
304 put<P>(
305 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
306 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
307 put<P, Gtx extends Ctx = Ctx>(
308 fn: MiddlewareApiCo<Gtx>,
309 ): CreateActionWithPayload<Gtx, P>;
310 put<P extends never, ApiSuccess, ApiError = unknown>(
311 fn: MiddlewareApiCo<
312 Omit<Ctx, "json"> &
313 FetchJson<
314 ApiSuccess,
315 ApiError extends unknown ? Ctx["_error"] : ApiError
316 >
317 >,
318 ): CreateAction<
319 Omit<Ctx, "json"> &
320 FetchJson<
321 ApiSuccess,
322 ApiError extends unknown ? Ctx["_error"] : ApiError
323 >,
324 ApiSuccess
325 >;
326 put<P, ApiSuccess, ApiError = unknown>(
327 fn: MiddlewareApiCo<Ctx>,
328 ): CreateActionWithPayload<
329 Omit<Ctx, "payload" | "json"> &
330 Payload<P> &
331 FetchJson<
332 ApiSuccess,
333 ApiError extends unknown ? Ctx["_error"] : ApiError
334 >,
335 P,
336 ApiSuccess
337 >;
338
339 /**
340 * Options and Middleware
341 */
342 put(
343 req: { supervisor?: Supervisor },
344 fn: MiddlewareApiCo<Ctx>,
345 ): CreateAction<Ctx>;
346 put<Gtx extends Ctx = Ctx>(
347 req: { supervisor?: Supervisor },
348 fn: MiddlewareApiCo<Gtx>,
349 ): CreateAction<Gtx>;
350 put<P>(
351 req: { supervisor?: Supervisor },
352 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
353 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
354 put<P, Gtx extends Ctx = Ctx>(
355 req: { supervisor?: Supervisor },
356 fn: MiddlewareApiCo<Gtx>,
357 ): CreateActionWithPayload<Gtx, P>;
358 put<P extends never, ApiSuccess, ApiError = unknown>(
359 req: { supervisor?: Supervisor },
360 fn: MiddlewareApiCo<
361 Omit<Ctx, "json"> &
362 FetchJson<
363 ApiSuccess,
364 ApiError extends unknown ? Ctx["_error"] : ApiError
365 >
366 >,
367 ): CreateAction<
368 Omit<Ctx, "json"> &
369 FetchJson<
370 ApiSuccess,
371 ApiError extends unknown ? Ctx["_error"] : ApiError
372 >,
373 ApiSuccess
374 >;
375 put<P, ApiSuccess, ApiError = unknown>(
376 req: { supervisor?: Supervisor },
377 fn: MiddlewareApiCo<Ctx>,
378 ): CreateActionWithPayload<
379 Omit<Ctx, "payload" | "json"> &
380 Payload<P> &
381 FetchJson<
382 ApiSuccess,
383 ApiError extends unknown ? Ctx["_error"] : ApiError
384 >,
385 P,
386 ApiSuccess
387 >;
388
389 /**
390 * Options only
391 */
392 patch(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
393 patch<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
394 Omit<Ctx, "payload"> & Payload<P>,
395 P
396 >;
397 patch<P extends never, ApiSuccess, ApiError = unknown>(req: {
398 supervisor?: Supervisor;
399 }): CreateAction<
400 Omit<Ctx, "json"> &
401 FetchJson<
402 ApiSuccess,
403 ApiError extends unknown ? Ctx["_error"] : ApiError
404 >,
405 ApiSuccess
406 >;
407 patch<P, ApiSuccess, ApiError = unknown>(req: {
408 supervisor?: Supervisor;
409 }): CreateActionWithPayload<
410 Omit<Ctx, "payload" | "json"> &
411 Payload<P> &
412 FetchJson<
413 ApiSuccess,
414 ApiError extends unknown ? Ctx["_error"] : ApiError
415 >,
416 P,
417 ApiSuccess
418 >;
419
420 /**
421 * Middleware only
422 */
423 patch(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
424 patch<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
425 patch<P>(
426 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
427 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
428 patch<P, Gtx extends Ctx = Ctx>(
429 fn: MiddlewareApiCo<Gtx>,
430 ): CreateActionWithPayload<Gtx, P>;
431 patch<P extends never, ApiSuccess, ApiError = unknown>(
432 fn: MiddlewareApiCo<
433 Omit<Ctx, "json"> &
434 FetchJson<
435 ApiSuccess,
436 ApiError extends unknown ? Ctx["_error"] : ApiError
437 >
438 >,
439 ): CreateAction<
440 Omit<Ctx, "json"> &
441 FetchJson<
442 ApiSuccess,
443 ApiError extends unknown ? Ctx["_error"] : ApiError
444 >,
445 ApiSuccess
446 >;
447 patch<P, ApiSuccess, ApiError = unknown>(
448 fn: MiddlewareApiCo<Ctx>,
449 ): CreateActionWithPayload<
450 Omit<Ctx, "payload" | "json"> &
451 Payload<P> &
452 FetchJson<
453 ApiSuccess,
454 ApiError extends unknown ? Ctx["_error"] : ApiError
455 >,
456 P,
457 ApiSuccess
458 >;
459
460 /**
461 * Options and Middleware
462 */
463 patch(
464 req: { supervisor?: Supervisor },
465 fn: MiddlewareApiCo<Ctx>,
466 ): CreateAction<Ctx>;
467 patch<Gtx extends Ctx = Ctx>(
468 req: { supervisor?: Supervisor },
469 fn: MiddlewareApiCo<Gtx>,
470 ): CreateAction<Gtx>;
471 patch<P>(
472 req: { supervisor?: Supervisor },
473 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
474 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
475 patch<P, Gtx extends Ctx = Ctx>(
476 req: { supervisor?: Supervisor },
477 fn: MiddlewareApiCo<Gtx>,
478 ): CreateActionWithPayload<Gtx, P>;
479 patch<P extends never, ApiSuccess, ApiError = unknown>(
480 req: { supervisor?: Supervisor },
481 fn: MiddlewareApiCo<
482 Omit<Ctx, "json"> &
483 FetchJson<
484 ApiSuccess,
485 ApiError extends unknown ? Ctx["_error"] : ApiError
486 >
487 >,
488 ): CreateAction<
489 Omit<Ctx, "json"> &
490 FetchJson<
491 ApiSuccess,
492 ApiError extends unknown ? Ctx["_error"] : ApiError
493 >,
494 ApiSuccess
495 >;
496 patch<P, ApiSuccess, ApiError = unknown>(
497 req: { supervisor?: Supervisor },
498 fn: MiddlewareApiCo<Ctx>,
499 ): CreateActionWithPayload<
500 Omit<Ctx, "payload" | "json"> &
501 Payload<P> &
502 FetchJson<
503 ApiSuccess,
504 ApiError extends unknown ? Ctx["_error"] : ApiError
505 >,
506 P,
507 ApiSuccess
508 >;
509
510 /**
511 * Options only
512 */
513 delete(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
514 delete<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
515 Omit<Ctx, "payload"> & Payload<P>,
516 P
517 >;
518 delete<P extends never, ApiSuccess, ApiError = unknown>(req: {
519 supervisor?: Supervisor;
520 }): CreateAction<
521 Omit<Ctx, "json"> &
522 FetchJson<
523 ApiSuccess,
524 ApiError extends unknown ? Ctx["_error"] : ApiError
525 >,
526 ApiSuccess
527 >;
528 delete<P, ApiSuccess, ApiError = unknown>(req: {
529 supervisor?: Supervisor;
530 }): CreateActionWithPayload<
531 Omit<Ctx, "payload" | "json"> &
532 Payload<P> &
533 FetchJson<
534 ApiSuccess,
535 ApiError extends unknown ? Ctx["_error"] : ApiError
536 >,
537 P,
538 ApiSuccess
539 >;
540
541 /**
542 * Middleware only
543 */
544 delete(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
545 delete<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
546 delete<P>(
547 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
548 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
549 delete<P, Gtx extends Ctx = Ctx>(
550 fn: MiddlewareApiCo<Gtx>,
551 ): CreateActionWithPayload<Gtx, P>;
552 delete<P extends never, ApiSuccess, ApiError = unknown>(
553 fn: MiddlewareApiCo<
554 Omit<Ctx, "json"> &
555 FetchJson<
556 ApiSuccess,
557 ApiError extends unknown ? Ctx["_error"] : ApiError
558 >
559 >,
560 ): CreateAction<
561 Omit<Ctx, "json"> &
562 FetchJson<
563 ApiSuccess,
564 ApiError extends unknown ? Ctx["_error"] : ApiError
565 >,
566 ApiSuccess
567 >;
568 delete<P, ApiSuccess, ApiError = unknown>(
569 fn: MiddlewareApiCo<Ctx>,
570 ): CreateActionWithPayload<
571 Omit<Ctx, "payload" | "json"> &
572 Payload<P> &
573 FetchJson<
574 ApiSuccess,
575 ApiError extends unknown ? Ctx["_error"] : ApiError
576 >,
577 P,
578 ApiSuccess
579 >;
580
581 /**
582 * Options and Middleware
583 */
584 delete(
585 req: { supervisor?: Supervisor },
586 fn: MiddlewareApiCo<Ctx>,
587 ): CreateAction<Ctx>;
588 delete<Gtx extends Ctx = Ctx>(
589 req: { supervisor?: Supervisor },
590 fn: MiddlewareApiCo<Gtx>,
591 ): CreateAction<Gtx>;
592 delete<P>(
593 req: { supervisor?: Supervisor },
594 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
595 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
596 delete<P, Gtx extends Ctx = Ctx>(
597 req: { supervisor?: Supervisor },
598 fn: MiddlewareApiCo<Gtx>,
599 ): CreateActionWithPayload<Gtx, P>;
600 delete<P extends never, ApiSuccess, ApiError = unknown>(
601 req: { supervisor?: Supervisor },
602 fn: MiddlewareApiCo<
603 Omit<Ctx, "json"> &
604 FetchJson<
605 ApiSuccess,
606 ApiError extends unknown ? Ctx["_error"] : ApiError
607 >
608 >,
609 ): CreateAction<
610 Omit<Ctx, "json"> &
611 FetchJson<
612 ApiSuccess,
613 ApiError extends unknown ? Ctx["_error"] : ApiError
614 >,
615 ApiSuccess
616 >;
617 delete<P, ApiSuccess, ApiError = unknown>(
618 req: { supervisor?: Supervisor },
619 fn: MiddlewareApiCo<Ctx>,
620 ): CreateActionWithPayload<
621 Omit<Ctx, "payload" | "json"> &
622 Payload<P> &
623 FetchJson<
624 ApiSuccess,
625 ApiError extends unknown ? Ctx["_error"] : ApiError
626 >,
627 P,
628 ApiSuccess
629 >;
630
631 /**
632 * Options only
633 */
634 options(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
635 options<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
636 Omit<Ctx, "payload"> & Payload<P>,
637 P
638 >;
639 options<P extends never, ApiSuccess, ApiError = unknown>(req: {
640 supervisor?: Supervisor;
641 }): CreateAction<
642 Omit<Ctx, "json"> &
643 FetchJson<
644 ApiSuccess,
645 ApiError extends unknown ? Ctx["_error"] : ApiError
646 >,
647 ApiSuccess
648 >;
649 options<P, ApiSuccess, ApiError = unknown>(req: {
650 supervisor?: Supervisor;
651 }): CreateActionWithPayload<
652 Omit<Ctx, "payload" | "json"> &
653 Payload<P> &
654 FetchJson<
655 ApiSuccess,
656 ApiError extends unknown ? Ctx["_error"] : ApiError
657 >,
658 P,
659 ApiSuccess
660 >;
661
662 /**
663 * Middleware only
664 */
665 options(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
666 options<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
667 options<P>(
668 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
669 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
670 options<P, Gtx extends Ctx = Ctx>(
671 fn: MiddlewareApiCo<Gtx>,
672 ): CreateActionWithPayload<Gtx, P>;
673 options<P extends never, ApiSuccess, ApiError = unknown>(
674 fn: MiddlewareApiCo<
675 Omit<Ctx, "json"> &
676 FetchJson<
677 ApiSuccess,
678 ApiError extends unknown ? Ctx["_error"] : ApiError
679 >
680 >,
681 ): CreateAction<
682 Omit<Ctx, "json"> &
683 FetchJson<
684 ApiSuccess,
685 ApiError extends unknown ? Ctx["_error"] : ApiError
686 >,
687 ApiSuccess
688 >;
689 options<P, ApiSuccess, ApiError = unknown>(
690 fn: MiddlewareApiCo<Ctx>,
691 ): CreateActionWithPayload<
692 Omit<Ctx, "payload" | "json"> &
693 Payload<P> &
694 FetchJson<
695 ApiSuccess,
696 ApiError extends unknown ? Ctx["_error"] : ApiError
697 >,
698 P,
699 ApiSuccess
700 >;
701
702 /**
703 * Options and Middleware
704 */
705 options(
706 req: { supervisor?: Supervisor },
707 fn: MiddlewareApiCo<Ctx>,
708 ): CreateAction<Ctx>;
709 options<Gtx extends Ctx = Ctx>(
710 req: { supervisor?: Supervisor },
711 fn: MiddlewareApiCo<Gtx>,
712 ): CreateAction<Gtx>;
713 options<P>(
714 req: { supervisor?: Supervisor },
715 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
716 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
717 options<P, Gtx extends Ctx = Ctx>(
718 req: { supervisor?: Supervisor },
719 fn: MiddlewareApiCo<Gtx>,
720 ): CreateActionWithPayload<Gtx, P>;
721 options<P extends never, ApiSuccess, ApiError = unknown>(
722 req: { supervisor?: Supervisor },
723 fn: MiddlewareApiCo<
724 Omit<Ctx, "json"> &
725 FetchJson<
726 ApiSuccess,
727 ApiError extends unknown ? Ctx["_error"] : ApiError
728 >
729 >,
730 ): CreateAction<
731 Omit<Ctx, "json"> &
732 FetchJson<
733 ApiSuccess,
734 ApiError extends unknown ? Ctx["_error"] : ApiError
735 >,
736 ApiSuccess
737 >;
738 options<P, ApiSuccess, ApiError = unknown>(
739 req: { supervisor?: Supervisor },
740 fn: MiddlewareApiCo<Ctx>,
741 ): CreateActionWithPayload<
742 Omit<Ctx, "payload" | "json"> &
743 Payload<P> &
744 FetchJson<
745 ApiSuccess,
746 ApiError extends unknown ? Ctx["_error"] : ApiError
747 >,
748 P,
749 ApiSuccess
750 >;
751
752 /**
753 * Options only
754 */
755 head(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
756 head<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
757 Omit<Ctx, "payload"> & Payload<P>,
758 P
759 >;
760 head<P extends never, ApiSuccess, ApiError = unknown>(req: {
761 supervisor?: Supervisor;
762 }): CreateAction<
763 Omit<Ctx, "json"> &
764 FetchJson<
765 ApiSuccess,
766 ApiError extends unknown ? Ctx["_error"] : ApiError
767 >,
768 ApiSuccess
769 >;
770 head<P, ApiSuccess, ApiError = unknown>(req: {
771 supervisor?: Supervisor;
772 }): CreateActionWithPayload<
773 Omit<Ctx, "payload" | "json"> &
774 Payload<P> &
775 FetchJson<
776 ApiSuccess,
777 ApiError extends unknown ? Ctx["_error"] : ApiError
778 >,
779 P,
780 ApiSuccess
781 >;
782
783 /**
784 * Middleware only
785 */
786 head(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
787 head<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
788 head<P>(
789 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
790 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
791 head<P, Gtx extends Ctx = Ctx>(
792 fn: MiddlewareApiCo<Gtx>,
793 ): CreateActionWithPayload<Gtx, P>;
794 head<P extends never, ApiSuccess, ApiError = unknown>(
795 fn: MiddlewareApiCo<
796 Omit<Ctx, "json"> &
797 FetchJson<
798 ApiSuccess,
799 ApiError extends unknown ? Ctx["_error"] : ApiError
800 >
801 >,
802 ): CreateAction<
803 Omit<Ctx, "json"> &
804 FetchJson<
805 ApiSuccess,
806 ApiError extends unknown ? Ctx["_error"] : ApiError
807 >,
808 ApiSuccess
809 >;
810 head<P, ApiSuccess, ApiError = unknown>(
811 fn: MiddlewareApiCo<Ctx>,
812 ): CreateActionWithPayload<
813 Omit<Ctx, "payload" | "json"> &
814 Payload<P> &
815 FetchJson<
816 ApiSuccess,
817 ApiError extends unknown ? Ctx["_error"] : ApiError
818 >,
819 P,
820 ApiSuccess
821 >;
822
823 /**
824 * Options and Middleware
825 */
826 head(
827 req: { supervisor?: Supervisor },
828 fn: MiddlewareApiCo<Ctx>,
829 ): CreateAction<Ctx>;
830 head<Gtx extends Ctx = Ctx>(
831 req: { supervisor?: Supervisor },
832 fn: MiddlewareApiCo<Gtx>,
833 ): CreateAction<Gtx>;
834 head<P>(
835 req: { supervisor?: Supervisor },
836 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
837 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
838 head<P, Gtx extends Ctx = Ctx>(
839 req: { supervisor?: Supervisor },
840 fn: MiddlewareApiCo<Gtx>,
841 ): CreateActionWithPayload<Gtx, P>;
842 head<P extends never, ApiSuccess, ApiError = unknown>(
843 req: { supervisor?: Supervisor },
844 fn: MiddlewareApiCo<
845 Omit<Ctx, "json"> &
846 FetchJson<
847 ApiSuccess,
848 ApiError extends unknown ? Ctx["_error"] : ApiError
849 >
850 >,
851 ): CreateAction<
852 Omit<Ctx, "json"> &
853 FetchJson<
854 ApiSuccess,
855 ApiError extends unknown ? Ctx["_error"] : ApiError
856 >,
857 ApiSuccess
858 >;
859 head<P, ApiSuccess, ApiError = unknown>(
860 req: { supervisor?: Supervisor },
861 fn: MiddlewareApiCo<Ctx>,
862 ): CreateActionWithPayload<
863 Omit<Ctx, "payload" | "json"> &
864 Payload<P> &
865 FetchJson<
866 ApiSuccess,
867 ApiError extends unknown ? Ctx["_error"] : ApiError
868 >,
869 P,
870 ApiSuccess
871 >;
872
873 /**
874 * Options only
875 */
876 connect(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
877 connect<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
878 Omit<Ctx, "payload"> & Payload<P>,
879 P
880 >;
881 connect<P extends never, ApiSuccess, ApiError = unknown>(req: {
882 supervisor?: Supervisor;
883 }): CreateAction<
884 Omit<Ctx, "json"> &
885 FetchJson<
886 ApiSuccess,
887 ApiError extends unknown ? Ctx["_error"] : ApiError
888 >,
889 ApiSuccess
890 >;
891 connect<P, ApiSuccess, ApiError = unknown>(req: {
892 supervisor?: Supervisor;
893 }): CreateActionWithPayload<
894 Omit<Ctx, "payload" | "json"> &
895 Payload<P> &
896 FetchJson<
897 ApiSuccess,
898 ApiError extends unknown ? Ctx["_error"] : ApiError
899 >,
900 P,
901 ApiSuccess
902 >;
903
904 /**
905 * Middleware only
906 */
907 connect(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
908 connect<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
909 connect<P>(
910 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
911 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
912 connect<P, Gtx extends Ctx = Ctx>(
913 fn: MiddlewareApiCo<Gtx>,
914 ): CreateActionWithPayload<Gtx, P>;
915 connect<P extends never, ApiSuccess, ApiError = unknown>(
916 fn: MiddlewareApiCo<
917 Omit<Ctx, "json"> &
918 FetchJson<
919 ApiSuccess,
920 ApiError extends unknown ? Ctx["_error"] : ApiError
921 >
922 >,
923 ): CreateAction<
924 Omit<Ctx, "json"> &
925 FetchJson<
926 ApiSuccess,
927 ApiError extends unknown ? Ctx["_error"] : ApiError
928 >,
929 ApiSuccess
930 >;
931 connect<P, ApiSuccess, ApiError = unknown>(
932 fn: MiddlewareApiCo<Ctx>,
933 ): CreateActionWithPayload<
934 Omit<Ctx, "payload" | "json"> &
935 Payload<P> &
936 FetchJson<
937 ApiSuccess,
938 ApiError extends unknown ? Ctx["_error"] : ApiError
939 >,
940 P,
941 ApiSuccess
942 >;
943
944 /**
945 * Options and Middleware
946 */
947 connect(
948 req: { supervisor?: Supervisor },
949 fn: MiddlewareApiCo<Ctx>,
950 ): CreateAction<Ctx>;
951 connect<Gtx extends Ctx = Ctx>(
952 req: { supervisor?: Supervisor },
953 fn: MiddlewareApiCo<Gtx>,
954 ): CreateAction<Gtx>;
955 connect<P>(
956 req: { supervisor?: Supervisor },
957 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
958 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
959 connect<P, Gtx extends Ctx = Ctx>(
960 req: { supervisor?: Supervisor },
961 fn: MiddlewareApiCo<Gtx>,
962 ): CreateActionWithPayload<Gtx, P>;
963 connect<P extends never, ApiSuccess, ApiError = unknown>(
964 req: { supervisor?: Supervisor },
965 fn: MiddlewareApiCo<
966 Omit<Ctx, "json"> &
967 FetchJson<
968 ApiSuccess,
969 ApiError extends unknown ? Ctx["_error"] : ApiError
970 >
971 >,
972 ): CreateAction<
973 Omit<Ctx, "json"> &
974 FetchJson<
975 ApiSuccess,
976 ApiError extends unknown ? Ctx["_error"] : ApiError
977 >,
978 ApiSuccess
979 >;
980 connect<P, ApiSuccess, ApiError = unknown>(
981 req: { supervisor?: Supervisor },
982 fn: MiddlewareApiCo<Ctx>,
983 ): CreateActionWithPayload<
984 Omit<Ctx, "payload" | "json"> &
985 Payload<P> &
986 FetchJson<
987 ApiSuccess,
988 ApiError extends unknown ? Ctx["_error"] : ApiError
989 >,
990 P,
991 ApiSuccess
992 >;
993
994 /**
995 * Options only
996 */
997 trace(req: { supervisor?: Supervisor }): CreateAction<Ctx>;
998 trace<P>(req: { supervisor?: Supervisor }): CreateActionWithPayload<
999 Omit<Ctx, "payload"> & Payload<P>,
1000 P
1001 >;
1002 trace<P extends never, ApiSuccess, ApiError = unknown>(req: {
1003 supervisor?: Supervisor;
1004 }): CreateAction<
1005 Omit<Ctx, "json"> &
1006 FetchJson<
1007 ApiSuccess,
1008 ApiError extends unknown ? Ctx["_error"] : ApiError
1009 >,
1010 ApiSuccess
1011 >;
1012 trace<P, ApiSuccess, ApiError = unknown>(req: {
1013 supervisor?: Supervisor;
1014 }): CreateActionWithPayload<
1015 Omit<Ctx, "payload" | "json"> &
1016 Payload<P> &
1017 FetchJson<
1018 ApiSuccess,
1019 ApiError extends unknown ? Ctx["_error"] : ApiError
1020 >,
1021 P,
1022 ApiSuccess
1023 >;
1024
1025 /**
1026 * Middleware only
1027 */
1028 trace(fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1029 trace<Gtx extends Ctx = Ctx>(fn: MiddlewareApiCo<Gtx>): CreateAction<Gtx>;
1030 trace<P>(
1031 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1032 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1033 trace<P, Gtx extends Ctx = Ctx>(
1034 fn: MiddlewareApiCo<Gtx>,
1035 ): CreateActionWithPayload<Gtx, P>;
1036 trace<P extends never, ApiSuccess, ApiError = unknown>(
1037 fn: MiddlewareApiCo<
1038 Omit<Ctx, "json"> &
1039 FetchJson<
1040 ApiSuccess,
1041 ApiError extends unknown ? Ctx["_error"] : ApiError
1042 >
1043 >,
1044 ): CreateAction<
1045 Omit<Ctx, "json"> &
1046 FetchJson<
1047 ApiSuccess,
1048 ApiError extends unknown ? Ctx["_error"] : ApiError
1049 >,
1050 ApiSuccess
1051 >;
1052 trace<P, ApiSuccess, ApiError = unknown>(
1053 fn: MiddlewareApiCo<Ctx>,
1054 ): CreateActionWithPayload<
1055 Omit<Ctx, "payload" | "json"> &
1056 Payload<P> &
1057 FetchJson<
1058 ApiSuccess,
1059 ApiError extends unknown ? Ctx["_error"] : ApiError
1060 >,
1061 P,
1062 ApiSuccess
1063 >;
1064
1065 /**
1066 * Options and Middleware
1067 */
1068 trace(
1069 req: { supervisor?: Supervisor },
1070 fn: MiddlewareApiCo<Ctx>,
1071 ): CreateAction<Ctx>;
1072 trace<Gtx extends Ctx = Ctx>(
1073 req: { supervisor?: Supervisor },
1074 fn: MiddlewareApiCo<Gtx>,
1075 ): CreateAction<Gtx>;
1076 trace<P>(
1077 req: { supervisor?: Supervisor },
1078 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1079 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1080 trace<P, Gtx extends Ctx = Ctx>(
1081 req: { supervisor?: Supervisor },
1082 fn: MiddlewareApiCo<Gtx>,
1083 ): CreateActionWithPayload<Gtx, P>;
1084 trace<P extends never, ApiSuccess, ApiError = unknown>(
1085 req: { supervisor?: Supervisor },
1086 fn: MiddlewareApiCo<
1087 Omit<Ctx, "json"> &
1088 FetchJson<
1089 ApiSuccess,
1090 ApiError extends unknown ? Ctx["_error"] : ApiError
1091 >
1092 >,
1093 ): CreateAction<
1094 Omit<Ctx, "json"> &
1095 FetchJson<
1096 ApiSuccess,
1097 ApiError extends unknown ? Ctx["_error"] : ApiError
1098 >,
1099 ApiSuccess
1100 >;
1101 trace<P, ApiSuccess, ApiError = unknown>(
1102 req: { supervisor?: Supervisor },
1103 fn: MiddlewareApiCo<Ctx>,
1104 ): CreateActionWithPayload<
1105 Omit<Ctx, "payload" | "json"> &
1106 Payload<P> &
1107 FetchJson<
1108 ApiSuccess,
1109 ApiError extends unknown ? Ctx["_error"] : ApiError
1110 >,
1111 P,
1112 ApiSuccess
1113 >;
1114 };
1115
1116 /**
1117 * Only name
1118 */
1119 get(name: ApiName): CreateAction<Ctx>;
1120 get<P>(
1121 name: ApiName,
1122 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1123 get<P extends never, ApiSuccess, ApiError = unknown>(
1124 name: ApiName,
1125 ): CreateAction<
1126 Omit<Ctx, "json"> &
1127 FetchJson<
1128 ApiSuccess,
1129 ApiError extends unknown ? Ctx["_error"] : ApiError
1130 >,
1131 ApiSuccess
1132 >;
1133 get<P, ApiSuccess, ApiError = unknown>(
1134 name: ApiName,
1135 ): CreateActionWithPayload<
1136 Omit<Ctx, "payload" | "json"> &
1137 Payload<P> &
1138 FetchJson<
1139 ApiSuccess,
1140 ApiError extends unknown ? Ctx["_error"] : ApiError
1141 >,
1142 P,
1143 ApiSuccess
1144 >;
1145
1146 /**
1147 * Name and options
1148 */
1149 get(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
1150 get<P>(
1151 name: ApiName,
1152 req: { supervisor?: Supervisor },
1153 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1154 get<P, Gtx extends Ctx = Ctx>(
1155 name: ApiName,
1156 req: { supervisor?: Supervisor },
1157 ): CreateActionWithPayload<Gtx, P>;
1158 get<P extends never, ApiSuccess, ApiError = unknown>(
1159 name: ApiName,
1160 req: { supervisor?: Supervisor },
1161 ): CreateAction<
1162 Omit<Ctx, "json"> &
1163 FetchJson<
1164 ApiSuccess,
1165 ApiError extends unknown ? Ctx["_error"] : ApiError
1166 >,
1167 ApiSuccess
1168 >;
1169 get<P, ApiSuccess, ApiError = unknown>(
1170 name: ApiName,
1171 req: { supervisor?: Supervisor },
1172 ): CreateActionWithPayload<
1173 Omit<Ctx, "payload" | "json"> &
1174 Payload<P> &
1175 FetchJson<
1176 ApiSuccess,
1177 ApiError extends unknown ? Ctx["_error"] : ApiError
1178 >,
1179 P,
1180 ApiSuccess
1181 >;
1182
1183 /**
1184 * Name and middleware
1185 */
1186 get(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1187 get<Gtx extends Ctx = Ctx>(
1188 name: ApiName,
1189 fn: MiddlewareApiCo<Gtx>,
1190 ): CreateAction<Gtx>;
1191 get<P>(
1192 name: ApiName,
1193 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1194 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1195 get<P, Gtx extends Ctx = Ctx>(
1196 name: ApiName,
1197 fn: MiddlewareApiCo<Gtx>,
1198 ): CreateActionWithPayload<Gtx, P>;
1199 get<P extends never, ApiSuccess, ApiError = unknown>(
1200 name: ApiName,
1201 fn: MiddlewareApiCo<
1202 Omit<Ctx, "json"> &
1203 FetchJson<
1204 ApiSuccess,
1205 ApiError extends unknown ? Ctx["_error"] : ApiError
1206 >
1207 >,
1208 ): CreateAction<
1209 Omit<Ctx, "json"> &
1210 FetchJson<
1211 ApiSuccess,
1212 ApiError extends unknown ? Ctx["_error"] : ApiError
1213 >,
1214 ApiSuccess
1215 >;
1216 get<P, ApiSuccess, ApiError = unknown>(
1217 name: ApiName,
1218 fn: MiddlewareApiCo<
1219 Omit<Ctx, "payload" | "json"> &
1220 Payload<P> &
1221 FetchJson<
1222 ApiSuccess,
1223 ApiError extends unknown ? Ctx["_error"] : ApiError
1224 >
1225 >,
1226 ): CreateActionWithPayload<
1227 Omit<Ctx, "payload" | "json"> &
1228 Payload<P> &
1229 FetchJson<
1230 ApiSuccess,
1231 ApiError extends unknown ? Ctx["_error"] : ApiError
1232 >,
1233 P,
1234 ApiSuccess
1235 >;
1236
1237 /**
1238 * Name, options, and middleware
1239 */
1240 get(
1241 name: ApiName,
1242 req: { supervisor?: Supervisor },
1243 fn: MiddlewareApiCo<Ctx>,
1244 ): CreateAction<Ctx>;
1245 get<Gtx extends Ctx = Ctx>(
1246 name: ApiName,
1247 req: { supervisor?: Supervisor },
1248 fn: MiddlewareApiCo<Gtx>,
1249 ): CreateAction<Gtx>;
1250 get<P>(
1251 name: ApiName,
1252 req: { supervisor?: Supervisor },
1253 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1254 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1255 get<P, Gtx extends Ctx = Ctx>(
1256 name: ApiName,
1257 req: { supervisor?: Supervisor },
1258 fn: MiddlewareApiCo<Gtx>,
1259 ): CreateActionWithPayload<Gtx, P>;
1260 get<P extends never, ApiSuccess, ApiError = unknown>(
1261 name: ApiName,
1262 req: { supervisor?: Supervisor },
1263 fn: MiddlewareApiCo<
1264 Omit<Ctx, "json"> &
1265 FetchJson<
1266 ApiSuccess,
1267 ApiError extends unknown ? Ctx["_error"] : ApiError
1268 >
1269 >,
1270 ): CreateAction<
1271 Omit<Ctx, "json"> &
1272 FetchJson<
1273 ApiSuccess,
1274 ApiError extends unknown ? Ctx["_error"] : ApiError
1275 >,
1276 ApiSuccess
1277 >;
1278 get<P, ApiSuccess, ApiError = unknown>(
1279 name: ApiName,
1280 req: { supervisor?: Supervisor },
1281 fn: MiddlewareApiCo<
1282 Omit<Ctx, "payload" | "json"> &
1283 Payload<P> &
1284 FetchJson<
1285 ApiSuccess,
1286 ApiError extends unknown ? Ctx["_error"] : ApiError
1287 >
1288 >,
1289 ): CreateActionWithPayload<
1290 Omit<Ctx, "payload" | "json"> &
1291 Payload<P> &
1292 FetchJson<
1293 ApiSuccess,
1294 ApiError extends unknown ? Ctx["_error"] : ApiError
1295 >,
1296 P,
1297 ApiSuccess
1298 >;
1299
1300 /**
1301 * Only name
1302 */
1303 post(name: ApiName): CreateAction<Ctx>;
1304 post<P>(
1305 name: ApiName,
1306 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1307 post<P extends never, ApiSuccess, ApiError = unknown>(
1308 name: ApiName,
1309 ): CreateAction<
1310 Omit<Ctx, "json"> &
1311 FetchJson<
1312 ApiSuccess,
1313 ApiError extends unknown ? Ctx["_error"] : ApiError
1314 >,
1315 ApiSuccess
1316 >;
1317 post<P, ApiSuccess, ApiError = unknown>(
1318 name: ApiName,
1319 ): CreateActionWithPayload<
1320 Omit<Ctx, "payload" | "json"> &
1321 Payload<P> &
1322 FetchJson<
1323 ApiSuccess,
1324 ApiError extends unknown ? Ctx["_error"] : ApiError
1325 >,
1326 P,
1327 ApiSuccess
1328 >;
1329
1330 /**
1331 * Name and options
1332 */
1333 post(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
1334 post<P>(
1335 name: ApiName,
1336 req: { supervisor?: Supervisor },
1337 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1338 post<P, Gtx extends Ctx = Ctx>(
1339 name: ApiName,
1340 req: { supervisor?: Supervisor },
1341 ): CreateActionWithPayload<Gtx, P>;
1342 post<P extends never, ApiSuccess, ApiError = unknown>(
1343 name: ApiName,
1344 req: { supervisor?: Supervisor },
1345 ): CreateAction<
1346 Omit<Ctx, "json"> &
1347 FetchJson<
1348 ApiSuccess,
1349 ApiError extends unknown ? Ctx["_error"] : ApiError
1350 >,
1351 ApiSuccess
1352 >;
1353 post<P, ApiSuccess, ApiError = unknown>(
1354 name: ApiName,
1355 req: { supervisor?: Supervisor },
1356 ): CreateActionWithPayload<
1357 Omit<Ctx, "payload" | "json"> &
1358 Payload<P> &
1359 FetchJson<
1360 ApiSuccess,
1361 ApiError extends unknown ? Ctx["_error"] : ApiError
1362 >,
1363 P,
1364 ApiSuccess
1365 >;
1366
1367 /**
1368 * Name and middleware
1369 */
1370 post(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1371 post<Gtx extends Ctx = Ctx>(
1372 name: ApiName,
1373 fn: MiddlewareApiCo<Gtx>,
1374 ): CreateAction<Gtx>;
1375 post<P>(
1376 name: ApiName,
1377 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1378 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1379 post<P, Gtx extends Ctx = Ctx>(
1380 name: ApiName,
1381 fn: MiddlewareApiCo<Gtx>,
1382 ): CreateActionWithPayload<Gtx, P>;
1383 post<P extends never, ApiSuccess, ApiError = unknown>(
1384 name: ApiName,
1385 fn: MiddlewareApiCo<
1386 Omit<Ctx, "json"> &
1387 FetchJson<
1388 ApiSuccess,
1389 ApiError extends unknown ? Ctx["_error"] : ApiError
1390 >
1391 >,
1392 ): CreateAction<
1393 Omit<Ctx, "json"> &
1394 FetchJson<
1395 ApiSuccess,
1396 ApiError extends unknown ? Ctx["_error"] : ApiError
1397 >,
1398 ApiSuccess
1399 >;
1400 post<P, ApiSuccess, ApiError = unknown>(
1401 name: ApiName,
1402 fn: MiddlewareApiCo<
1403 Omit<Ctx, "payload" | "json"> &
1404 Payload<P> &
1405 FetchJson<
1406 ApiSuccess,
1407 ApiError extends unknown ? Ctx["_error"] : ApiError
1408 >
1409 >,
1410 ): CreateActionWithPayload<
1411 Omit<Ctx, "payload" | "json"> &
1412 Payload<P> &
1413 FetchJson<
1414 ApiSuccess,
1415 ApiError extends unknown ? Ctx["_error"] : ApiError
1416 >,
1417 P,
1418 ApiSuccess
1419 >;
1420
1421 /**
1422 * Name, options, and middleware
1423 */
1424 post(
1425 name: ApiName,
1426 req: { supervisor?: Supervisor },
1427 fn: MiddlewareApiCo<Ctx>,
1428 ): CreateAction<Ctx>;
1429 post<Gtx extends Ctx = Ctx>(
1430 name: ApiName,
1431 req: { supervisor?: Supervisor },
1432 fn: MiddlewareApiCo<Gtx>,
1433 ): CreateAction<Gtx>;
1434 post<P>(
1435 name: ApiName,
1436 req: { supervisor?: Supervisor },
1437 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1438 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1439 post<P, Gtx extends Ctx = Ctx>(
1440 name: ApiName,
1441 req: { supervisor?: Supervisor },
1442 fn: MiddlewareApiCo<Gtx>,
1443 ): CreateActionWithPayload<Gtx, P>;
1444 post<P extends never, ApiSuccess, ApiError = unknown>(
1445 name: ApiName,
1446 req: { supervisor?: Supervisor },
1447 fn: MiddlewareApiCo<
1448 Omit<Ctx, "json"> &
1449 FetchJson<
1450 ApiSuccess,
1451 ApiError extends unknown ? Ctx["_error"] : ApiError
1452 >
1453 >,
1454 ): CreateAction<
1455 Omit<Ctx, "json"> &
1456 FetchJson<
1457 ApiSuccess,
1458 ApiError extends unknown ? Ctx["_error"] : ApiError
1459 >,
1460 ApiSuccess
1461 >;
1462 post<P, ApiSuccess, ApiError = unknown>(
1463 name: ApiName,
1464 req: { supervisor?: Supervisor },
1465 fn: MiddlewareApiCo<
1466 Omit<Ctx, "payload" | "json"> &
1467 Payload<P> &
1468 FetchJson<
1469 ApiSuccess,
1470 ApiError extends unknown ? Ctx["_error"] : ApiError
1471 >
1472 >,
1473 ): CreateActionWithPayload<
1474 Omit<Ctx, "payload" | "json"> &
1475 Payload<P> &
1476 FetchJson<
1477 ApiSuccess,
1478 ApiError extends unknown ? Ctx["_error"] : ApiError
1479 >,
1480 P,
1481 ApiSuccess
1482 >;
1483
1484 /**
1485 * Only name
1486 */
1487 put(name: ApiName): CreateAction<Ctx>;
1488 put<P>(
1489 name: ApiName,
1490 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1491 put<P extends never, ApiSuccess, ApiError = unknown>(
1492 name: ApiName,
1493 ): CreateAction<
1494 Omit<Ctx, "json"> &
1495 FetchJson<
1496 ApiSuccess,
1497 ApiError extends unknown ? Ctx["_error"] : ApiError
1498 >,
1499 ApiSuccess
1500 >;
1501 put<P, ApiSuccess, ApiError = unknown>(
1502 name: ApiName,
1503 ): CreateActionWithPayload<
1504 Omit<Ctx, "payload" | "json"> &
1505 Payload<P> &
1506 FetchJson<
1507 ApiSuccess,
1508 ApiError extends unknown ? Ctx["_error"] : ApiError
1509 >,
1510 P,
1511 ApiSuccess
1512 >;
1513
1514 /**
1515 * Name and options
1516 */
1517 put(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
1518 put<P>(
1519 name: ApiName,
1520 req: { supervisor?: Supervisor },
1521 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1522 put<P, Gtx extends Ctx = Ctx>(
1523 name: ApiName,
1524 req: { supervisor?: Supervisor },
1525 ): CreateActionWithPayload<Gtx, P>;
1526 put<P extends never, ApiSuccess, ApiError = unknown>(
1527 name: ApiName,
1528 req: { supervisor?: Supervisor },
1529 ): CreateAction<
1530 Omit<Ctx, "json"> &
1531 FetchJson<
1532 ApiSuccess,
1533 ApiError extends unknown ? Ctx["_error"] : ApiError
1534 >,
1535 ApiSuccess
1536 >;
1537 put<P, ApiSuccess, ApiError = unknown>(
1538 name: ApiName,
1539 req: { supervisor?: Supervisor },
1540 ): CreateActionWithPayload<
1541 Omit<Ctx, "payload" | "json"> &
1542 Payload<P> &
1543 FetchJson<
1544 ApiSuccess,
1545 ApiError extends unknown ? Ctx["_error"] : ApiError
1546 >,
1547 P,
1548 ApiSuccess
1549 >;
1550
1551 /**
1552 * Name and middleware
1553 */
1554 put(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1555 put<Gtx extends Ctx = Ctx>(
1556 name: ApiName,
1557 fn: MiddlewareApiCo<Gtx>,
1558 ): CreateAction<Gtx>;
1559 put<P>(
1560 name: ApiName,
1561 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1562 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1563 put<P, Gtx extends Ctx = Ctx>(
1564 name: ApiName,
1565 fn: MiddlewareApiCo<Gtx>,
1566 ): CreateActionWithPayload<Gtx, P>;
1567 put<P extends never, ApiSuccess, ApiError = unknown>(
1568 name: ApiName,
1569 fn: MiddlewareApiCo<
1570 Omit<Ctx, "json"> &
1571 FetchJson<
1572 ApiSuccess,
1573 ApiError extends unknown ? Ctx["_error"] : ApiError
1574 >
1575 >,
1576 ): CreateAction<
1577 Omit<Ctx, "json"> &
1578 FetchJson<
1579 ApiSuccess,
1580 ApiError extends unknown ? Ctx["_error"] : ApiError
1581 >,
1582 ApiSuccess
1583 >;
1584 put<P, ApiSuccess, ApiError = unknown>(
1585 name: ApiName,
1586 fn: MiddlewareApiCo<
1587 Omit<Ctx, "payload" | "json"> &
1588 Payload<P> &
1589 FetchJson<
1590 ApiSuccess,
1591 ApiError extends unknown ? Ctx["_error"] : ApiError
1592 >
1593 >,
1594 ): CreateActionWithPayload<
1595 Omit<Ctx, "payload" | "json"> &
1596 Payload<P> &
1597 FetchJson<
1598 ApiSuccess,
1599 ApiError extends unknown ? Ctx["_error"] : ApiError
1600 >,
1601 P,
1602 ApiSuccess
1603 >;
1604
1605 /**
1606 * Name, options, and middleware
1607 */
1608 put(
1609 name: ApiName,
1610 req: { supervisor?: Supervisor },
1611 fn: MiddlewareApiCo<Ctx>,
1612 ): CreateAction<Ctx>;
1613 put<Gtx extends Ctx = Ctx>(
1614 name: ApiName,
1615 req: { supervisor?: Supervisor },
1616 fn: MiddlewareApiCo<Gtx>,
1617 ): CreateAction<Gtx>;
1618 put<P>(
1619 name: ApiName,
1620 req: { supervisor?: Supervisor },
1621 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1622 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1623 put<P, Gtx extends Ctx = Ctx>(
1624 name: ApiName,
1625 req: { supervisor?: Supervisor },
1626 fn: MiddlewareApiCo<Gtx>,
1627 ): CreateActionWithPayload<Gtx, P>;
1628 put<P extends never, ApiSuccess, ApiError = unknown>(
1629 name: ApiName,
1630 req: { supervisor?: Supervisor },
1631 fn: MiddlewareApiCo<
1632 Omit<Ctx, "json"> &
1633 FetchJson<
1634 ApiSuccess,
1635 ApiError extends unknown ? Ctx["_error"] : ApiError
1636 >
1637 >,
1638 ): CreateAction<
1639 Omit<Ctx, "json"> &
1640 FetchJson<
1641 ApiSuccess,
1642 ApiError extends unknown ? Ctx["_error"] : ApiError
1643 >,
1644 ApiSuccess
1645 >;
1646 put<P, ApiSuccess, ApiError = unknown>(
1647 name: ApiName,
1648 req: { supervisor?: Supervisor },
1649 fn: MiddlewareApiCo<
1650 Omit<Ctx, "payload" | "json"> &
1651 Payload<P> &
1652 FetchJson<
1653 ApiSuccess,
1654 ApiError extends unknown ? Ctx["_error"] : ApiError
1655 >
1656 >,
1657 ): CreateActionWithPayload<
1658 Omit<Ctx, "payload" | "json"> &
1659 Payload<P> &
1660 FetchJson<
1661 ApiSuccess,
1662 ApiError extends unknown ? Ctx["_error"] : ApiError
1663 >,
1664 P,
1665 ApiSuccess
1666 >;
1667
1668 /**
1669 * Only name
1670 */
1671 patch(name: ApiName): CreateAction<Ctx>;
1672 patch<P>(
1673 name: ApiName,
1674 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1675 patch<P extends never, ApiSuccess, ApiError = unknown>(
1676 name: ApiName,
1677 ): CreateAction<
1678 Omit<Ctx, "json"> &
1679 FetchJson<
1680 ApiSuccess,
1681 ApiError extends unknown ? Ctx["_error"] : ApiError
1682 >,
1683 ApiSuccess
1684 >;
1685 patch<P, ApiSuccess, ApiError = unknown>(
1686 name: ApiName,
1687 ): CreateActionWithPayload<
1688 Omit<Ctx, "payload" | "json"> &
1689 Payload<P> &
1690 FetchJson<
1691 ApiSuccess,
1692 ApiError extends unknown ? Ctx["_error"] : ApiError
1693 >,
1694 P,
1695 ApiSuccess
1696 >;
1697
1698 /**
1699 * Name and options
1700 */
1701 patch(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
1702 patch<P>(
1703 name: ApiName,
1704 req: { supervisor?: Supervisor },
1705 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1706 patch<P, Gtx extends Ctx = Ctx>(
1707 name: ApiName,
1708 req: { supervisor?: Supervisor },
1709 ): CreateActionWithPayload<Gtx, P>;
1710 patch<P extends never, ApiSuccess, ApiError = unknown>(
1711 name: ApiName,
1712 req: { supervisor?: Supervisor },
1713 ): CreateAction<
1714 Omit<Ctx, "json"> &
1715 FetchJson<
1716 ApiSuccess,
1717 ApiError extends unknown ? Ctx["_error"] : ApiError
1718 >,
1719 ApiSuccess
1720 >;
1721 patch<P, ApiSuccess, ApiError = unknown>(
1722 name: ApiName,
1723 req: { supervisor?: Supervisor },
1724 ): CreateActionWithPayload<
1725 Omit<Ctx, "payload" | "json"> &
1726 Payload<P> &
1727 FetchJson<
1728 ApiSuccess,
1729 ApiError extends unknown ? Ctx["_error"] : ApiError
1730 >,
1731 P,
1732 ApiSuccess
1733 >;
1734
1735 /**
1736 * Name and middleware
1737 */
1738 patch(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1739 patch<Gtx extends Ctx = Ctx>(
1740 name: ApiName,
1741 fn: MiddlewareApiCo<Gtx>,
1742 ): CreateAction<Gtx>;
1743 patch<P>(
1744 name: ApiName,
1745 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1746 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1747 patch<P, Gtx extends Ctx = Ctx>(
1748 name: ApiName,
1749 fn: MiddlewareApiCo<Gtx>,
1750 ): CreateActionWithPayload<Gtx, P>;
1751 patch<P extends never, ApiSuccess, ApiError = unknown>(
1752 name: ApiName,
1753 fn: MiddlewareApiCo<
1754 Omit<Ctx, "json"> &
1755 FetchJson<
1756 ApiSuccess,
1757 ApiError extends unknown ? Ctx["_error"] : ApiError
1758 >
1759 >,
1760 ): CreateAction<
1761 Omit<Ctx, "json"> &
1762 FetchJson<
1763 ApiSuccess,
1764 ApiError extends unknown ? Ctx["_error"] : ApiError
1765 >,
1766 ApiSuccess
1767 >;
1768 patch<P, ApiSuccess, ApiError = unknown>(
1769 name: ApiName,
1770 fn: MiddlewareApiCo<
1771 Omit<Ctx, "payload" | "json"> &
1772 Payload<P> &
1773 FetchJson<
1774 ApiSuccess,
1775 ApiError extends unknown ? Ctx["_error"] : ApiError
1776 >
1777 >,
1778 ): CreateActionWithPayload<
1779 Omit<Ctx, "payload" | "json"> &
1780 Payload<P> &
1781 FetchJson<
1782 ApiSuccess,
1783 ApiError extends unknown ? Ctx["_error"] : ApiError
1784 >,
1785 P,
1786 ApiSuccess
1787 >;
1788
1789 /**
1790 * Name, options, and middleware
1791 */
1792 patch(
1793 name: ApiName,
1794 req: { supervisor?: Supervisor },
1795 fn: MiddlewareApiCo<Ctx>,
1796 ): CreateAction<Ctx>;
1797 patch<Gtx extends Ctx = Ctx>(
1798 name: ApiName,
1799 req: { supervisor?: Supervisor },
1800 fn: MiddlewareApiCo<Gtx>,
1801 ): CreateAction<Gtx>;
1802 patch<P>(
1803 name: ApiName,
1804 req: { supervisor?: Supervisor },
1805 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1806 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1807 patch<P, Gtx extends Ctx = Ctx>(
1808 name: ApiName,
1809 req: { supervisor?: Supervisor },
1810 fn: MiddlewareApiCo<Gtx>,
1811 ): CreateActionWithPayload<Gtx, P>;
1812 patch<P extends never, ApiSuccess, ApiError = unknown>(
1813 name: ApiName,
1814 req: { supervisor?: Supervisor },
1815 fn: MiddlewareApiCo<
1816 Omit<Ctx, "json"> &
1817 FetchJson<
1818 ApiSuccess,
1819 ApiError extends unknown ? Ctx["_error"] : ApiError
1820 >
1821 >,
1822 ): CreateAction<
1823 Omit<Ctx, "json"> &
1824 FetchJson<
1825 ApiSuccess,
1826 ApiError extends unknown ? Ctx["_error"] : ApiError
1827 >,
1828 ApiSuccess
1829 >;
1830 patch<P, ApiSuccess, ApiError = unknown>(
1831 name: ApiName,
1832 req: { supervisor?: Supervisor },
1833 fn: MiddlewareApiCo<
1834 Omit<Ctx, "payload" | "json"> &
1835 Payload<P> &
1836 FetchJson<
1837 ApiSuccess,
1838 ApiError extends unknown ? Ctx["_error"] : ApiError
1839 >
1840 >,
1841 ): CreateActionWithPayload<
1842 Omit<Ctx, "payload" | "json"> &
1843 Payload<P> &
1844 FetchJson<
1845 ApiSuccess,
1846 ApiError extends unknown ? Ctx["_error"] : ApiError
1847 >,
1848 P,
1849 ApiSuccess
1850 >;
1851
1852 /**
1853 * Only name
1854 */
1855 delete(name: ApiName): CreateAction<Ctx>;
1856 delete<P>(
1857 name: ApiName,
1858 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1859 delete<P extends never, ApiSuccess, ApiError = unknown>(
1860 name: ApiName,
1861 ): CreateAction<
1862 Omit<Ctx, "json"> &
1863 FetchJson<
1864 ApiSuccess,
1865 ApiError extends unknown ? Ctx["_error"] : ApiError
1866 >,
1867 ApiSuccess
1868 >;
1869 delete<P, ApiSuccess, ApiError = unknown>(
1870 name: ApiName,
1871 ): CreateActionWithPayload<
1872 Omit<Ctx, "payload" | "json"> &
1873 Payload<P> &
1874 FetchJson<
1875 ApiSuccess,
1876 ApiError extends unknown ? Ctx["_error"] : ApiError
1877 >,
1878 P,
1879 ApiSuccess
1880 >;
1881
1882 /**
1883 * Name and options
1884 */
1885 delete(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
1886 delete<P>(
1887 name: ApiName,
1888 req: { supervisor?: Supervisor },
1889 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1890 delete<P, Gtx extends Ctx = Ctx>(
1891 name: ApiName,
1892 req: { supervisor?: Supervisor },
1893 ): CreateActionWithPayload<Gtx, P>;
1894 delete<P extends never, ApiSuccess, ApiError = unknown>(
1895 name: ApiName,
1896 req: { supervisor?: Supervisor },
1897 ): CreateAction<
1898 Omit<Ctx, "json"> &
1899 FetchJson<
1900 ApiSuccess,
1901 ApiError extends unknown ? Ctx["_error"] : ApiError
1902 >,
1903 ApiSuccess
1904 >;
1905 delete<P, ApiSuccess, ApiError = unknown>(
1906 name: ApiName,
1907 req: { supervisor?: Supervisor },
1908 ): CreateActionWithPayload<
1909 Omit<Ctx, "payload" | "json"> &
1910 Payload<P> &
1911 FetchJson<
1912 ApiSuccess,
1913 ApiError extends unknown ? Ctx["_error"] : ApiError
1914 >,
1915 P,
1916 ApiSuccess
1917 >;
1918
1919 /**
1920 * Name and middleware
1921 */
1922 delete(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
1923 delete<Gtx extends Ctx = Ctx>(
1924 name: ApiName,
1925 fn: MiddlewareApiCo<Gtx>,
1926 ): CreateAction<Gtx>;
1927 delete<P>(
1928 name: ApiName,
1929 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1930 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1931 delete<P, Gtx extends Ctx = Ctx>(
1932 name: ApiName,
1933 fn: MiddlewareApiCo<Gtx>,
1934 ): CreateActionWithPayload<Gtx, P>;
1935 delete<P extends never, ApiSuccess, ApiError = unknown>(
1936 name: ApiName,
1937 fn: MiddlewareApiCo<
1938 Omit<Ctx, "json"> &
1939 FetchJson<
1940 ApiSuccess,
1941 ApiError extends unknown ? Ctx["_error"] : ApiError
1942 >
1943 >,
1944 ): CreateAction<
1945 Omit<Ctx, "json"> &
1946 FetchJson<
1947 ApiSuccess,
1948 ApiError extends unknown ? Ctx["_error"] : ApiError
1949 >,
1950 ApiSuccess
1951 >;
1952 delete<P, ApiSuccess, ApiError = unknown>(
1953 name: ApiName,
1954 fn: MiddlewareApiCo<
1955 Omit<Ctx, "payload" | "json"> &
1956 Payload<P> &
1957 FetchJson<
1958 ApiSuccess,
1959 ApiError extends unknown ? Ctx["_error"] : ApiError
1960 >
1961 >,
1962 ): CreateActionWithPayload<
1963 Omit<Ctx, "payload" | "json"> &
1964 Payload<P> &
1965 FetchJson<
1966 ApiSuccess,
1967 ApiError extends unknown ? Ctx["_error"] : ApiError
1968 >,
1969 P,
1970 ApiSuccess
1971 >;
1972
1973 /**
1974 * Name, options, and middleware
1975 */
1976 delete(
1977 name: ApiName,
1978 req: { supervisor?: Supervisor },
1979 fn: MiddlewareApiCo<Ctx>,
1980 ): CreateAction<Ctx>;
1981 delete<Gtx extends Ctx = Ctx>(
1982 name: ApiName,
1983 req: { supervisor?: Supervisor },
1984 fn: MiddlewareApiCo<Gtx>,
1985 ): CreateAction<Gtx>;
1986 delete<P>(
1987 name: ApiName,
1988 req: { supervisor?: Supervisor },
1989 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
1990 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
1991 delete<P, Gtx extends Ctx = Ctx>(
1992 name: ApiName,
1993 req: { supervisor?: Supervisor },
1994 fn: MiddlewareApiCo<Gtx>,
1995 ): CreateActionWithPayload<Gtx, P>;
1996 delete<P extends never, ApiSuccess, ApiError = unknown>(
1997 name: ApiName,
1998 req: { supervisor?: Supervisor },
1999 fn: MiddlewareApiCo<
2000 Omit<Ctx, "json"> &
2001 FetchJson<
2002 ApiSuccess,
2003 ApiError extends unknown ? Ctx["_error"] : ApiError
2004 >
2005 >,
2006 ): CreateAction<
2007 Omit<Ctx, "json"> &
2008 FetchJson<
2009 ApiSuccess,
2010 ApiError extends unknown ? Ctx["_error"] : ApiError
2011 >,
2012 ApiSuccess
2013 >;
2014 delete<P, ApiSuccess, ApiError = unknown>(
2015 name: ApiName,
2016 req: { supervisor?: Supervisor },
2017 fn: MiddlewareApiCo<
2018 Omit<Ctx, "payload" | "json"> &
2019 Payload<P> &
2020 FetchJson<
2021 ApiSuccess,
2022 ApiError extends unknown ? Ctx["_error"] : ApiError
2023 >
2024 >,
2025 ): CreateActionWithPayload<
2026 Omit<Ctx, "payload" | "json"> &
2027 Payload<P> &
2028 FetchJson<
2029 ApiSuccess,
2030 ApiError extends unknown ? Ctx["_error"] : ApiError
2031 >,
2032 P,
2033 ApiSuccess
2034 >;
2035
2036 /**
2037 * Only name
2038 */
2039 options(name: ApiName): CreateAction<Ctx>;
2040 options<P>(
2041 name: ApiName,
2042 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2043 options<P extends never, ApiSuccess, ApiError = unknown>(
2044 name: ApiName,
2045 ): CreateAction<
2046 Omit<Ctx, "json"> &
2047 FetchJson<
2048 ApiSuccess,
2049 ApiError extends unknown ? Ctx["_error"] : ApiError
2050 >,
2051 ApiSuccess
2052 >;
2053 options<P, ApiSuccess, ApiError = unknown>(
2054 name: ApiName,
2055 ): CreateActionWithPayload<
2056 Omit<Ctx, "payload" | "json"> &
2057 Payload<P> &
2058 FetchJson<
2059 ApiSuccess,
2060 ApiError extends unknown ? Ctx["_error"] : ApiError
2061 >,
2062 P,
2063 ApiSuccess
2064 >;
2065
2066 /**
2067 * Name and options
2068 */
2069 options(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
2070 options<P>(
2071 name: ApiName,
2072 req: { supervisor?: Supervisor },
2073 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2074 options<P, Gtx extends Ctx = Ctx>(
2075 name: ApiName,
2076 req: { supervisor?: Supervisor },
2077 ): CreateActionWithPayload<Gtx, P>;
2078 options<P extends never, ApiSuccess, ApiError = unknown>(
2079 name: ApiName,
2080 req: { supervisor?: Supervisor },
2081 ): CreateAction<
2082 Omit<Ctx, "json"> &
2083 FetchJson<
2084 ApiSuccess,
2085 ApiError extends unknown ? Ctx["_error"] : ApiError
2086 >,
2087 ApiSuccess
2088 >;
2089 options<P, ApiSuccess, ApiError = unknown>(
2090 name: ApiName,
2091 req: { supervisor?: Supervisor },
2092 ): CreateActionWithPayload<
2093 Omit<Ctx, "payload" | "json"> &
2094 Payload<P> &
2095 FetchJson<
2096 ApiSuccess,
2097 ApiError extends unknown ? Ctx["_error"] : ApiError
2098 >,
2099 P,
2100 ApiSuccess
2101 >;
2102
2103 /**
2104 * Name and middleware
2105 */
2106 options(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
2107 options<Gtx extends Ctx = Ctx>(
2108 name: ApiName,
2109 fn: MiddlewareApiCo<Gtx>,
2110 ): CreateAction<Gtx>;
2111 options<P>(
2112 name: ApiName,
2113 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2114 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2115 options<P, Gtx extends Ctx = Ctx>(
2116 name: ApiName,
2117 fn: MiddlewareApiCo<Gtx>,
2118 ): CreateActionWithPayload<Gtx, P>;
2119 options<P extends never, ApiSuccess, ApiError = unknown>(
2120 name: ApiName,
2121 fn: MiddlewareApiCo<
2122 Omit<Ctx, "json"> &
2123 FetchJson<
2124 ApiSuccess,
2125 ApiError extends unknown ? Ctx["_error"] : ApiError
2126 >
2127 >,
2128 ): CreateAction<
2129 Omit<Ctx, "json"> &
2130 FetchJson<
2131 ApiSuccess,
2132 ApiError extends unknown ? Ctx["_error"] : ApiError
2133 >,
2134 ApiSuccess
2135 >;
2136 options<P, ApiSuccess, ApiError = unknown>(
2137 name: ApiName,
2138 fn: MiddlewareApiCo<
2139 Omit<Ctx, "payload" | "json"> &
2140 Payload<P> &
2141 FetchJson<
2142 ApiSuccess,
2143 ApiError extends unknown ? Ctx["_error"] : ApiError
2144 >
2145 >,
2146 ): CreateActionWithPayload<
2147 Omit<Ctx, "payload" | "json"> &
2148 Payload<P> &
2149 FetchJson<
2150 ApiSuccess,
2151 ApiError extends unknown ? Ctx["_error"] : ApiError
2152 >,
2153 P,
2154 ApiSuccess
2155 >;
2156
2157 /**
2158 * Name, options, and middleware
2159 */
2160 options(
2161 name: ApiName,
2162 req: { supervisor?: Supervisor },
2163 fn: MiddlewareApiCo<Ctx>,
2164 ): CreateAction<Ctx>;
2165 options<Gtx extends Ctx = Ctx>(
2166 name: ApiName,
2167 req: { supervisor?: Supervisor },
2168 fn: MiddlewareApiCo<Gtx>,
2169 ): CreateAction<Gtx>;
2170 options<P>(
2171 name: ApiName,
2172 req: { supervisor?: Supervisor },
2173 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2174 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2175 options<P, Gtx extends Ctx = Ctx>(
2176 name: ApiName,
2177 req: { supervisor?: Supervisor },
2178 fn: MiddlewareApiCo<Gtx>,
2179 ): CreateActionWithPayload<Gtx, P>;
2180 options<P extends never, ApiSuccess, ApiError = unknown>(
2181 name: ApiName,
2182 req: { supervisor?: Supervisor },
2183 fn: MiddlewareApiCo<
2184 Omit<Ctx, "json"> &
2185 FetchJson<
2186 ApiSuccess,
2187 ApiError extends unknown ? Ctx["_error"] : ApiError
2188 >
2189 >,
2190 ): CreateAction<
2191 Omit<Ctx, "json"> &
2192 FetchJson<
2193 ApiSuccess,
2194 ApiError extends unknown ? Ctx["_error"] : ApiError
2195 >,
2196 ApiSuccess
2197 >;
2198 options<P, ApiSuccess, ApiError = unknown>(
2199 name: ApiName,
2200 req: { supervisor?: Supervisor },
2201 fn: MiddlewareApiCo<
2202 Omit<Ctx, "payload" | "json"> &
2203 Payload<P> &
2204 FetchJson<
2205 ApiSuccess,
2206 ApiError extends unknown ? Ctx["_error"] : ApiError
2207 >
2208 >,
2209 ): CreateActionWithPayload<
2210 Omit<Ctx, "payload" | "json"> &
2211 Payload<P> &
2212 FetchJson<
2213 ApiSuccess,
2214 ApiError extends unknown ? Ctx["_error"] : ApiError
2215 >,
2216 P,
2217 ApiSuccess
2218 >;
2219
2220 /**
2221 * Only name
2222 */
2223 head(name: ApiName): CreateAction<Ctx>;
2224 head<P>(
2225 name: ApiName,
2226 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2227 head<P extends never, ApiSuccess, ApiError = unknown>(
2228 name: ApiName,
2229 ): CreateAction<
2230 Omit<Ctx, "json"> &
2231 FetchJson<
2232 ApiSuccess,
2233 ApiError extends unknown ? Ctx["_error"] : ApiError
2234 >,
2235 ApiSuccess
2236 >;
2237 head<P, ApiSuccess, ApiError = unknown>(
2238 name: ApiName,
2239 ): CreateActionWithPayload<
2240 Omit<Ctx, "payload" | "json"> &
2241 Payload<P> &
2242 FetchJson<
2243 ApiSuccess,
2244 ApiError extends unknown ? Ctx["_error"] : ApiError
2245 >,
2246 P,
2247 ApiSuccess
2248 >;
2249
2250 /**
2251 * Name and options
2252 */
2253 head(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
2254 head<P>(
2255 name: ApiName,
2256 req: { supervisor?: Supervisor },
2257 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2258 head<P, Gtx extends Ctx = Ctx>(
2259 name: ApiName,
2260 req: { supervisor?: Supervisor },
2261 ): CreateActionWithPayload<Gtx, P>;
2262 head<P extends never, ApiSuccess, ApiError = unknown>(
2263 name: ApiName,
2264 req: { supervisor?: Supervisor },
2265 ): CreateAction<
2266 Omit<Ctx, "json"> &
2267 FetchJson<
2268 ApiSuccess,
2269 ApiError extends unknown ? Ctx["_error"] : ApiError
2270 >,
2271 ApiSuccess
2272 >;
2273 head<P, ApiSuccess, ApiError = unknown>(
2274 name: ApiName,
2275 req: { supervisor?: Supervisor },
2276 ): CreateActionWithPayload<
2277 Omit<Ctx, "payload" | "json"> &
2278 Payload<P> &
2279 FetchJson<
2280 ApiSuccess,
2281 ApiError extends unknown ? Ctx["_error"] : ApiError
2282 >,
2283 P,
2284 ApiSuccess
2285 >;
2286
2287 /**
2288 * Name and middleware
2289 */
2290 head(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
2291 head<Gtx extends Ctx = Ctx>(
2292 name: ApiName,
2293 fn: MiddlewareApiCo<Gtx>,
2294 ): CreateAction<Gtx>;
2295 head<P>(
2296 name: ApiName,
2297 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2298 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2299 head<P, Gtx extends Ctx = Ctx>(
2300 name: ApiName,
2301 fn: MiddlewareApiCo<Gtx>,
2302 ): CreateActionWithPayload<Gtx, P>;
2303 head<P extends never, ApiSuccess, ApiError = unknown>(
2304 name: ApiName,
2305 fn: MiddlewareApiCo<
2306 Omit<Ctx, "json"> &
2307 FetchJson<
2308 ApiSuccess,
2309 ApiError extends unknown ? Ctx["_error"] : ApiError
2310 >
2311 >,
2312 ): CreateAction<
2313 Omit<Ctx, "json"> &
2314 FetchJson<
2315 ApiSuccess,
2316 ApiError extends unknown ? Ctx["_error"] : ApiError
2317 >,
2318 ApiSuccess
2319 >;
2320 head<P, ApiSuccess, ApiError = unknown>(
2321 name: ApiName,
2322 fn: MiddlewareApiCo<
2323 Omit<Ctx, "payload" | "json"> &
2324 Payload<P> &
2325 FetchJson<
2326 ApiSuccess,
2327 ApiError extends unknown ? Ctx["_error"] : ApiError
2328 >
2329 >,
2330 ): CreateActionWithPayload<
2331 Omit<Ctx, "payload" | "json"> &
2332 Payload<P> &
2333 FetchJson<
2334 ApiSuccess,
2335 ApiError extends unknown ? Ctx["_error"] : ApiError
2336 >,
2337 P,
2338 ApiSuccess
2339 >;
2340
2341 /**
2342 * Name, options, and middleware
2343 */
2344 head(
2345 name: ApiName,
2346 req: { supervisor?: Supervisor },
2347 fn: MiddlewareApiCo<Ctx>,
2348 ): CreateAction<Ctx>;
2349 head<Gtx extends Ctx = Ctx>(
2350 name: ApiName,
2351 req: { supervisor?: Supervisor },
2352 fn: MiddlewareApiCo<Gtx>,
2353 ): CreateAction<Gtx>;
2354 head<P>(
2355 name: ApiName,
2356 req: { supervisor?: Supervisor },
2357 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2358 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2359 head<P, Gtx extends Ctx = Ctx>(
2360 name: ApiName,
2361 req: { supervisor?: Supervisor },
2362 fn: MiddlewareApiCo<Gtx>,
2363 ): CreateActionWithPayload<Gtx, P>;
2364 head<P extends never, ApiSuccess, ApiError = unknown>(
2365 name: ApiName,
2366 req: { supervisor?: Supervisor },
2367 fn: MiddlewareApiCo<
2368 Omit<Ctx, "json"> &
2369 FetchJson<
2370 ApiSuccess,
2371 ApiError extends unknown ? Ctx["_error"] : ApiError
2372 >
2373 >,
2374 ): CreateAction<
2375 Omit<Ctx, "json"> &
2376 FetchJson<
2377 ApiSuccess,
2378 ApiError extends unknown ? Ctx["_error"] : ApiError
2379 >,
2380 ApiSuccess
2381 >;
2382 head<P, ApiSuccess, ApiError = unknown>(
2383 name: ApiName,
2384 req: { supervisor?: Supervisor },
2385 fn: MiddlewareApiCo<
2386 Omit<Ctx, "payload" | "json"> &
2387 Payload<P> &
2388 FetchJson<
2389 ApiSuccess,
2390 ApiError extends unknown ? Ctx["_error"] : ApiError
2391 >
2392 >,
2393 ): CreateActionWithPayload<
2394 Omit<Ctx, "payload" | "json"> &
2395 Payload<P> &
2396 FetchJson<
2397 ApiSuccess,
2398 ApiError extends unknown ? Ctx["_error"] : ApiError
2399 >,
2400 P,
2401 ApiSuccess
2402 >;
2403
2404 /**
2405 * Only name
2406 */
2407 connect(name: ApiName): CreateAction<Ctx>;
2408 connect<P>(
2409 name: ApiName,
2410 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2411 connect<P extends never, ApiSuccess, ApiError = unknown>(
2412 name: ApiName,
2413 ): CreateAction<
2414 Omit<Ctx, "json"> &
2415 FetchJson<
2416 ApiSuccess,
2417 ApiError extends unknown ? Ctx["_error"] : ApiError
2418 >,
2419 ApiSuccess
2420 >;
2421 connect<P, ApiSuccess, ApiError = unknown>(
2422 name: ApiName,
2423 ): CreateActionWithPayload<
2424 Omit<Ctx, "payload" | "json"> &
2425 Payload<P> &
2426 FetchJson<
2427 ApiSuccess,
2428 ApiError extends unknown ? Ctx["_error"] : ApiError
2429 >,
2430 P,
2431 ApiSuccess
2432 >;
2433
2434 /**
2435 * Name and options
2436 */
2437 connect(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
2438 connect<P>(
2439 name: ApiName,
2440 req: { supervisor?: Supervisor },
2441 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2442 connect<P, Gtx extends Ctx = Ctx>(
2443 name: ApiName,
2444 req: { supervisor?: Supervisor },
2445 ): CreateActionWithPayload<Gtx, P>;
2446 connect<P extends never, ApiSuccess, ApiError = unknown>(
2447 name: ApiName,
2448 req: { supervisor?: Supervisor },
2449 ): CreateAction<
2450 Omit<Ctx, "json"> &
2451 FetchJson<
2452 ApiSuccess,
2453 ApiError extends unknown ? Ctx["_error"] : ApiError
2454 >,
2455 ApiSuccess
2456 >;
2457 connect<P, ApiSuccess, ApiError = unknown>(
2458 name: ApiName,
2459 req: { supervisor?: Supervisor },
2460 ): CreateActionWithPayload<
2461 Omit<Ctx, "payload" | "json"> &
2462 Payload<P> &
2463 FetchJson<
2464 ApiSuccess,
2465 ApiError extends unknown ? Ctx["_error"] : ApiError
2466 >,
2467 P,
2468 ApiSuccess
2469 >;
2470
2471 /**
2472 * Name and middleware
2473 */
2474 connect(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
2475 connect<Gtx extends Ctx = Ctx>(
2476 name: ApiName,
2477 fn: MiddlewareApiCo<Gtx>,
2478 ): CreateAction<Gtx>;
2479 connect<P>(
2480 name: ApiName,
2481 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2482 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2483 connect<P, Gtx extends Ctx = Ctx>(
2484 name: ApiName,
2485 fn: MiddlewareApiCo<Gtx>,
2486 ): CreateActionWithPayload<Gtx, P>;
2487 connect<P extends never, ApiSuccess, ApiError = unknown>(
2488 name: ApiName,
2489 fn: MiddlewareApiCo<
2490 Omit<Ctx, "json"> &
2491 FetchJson<
2492 ApiSuccess,
2493 ApiError extends unknown ? Ctx["_error"] : ApiError
2494 >
2495 >,
2496 ): CreateAction<
2497 Omit<Ctx, "json"> &
2498 FetchJson<
2499 ApiSuccess,
2500 ApiError extends unknown ? Ctx["_error"] : ApiError
2501 >,
2502 ApiSuccess
2503 >;
2504 connect<P, ApiSuccess, ApiError = unknown>(
2505 name: ApiName,
2506 fn: MiddlewareApiCo<
2507 Omit<Ctx, "payload" | "json"> &
2508 Payload<P> &
2509 FetchJson<
2510 ApiSuccess,
2511 ApiError extends unknown ? Ctx["_error"] : ApiError
2512 >
2513 >,
2514 ): CreateActionWithPayload<
2515 Omit<Ctx, "payload" | "json"> &
2516 Payload<P> &
2517 FetchJson<
2518 ApiSuccess,
2519 ApiError extends unknown ? Ctx["_error"] : ApiError
2520 >,
2521 P,
2522 ApiSuccess
2523 >;
2524
2525 /**
2526 * Name, options, and middleware
2527 */
2528 connect(
2529 name: ApiName,
2530 req: { supervisor?: Supervisor },
2531 fn: MiddlewareApiCo<Ctx>,
2532 ): CreateAction<Ctx>;
2533 connect<Gtx extends Ctx = Ctx>(
2534 name: ApiName,
2535 req: { supervisor?: Supervisor },
2536 fn: MiddlewareApiCo<Gtx>,
2537 ): CreateAction<Gtx>;
2538 connect<P>(
2539 name: ApiName,
2540 req: { supervisor?: Supervisor },
2541 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2542 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2543 connect<P, Gtx extends Ctx = Ctx>(
2544 name: ApiName,
2545 req: { supervisor?: Supervisor },
2546 fn: MiddlewareApiCo<Gtx>,
2547 ): CreateActionWithPayload<Gtx, P>;
2548 connect<P extends never, ApiSuccess, ApiError = unknown>(
2549 name: ApiName,
2550 req: { supervisor?: Supervisor },
2551 fn: MiddlewareApiCo<
2552 Omit<Ctx, "json"> &
2553 FetchJson<
2554 ApiSuccess,
2555 ApiError extends unknown ? Ctx["_error"] : ApiError
2556 >
2557 >,
2558 ): CreateAction<
2559 Omit<Ctx, "json"> &
2560 FetchJson<
2561 ApiSuccess,
2562 ApiError extends unknown ? Ctx["_error"] : ApiError
2563 >,
2564 ApiSuccess
2565 >;
2566 connect<P, ApiSuccess, ApiError = unknown>(
2567 name: ApiName,
2568 req: { supervisor?: Supervisor },
2569 fn: MiddlewareApiCo<
2570 Omit<Ctx, "payload" | "json"> &
2571 Payload<P> &
2572 FetchJson<
2573 ApiSuccess,
2574 ApiError extends unknown ? Ctx["_error"] : ApiError
2575 >
2576 >,
2577 ): CreateActionWithPayload<
2578 Omit<Ctx, "payload" | "json"> &
2579 Payload<P> &
2580 FetchJson<
2581 ApiSuccess,
2582 ApiError extends unknown ? Ctx["_error"] : ApiError
2583 >,
2584 P,
2585 ApiSuccess
2586 >;
2587
2588 /**
2589 * Only name
2590 */
2591 trace(name: ApiName): CreateAction<Ctx>;
2592 trace<P>(
2593 name: ApiName,
2594 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2595 trace<P extends never, ApiSuccess, ApiError = unknown>(
2596 name: ApiName,
2597 ): CreateAction<
2598 Omit<Ctx, "json"> &
2599 FetchJson<
2600 ApiSuccess,
2601 ApiError extends unknown ? Ctx["_error"] : ApiError
2602 >,
2603 ApiSuccess
2604 >;
2605 trace<P, ApiSuccess, ApiError = unknown>(
2606 name: ApiName,
2607 ): CreateActionWithPayload<
2608 Omit<Ctx, "payload" | "json"> &
2609 Payload<P> &
2610 FetchJson<
2611 ApiSuccess,
2612 ApiError extends unknown ? Ctx["_error"] : ApiError
2613 >,
2614 P,
2615 ApiSuccess
2616 >;
2617
2618 /**
2619 * Name and options
2620 */
2621 trace(name: ApiName, req: { supervisor?: Supervisor }): CreateAction<Ctx>;
2622 trace<P>(
2623 name: ApiName,
2624 req: { supervisor?: Supervisor },
2625 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2626 trace<P, Gtx extends Ctx = Ctx>(
2627 name: ApiName,
2628 req: { supervisor?: Supervisor },
2629 ): CreateActionWithPayload<Gtx, P>;
2630 trace<P extends never, ApiSuccess, ApiError = unknown>(
2631 name: ApiName,
2632 req: { supervisor?: Supervisor },
2633 ): CreateAction<
2634 Omit<Ctx, "json"> &
2635 FetchJson<
2636 ApiSuccess,
2637 ApiError extends unknown ? Ctx["_error"] : ApiError
2638 >,
2639 ApiSuccess
2640 >;
2641 trace<P, ApiSuccess, ApiError = unknown>(
2642 name: ApiName,
2643 req: { supervisor?: Supervisor },
2644 ): CreateActionWithPayload<
2645 Omit<Ctx, "payload" | "json"> &
2646 Payload<P> &
2647 FetchJson<
2648 ApiSuccess,
2649 ApiError extends unknown ? Ctx["_error"] : ApiError
2650 >,
2651 P,
2652 ApiSuccess
2653 >;
2654
2655 /**
2656 * Name and middleware
2657 */
2658 trace(name: ApiName, fn: MiddlewareApiCo<Ctx>): CreateAction<Ctx>;
2659 trace<Gtx extends Ctx = Ctx>(
2660 name: ApiName,
2661 fn: MiddlewareApiCo<Gtx>,
2662 ): CreateAction<Gtx>;
2663 trace<P>(
2664 name: ApiName,
2665 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2666 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2667 trace<P, Gtx extends Ctx = Ctx>(
2668 name: ApiName,
2669 fn: MiddlewareApiCo<Gtx>,
2670 ): CreateActionWithPayload<Gtx, P>;
2671 trace<P extends never, ApiSuccess, ApiError = unknown>(
2672 name: ApiName,
2673 fn: MiddlewareApiCo<
2674 Omit<Ctx, "json"> &
2675 FetchJson<
2676 ApiSuccess,
2677 ApiError extends unknown ? Ctx["_error"] : ApiError
2678 >
2679 >,
2680 ): CreateAction<
2681 Omit<Ctx, "json"> &
2682 FetchJson<
2683 ApiSuccess,
2684 ApiError extends unknown ? Ctx["_error"] : ApiError
2685 >,
2686 ApiSuccess
2687 >;
2688 trace<P, ApiSuccess, ApiError = unknown>(
2689 name: ApiName,
2690 fn: MiddlewareApiCo<
2691 Omit<Ctx, "payload" | "json"> &
2692 Payload<P> &
2693 FetchJson<
2694 ApiSuccess,
2695 ApiError extends unknown ? Ctx["_error"] : ApiError
2696 >
2697 >,
2698 ): CreateActionWithPayload<
2699 Omit<Ctx, "payload" | "json"> &
2700 Payload<P> &
2701 FetchJson<
2702 ApiSuccess,
2703 ApiError extends unknown ? Ctx["_error"] : ApiError
2704 >,
2705 P,
2706 ApiSuccess
2707 >;
2708
2709 /**
2710 * Name, options, and middleware
2711 */
2712 trace(
2713 name: ApiName,
2714 req: { supervisor?: Supervisor },
2715 fn: MiddlewareApiCo<Ctx>,
2716 ): CreateAction<Ctx>;
2717 trace<Gtx extends Ctx = Ctx>(
2718 name: ApiName,
2719 req: { supervisor?: Supervisor },
2720 fn: MiddlewareApiCo<Gtx>,
2721 ): CreateAction<Gtx>;
2722 trace<P>(
2723 name: ApiName,
2724 req: { supervisor?: Supervisor },
2725 fn: MiddlewareApiCo<Omit<Ctx, "payload"> & Payload<P>>,
2726 ): CreateActionWithPayload<Omit<Ctx, "payload"> & Payload<P>, P>;
2727 trace<P, Gtx extends Ctx = Ctx>(
2728 name: ApiName,
2729 req: { supervisor?: Supervisor },
2730 fn: MiddlewareApiCo<Gtx>,
2731 ): CreateActionWithPayload<Gtx, P>;
2732 trace<P extends never, ApiSuccess, ApiError = unknown>(
2733 name: ApiName,
2734 req: { supervisor?: Supervisor },
2735 fn: MiddlewareApiCo<
2736 Omit<Ctx, "json"> &
2737 FetchJson<
2738 ApiSuccess,
2739 ApiError extends unknown ? Ctx["_error"] : ApiError
2740 >
2741 >,
2742 ): CreateAction<
2743 Omit<Ctx, "json"> &
2744 FetchJson<
2745 ApiSuccess,
2746 ApiError extends unknown ? Ctx["_error"] : ApiError
2747 >,
2748 ApiSuccess
2749 >;
2750 trace<P, ApiSuccess, ApiError = unknown>(
2751 name: ApiName,
2752 req: { supervisor?: Supervisor },
2753 fn: MiddlewareApiCo<
2754 Omit<Ctx, "payload" | "json"> &
2755 Payload<P> &
2756 FetchJson<
2757 ApiSuccess,
2758 ApiError extends unknown ? Ctx["_error"] : ApiError
2759 >
2760 >,
2761 ): CreateActionWithPayload<
2762 Omit<Ctx, "payload" | "json"> &
2763 Payload<P> &
2764 FetchJson<
2765 ApiSuccess,
2766 ApiError extends unknown ? Ctx["_error"] : ApiError
2767 >,
2768 P,
2769 ApiSuccess
2770 >;
2771}