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