This repository has been archived by the owner on May 25, 2022. It is now read-only.
forked from redux-saga/redux-saga
-
Notifications
You must be signed in to change notification settings - Fork 1
/
effects.d.ts
551 lines (449 loc) · 18.3 KB
/
effects.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
import {Action} from "redux";
import {
END, TakeableChannel, PuttableChannel, FlushableChannel,
Task, Buffer, Predicate,
} from "./index";
import {GuardPredicate} from "./utils";
export type ActionType = string | number | symbol;
export type StringableActionCreator<A extends Action = Action> = {
(...args: any[]): A;
toString(): string;
};
export type SubPattern<T> =
| Predicate<T>
| StringableActionCreator
| ActionType;
export type Pattern<T> =
| SubPattern<T>
| SubPattern<T>[];
export type ActionSubPattern<Guard extends Action = Action> =
| GuardPredicate<Guard, Action>
| StringableActionCreator<Guard>
| Predicate<Action>
| ActionType
export type ActionPattern<Guard extends Action = Action> =
| ActionSubPattern<Guard>
| ActionSubPattern<Guard>[];
export interface TakeEffectDescriptor {
pattern: ActionPattern;
maybe?: boolean;
}
export interface ChannelTakeEffectDescriptor<T> {
channel: TakeableChannel<T>;
pattern?: Pattern<T>;
maybe?: boolean;
}
export interface TakeEffect {
TAKE: TakeEffectDescriptor;
}
export interface ChannelTakeEffect<T> {
TAKE: ChannelTakeEffectDescriptor<T>;
}
export interface Take {
<A extends Action>(pattern?: ActionPattern<A>): TakeEffect;
<T>(channel: TakeableChannel<T>, multicastPattern?: Pattern<T>): ChannelTakeEffect<T>;
}
export const take: Take;
export const takeMaybe: Take;
export interface PutEffectDescriptor<A extends Action> {
action: A;
channel: null;
resolve?: boolean;
}
export interface ChannelPutEffectDescriptor<T> {
action: T;
channel: PuttableChannel<T>;
resolve?: boolean;
}
export interface PutEffect<A extends Action> {
PUT: PutEffectDescriptor<A>;
}
export interface ChannelPutEffect<T> {
PUT: ChannelPutEffectDescriptor<T>;
}
export interface Put {
<A extends Action>(action: A): PutEffect<A>;
<T>(channel: PuttableChannel<T>, action: T | END): ChannelPutEffect<T>;
}
export const put: Put;
export const putResolve: Put;
export type GenericAllEffectDescriptor<T> = T[] | {[key: string]: T};
export interface GenericAllEffect<T> {
ALL: GenericAllEffectDescriptor<T>;
}
export type AllEffectDescriptor = GenericAllEffectDescriptor<Effect>;
export interface AllEffect {
ALL: AllEffectDescriptor;
}
export function all(effects: Effect[]): AllEffect;
export function all(effects: {[key: string]: Effect}): AllEffect;
export function all<T>(effects: T[]): GenericAllEffect<T>;
export function all<T>(effects: {[key: string]: T}): GenericAllEffect<T>;
export type GenericRaceEffectDescriptor<T> = {[key: string]: T};
export interface GenericRaceEffect<T> {
RACE: GenericRaceEffectDescriptor<T>;
}
export type RaceEffectDescriptor = GenericRaceEffectDescriptor<Effect>;
export interface RaceEffect {
RACE: RaceEffectDescriptor;
}
export function race(effects: {[key: string]: Effect}): RaceEffect;
export function race<T>(effects: {[key: string]: T}): GenericRaceEffect<T>;
export interface CallEffectDescriptor {
context: any;
fn: Function;
args: any[];
}
export interface CallEffect {
CALL: CallEffectDescriptor;
}
type Func0<R> = () => R;
type Func1<R, T1> = (arg1: T1) => R;
type Func2<R, T1, T2> = (arg1: T1, arg2: T2) => R;
type Func3<R, T1, T2, T3> = (arg1: T1, arg2: T2, arg3: T3) => R;
type Func4<R, T1, T2, T3, T4> = (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R;
type Func5<R, T1, T2, T3, T4, T5> = (arg1: T1, arg2: T2, arg3: T3,
arg4: T4, arg5: T5) => R;
type Func6Rest<R, T1, T2, T3, T4, T5, T6> = (arg1: T1, arg2: T2, arg3: T3,
arg4: T4, arg5: T5, arg6: T6,
...rest: any[]) => R;
export type CallEffectFn<F extends Function> =
F | [any, F] | {context: any, fn: F};
export type CallEffectNamedFn<C extends {[P in Name]: Function},
Name extends string> =
[C, Name] | {context: C, fn: Name};
interface CallEffectFactory<Effect> {
<C extends {[P in N]: Func0<R>}, N extends string, R>(
fn: CallEffectNamedFn<C, N>): Effect;
<C extends {[P in N]: Func1<R, T1>}, N extends string, R, T1>(
fn: CallEffectNamedFn<C, N>,
arg1: T1): Effect;
<C extends {[P in N]: Func2<R, T1, T2>}, N extends string, R, T1, T2>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2): Effect;
<C extends {[P in N]: Func3<R, T1, T2, T3>}, N extends string,
R, T1, T2, T3>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3): Effect;
<C extends {[P in N]: Func4<R, T1, T2, T3, T4>}, N extends string,
R, T1, T2, T3, T4>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): Effect;
<C extends {[P in N]: Func5<R, T1, T2, T3, T4, T5>}, N extends string,
R, T1, T2, T3, T4, T5>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): Effect;
<C extends {[P in N]: Func6Rest<R, T1, T2, T3, T4, T5, T6>}, N extends string,
R, T1, T2, T3, T4, T5, T6>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6,
...rest: any[]): Effect;
<R>(fn: CallEffectFn<Func0<R>>): Effect;
<R, T1>(fn: CallEffectFn<Func1<R, T1>>,
arg1: T1): Effect;
<R, T1, T2>(fn: CallEffectFn<Func2<R, T1, T2>>,
arg1: T1, arg2: T2): Effect;
<R, T1, T2, T3>(fn: CallEffectFn<Func3<R, T1, T2, T3>>,
arg1: T1, arg2: T2, arg3: T3): Effect;
<R, T1, T2, T3, T4>(fn: CallEffectFn<Func4<R, T1, T2, T3, T4>>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): Effect;
<R, T1, T2, T3, T4, T5>(fn: CallEffectFn<Func5<R, T1, T2, T3, T4, T5>>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): Effect;
<R, T1, T2, T3, T4, T5, T6>(fn: CallEffectFn<Func6Rest<R, T1, T2, T3, T4, T5, T6>>,
arg1: T1, arg2: T2, arg3: T3,
arg4: T4, arg5: T5, arg6: T6, ...rest: any[]): Effect;
}
export const call: CallEffectFactory<CallEffect>;
export function apply<C extends {[P in N]: Func0<R>},
N extends string, R>(
context: C, fn: N): CallEffect;
export function apply<C extends {[P in N]: Func1<R, T1>},
N extends string,
R, T1>(
context: C, fn: N,
args: [T1]): CallEffect;
export function apply<C extends {[P in N]: Func2<R, T1, T2>},
N extends string,
R, T1, T2>(
context: C, fn: N,
args: [T1, T2]): CallEffect;
export function apply<C extends {[P in N]: Func3<R, T1, T2, T3>},
N extends string,
R, T1, T2, T3>(
context: C, fn: N,
args: [T1, T2, T3]): CallEffect;
export function apply<C extends {[P in N]: Func4<R, T1, T2, T3, T4>},
N extends string,
R, T1, T2, T3, T4>(
context: C, fn: N,
args: [T1, T2, T3, T4]): CallEffect;
export function apply<C extends {[P in N]: Func5<R, T1, T2, T3, T4, T5>},
N extends string,
R, T1, T2, T3, T4, T5>(
context: C, fn: N,
args: [T1, T2, T3, T4, T5]): CallEffect;
export function apply<C extends {[P in N]: Func6Rest<R, T1, T2, T3, T4, T5, T6>},
N extends string,
R, T1, T2, T3, T4, T5, T6>(
context: C, fn: N,
args: any[] & {
0: T1; 1: T2; 2: T3; 3: T4; 4: T5; 5: T6;
}): CallEffect;
export function apply<R>(context: any, fn: Func0<R>): CallEffect;
export function apply<R, T1>(context: any, fn: Func1<R, T1>,
args: [T1]): CallEffect;
export function apply<R, T1, T2>(context: any, fn: Func2<R, T1, T2>,
args: [T1, T2]): CallEffect;
export function apply<R, T1, T2, T3>(context: any, fn: Func3<R, T1, T2, T3>,
args: [T1, T2, T3]): CallEffect;
export function apply<R, T1, T2, T3, T4>(context: any,
fn: Func4<R, T1, T2, T3, T4>,
args: [T1, T2, T3, T4]): CallEffect;
export function apply<R, T1, T2, T3, T4, T5>(
context: any, fn: Func5<R, T1, T2, T3, T4, T5>, args: [T1, T2, T3, T4, T5],
): CallEffect;
export function apply<R, T1, T2, T3, T4, T5, T6>(
context: any, fn: Func6Rest<R, T1, T2, T3, T4, T5, T6>, args: any[] & {
0: T1; 1: T2; 2: T3; 3: T4; 4: T5; 5: T6;
},
): CallEffect;
export interface CpsEffect {
CPS: CallEffectDescriptor;
}
interface CpsCallback<R> {
(error: any, result: R): void;
cancel?(): void;
}
export function cps<C extends {[P in N]: Func1<void, CpsCallback<R>>},
N extends string, R>(
fn: CallEffectNamedFn<C, N>): CpsEffect;
export function cps<C extends {[P in N]: Func2<void, T1, CpsCallback<R>>},
N extends string,
R, T1>(
fn: CallEffectNamedFn<C, N>,
arg1: T1): CpsEffect;
export function cps<C extends {[P in N]: Func3<void, T1, T2, CpsCallback<R>>},
N extends string,
R, T1, T2>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2): CpsEffect;
export function cps<C extends {[P in N]: Func4<void, T1, T2, T3, CpsCallback<R>>},
N extends string,
R, T1, T2, T3>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3): CpsEffect;
export function cps<C extends {[P in N]: Func5<void, T1, T2, T3, T4, CpsCallback<R>>},
N extends string,
R, T1, T2, T3, T4>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): CpsEffect;
export function cps<C extends {[P in N]:
Func6Rest<void, T1, T2, T3, T4, T5, CpsCallback<R>>},
N extends string,
R, T1, T2, T3, T4, T5>(
fn: CallEffectNamedFn<C, N>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, ...rest: any[]): CpsEffect;
export function cps<R>(fn: CallEffectFn<Func1<void, CpsCallback<R>>>): CpsEffect;
export function cps<R, T1>(fn: CallEffectFn<Func2<void, T1, CpsCallback<R>>>,
arg1: T1): CpsEffect;
export function cps<R, T1, T2>(fn: CallEffectFn<Func3<void, T1, T2, CpsCallback<R>>>,
arg1: T1, arg2: T2): CpsEffect;
export function cps<R, T1, T2, T3>(
fn: CallEffectFn<Func4<void, T1, T2, T3, CpsCallback<R>>>,
arg1: T1, arg2: T2, arg3: T3): CpsEffect;
export function cps<R, T1, T2, T3, T4>(
fn: CallEffectFn<Func5<void, T1, T2, T3, T4, CpsCallback<R>>>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): CpsEffect;
export function cps<R, T1, T2, T3, T4, T5>(
fn: CallEffectFn<Func6Rest<void, T1, T2, T3, T4, T5, any>>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5,
...rest: any[]): CpsEffect;
export interface ForkEffectDescriptor extends CallEffectDescriptor {
detached?: boolean;
}
export interface ForkEffect {
FORK: ForkEffectDescriptor;
}
export const fork: CallEffectFactory<ForkEffect>;
export const spawn: CallEffectFactory<ForkEffect>;
export type JoinEffectDescriptor = Task;
export interface JoinEffect {
JOIN: JoinEffectDescriptor;
}
export function join(task: Task): JoinEffect;
export function join(task1: Task, task2: Task,
...tasks: Task[]): GenericAllEffect<JoinEffect>;
type SELF_CANCELLATION = '@@redux-saga/SELF_CANCELLATION';
export type CancelEffectDescriptor = Task | SELF_CANCELLATION;
export interface CancelEffect {
CANCEL: CancelEffectDescriptor;
}
export function cancel(): CancelEffect;
export function cancel(task: Task): CancelEffect;
export function cancel(...tasks: Task[]): GenericAllEffect<CancelEffect>;
export interface SelectEffectDescriptor {
selector(state: any, ...args: any[]): any;
args: any[];
}
export interface SelectEffect {
SELECT: SelectEffectDescriptor;
}
export function select(): SelectEffect;
export function select<S, R>(selector: Func1<R, S>): SelectEffect;
export function select<S, R, T1>(selector: Func2<R, S, T1>,
arg1: T1): SelectEffect;
export function select<S, R, T1, T2>(selector: Func3<R, S, T1, T2>,
arg1: T1, arg2: T2): SelectEffect;
export function select<S, R, T1, T2, T3>(
selector: Func4<R, S, T1, T2, T3>,
arg1: T1, arg2: T2, arg3: T3): SelectEffect;
export function select<S, R, T1, T2, T3, T4>(
selector: Func5<R, S, T1, T2, T3, T4>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): SelectEffect;
export function select<S, R, T1, T2, T3, T4, T5>(
selector: Func6Rest<R, S, T1, T2, T3, T4, T5>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5,
...rest: any[]): SelectEffect;
export interface ActionChannelEffectDescriptor {
pattern: ActionPattern;
buffer?: Buffer<Action>;
}
export interface ActionChannelEffect {
ACTION_CHANNEL: ActionChannelEffectDescriptor;
}
export function actionChannel(
pattern: ActionPattern, buffer?: Buffer<Action>,
): ActionChannelEffect;
export type CancelledEffectDescriptor = {};
export interface CancelledEffect {
CANCELLED: CancelledEffectDescriptor;
}
export function cancelled(): CancelledEffect;
export type FlushEffectDescriptor<T> = FlushableChannel<T>;
export interface FlushEffect<T> {
FLUSH: FlushEffectDescriptor<T>;
}
export function flush<T>(channel: FlushableChannel<T>): FlushEffect<T>;
export type GetContextEffectDescriptor = string;
export interface GetContextEffect {
GET_CONTEXT: GetContextEffectDescriptor;
}
export function getContext(prop: string): GetContextEffect;
export type SetContextEffectDescriptor<C extends object> = C;
export interface SetContextEffect<C extends object> {
SET_CONTEXT: SetContextEffectDescriptor<C>;
}
export function setContext<C extends object>(props: C): SetContextEffect<C>;
export interface RootEffect {
root: true;
saga(...args: any[]): Iterator<any>;
args: any[];
}
export type Effect =
RootEffect |
TakeEffect | ChannelTakeEffect<any> |
PutEffect<any> | ChannelPutEffect<any> |
AllEffect | RaceEffect | CallEffect |
CpsEffect | ForkEffect | JoinEffect | CancelEffect | SelectEffect |
ActionChannelEffect | CancelledEffect | FlushEffect<any> |
GetContextEffect | SetContextEffect<any>;
type HelperFunc0<A> = (action: A) => any;
type HelperFunc1<A, T1> = (arg1: T1, action: A) => any;
type HelperFunc2<A, T1, T2> = (arg1: T1, arg2: T2, action: A) => any;
type HelperFunc3<A, T1, T2, T3> = (arg1: T1, arg2: T2, arg3: T3,
action: A) => any;
type HelperFunc4<A, T1, T2, T3, T4> = (arg1: T1, arg2: T2, arg3: T3, arg4: T4,
action: A) => any;
type HelperFunc5<A, T1, T2, T3, T4, T5> = (arg1: T1, arg2: T2, arg3: T3,
arg4: T4, arg5: T5,
action: A) => any;
type HelperFunc6Rest<A, T1, T2, T3, T4, T5, T6> = (
arg1: T1, arg2: T2, arg3: T3,
arg4: T4, arg5: T5, arg6: T6,
arg7: any, ...rest: any[]) => any;
export function takeEvery<T>(
channel: TakeableChannel<T>,
worker: HelperFunc0<T>): ForkEffect;
export function takeEvery<T, T1>(
channel: TakeableChannel<T>,
worker: HelperFunc1<T, T1>,
arg1: T1): ForkEffect;
export function takeEvery<T, T1, T2>(
channel: TakeableChannel<T>,
worker: HelperFunc2<T, T1, T2>,
arg1: T1, arg2: T2): ForkEffect;
export function takeEvery<T, T1, T2, T3>(
channel: TakeableChannel<T>,
worker: HelperFunc3<T, T1, T2, T3>,
arg1: T1, arg2: T2, arg3: T3): ForkEffect;
export function takeEvery<T, T1, T2, T3, T4>(
channel: TakeableChannel<T>,
worker: HelperFunc4<T, T1, T2, T3, T4>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): ForkEffect;
export function takeEvery<T, T1, T2, T3, T4, T5>(
channel: TakeableChannel<T>,
worker: HelperFunc5<T, T1, T2, T3, T4, T5>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): ForkEffect;
export function takeEvery<T, T1, T2, T3, T4, T5, T6>(
channel: TakeableChannel<T>,
worker: HelperFunc6Rest<T, T1, T2, T3, T4, T5, T6>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6,
...rest: any[]): ForkEffect;
export function takeEvery<A extends Action>(
pattern: ActionPattern<A>,
worker: HelperFunc0<A>): ForkEffect;
export function takeEvery<A extends Action, T1>(
pattern: ActionPattern<A>,
worker: HelperFunc1<A, T1>,
arg1: T1): ForkEffect;
export function takeEvery<A extends Action, T1, T2>(
pattern: ActionPattern<A>,
worker: HelperFunc2<A, T1, T2>,
arg1: T1, arg2: T2): ForkEffect;
export function takeEvery<A extends Action, T1, T2, T3>(
pattern: ActionPattern<A>,
worker: HelperFunc3<A, T1, T2, T3>,
arg1: T1, arg2: T2, arg3: T3): ForkEffect;
export function takeEvery<A extends Action, T1, T2, T3, T4>(
pattern: ActionPattern<A>,
worker: HelperFunc4<A, T1, T2, T3, T4>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): ForkEffect;
export function takeEvery<A extends Action, T1, T2, T3, T4, T5>(
pattern: ActionPattern<A>,
worker: HelperFunc5<A, T1, T2, T3, T4, T5>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): ForkEffect;
export function takeEvery<A extends Action, T1, T2, T3, T4, T5, T6>(
pattern: ActionPattern<A>,
worker: HelperFunc6Rest<A, T1, T2, T3, T4, T5, T6>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6,
...rest: any[]): ForkEffect;
export const takeLatest: typeof takeEvery;
export function throttle<A extends Action>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc0<A>): ForkEffect;
export function throttle<A extends Action, T1>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc1<A, T1>,
arg1: T1): ForkEffect;
export function throttle<A extends Action, T1, T2>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc2<A, T1, T2>,
arg1: T1, arg2: T2): ForkEffect;
export function throttle<A extends Action, T1, T2, T3>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc3<A, T1, T2, T3>,
arg1: T1, arg2: T2, arg3: T3): ForkEffect;
export function throttle<A extends Action, T1, T2, T3, T4>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc4<A, T1, T2, T3, T4>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4): ForkEffect;
export function throttle<A extends Action, T1, T2, T3, T4, T5>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc5<A, T1, T2, T3, T4, T5>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): ForkEffect;
export function throttle<A extends Action, T1, T2, T3, T4, T5, T6>(
ms: number, pattern: ActionPattern<A>,
worker: HelperFunc6Rest<A, T1, T2, T3, T4, T5, T6>,
arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6,
...rest: any[]): ForkEffect;
export function delay<T>(ms: number, val?: T): CallEffect;