From 735772cee9f8d6bae39b61dd7715ab0f8314397c Mon Sep 17 00:00:00 2001 From: Tom Shen Date: Tue, 8 Mar 2016 14:19:25 -0500 Subject: [PATCH] Add useRouterHistory to react-router type definitions --- react-router/react-router.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index e87622e9b4..e510b74065 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -395,6 +395,14 @@ declare module "react-router/lib/match" { } +declare module "react-router/lib/useRouterHistory" { + interface CreateRouterHistory { + (options?: HistoryModule.HistoryOptions): HistoryModule.History & HistoryModule.HistoryQueries; + } + + export default function useRouterHistory(createHistory: HistoryModule.CreateHistory): CreateRouterHistory; +} + declare module "react-router" { @@ -434,6 +442,8 @@ declare module "react-router" { import match from "react-router/lib/match" + import useRouterHistory from "react-router/lib/useRouterHistory"; + // PlainRoute is defined in the API documented at: // https://github.com/rackt/react-router/blob/master/docs/API.md // but not included in any of the .../lib modules above. @@ -472,7 +482,8 @@ declare module "react-router" { formatPattern, RouterContext, PropTypes, - match + match, + useRouterHistory } export default Router