From 007ea3c8beece5b75fa69a28d74c117e31dbb185 Mon Sep 17 00:00:00 2001 From: William Corry <74549+wroughtec@users.noreply.github.com> Date: Wed, 12 Feb 2020 18:58:32 +0000 Subject: [PATCH] [@reach/router] added hook types 1.3.1 (#42088) * reach__router Add @reach/router hook types * fix type error * fixed typo * tweak useParams * useParams return any --- types/reach__router/index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/reach__router/index.d.ts b/types/reach__router/index.d.ts index ed4649367e..8cb291a5e4 100644 --- a/types/reach__router/index.d.ts +++ b/types/reach__router/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for @reach/router 1.2 +// Type definitions for @reach/router 1.3 // Project: https://github.com/reach/router // Definitions by: Kingdaro , // A.Mokhtar , // Awwit +// wroughtec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -153,3 +154,11 @@ export function isRedirect(error: any): error is RedirectRequest; export function redirectTo(uri: string): void; export const globalHistory: History; + +export function useLocation(): WindowLocation; + +export function useNavigate(): NavigateFn; + +export function useParams(): any; + +export function useMatch(pathname: string): null | { uri: string; path: string };