forked from supasate/connected-react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
59 lines (46 loc) · 1.7 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
declare module 'connected-react-router' {
import * as React from 'react'
import { Middleware, Reducer } from 'redux'
import { History, Path, Location, LocationState, LocationDescriptorObject } from 'history'
interface ConnectedRouterProps {
history: History
}
export type RouterActionType = 'POP' | 'PUSH' | 'REPLACE';
export interface LocationChangeAction {
type: typeof LOCATION_CHANGE;
payload: RouterState;
}
export interface RouterState {
location: Location
action: RouterActionType
}
export const LOCATION_CHANGE: '@@router/LOCATION_CHANGE'
export const CALL_HISTORY_METHOD: '@@router/CALL_HISTORY_METHOD'
export function push(path: Path, state?: LocationState): RouterAction;
export function push(location: LocationDescriptorObject): RouterAction;
export function replace(path: Path, state?: LocationState): RouterAction;
export function replace(location: LocationDescriptorObject): RouterAction;
export function go(n: number): RouterAction
export function goBack(): RouterAction
export function goForward(): RouterAction
export const routerActions: {
push: typeof push,
replace: typeof replace,
go: typeof go,
goBack: typeof goBack,
goForward: typeof goForward,
}
export interface LocationActionPayload {
method: string;
args?: any[];
}
export interface RouterAction {
type: typeof CALL_HISTORY_METHOD;
payload: LocationActionPayload;
}
export class ConnectedRouter extends React.Component<ConnectedRouterProps, {}> {
}
export function connectRouter(history: History)
: <S>(reducer: Reducer<S>) => Reducer<S & { router: RouterState }>
export function routerMiddleware(history: History): Middleware
}