1 | import { TypeConstant, ActionCreatorBuilder } from '../type-helpers';
|
2 |
|
3 | export declare type ActionBuilderMap<TType extends TypeConstant, TActionProps extends any, TPayloadArg extends any = undefined, TMetaArg extends any = undefined> = [TMetaArg] extends [undefined] ? [TPayloadArg] extends [undefined] ? () => {
|
4 | type: TType;
|
5 | } & TActionProps : (payload: TPayloadArg) => {
|
6 | type: TType;
|
7 | } & TActionProps : (payload: TPayloadArg, meta: TMetaArg) => {
|
8 | type: TType;
|
9 | } & TActionProps;
|
10 | export interface ActionBuilder<T extends TypeConstant> {
|
11 | <P = undefined, M = undefined>(): ActionCreatorBuilder<T, P, M>;
|
12 | map<R, P = undefined, M = undefined>(fn: (payload: P, meta: M) => R): ActionBuilderMap<T, R, P, M>;
|
13 | }
|
14 | /**
|
15 | * @description create an action-creator of a given function that contains hidden "type" metadata
|
16 | */
|
17 | export declare function createStandardAction<T extends TypeConstant>(type: T): ActionBuilder<T>;
|
18 |
|
\ | No newline at end of file |