-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.d.ts
40 lines (29 loc) · 886 Bytes
/
react.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
import * as React from 'react';
import { Route as RouteType, ObjectType } from './index';
export interface RouteProps {
children: React.ReactNode,
component: React.ComponentType,
path: string,
}
export interface RouteTypeExtended extends RouteType {
params: ObjectType,
pattern: string;
}
export function Route(props: RouteProps): JSX.Element;
export interface RouterProps {
children: React.ReactNode,
}
export function Router(props: RouterProps): JSX.Element;
export function useHistory(): {
current: RouteTypeExtended,
currentIndex: number,
previous: RouteTypeExtended | null,
}
export function useParams(): ObjectType
export function useQuery(): ObjectType
export function useRoute(): RouteTypeExtended
export const RouteContext: React.Context<RouteTypeExtended>
export const RouterContext: React.Context<{
prev: RouteType | null,
next: RouteType
}>