-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.d.ts
55 lines (46 loc) · 1.26 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
import {
ParseOptions,
RegexpToFunctionOptions,
TokensToFunctionOptions,
TokensToRegexpOptions,
} from 'path-to-regexp'
import {FunctionComponent} from 'react'
export declare type RouterProps = {
location: string|undefined|null,
options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions,
}
export declare const Router: FunctionComponent<RouterProps>
export declare function genLocation(
path: string,
params?: object,
options?: ParseOptions & TokensToFunctionOptions,
): string
export declare function loc(
path: string,
params?: object,
options?: ParseOptions & TokensToFunctionOptions,
): string
export declare function isPath(
path: string,
location: string,
options?: TokensToRegexpOptions & ParseOptions,
): boolean
export declare type SearchResult = {
path: string,
params: object[],
}
export declare function findPath(
paths: string[],
location: string,
options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions,
): SearchResult|void
export declare type SearchValueResult = {
path: string,
value: any,
params: object[],
}
export declare function findPathValue(
obj: object,
location: string,
options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions,
): SearchValueResult|void