forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redux-router.d.ts
106 lines (91 loc) · 3.37 KB
/
redux-router.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Type definitions for redux-router v1.0.0
// Project: https://github.com/rackt/redux-router
// Definitions by: Stepan Mikhaylyuk <http://github.com/stepancar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../react-router/react-router.d.ts" />
/// <reference path="../redux/redux.d.ts" />
declare namespace __ReduxRouter {
import React = __React;
import H = HistoryModule;
/**
* A component that renders a React Router app using router state from a Redux store.
*/
export class ReduxRouter extends React.Component<any, any> { }
/**
* A Redux store enhancer that adds router state to the store.
*/
export var reduxReactRouter: any;
export function isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean;
/**
* A reducer that keeps track of Router state.
*/
export function routerStateReducer(state: any, action: any): any;
export interface ReduxRouterAction {
type: string,
payload: any
}
export function routerDidChange(state: any): ReduxRouterAction;
export function initRoutes(routes: any): ReduxRouterAction;
export function replaceRoutes(routes: any): ReduxRouterAction;
export function historyAPI(method: any): (...args: Object[]) => ReduxRouterAction;
}
declare module "redux-router/lib/routerStateReducer" {
export default __ReduxRouter.routerStateReducer;
}
declare module "redux-router/lib/ReduxRouter" {
import Router from "react-router";
export default Router;
}
declare module "redux-router/lib/client" {
export default __ReduxRouter.reduxReactRouter;
}
declare module "redux-router/lib/isActive" {
export default __ReduxRouter.isActive;
}
declare module "redux-router/lib/actionCreators" {
export const routerDidChange: typeof __ReduxRouter.routerDidChange;
export const initRoutes: typeof __ReduxRouter.initRoutes;
export const replaceRoutes: typeof __ReduxRouter.replaceRoutes;
export const historyAPI: typeof __ReduxRouter.historyAPI;
export const pushState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const push: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const replaceState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const replace: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const setState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const go: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const goBack: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
export const goForward: (...args: Object[]) => __ReduxRouter.ReduxRouterAction;
}
declare module "redux-router" {
import routerStateReducer from "redux-router/lib/routerStateReducer";
import ReduxRouter from "redux-router/lib/ReduxRouter";
import reduxReactRouter from "redux-router/lib/client";
import isActive from "redux-router/lib/isActive";
import {
historyAPI,
pushState,
push,
replaceState,
replace,
setState,
go,
goBack,
goForward
} from "redux-router/lib/actionCreators";
export {
routerStateReducer,
ReduxRouter,
reduxReactRouter,
isActive,
historyAPI,
pushState,
push,
replaceState,
replace,
setState,
go,
goBack,
goForward
}
}