forked from supasate/connected-react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
62 lines (49 loc) · 1.69 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
60
61
62
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 enum RouterActionType {
POP = 'POP',
PUSH = 'PUSH'
}
export interface LocationChangeAction {
type: typeof LOCATION_CHANGE;
payload: RouterState;
}
export interface RouterState {
location: Location
action: RouterActionType.POP | RouterActionType.PUSH
}
export const LOCATION_CHANGE: '@@router/LOCATION_CHANGE'
export const CALL_HISTORY_METHOD: string
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>
export function routerMiddleware(history: History): Middleware
}