diff --git a/package.json b/package.json index 16c3170..67dae12 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "actions", "middleware" ], + "types": "./src/index.d.ts", "author": "Ostap Maliuvanchuk", "license": "MIT", "devDependencies": { diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..50f5be0 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,21 @@ +declare module 'redux-action-batcher' { + import { Action, Dispatch, Middleware, Reducer } from 'redux'; + export const enableBatching: (reducer : Reducer) => (state: S, action: any) => S; + export const batchingMiddleware: Middleware; + export function batchActions + (actions: A): Action; + export function batchActions + (action1: A, action2: B): Action; + export function batchActions + (action1: A, action2: B, action3: C): Action; + export function batchActions + (action1: A, action2: B, action3: C, action4: D): Action; + export function batchActions + (action1: A, action2: B, action3: C, action4: D, action5: E): Action; + export function batchActions + (action1: A, action2: B, action3: C, action4: D, action5: E, action6: F): Action; + export function batchActions + (action1: A, action2: B, action3: C, action4: D, action5: E, action6: F, action7: G): Action; + export function batchActions + (action1: A, action2: B, action3: C, action4: D, action5: E, action6: F, action7: G, action8: H): Action; + }