Skip to content

Commit 6dce4c1

Browse files
committed
Added missing dependencies
1 parent 6520512 commit 6dce4c1

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// flow-typed signature: ea482fb27a1352860e93a861681ae6e9
2+
// flow-typed version: 01716df816/react-router_v4.x.x/flow_>=v0.53.x
3+
4+
declare module "react-router" {
5+
// NOTE: many of these are re-exported by react-router-dom and
6+
// react-router-native, so when making changes, please be sure to update those
7+
// as well.
8+
declare export type Location = {
9+
pathname: string,
10+
search: string,
11+
hash: string,
12+
state?: any,
13+
key?: string
14+
};
15+
16+
declare export type LocationShape = {
17+
pathname?: string,
18+
search?: string,
19+
hash?: string,
20+
state?: any
21+
};
22+
23+
declare export type HistoryAction = "PUSH" | "REPLACE" | "POP";
24+
25+
declare export type RouterHistory = {
26+
length: number,
27+
location: Location,
28+
action: HistoryAction,
29+
listen(
30+
callback: (location: Location, action: HistoryAction) => void
31+
): () => void,
32+
push(path: string | LocationShape, state?: any): void,
33+
replace(path: string | LocationShape, state?: any): void,
34+
go(n: number): void,
35+
goBack(): void,
36+
goForward(): void,
37+
canGo?: (n: number) => boolean,
38+
block(
39+
callback: (location: Location, action: HistoryAction) => boolean
40+
): void,
41+
// createMemoryHistory
42+
index?: number,
43+
entries?: Array<Location>
44+
};
45+
46+
declare export type Match = {
47+
params: { [key: string]: ?string },
48+
isExact: boolean,
49+
path: string,
50+
url: string
51+
};
52+
53+
declare export type ContextRouter = {|
54+
history: RouterHistory,
55+
location: Location,
56+
match: Match
57+
|};
58+
59+
declare export type GetUserConfirmation = (
60+
message: string,
61+
callback: (confirmed: boolean) => void
62+
) => void;
63+
64+
declare type StaticRouterContext = {
65+
url?: string
66+
};
67+
68+
declare export class StaticRouter extends React$Component<{
69+
basename?: string,
70+
location?: string | Location,
71+
context: StaticRouterContext,
72+
children?: React$Node
73+
}> {}
74+
75+
declare export class MemoryRouter extends React$Component<{
76+
initialEntries?: Array<LocationShape | string>,
77+
initialIndex?: number,
78+
getUserConfirmation?: GetUserConfirmation,
79+
keyLength?: number,
80+
children?: React$Node
81+
}> {}
82+
83+
declare export class Router extends React$Component<{
84+
history: RouterHistory,
85+
children?: React$Node
86+
}> {}
87+
88+
declare export class Prompt extends React$Component<{
89+
message: string | ((location: Location) => string | true),
90+
when?: boolean
91+
}> {}
92+
93+
declare export class Redirect extends React$Component<{
94+
to: string | LocationShape,
95+
push?: boolean
96+
}> {}
97+
98+
declare export class Route extends React$Component<{
99+
component?: React$ComponentType<*>,
100+
render?: (router: ContextRouter) => React$Node,
101+
children?: React$ComponentType<ContextRouter> | React$Node,
102+
path?: string,
103+
exact?: boolean,
104+
strict?: boolean
105+
}> {}
106+
107+
declare export class Switch extends React$Component<{
108+
children?: React$Node
109+
}> {}
110+
111+
declare export function withRouter<P>(
112+
Component: React$ComponentType<{| ...ContextRouter, ...P |}>
113+
): React$ComponentType<P>;
114+
115+
declare type MatchPathOptions = {
116+
path?: string,
117+
exact?: boolean,
118+
strict?: boolean,
119+
sensitive?: boolean
120+
};
121+
declare export function matchPath(
122+
pathname: string,
123+
options?: MatchPathOptions | string
124+
): null | Match;
125+
}

packages/react-router-pagination/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"peerDependencies": {
2323
"react": ">=16.5.2",
24+
"react-router": "^4.3.1",
2425
"react-router-dom": ">=4.3.1"
2526
},
2627
"devDependencies": {

0 commit comments

Comments
 (0)