UNPKG

1.75 kBTypeScriptView Raw
1// Type definitions for React Router 4.2
2// Project: https://github.com/ReactTraining/react-router
3// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
4// Huy Nguyen <https://github.com/huy-nguyen>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 2.6
7
8import { match } from "react-router";
9import * as React from 'react';
10import * as H from 'history';
11
12export {
13 Prompt,
14 MemoryRouter,
15 RedirectProps,
16 Redirect,
17 RouteComponentProps,
18 RouteProps,
19 Route,
20 Router,
21 StaticRouter,
22 Switch,
23 match,
24 matchPath,
25 withRouter,
26 RouterChildContext
27} from 'react-router';
28
29export interface BrowserRouterProps {
30 basename?: string;
31 getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void);
32 forceRefresh?: boolean;
33 keyLength?: number;
34}
35export class BrowserRouter extends React.Component<BrowserRouterProps, any> {}
36
37export interface HashRouterProps {
38 basename?: string;
39 getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void);
40 hashType?: 'slash' | 'noslash' | 'hashbang';
41}
42export class HashRouter extends React.Component<HashRouterProps, any> {}
43
44export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
45 to: H.LocationDescriptor;
46 replace?: boolean;
47}
48export class Link extends React.Component<LinkProps, any> {}
49
50export interface NavLinkProps extends LinkProps {
51 activeClassName?: string;
52 activeStyle?: React.CSSProperties;
53 exact?: boolean;
54 strict?: boolean;
55 isActive?<P>(match: match<P>, location: H.Location): boolean;
56 location?: H.Location;
57}
58export class NavLink extends React.Component<NavLinkProps, any> {}
59
\No newline at end of file