|
| 1 | +import type { Hash, Location, Path, Pathname, Search, To } from "history"; |
| 2 | +import { Action as NavigationType, parsePath, createPath } from "history"; |
| 3 | + |
| 4 | +import type { |
| 5 | + MemoryRouterProps, |
| 6 | + NavigateProps, |
| 7 | + OutletProps, |
| 8 | + RouteProps, |
| 9 | + PathRouteProps, |
| 10 | + LayoutRouteProps, |
| 11 | + IndexRouteProps, |
| 12 | + RouterProps, |
| 13 | + RoutesProps, |
| 14 | +} from "./lib/components"; |
| 15 | +import { |
| 16 | + createRoutesFromChildren, |
| 17 | + renderMatches, |
| 18 | + MemoryRouter, |
| 19 | + Navigate, |
| 20 | + Outlet, |
| 21 | + Route, |
| 22 | + Router, |
| 23 | + Routes, |
| 24 | +} from "./lib/components"; |
| 25 | +import type { Navigator } from "./lib/context"; |
| 26 | +import { |
| 27 | + LocationContext, |
| 28 | + NavigationContext, |
| 29 | + RouteContext, |
| 30 | +} from "./lib/context"; |
| 31 | +import type { NavigateFunction, NavigateOptions } from "./lib/hooks"; |
| 32 | +import { |
| 33 | + useHref, |
| 34 | + useInRouterContext, |
| 35 | + useLocation, |
| 36 | + useMatch, |
| 37 | + useNavigationType, |
| 38 | + useNavigate, |
| 39 | + useOutlet, |
| 40 | + useOutletContext, |
| 41 | + useParams, |
| 42 | + useResolvedPath, |
| 43 | + useRoutes, |
| 44 | +} from "./lib/hooks"; |
| 45 | +import type { |
| 46 | + Params, |
| 47 | + PathMatch, |
| 48 | + PathPattern, |
| 49 | + RouteMatch, |
| 50 | + RouteObject, |
| 51 | +} from "./lib/router"; |
| 52 | +import { |
| 53 | + generatePath, |
| 54 | + matchPath, |
| 55 | + matchRoutes, |
| 56 | + resolvePath, |
| 57 | +} from "./lib/router"; |
| 58 | + |
| 59 | +// Expose react-router public API |
| 60 | +export type { |
| 61 | + Hash, |
| 62 | + IndexRouteProps, |
| 63 | + LayoutRouteProps, |
| 64 | + Location, |
| 65 | + MemoryRouterProps, |
| 66 | + NavigateFunction, |
| 67 | + NavigateOptions, |
| 68 | + NavigateProps, |
| 69 | + OutletProps, |
| 70 | + PathMatch, |
| 71 | + PathPattern, |
| 72 | + PathRouteProps, |
| 73 | + RouteMatch, |
| 74 | + RouteObject, |
| 75 | + RouteProps, |
| 76 | + RouterProps, |
| 77 | + RoutesProps, |
| 78 | + Navigator, |
| 79 | + Params, |
| 80 | + Path, |
| 81 | + Pathname, |
| 82 | + Search, |
| 83 | + To, |
| 84 | +}; |
| 85 | +export { |
| 86 | + MemoryRouter, |
| 87 | + Navigate, |
| 88 | + NavigationType, |
| 89 | + Outlet, |
| 90 | + Route, |
| 91 | + Router, |
| 92 | + Routes, |
| 93 | + createPath, |
| 94 | + createRoutesFromChildren, |
| 95 | + generatePath, |
| 96 | + matchPath, |
| 97 | + matchRoutes, |
| 98 | + parsePath, |
| 99 | + renderMatches, |
| 100 | + resolvePath, |
| 101 | + useHref, |
| 102 | + useInRouterContext, |
| 103 | + useLocation, |
| 104 | + useMatch, |
| 105 | + useNavigate, |
| 106 | + useNavigationType, |
| 107 | + useOutlet, |
| 108 | + useOutletContext, |
| 109 | + useParams, |
| 110 | + useResolvedPath, |
| 111 | + useRoutes, |
| 112 | +}; |
| 113 | + |
| 114 | +/////////////////////////////////////////////////////////////////////////////// |
| 115 | +// DANGER! PLEASE READ ME! |
| 116 | +// We provide these exports as an escape hatch in the event that you need any |
| 117 | +// routing data that we don't provide an explicit API for. With that said, we |
| 118 | +// want to cover your use case if we can, so if you feel the need to use these |
| 119 | +// we want to hear from you. Let us know what you're building and we'll do our |
| 120 | +// best to make sure we can support you! |
| 121 | +// |
| 122 | +// We consider these exports an implementation detail and do not guarantee |
| 123 | +// against any breaking changes, regardless of the semver release. Use with |
| 124 | +// extreme caution and only if you understand the consequences. Godspeed. |
| 125 | +/////////////////////////////////////////////////////////////////////////////// |
| 126 | + |
| 127 | +/** @internal */ |
| 128 | +export { |
| 129 | + NavigationContext as UNSAFE_NavigationContext, |
| 130 | + LocationContext as UNSAFE_LocationContext, |
| 131 | + RouteContext as UNSAFE_RouteContext, |
| 132 | +}; |
0 commit comments