forked from redux-observable/redux-observable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
54 lines (44 loc) · 2.66 KB
/
index.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
import { Middleware, MiddlewareAPI, Action } from 'redux';
import { Observable, ObservableInput } from 'rxjs/Observable';
import { Scheduler } from 'rxjs/Scheduler';
import { Operator } from 'rxjs/Operator';
export declare class ActionsObservable<T extends Action> extends Observable<T> {
/**
* Just like RxJS itself, we can't actually make this method always type-safe
* because we would need non-final position spread params e.g.
* `static of<T>(...items: T, scheduler?: Scheduler): ActionsObservable<T>`
* which isn't possible in either JavaScript or TypeScript. So instead, we
* provide safe typing for up to 6 items, following by a scheduler.
*/
static of<T extends Action>(item1: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(item1: T, item2: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(item1: T, item2: T, item3: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(item1: T, item2: T, item3: T, item4: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(item1: T, item2: T, item3: T, item4: T, item5: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(item1: T, item2: T, item3: T, item4: T, item5: T, item6: T, scheduler?: Scheduler): ActionsObservable<T>;
static of<T extends Action>(...array: Array<T | Scheduler>): ActionsObservable<T>;
static from<T extends Action>(ish: ObservableInput<T>, scheduler?: Scheduler): ActionsObservable<T>;
static from<T extends Action, R extends Action>(ish: ArrayLike<T>, scheduler?: Scheduler): ActionsObservable<R>;
constructor(input$: Observable<T>);
lift<R extends Action>(operator: Operator<T, R>): ActionsObservable<R>;
lift<R>(operator: Operator<T, R>): Observable<R>;
ofType(...key: T['type'][]): ActionsObservable<T>;
}
export declare interface Epic<T extends Action, S, D = any> {
(action$: ActionsObservable<T>, store: MiddlewareAPI<S>, dependencies: D): Observable<T>;
}
export interface EpicMiddleware<T extends Action, S, D = any> extends Middleware {
replaceEpic(nextEpic: Epic<T, S, D>): void;
}
interface Adapter {
input: (input$: Observable<any>) => any;
output: (output$: any) => Observable<any>;
}
interface Options<D = any> {
adapter?: Adapter;
dependencies?: D;
}
export declare function createEpicMiddleware<T extends Action, S, D = any>(rootEpic: Epic<T, S, D>, options?: Options<D>): EpicMiddleware<T, S, D>;
export declare function combineEpics<T extends Action, S, D = any>(...epics: Epic<T, S, D>[]): Epic<T, S, D>;
export declare function combineEpics<E>(...epics: E[]): E;
export declare const EPIC_END: '@@redux-observable/EPIC_END';