1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | import { match } from 'react-router';
|
14 | import * as React from 'react';
|
15 | import * as H from 'history';
|
16 |
|
17 | export {
|
18 | generatePath,
|
19 | PromptProps,
|
20 | Prompt,
|
21 | MemoryRouterProps,
|
22 | MemoryRouter,
|
23 | RedirectProps,
|
24 | Redirect,
|
25 | RouteChildrenProps,
|
26 | RouteComponentProps,
|
27 | RouteProps,
|
28 | Route,
|
29 | RouterProps,
|
30 | Router,
|
31 | StaticRouterProps,
|
32 | StaticRouter,
|
33 | SwitchProps,
|
34 | Switch,
|
35 | match,
|
36 | matchPath,
|
37 | withRouter,
|
38 | RouterChildContext,
|
39 | useHistory,
|
40 | useLocation,
|
41 | useParams,
|
42 | useRouteMatch,
|
43 | } from 'react-router';
|
44 |
|
45 | export interface BrowserRouterProps {
|
46 | basename?: string | undefined;
|
47 | children?: React.ReactNode;
|
48 | getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
|
49 | forceRefresh?: boolean | undefined;
|
50 | keyLength?: number | undefined;
|
51 | }
|
52 | export class BrowserRouter extends React.Component<BrowserRouterProps, any> {}
|
53 |
|
54 | export interface HashRouterProps {
|
55 | basename?: string | undefined;
|
56 | children?: React.ReactNode;
|
57 | getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined;
|
58 | hashType?: 'slash' | 'noslash' | 'hashbang' | undefined;
|
59 | }
|
60 | export class HashRouter extends React.Component<HashRouterProps, any> {}
|
61 |
|
62 | export interface LinkProps<S = H.LocationState> extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
63 | component?: React.ComponentType<any> | undefined;
|
64 | to: H.LocationDescriptor<S> | ((location: H.Location<S>) => H.LocationDescriptor<S>);
|
65 | replace?: boolean | undefined;
|
66 | innerRef?: React.Ref<HTMLAnchorElement> | undefined;
|
67 | }
|
68 | export function Link<S = H.LocationState>(
|
69 | ...params: Parameters<Link<S>>
|
70 | ): ReturnType<Link<S>>;
|
71 |
|
72 | export interface Link<S = H.LocationState>
|
73 | extends React.ForwardRefExoticComponent<
|
74 | React.PropsWithoutRef<LinkProps<S>> & React.RefAttributes<HTMLAnchorElement>
|
75 | > {}
|
76 |
|
77 | export interface NavLinkProps<S = H.LocationState> extends Omit<LinkProps<S>, "className" | "style"> {
|
78 | activeClassName?: string | undefined;
|
79 | activeStyle?: React.CSSProperties | undefined;
|
80 | exact?: boolean | undefined;
|
81 | strict?: boolean | undefined;
|
82 | isActive?<Params extends { [K in keyof Params]?: string }>(match: match<Params> | null, location: H.Location<S>): boolean;
|
83 | location?: H.Location<S> | undefined;
|
84 | className?: string | ((isActive: boolean) => string) | undefined;
|
85 | style?:
|
86 | | React.CSSProperties
|
87 | | ((isActive: boolean) => React.CSSProperties)
|
88 | | undefined;
|
89 | sensitive?: boolean | undefined;
|
90 | }
|
91 | export function NavLink<S = H.LocationState>(
|
92 |
|
93 | props: React.PropsWithoutRef<NavLinkProps<S>> & React.RefAttributes<HTMLAnchorElement>,
|
94 | ): ReturnType<NavLink<S>>;
|
95 | export interface NavLink<S = H.LocationState>
|
96 | extends React.ForwardRefExoticComponent<
|
97 | React.PropsWithoutRef<NavLinkProps<S>> & React.RefAttributes<HTMLAnchorElement>
|
98 | > {}
|
99 |
|
\ | No newline at end of file |