UNPKG

2.82 kBTypeScriptView Raw
1import { Action, ActionCreator, Creator } from '@ngrx/store';
2import { Observable, OperatorFunction, Operator } from 'rxjs';
3import * as i0 from "@angular/core";
4export declare class Actions<V = Action> extends Observable<V> {
5 constructor(source?: Observable<V>);
6 lift<R>(operator: Operator<V, R>): Observable<R>;
7 static ɵfac: i0.ɵɵFactoryDeclaration<Actions<any>, never>;
8 static ɵprov: i0.ɵɵInjectableDeclaration<Actions<any>>;
9}
10type ActionExtractor<T extends string | AC, AC extends ActionCreator<string, Creator>, E> = T extends string ? E : ReturnType<Extract<T, AC>>;
11export declare function ofType<AC extends ActionCreator<string, Creator>[], U extends Action = Action, V = ReturnType<AC[number]>>(...allowedTypes: AC): OperatorFunction<U, V>;
12export declare function ofType<E extends Extract<U, {
13 type: T1;
14}>, AC extends ActionCreator<string, Creator>, T1 extends string | AC, U extends Action = Action, V = T1 extends string ? E : ReturnType<Extract<T1, AC>>>(t1: T1): OperatorFunction<U, V>;
15export declare function ofType<E extends Extract<U, {
16 type: T1 | T2;
17}>, AC extends ActionCreator<string, Creator>, T1 extends string | AC, T2 extends string | AC, U extends Action = Action, V = ActionExtractor<T1 | T2, AC, E>>(t1: T1, t2: T2): OperatorFunction<U, V>;
18export declare function ofType<E extends Extract<U, {
19 type: T1 | T2 | T3;
20}>, AC extends ActionCreator<string, Creator>, T1 extends string | AC, T2 extends string | AC, T3 extends string | AC, U extends Action = Action, V = ActionExtractor<T1 | T2 | T3, AC, E>>(t1: T1, t2: T2, t3: T3): OperatorFunction<U, V>;
21export declare function ofType<E extends Extract<U, {
22 type: T1 | T2 | T3 | T4;
23}>, AC extends ActionCreator<string, Creator>, T1 extends string | AC, T2 extends string | AC, T3 extends string | AC, T4 extends string | AC, U extends Action = Action, V = ActionExtractor<T1 | T2 | T3 | T4, AC, E>>(t1: T1, t2: T2, t3: T3, t4: T4): OperatorFunction<U, V>;
24export declare function ofType<E extends Extract<U, {
25 type: T1 | T2 | T3 | T4 | T5;
26}>, AC extends ActionCreator<string, Creator>, T1 extends string | AC, T2 extends string | AC, T3 extends string | AC, T4 extends string | AC, T5 extends string | AC, U extends Action = Action, V = ActionExtractor<T1 | T2 | T3 | T4 | T5, AC, E>>(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): OperatorFunction<U, V>;
27/**
28 * Fallback for more than 5 arguments.
29 * There is no inference, so the return type is the same as the input -
30 * Observable<Action>.
31 *
32 * We provide a type parameter, even though TS will not infer it from the
33 * arguments, to preserve backwards compatibility with old versions of ngrx.
34 */
35export declare function ofType<V extends Action>(...allowedTypes: Array<string | ActionCreator<string, Creator>>): OperatorFunction<Action, V>;
36export {};