declare module 'connected-react-router' { import * as React from 'react'; import { Middleware, Reducer } from 'redux'; import { ReactReduxContextValue } from 'react-redux'; import { match, matchPath } from 'react-router'; import { Action, Hash, History, Path, Location, LocationState, LocationDescriptorObject, Search } from 'history'; type PathParam = Parameters[1]; interface ConnectedRouterProps { history: History; context?: React.Context; noInitialPop?: boolean; noTimeTravelDebugging?: boolean; omitRouter?: boolean; children?: React.ReactNode; } export type RouterActionType = Action; export interface RouterLocation extends Location { query: Record } export interface RouterState { location: RouterLocation action: RouterActionType } export const LOCATION_CHANGE: '@@router/LOCATION_CHANGE'; export const CALL_HISTORY_METHOD: '@@router/CALL_HISTORY_METHOD'; export interface LocationChangeAction { type: typeof LOCATION_CHANGE; payload: LocationChangePayload; } export interface LocationChangePayload extends RouterState { isFirstRendering: boolean; } export interface CallHistoryMethodAction { type: typeof CALL_HISTORY_METHOD; payload: LocationActionPayload; } export interface RouterRootState { router: RouterState; } export type matchSelectorFn< S extends RouterRootState, Params extends { [K in keyof Params]?: string } > = (state: S) => match | null; export type RouterAction = LocationChangeAction | CallHistoryMethodAction; export function push(path: Path, state?: S): CallHistoryMethodAction<[ Path, S? ]>; export function push(location: LocationDescriptorObject): CallHistoryMethodAction<[ LocationDescriptorObject ]>; export function replace(path: Path, state?: S): CallHistoryMethodAction<[ Path, S? ]>; export function replace(location: LocationDescriptorObject): CallHistoryMethodAction<[ LocationDescriptorObject ]>; export function go(n: number): CallHistoryMethodAction<[ number ]>; export function goBack(): CallHistoryMethodAction<[]>; export function goForward(): CallHistoryMethodAction<[]>; export function getRouter, LS = LocationState>(state: S): RouterState; export function getAction(state: S): RouterActionType; export function getHash(state: S): Hash; export function getLocation, LS = LocationState>(state: S): RouterLocation; export function getSearch(state: S): Search; export function createMatchSelector< S extends RouterRootState, Params extends { [K in keyof Params]?: string } >(path: PathParam): matchSelectorFn; export function onLocationChanged(location: Location, action: RouterActionType, isFirstRendering?: boolean) : LocationChangeAction; 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: Push; replace: Replace; go: Go; goBack: GoBack; goForward: GoForward; }; export interface LocationActionPayload { method: string; args?: A; } export class ConnectedRouter extends React.Component< ConnectedRouterProps, {} > {} export function connectRouter(history: History) : Reducer> export function routerMiddleware(history: History): Middleware; }