From a08f07da812bb67a120bba436eefbb19571a7af7 Mon Sep 17 00:00:00 2001 From: afholderman Date: Tue, 20 Nov 2018 13:48:11 -0700 Subject: [PATCH] create and export types for routerActions so they can be imported and used in definitions --- index.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index 2c360a17..2fe68d61 100644 --- a/index.d.ts +++ b/index.d.ts @@ -12,7 +12,7 @@ declare module 'connected-react-router' { interface ConnectedRouterProps { history: History; } - + export type RouterActionType = 'POP' | 'PUSH' | 'REPLACE'; export interface RouterState { @@ -43,12 +43,18 @@ declare module 'connected-react-router' { export function goBack(): CallHistoryMethodAction; export function goForward(): CallHistoryMethodAction; + export type Push = typeof push; + export type Replace = typeof replace; + export type Go = typeof go; + export type GoBack = typeof goBack; + export type GoForward = typeof goForward; + export const routerActions: { - push: typeof push; - replace: typeof replace; - go: typeof go; - goBack: typeof goBack; - goForward: typeof goForward; + push: Push; + replace: Replace; + go: Go; + goBack: GoBack; + goForward: GoForward; }; export interface LocationActionPayload {