1 | # Installation
|
2 | > `npm install --save @types/react-router-redux`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for react-router-redux (https://github.com/reactjs/react-router-redux).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-redux.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-redux/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for react-router-redux 5.0
|
12 | // Project: https://github.com/reactjs/react-router-redux
|
13 | // Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
|
14 | // Shoya Tanaka <https://github.com/8398a7>
|
15 | // Mykolas <https://github.com/mykolas>
|
16 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
17 | // TypeScript Version: 3.0
|
18 |
|
19 | import {
|
20 | Store,
|
21 | Dispatch,
|
22 | Middleware,
|
23 | Reducer
|
24 | } from 'redux';
|
25 | import {
|
26 | History,
|
27 | Location,
|
28 | Path,
|
29 | LocationState,
|
30 | LocationDescriptor
|
31 | } from 'history';
|
32 | import * as React from 'react';
|
33 | import { match } from 'react-router';
|
34 |
|
35 | export interface ConnectedRouterProps<State> {
|
36 | children?: React.ReactNode;
|
37 | store?: Store<State> | undefined;
|
38 | history: History;
|
39 | }
|
40 | export class ConnectedRouter<State> extends React.Component<ConnectedRouterProps<State>> {}
|
41 |
|
42 | export const LOCATION_CHANGE = '@@router/LOCATION_CHANGE';
|
43 |
|
44 | export interface RouterState {
|
45 | location: Location | null;
|
46 | }
|
47 |
|
48 | export const routerReducer: Reducer<RouterState>;
|
49 |
|
50 | export const CALL_HISTORY_METHOD = '@@router/CALL_HISTORY_METHOD';
|
51 |
|
52 | export function push(location: LocationDescriptor, state?: LocationState): RouterAction;
|
53 | export function replace(location: LocationDescriptor, state?: LocationState): RouterAction;
|
54 | export function go(n: number): RouterAction;
|
55 | export function goBack(): RouterAction;
|
56 | export function goForward(): RouterAction;
|
57 |
|
58 | export const routerActions: {
|
59 | push: typeof push
|
60 | replace: typeof replace
|
61 | go: typeof go
|
62 | goBack: typeof goBack
|
63 | goForward: typeof goForward
|
64 | };
|
65 |
|
66 | export interface LocationActionPayload {
|
67 | method: string;
|
68 | args?: any[] | undefined;
|
69 | }
|
70 |
|
71 | export interface RouterAction {
|
72 | type: typeof CALL_HISTORY_METHOD;
|
73 | payload: LocationActionPayload;
|
74 | }
|
75 |
|
76 | export interface LocationChangeAction {
|
77 | type: typeof LOCATION_CHANGE;
|
78 | payload: Location & {
|
79 | props?: {
|
80 | match: {
|
81 | path: string;
|
82 | url: string;
|
83 | params: any;
|
84 | isExact: boolean;
|
85 | },
|
86 | location: Location;
|
87 | history: History;
|
88 | } | undefined
|
89 | };
|
90 | }
|
91 |
|
92 | export function routerMiddleware(history: History): Middleware;
|
93 |
|
94 | export function createMatchSelector(path: string): (state: { router: RouterState }) => match | null;
|
95 |
|
96 | ````
|
97 |
|
98 | ### Additional Details
|
99 | * Last updated: Thu, 07 Oct 2021 22:31:31 GMT
|
100 | * Dependencies: [@types/redux](https://npmjs.com/package/@types/redux), [@types/history](https://npmjs.com/package/@types/history), [@types/react](https://npmjs.com/package/@types/react), [@types/react-router](https://npmjs.com/package/@types/react-router)
|
101 | * Global values: none
|
102 |
|
103 | # Credits
|
104 | These definitions were written by [Huy Nguyen](https://github.com/huy-nguyen), [Shoya Tanaka](https://github.com/8398a7), and [Mykolas](https://github.com/mykolas).
|
105 |
|
\ | No newline at end of file |