diff --git a/src/index.ts b/src/index.ts index d8ada3a..5d5f546 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,4 @@ -import { Action, ActionCreator, isType } from "typescript-fsa"; - -// Redeclare AnyAction from typescript-fsa so modules can export reducers created by this library -// without requiring a dependency on typescript-fsa. -export interface AnyAction { - type: any; -} +import { Action, ActionCreator, AnyAction, isType } from "typescript-fsa"; export interface ReducerBuilder { case

(actionCreator: ActionCreator

, handler: Handler): ReducerBuilder; @@ -12,7 +6,9 @@ export interface ReducerBuilder { actionCreator: ActionCreator

, handler: Handler>, ): ReducerBuilder; - build(): (state: InS, action: AnyAction) => OutS; + // Intentionally avoid AnyAction type so modules can export reducers created using .build() + // without requiring a dependency on typescript-fsa. + build(): (state: InS, action: { type: any }) => OutS; (state: InS, action: AnyAction): OutS; }