-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathproviders.d.ts
34 lines (29 loc) · 1.6 KB
/
providers.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
import * as E from 'redux-saga/effects';
import { Matcher } from './matchers';
type ProviderNext = Object; // taken frm flow definitions in /decl
type ProviderNextF = () => ProviderNext; // taken frm flow definitions in /decl
export type StaticProvider = [E.Effect | Matcher, any];
/** Dynamic provider that gets an effect descriptor and next as parameters and returns a value. */
export type EffectProvider<EffectDescriptor>
= (effect: EffectDescriptor, next: ProviderNextF) => any;
export type EffectProviders = {
actionChannel?: EffectProvider<E.ActionChannelEffectDescriptor>;
all?: EffectProvider<E.AllEffectDescriptor<any>>;
call?: EffectProvider<E.CallEffectDescriptor<any>>;
cancel?: EffectProvider<E.CancelEffectDescriptor>;
cancelled?: EffectProvider<E.CancelledEffectDescriptor>;
cps?: EffectProvider<E.CallEffectDescriptor<any>>;
flush?: EffectProvider<E.FlushEffectDescriptor<any>>;
fork?: EffectProvider<E.ForkEffectDescriptor<any>>;
getContext?: EffectProvider<E.GetContextEffectDescriptor>;
join?: EffectProvider<E.JoinEffectDescriptor>;
put?: EffectProvider<E.PutEffectDescriptor<any>>;
race?: EffectProvider<E.RaceEffectDescriptor<any>>;
select?: EffectProvider<E.SelectEffectDescriptor>;
setContext?: EffectProvider<E.SetContextEffectDescriptor<any>>;
spawn?: EffectProvider<E.CallEffectDescriptor<any>>;
take?: EffectProvider<E.TakeEffectDescriptor & E.ChannelTakeEffectDescriptor<any>>;
};
export const composeProviders: Function;
export function dynamic<D = any>(effect: EffectProvider<D>): any;
export function throwError(error?: Error): any;