react-router 7.14.0 → 7.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -24
- package/dist/development/{browser-C9Ar1yxG.d.ts → browser-C-UvoYvi.d.ts} +2 -2
- package/dist/development/{browser-vtIR1Kpe.d.mts → browser-I6n6wVSO.d.mts} +2 -2
- package/dist/development/{chunk-QFMPRPBF.mjs → chunk-EVOBXE3Y.mjs} +45 -19
- package/dist/development/{chunk-WAVMRYR2.js → chunk-PZFPF4X7.js} +7 -7
- package/dist/{production/chunk-X5LK27NZ.mjs → development/chunk-YQSHRJWW.mjs} +3 -3
- package/dist/{production/chunk-FPT5DLVJ.js → development/chunk-YZKCRDTN.js} +99 -99
- package/dist/development/{chunk-IK6APEEG.js → chunk-ZZNWZ5Q3.js} +82 -56
- package/dist/{production/context-phCt_zmH.d.mts → development/context-DGGUoDIu.d.mts} +1 -1
- package/dist/development/dom-export.d.mts +4 -4
- package/dist/development/dom-export.d.ts +4 -4
- package/dist/development/dom-export.js +27 -27
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-luDbagNU.d.ts → index-react-server-client-BBd0A0TL.d.ts} +2 -2
- package/dist/{production/index-react-server-client-BwWaHAr3.d.mts → development/index-react-server-client-BjhKIe3u.d.mts} +2 -2
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +6 -0
- package/dist/development/index-react-server.d.ts +6 -0
- package/dist/development/index-react-server.js +9 -6
- package/dist/development/index-react-server.mjs +9 -6
- package/dist/development/index.d.mts +11 -11
- package/dist/development/index.d.ts +11 -11
- package/dist/development/index.js +96 -96
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-BYr6ff5D.d.ts → development/instrumentation-g0dG8UL0.d.ts} +1 -1
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-CTxsJBKQ.d.mts → register-D9d2sMQ7.d.mts} +1 -1
- package/dist/development/{register-CkcGwv27.d.ts → register-DcBltf5q.d.ts} +1 -1
- package/dist/development/{routeModules-CA7kSxJJ.d.ts → routeModules-7rtk67cd.d.ts} +32 -11
- package/dist/development/{routeModules-BRrCYrSL.d.mts → routeModules-BW4a8k3I.d.mts} +32 -11
- package/dist/production/{browser-C9Ar1yxG.d.ts → browser-C-UvoYvi.d.ts} +2 -2
- package/dist/production/{browser-vtIR1Kpe.d.mts → browser-I6n6wVSO.d.mts} +2 -2
- package/dist/{development/chunk-2UH5WJXA.mjs → production/chunk-2WLZNCK5.mjs} +3 -3
- package/dist/production/{chunk-HZQGQD2X.mjs → chunk-LK6U7ULH.mjs} +45 -19
- package/dist/production/{chunk-355DUZMC.js → chunk-PQL4HLVQ.js} +7 -7
- package/dist/{development/chunk-NXTEWSJO.js → production/chunk-UJQ4OJF4.js} +99 -99
- package/dist/production/{chunk-4TJ7T2OQ.js → chunk-X5SKXJ4A.js} +82 -56
- package/dist/{development/context-phCt_zmH.d.mts → production/context-DGGUoDIu.d.mts} +1 -1
- package/dist/production/dom-export.d.mts +4 -4
- package/dist/production/dom-export.d.ts +4 -4
- package/dist/production/dom-export.js +27 -27
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-luDbagNU.d.ts → index-react-server-client-BBd0A0TL.d.ts} +2 -2
- package/dist/{development/index-react-server-client-BwWaHAr3.d.mts → production/index-react-server-client-BjhKIe3u.d.mts} +2 -2
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +6 -0
- package/dist/production/index-react-server.d.ts +6 -0
- package/dist/production/index-react-server.js +9 -6
- package/dist/production/index-react-server.mjs +9 -6
- package/dist/production/index.d.mts +11 -11
- package/dist/production/index.d.ts +11 -11
- package/dist/production/index.js +96 -96
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-BYr6ff5D.d.ts → production/instrumentation-g0dG8UL0.d.ts} +1 -1
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-CTxsJBKQ.d.mts → register-D9d2sMQ7.d.mts} +1 -1
- package/dist/production/{register-CkcGwv27.d.ts → register-DcBltf5q.d.ts} +1 -1
- package/dist/production/{routeModules-CA7kSxJJ.d.ts → routeModules-7rtk67cd.d.ts} +32 -11
- package/dist/production/{routeModules-BRrCYrSL.d.mts → routeModules-BW4a8k3I.d.mts} +32 -11
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.14.
|
|
2
|
+
* react-router v7.14.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isSession,
|
|
29
29
|
routeRSCServerRequest,
|
|
30
30
|
setDevServerHooks
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2WLZNCK5.mjs";
|
|
32
32
|
import {
|
|
33
33
|
Action,
|
|
34
34
|
Await,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
withComponentProps,
|
|
142
142
|
withErrorBoundaryProps,
|
|
143
143
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-LK6U7ULH.mjs";
|
|
145
145
|
export {
|
|
146
146
|
Await,
|
|
147
147
|
BrowserRouter,
|
package/dist/{development/instrumentation-BYr6ff5D.d.ts → production/instrumentation-g0dG8UL0.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, U as UIMatch, T as To, o as HTMLFormMethod, F as FormEncType, p as Path, q as LoaderFunctionArgs, r as MiddlewareEnabled, s as AppLoadContext } from './routeModules-
|
|
1
|
+
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, U as UIMatch, T as To, o as HTMLFormMethod, F as FormEncType, p as Path, q as LoaderFunctionArgs, r as MiddlewareEnabled, s as AppLoadContext } from './routeModules-7rtk67cd.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../routeModules-
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../routeModules-BW4a8k3I.mjs';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-D9d2sMQ7.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, t as LinkDescriptor, L as Location, u as Func, v as Pretty, w as MetaDescriptor, G as GetLoaderData, x as ServerDataFunctionArgs, y as MiddlewareNextFunction, z as ClientDataFunctionArgs, B as DataStrategyResult, E as ServerDataFrom, N as Normalize, I as GetActionData } from '../../routeModules-
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, t as LinkDescriptor, L as Location, u as Func, v as Pretty, w as MetaDescriptor, G as GetLoaderData, x as ServerDataFunctionArgs, y as MiddlewareNextFunction, z as ClientDataFunctionArgs, B as DataStrategyResult, E as ServerDataFrom, N as Normalize, I as GetActionData } from '../../routeModules-7rtk67cd.js';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-DcBltf5q.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RouteModule } from './routeModules-
|
|
1
|
+
import { R as RouteModule } from './routeModules-BW4a8k3I.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RouteModule } from './routeModules-
|
|
1
|
+
import { R as RouteModule } from './routeModules-7rtk67cd.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
@@ -846,13 +846,30 @@ type DataNonIndexRouteObject = NonIndexRouteObject & {
|
|
|
846
846
|
type DataRouteObject = DataIndexRouteObject | DataNonIndexRouteObject;
|
|
847
847
|
type RouteManifest<R = DataRouteObject> = Record<string, R | undefined>;
|
|
848
848
|
type Regex_az = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
849
|
-
type
|
|
849
|
+
type Regex_AZ = Uppercase<Regex_az>;
|
|
850
850
|
type Regex_09 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
851
|
-
type Regex_w = Regex_az |
|
|
852
|
-
|
|
853
|
-
type RegexMatchPlus<
|
|
854
|
-
type
|
|
855
|
-
type
|
|
851
|
+
type Regex_w = Regex_az | Regex_AZ | Regex_09 | "_";
|
|
852
|
+
/** Emulates Regex `+` operator */
|
|
853
|
+
type RegexMatchPlus<char extends string, T extends string> = _RegexMatchPlus<char, T> extends infer result extends string ? result extends '' ? never : result : never;
|
|
854
|
+
type _RegexMatchPlus<char extends string, T extends string> = T extends `${infer head extends char}${infer rest}` ? `${head}${_RegexMatchPlus<char, rest>}` : '';
|
|
855
|
+
type ParamNameChar = Regex_w | "-";
|
|
856
|
+
type Simplify<T> = {
|
|
857
|
+
[K in keyof T]: T[K];
|
|
858
|
+
} & {};
|
|
859
|
+
type GeneratePathParams<path extends string> = Simplify<ParseParams<path> & {
|
|
860
|
+
[key in string]: string | null | undefined;
|
|
861
|
+
}>;
|
|
862
|
+
type ParseParams<path extends string> = path extends '*' ? {
|
|
863
|
+
'*': string;
|
|
864
|
+
} : path extends `${infer rest}/*` ? {
|
|
865
|
+
'*': string;
|
|
866
|
+
} & ParseParams<rest> : _ParseParams<path>;
|
|
867
|
+
type _ParseParams<path extends string> = path extends `${infer left}/${infer right}` ? _ParseParams<left> & _ParseParams<right> : path extends `:${infer param}?${string}` ? {
|
|
868
|
+
[key in RegexMatchPlus<ParamNameChar, param>]?: string | null | undefined;
|
|
869
|
+
} : path extends `:${infer param}` ? {
|
|
870
|
+
[key in RegexMatchPlus<ParamNameChar, param>]: string;
|
|
871
|
+
} : {};
|
|
872
|
+
type PathParam<path extends string> = (keyof ParseParams<path>) & string;
|
|
856
873
|
type ParamParseKey<Segment extends string> = [
|
|
857
874
|
PathParam<Segment>
|
|
858
875
|
] extends [never] ? string : PathParam<Segment>;
|
|
@@ -953,9 +970,7 @@ interface UIMatch<Data = unknown, Handle = unknown> {
|
|
|
953
970
|
* @param params The parameters to interpolate into the path.
|
|
954
971
|
* @returns The generated path with parameters interpolated.
|
|
955
972
|
*/
|
|
956
|
-
declare function generatePath<Path extends string>(originalPath: Path, params?:
|
|
957
|
-
[key in PathParam<Path>]: string | null;
|
|
958
|
-
}): string;
|
|
973
|
+
declare function generatePath<Path extends string>(originalPath: Path, params?: GeneratePathParams<Path>): string;
|
|
959
974
|
/**
|
|
960
975
|
* Used to match on some portion of a URL pathname.
|
|
961
976
|
*/
|
|
@@ -1011,7 +1026,7 @@ interface PathMatch<ParamKey extends string = string> {
|
|
|
1011
1026
|
* @returns A path match object if the pattern matches the pathname,
|
|
1012
1027
|
* or `null` if it does not match.
|
|
1013
1028
|
*/
|
|
1014
|
-
declare function matchPath<
|
|
1029
|
+
declare function matchPath<Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamParseKey<Path>> | null;
|
|
1015
1030
|
/**
|
|
1016
1031
|
* Returns a resolved {@link Path} object relative to the given pathname.
|
|
1017
1032
|
*
|
|
@@ -1067,6 +1082,9 @@ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
|
|
|
1067
1082
|
* Sets the status code and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
|
|
1068
1083
|
* header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
|
|
1069
1084
|
*
|
|
1085
|
+
* This utility accepts absolute URLs and can navigate to external domains, so
|
|
1086
|
+
* the application should validate any user-supplied inputs to redirects.
|
|
1087
|
+
*
|
|
1070
1088
|
* @example
|
|
1071
1089
|
* import { redirect } from "react-router";
|
|
1072
1090
|
*
|
|
@@ -1096,6 +1114,9 @@ declare const redirect: RedirectFunction;
|
|
|
1096
1114
|
* and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
|
|
1097
1115
|
* header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
|
|
1098
1116
|
*
|
|
1117
|
+
* This utility accepts absolute URLs and can navigate to external domains, so
|
|
1118
|
+
* the application should validate any user-supplied inputs to redirects.
|
|
1119
|
+
*
|
|
1099
1120
|
* ```tsx filename=routes/logout.tsx
|
|
1100
1121
|
* import { redirectDocument } from "react-router";
|
|
1101
1122
|
*
|
|
@@ -1690,4 +1711,4 @@ type RouteComponent = ComponentType<{}>;
|
|
|
1690
1711
|
*/
|
|
1691
1712
|
type RouteHandle = unknown;
|
|
1692
1713
|
|
|
1693
|
-
export { type BaseRouteObject as $, type ActionFunction as A, type DataStrategyResult as B, type ClientActionFunction as C, type DataRouteMatch as D, type ServerDataFrom as E, type FormEncType as F, type GetLoaderData as G, type HeadersFunction as H, type GetActionData as I, type RouteModules as J, type SerializeFrom as K, type Location as L, type MetaFunction as M, type Normalize as N, type
|
|
1714
|
+
export { type BaseRouteObject as $, type ActionFunction as A, type DataStrategyResult as B, type ClientActionFunction as C, type DataRouteMatch as D, type ServerDataFrom as E, type FormEncType as F, type GetLoaderData as G, type HeadersFunction as H, type GetActionData as I, type RouteModules as J, type SerializeFrom as K, type Location as L, type MetaFunction as M, type Normalize as N, type PathPattern as O, type Params as P, type PathMatch as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type ParamParseKey as V, type InitialEntry as W, type IndexRouteObject as X, type NonIndexRouteObject as Y, type Equal as Z, type ActionFunctionArgs as _, type ClientLoaderFunction as a, type DataStrategyFunctionArgs as a0, type DataStrategyMatch as a1, DataWithResponseInit as a2, type ErrorResponse as a3, type FormMethod as a4, type LazyRouteFunction as a5, type MiddlewareFunction as a6, type PatchRoutesOnNavigationFunctionArgs as a7, type PathParam as a8, type RedirectFunction as a9, invariant as aA, ErrorResponseImpl as aB, type RouteManifest as aC, type ServerRouteModule as aD, type TrackedPromise as aE, type RouteMatch as aa, type RouterContext as ab, type ShouldRevalidateFunctionArgs as ac, createContext as ad, createPath as ae, parsePath as af, data as ag, generatePath as ah, isRouteErrorResponse as ai, matchPath as aj, matchRoutes as ak, redirect as al, redirectDocument as am, replace as an, resolvePath as ao, type ClientActionFunctionArgs as ap, type ClientLoaderFunctionArgs as aq, type HeadersArgs as ar, type MetaArgs as as, type PageLinkDescriptor as at, type HtmlLinkDescriptor as au, type Future as av, type unstable_SerializesTo as aw, createMemoryHistory as ax, createBrowserHistory as ay, createHashHistory as az, type LinksFunction as b, RouterContextProvider as c, type LoaderFunction as d, type RouteObject as e, type History as f, type MaybePromise as g, type MapRoutePropertiesFunction as h, Action as i, type Submission as j, type RouteData as k, type DataStrategyFunction as l, type PatchRoutesOnNavigationFunction as m, type DataRouteObject as n, type HTMLFormMethod as o, type Path as p, type LoaderFunctionArgs as q, type MiddlewareEnabled as r, type AppLoadContext as s, type LinkDescriptor as t, type Func as u, type Pretty as v, type MetaDescriptor as w, type ServerDataFunctionArgs as x, type MiddlewareNextFunction as y, type ClientDataFunctionArgs as z };
|
|
@@ -846,13 +846,30 @@ type DataNonIndexRouteObject = NonIndexRouteObject & {
|
|
|
846
846
|
type DataRouteObject = DataIndexRouteObject | DataNonIndexRouteObject;
|
|
847
847
|
type RouteManifest<R = DataRouteObject> = Record<string, R | undefined>;
|
|
848
848
|
type Regex_az = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
849
|
-
type
|
|
849
|
+
type Regex_AZ = Uppercase<Regex_az>;
|
|
850
850
|
type Regex_09 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
851
|
-
type Regex_w = Regex_az |
|
|
852
|
-
|
|
853
|
-
type RegexMatchPlus<
|
|
854
|
-
type
|
|
855
|
-
type
|
|
851
|
+
type Regex_w = Regex_az | Regex_AZ | Regex_09 | "_";
|
|
852
|
+
/** Emulates Regex `+` operator */
|
|
853
|
+
type RegexMatchPlus<char extends string, T extends string> = _RegexMatchPlus<char, T> extends infer result extends string ? result extends '' ? never : result : never;
|
|
854
|
+
type _RegexMatchPlus<char extends string, T extends string> = T extends `${infer head extends char}${infer rest}` ? `${head}${_RegexMatchPlus<char, rest>}` : '';
|
|
855
|
+
type ParamNameChar = Regex_w | "-";
|
|
856
|
+
type Simplify<T> = {
|
|
857
|
+
[K in keyof T]: T[K];
|
|
858
|
+
} & {};
|
|
859
|
+
type GeneratePathParams<path extends string> = Simplify<ParseParams<path> & {
|
|
860
|
+
[key in string]: string | null | undefined;
|
|
861
|
+
}>;
|
|
862
|
+
type ParseParams<path extends string> = path extends '*' ? {
|
|
863
|
+
'*': string;
|
|
864
|
+
} : path extends `${infer rest}/*` ? {
|
|
865
|
+
'*': string;
|
|
866
|
+
} & ParseParams<rest> : _ParseParams<path>;
|
|
867
|
+
type _ParseParams<path extends string> = path extends `${infer left}/${infer right}` ? _ParseParams<left> & _ParseParams<right> : path extends `:${infer param}?${string}` ? {
|
|
868
|
+
[key in RegexMatchPlus<ParamNameChar, param>]?: string | null | undefined;
|
|
869
|
+
} : path extends `:${infer param}` ? {
|
|
870
|
+
[key in RegexMatchPlus<ParamNameChar, param>]: string;
|
|
871
|
+
} : {};
|
|
872
|
+
type PathParam<path extends string> = (keyof ParseParams<path>) & string;
|
|
856
873
|
type ParamParseKey<Segment extends string> = [
|
|
857
874
|
PathParam<Segment>
|
|
858
875
|
] extends [never] ? string : PathParam<Segment>;
|
|
@@ -953,9 +970,7 @@ interface UIMatch<Data = unknown, Handle = unknown> {
|
|
|
953
970
|
* @param params The parameters to interpolate into the path.
|
|
954
971
|
* @returns The generated path with parameters interpolated.
|
|
955
972
|
*/
|
|
956
|
-
declare function generatePath<Path extends string>(originalPath: Path, params?:
|
|
957
|
-
[key in PathParam<Path>]: string | null;
|
|
958
|
-
}): string;
|
|
973
|
+
declare function generatePath<Path extends string>(originalPath: Path, params?: GeneratePathParams<Path>): string;
|
|
959
974
|
/**
|
|
960
975
|
* Used to match on some portion of a URL pathname.
|
|
961
976
|
*/
|
|
@@ -1011,7 +1026,7 @@ interface PathMatch<ParamKey extends string = string> {
|
|
|
1011
1026
|
* @returns A path match object if the pattern matches the pathname,
|
|
1012
1027
|
* or `null` if it does not match.
|
|
1013
1028
|
*/
|
|
1014
|
-
declare function matchPath<
|
|
1029
|
+
declare function matchPath<Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamParseKey<Path>> | null;
|
|
1015
1030
|
/**
|
|
1016
1031
|
* Returns a resolved {@link Path} object relative to the given pathname.
|
|
1017
1032
|
*
|
|
@@ -1067,6 +1082,9 @@ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
|
|
|
1067
1082
|
* Sets the status code and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
|
|
1068
1083
|
* header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
|
|
1069
1084
|
*
|
|
1085
|
+
* This utility accepts absolute URLs and can navigate to external domains, so
|
|
1086
|
+
* the application should validate any user-supplied inputs to redirects.
|
|
1087
|
+
*
|
|
1070
1088
|
* @example
|
|
1071
1089
|
* import { redirect } from "react-router";
|
|
1072
1090
|
*
|
|
@@ -1096,6 +1114,9 @@ declare const redirect: RedirectFunction;
|
|
|
1096
1114
|
* and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
|
|
1097
1115
|
* header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
|
|
1098
1116
|
*
|
|
1117
|
+
* This utility accepts absolute URLs and can navigate to external domains, so
|
|
1118
|
+
* the application should validate any user-supplied inputs to redirects.
|
|
1119
|
+
*
|
|
1099
1120
|
* ```tsx filename=routes/logout.tsx
|
|
1100
1121
|
* import { redirectDocument } from "react-router";
|
|
1101
1122
|
*
|
|
@@ -1690,4 +1711,4 @@ type RouteComponent = ComponentType<{}>;
|
|
|
1690
1711
|
*/
|
|
1691
1712
|
type RouteHandle = unknown;
|
|
1692
1713
|
|
|
1693
|
-
export { type
|
|
1714
|
+
export { type ParamParseKey as $, type ActionFunction as A, type PatchRoutesOnNavigationFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type DataRouteObject as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type Path as I, type InitialEntry as J, type NonIndexRouteObject as K, type Location as L, type MetaFunction as M, type Normalize as N, type LazyRouteFunction as O, type Params as P, type IndexRouteObject as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type RouteMatch as V, type TrackedPromise as W, type RouteModules as X, type SerializeFrom as Y, type PathPattern as Z, type PathMatch as _, type ClientLoaderFunction as a, type Equal as a0, type ActionFunctionArgs as a1, type BaseRouteObject as a2, type DataStrategyFunctionArgs as a3, type DataStrategyMatch as a4, DataWithResponseInit as a5, type ErrorResponse as a6, type FormMethod as a7, type MiddlewareFunction as a8, type PatchRoutesOnNavigationFunctionArgs as a9, createHashHistory as aA, invariant as aB, ErrorResponseImpl as aC, type RouteManifest as aD, type ServerRouteModule as aE, type PathParam as aa, type RedirectFunction as ab, type RouterContext as ac, type ShouldRevalidateFunctionArgs as ad, createContext as ae, createPath as af, parsePath as ag, data as ah, generatePath as ai, isRouteErrorResponse as aj, matchPath as ak, matchRoutes as al, redirect as am, redirectDocument as an, replace as ao, resolvePath as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunctionArgs as ar, type HeadersArgs as as, type MetaArgs as at, type PageLinkDescriptor as au, type HtmlLinkDescriptor as av, type Future as aw, type unstable_SerializesTo as ax, createMemoryHistory as ay, createBrowserHistory as az, type LinksFunction as b, RouterContextProvider as c, type LoaderFunction as d, type LinkDescriptor as e, type Pretty as f, type MetaDescriptor as g, type ServerDataFunctionArgs as h, type MiddlewareNextFunction as i, type ClientDataFunctionArgs as j, type ServerDataFrom as k, type GetActionData as l, type HTMLFormMethod as m, type FormEncType as n, type LoaderFunctionArgs as o, type MiddlewareEnabled as p, type AppLoadContext as q, type RouteObject as r, type History as s, type MaybePromise as t, type MapRoutePropertiesFunction as u, Action as v, type DataRouteMatch as w, type Submission as x, type RouteData as y, type DataStrategyFunction as z };
|