1 | import { ReactNode } from 'react';
|
2 | import { LocationProvider, LocationContext, NavigateFn, History } from '@reach/router';
|
3 | import { StoryData } from './utils';
|
4 | interface Other extends StoryData {
|
5 | path: string;
|
6 | }
|
7 | export declare type RenderData = Pick<LocationContext, 'location'> & Partial<Pick<LocationContext, 'navigate'>> & Other;
|
8 | interface MatchingData {
|
9 | match: null | {
|
10 | path: string;
|
11 | };
|
12 | }
|
13 | interface QueryLocationProps {
|
14 | children: (renderData: RenderData) => ReactNode;
|
15 | }
|
16 | interface QueryMatchProps {
|
17 | path: string;
|
18 | startsWith: boolean;
|
19 | children: (matchingData: MatchingData) => ReactNode;
|
20 | }
|
21 | interface RouteProps {
|
22 | path: string;
|
23 | startsWith?: boolean;
|
24 | hideOnly?: boolean;
|
25 | children: ReactNode;
|
26 | }
|
27 | export interface QueryLinkProps {
|
28 | to: string;
|
29 | children: ReactNode;
|
30 | }
|
31 | declare const queryNavigate: NavigateFn;
|
32 | declare const QueryLink: {
|
33 | ({ to, children, ...rest }: QueryLinkProps): JSX.Element;
|
34 | displayName: string;
|
35 | };
|
36 | declare const QueryLocation: {
|
37 | ({ children }: QueryLocationProps): JSX.Element;
|
38 | displayName: string;
|
39 | };
|
40 | declare const QueryMatch: {
|
41 | ({ children, path: targetPath, startsWith }: QueryMatchProps): JSX.Element;
|
42 | displayName: string;
|
43 | };
|
44 | declare const Route: {
|
45 | ({ path, children, startsWith, hideOnly }: RouteProps): JSX.Element;
|
46 | displayName: string;
|
47 | };
|
48 | export { QueryLink as Link };
|
49 | export { QueryMatch as Match };
|
50 | export { QueryLocation as Location };
|
51 | export { Route };
|
52 | export { queryNavigate as navigate };
|
53 | export { LocationProvider };
|
54 | export type { History };
|