-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
56 lines (56 loc) · 1.72 KB
/
index.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
declare module 'web-router' {
interface History<State = {}> {
readonly length: number;
readonly state: State;
back(): void;
forward(): void;
go(delta?: number): void;
push(url: string, state?: State): void;
replace(url: string, state?: State): void;
}
interface Location {
readonly hash: string;
readonly host: string;
readonly hostname: string;
readonly href: string;
readonly pathname: string;
readonly port: string;
readonly protocol: string;
readonly origin: string;
}
interface LinkProps
extends Omit<
React.DetailedHTMLProps<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement
>,
'href'
> {
to: string;
}
function Link(props: LinkProps): React.ReactElement;
interface RedirectProps {
to: string;
push?: boolean;
}
function Redirect(props: RedirectProps): React.ReactElement;
function Router(props: React.PropsWithChildren<{}>): React.ReactElement;
type Callback = (history: History, location: Location) => void;
function useHistory<State = {}>(): History<State>;
function useLocation(): Location;
function useParams<T extends Params = Params>(): T;
type RouteProps = React.PropsWithChildren<{ path?: string }>;
function Route(props: RouteProps): React.ReactElement;
interface Params {
[key: string]: string;
}
function Switch(props: React.PropsWithChildren<{}>): React.ReactElement;
interface FixedProgressProps {
show: boolean;
}
function FixedProgress({ show }: FixedProgressProps): React.ReactElement;
type TransitionSwitchProps = Partial<
React.SuspenseProps & React.TimeoutConfig
>;
function TransitionSwitch(props: TransitionSwitchProps): React.ReactElement;
}