1 | import { ReactNode } from 'react';
|
2 | import * as R from 'react-router-dom';
|
3 |
|
4 | export declare const BaseLocationProvider: typeof R.Router;
|
5 | export declare const DEEPLY_EQUAL: unique symbol;
|
6 | export declare const Link: {
|
7 | ({ to, children, ...rest }: LinkProps): JSX.Element;
|
8 | displayName: string;
|
9 | };
|
10 | export declare const Location: {
|
11 | ({ children }: LocationProps): JSX.Element;
|
12 | displayName: string;
|
13 | };
|
14 | export declare const LocationProvider: typeof R.BrowserRouter;
|
15 | export declare const Match: {
|
16 | ({ children, path: targetPath, startsWith }: MatchProps): JSX.Element;
|
17 | displayName: string;
|
18 | };
|
19 | export declare const Route: {
|
20 | ({ path, children, startsWith, hideOnly }: RouteProps): JSX.Element;
|
21 | displayName: string;
|
22 | };
|
23 | export declare const buildArgsParam: (initialArgs: Args, args: Args) => string;
|
24 | export declare const deepDiff: (value: any, update: any) => any;
|
25 | export declare const getMatch: (current: string, target: string, startsWith?: any) => Match | null;
|
26 | export declare const parsePath: (path: string | undefined) => StoryData;
|
27 | export declare const queryFromLocation: (location: Partial<Location>) => Query;
|
28 | export declare const queryFromString: (s: string) => Query;
|
29 | export declare const stringifyQuery: (query: Query) => string;
|
30 | export declare const useNavigate: () => (to: string | number, { plain, ...options }?: any) => void;
|
31 | export declare type Match = {
|
32 | path: string;
|
33 | };
|
34 | export declare type NavigateOptions = ReturnType<typeof R.useNavigate> & {
|
35 | plain?: boolean;
|
36 | };
|
37 | export declare type RenderData = Pick<RouterData, "location"> & Other;
|
38 | export declare type RouterData = {
|
39 | location: Partial<Location>;
|
40 | navigate: ReturnType<typeof useNavigate>;
|
41 | } & Other;
|
42 | export interface Args {
|
43 | [key: string]: any;
|
44 | }
|
45 | export interface LinkProps {
|
46 | to: string;
|
47 | children: ReactNode;
|
48 | }
|
49 | export interface LocationProps {
|
50 | children: (renderData: RenderData) => ReactNode;
|
51 | }
|
52 | export interface MatchProps {
|
53 | path: string;
|
54 | startsWith: boolean;
|
55 | children: (matchingData: MatchingData) => ReactNode;
|
56 | }
|
57 | export interface MatchingData {
|
58 | match: null | {
|
59 | path: string;
|
60 | };
|
61 | }
|
62 | export interface Other extends StoryData {
|
63 | path: string;
|
64 | singleStory?: boolean;
|
65 | }
|
66 | export interface Query {
|
67 | [key: string]: any;
|
68 | }
|
69 | export interface RouteProps {
|
70 | path: string;
|
71 | startsWith?: boolean;
|
72 | hideOnly?: boolean;
|
73 | children: ReactNode;
|
74 | }
|
75 | export interface StoryData {
|
76 | viewMode?: string;
|
77 | storyId?: string;
|
78 | refId?: string;
|
79 | }
|
80 |
|
81 | export {};
|