UNPKG

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