diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts index 750f8438b6..f15d27ceb7 100644 --- a/types/redux-first-router/index.d.ts +++ b/types/redux-first-router/index.d.ts @@ -249,7 +249,8 @@ export function nextPath(): string | void; export function pathToAction( pathname: string, - routesMap: RoutesMap + routesMap: RoutesMap, + querySerializer?: QuerySerializer ): ReceivedAction; export function prevPath(): string | void; diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts index 3168db6ed8..7d14b755c3 100644 --- a/types/redux-first-router/redux-first-router-tests.ts +++ b/types/redux-first-router/redux-first-router-tests.ts @@ -6,7 +6,8 @@ import { ReceivedAction, redirect, Action as ReduxFirstRouterAction, - QuerySerializer + QuerySerializer, + pathToAction } from 'redux-first-router'; import { createStore, @@ -23,8 +24,8 @@ import { } from 'redux'; import { History } from 'history'; -declare var console: any; -declare var history: History; +declare const console: any; +declare const history: History; interface Keys { role: string; @@ -97,12 +98,14 @@ const receivedAction: ReceivedAction = { payload: {} }; actionToPath(receivedAction, routesMap); // $ExpectType string +pathToAction('/', routesMap); // $ExpectType ReceivedAction const querySerializer: QuerySerializer = { stringify: (params) => '', parse: (queryString) => ({}) }; actionToPath(receivedAction, routesMap, querySerializer); // $ExpectType string +pathToAction('/', routesMap, querySerializer); // $ExpectType ReceivedAction const action: ReduxFirstRouterAction = { type: 'HOME'