ngrx-etc
Version:
Utilities for NgRx
15 lines (14 loc) • 1.54 kB
TypeScript
import { Creator, ActionCreator } from '@ngrx/store';
import { FunctionWithParametersType, TypedAction, NotAllowedCheck } from '@ngrx/store/src/models';
export interface TypedActionWithCorrelation<T extends string> extends TypedAction<T> {
__correlationId: string;
}
export declare function createActionWithCorrelation<T extends string>(type: T): ActionCreator<T, () => TypedActionWithCorrelation<T>>;
export declare function createActionWithCorrelation<T extends string, P extends object>(type: T, config: {
_as: 'props';
_p: P;
}): ActionCreator<T, (props: P) => P & TypedActionWithCorrelation<T>>;
export declare function createActionWithCorrelation<T extends string, P extends any[], R extends object>(type: T, creator: Creator<P, R> & NotAllowedCheck<R>): FunctionWithParametersType<P, R & TypedActionWithCorrelation<T>> & TypedActionWithCorrelation<T>;
export declare function correlateAction<T extends string>(actionCreator: ActionCreator<T, () => TypedAction<T>>): ActionCreator<T, () => TypedActionWithCorrelation<T>>;
export declare function correlateAction<T extends string, P extends object>(actionCreator: ActionCreator<T, (props: P) => P & TypedAction<T>>): ActionCreator<T, (props: P) => P & TypedActionWithCorrelation<T>>;
export declare function correlateAction<T extends string, P extends any[], R extends object>(actionCreator: FunctionWithParametersType<P, R & TypedAction<T>> & TypedAction<T>): FunctionWithParametersType<P, R & TypedActionWithCorrelation<T>> & TypedActionWithCorrelation<T>;