Get started
This commit is contained in:
46
node_modules/react-router/dist/development/browser-z32v5KVN.d.mts
generated
vendored
Normal file
46
node_modules/react-router/dist/development/browser-z32v5KVN.d.mts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
__FLIGHT_DATA: any[];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the prerendered [RSC](https://react.dev/reference/rsc/server-components)
|
||||
* stream for hydration. Usually passed directly to your
|
||||
* `react-server-dom-xyz/client`'s `createFromReadableStream`.
|
||||
*
|
||||
* @example
|
||||
* import { startTransition, StrictMode } from "react";
|
||||
* import { hydrateRoot } from "react-dom/client";
|
||||
* import {
|
||||
* unstable_getRSCStream as getRSCStream,
|
||||
* unstable_RSCHydratedRouter as RSCHydratedRouter,
|
||||
* } from "react-router";
|
||||
* import type { unstable_RSCPayload as RSCPayload } from "react-router";
|
||||
*
|
||||
* createFromReadableStream(getRSCStream()).then(
|
||||
* (payload: RSCServerPayload) => {
|
||||
* startTransition(async () => {
|
||||
* hydrateRoot(
|
||||
* document,
|
||||
* <StrictMode>
|
||||
* <RSCHydratedRouter {...props} />
|
||||
* </StrictMode>,
|
||||
* {
|
||||
* // Options
|
||||
* }
|
||||
* );
|
||||
* });
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* @name unstable_getRSCStream
|
||||
* @public
|
||||
* @category RSC
|
||||
* @mode data
|
||||
* @returns A [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
|
||||
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
|
||||
* data for hydration.
|
||||
*/
|
||||
declare function getRSCStream(): ReadableStream;
|
||||
|
||||
export { getRSCStream as g };
|
||||
2939
node_modules/react-router/dist/development/chunk-65XJMMLO.mjs
generated
vendored
Normal file
2939
node_modules/react-router/dist/development/chunk-65XJMMLO.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2089
node_modules/react-router/dist/development/chunk-EUCGRVHH.js
generated
vendored
Normal file
2089
node_modules/react-router/dist/development/chunk-EUCGRVHH.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8336
node_modules/react-router/dist/development/chunk-LZYTN6SO.js
generated
vendored
Normal file
8336
node_modules/react-router/dist/development/chunk-LZYTN6SO.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10348
node_modules/react-router/dist/development/chunk-NISHYRIK.mjs
generated
vendored
Normal file
10348
node_modules/react-router/dist/development/chunk-NISHYRIK.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2568
node_modules/react-router/dist/development/context-BqL5Eckq.d.mts
generated
vendored
Normal file
2568
node_modules/react-router/dist/development/context-BqL5Eckq.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
54
node_modules/react-router/dist/development/dom-export.d.mts
generated
vendored
Normal file
54
node_modules/react-router/dist/development/dom-export.d.mts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import * as React from 'react';
|
||||
import { R as RouterProviderProps$1, a as RouterInit, u as unstable_ClientOnErrorFunction } from './context-BqL5Eckq.mjs';
|
||||
import './browser-z32v5KVN.mjs';
|
||||
|
||||
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
||||
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
||||
|
||||
/**
|
||||
* Props for the {@link dom.HydratedRouter} component.
|
||||
*
|
||||
* @category Types
|
||||
*/
|
||||
interface HydratedRouterProps {
|
||||
/**
|
||||
* Context object to be passed through to {@link createBrowserRouter} and made
|
||||
* available to
|
||||
* [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
|
||||
* functions
|
||||
*/
|
||||
getContext?: RouterInit["getContext"];
|
||||
/**
|
||||
* An error handler function that will be called for any loader/action/render
|
||||
* errors that are encountered in your application. This is useful for
|
||||
* logging or reporting errors instead of the `ErrorBoundary` because it's not
|
||||
* subject to re-rendering and will only run one time per error.
|
||||
*
|
||||
* The `errorInfo` parameter is passed along from
|
||||
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
|
||||
* and is only present for render errors.
|
||||
*
|
||||
* ```tsx
|
||||
* <HydratedRouter unstable_onError={(error, errorInfo) => {
|
||||
* console.error(error, errorInfo);
|
||||
* reportToErrorService(error, errorInfo);
|
||||
* }} />
|
||||
* ```
|
||||
*/
|
||||
unstable_onError?: unstable_ClientOnErrorFunction;
|
||||
}
|
||||
/**
|
||||
* Framework-mode router component to be used to hydrate a router from a
|
||||
* {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
|
||||
*
|
||||
* @public
|
||||
* @category Framework Routers
|
||||
* @mode framework
|
||||
* @param props Props
|
||||
* @param {dom.HydratedRouterProps.getContext} props.getContext n/a
|
||||
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
|
||||
* @returns A React element that represents the hydrated application.
|
||||
*/
|
||||
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
||||
|
||||
export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps };
|
||||
53
node_modules/react-router/dist/development/dom-export.d.ts
generated
vendored
Normal file
53
node_modules/react-router/dist/development/dom-export.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import * as React from 'react';
|
||||
import { RouterProviderProps as RouterProviderProps$1, RouterInit, unstable_ClientOnErrorFunction } from 'react-router';
|
||||
|
||||
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
||||
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
||||
|
||||
/**
|
||||
* Props for the {@link dom.HydratedRouter} component.
|
||||
*
|
||||
* @category Types
|
||||
*/
|
||||
interface HydratedRouterProps {
|
||||
/**
|
||||
* Context object to be passed through to {@link createBrowserRouter} and made
|
||||
* available to
|
||||
* [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
|
||||
* functions
|
||||
*/
|
||||
getContext?: RouterInit["getContext"];
|
||||
/**
|
||||
* An error handler function that will be called for any loader/action/render
|
||||
* errors that are encountered in your application. This is useful for
|
||||
* logging or reporting errors instead of the `ErrorBoundary` because it's not
|
||||
* subject to re-rendering and will only run one time per error.
|
||||
*
|
||||
* The `errorInfo` parameter is passed along from
|
||||
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
|
||||
* and is only present for render errors.
|
||||
*
|
||||
* ```tsx
|
||||
* <HydratedRouter unstable_onError={(error, errorInfo) => {
|
||||
* console.error(error, errorInfo);
|
||||
* reportToErrorService(error, errorInfo);
|
||||
* }} />
|
||||
* ```
|
||||
*/
|
||||
unstable_onError?: unstable_ClientOnErrorFunction;
|
||||
}
|
||||
/**
|
||||
* Framework-mode router component to be used to hydrate a router from a
|
||||
* {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
|
||||
*
|
||||
* @public
|
||||
* @category Framework Routers
|
||||
* @mode framework
|
||||
* @param props Props
|
||||
* @param {dom.HydratedRouterProps.getContext} props.getContext n/a
|
||||
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
|
||||
* @returns A React element that represents the hydrated application.
|
||||
*/
|
||||
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
||||
|
||||
export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps };
|
||||
240
node_modules/react-router/dist/development/dom-export.js
generated
vendored
Normal file
240
node_modules/react-router/dist/development/dom-export.js
generated
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
|
||||
|
||||
var _chunkLZYTN6SOjs = require('./chunk-LZYTN6SO.js');
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
||||
var _reactdom = require('react-dom'); var ReactDOM = _interopRequireWildcard(_reactdom);
|
||||
var _reactrouter = require('react-router');
|
||||
function RouterProvider(props) {
|
||||
return /* @__PURE__ */ React.createElement(_reactrouter.RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (_optionalChain([importMap, 'optionalAccess', _ => _.textContent])) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
getContext
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
_reactrouter.UNSAFE_invariant.call(void 0, stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = _reactrouter.UNSAFE_decodeViaTurboStream.call(void 0, stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = _reactrouter.UNSAFE_createClientRoutes.call(void 0,
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
let { loaderData } = ssrInfo.context.state;
|
||||
if (_optionalChain([ssrInfo, 'access', _2 => _2.manifest, 'access', _3 => _3.routes, 'access', _4 => _4.root, 'optionalAccess', _5 => _5.hasLoader]) && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = _reactrouter.UNSAFE_getHydrationData.call(void 0, {
|
||||
state: ssrInfo.context.state,
|
||||
routes,
|
||||
getRouteInfo: (routeId) => ({
|
||||
clientLoader: _optionalChain([ssrInfo, 'access', _6 => _6.routeModules, 'access', _7 => _7[routeId], 'optionalAccess', _8 => _8.clientLoader]),
|
||||
hasLoader: _optionalChain([ssrInfo, 'access', _9 => _9.manifest, 'access', _10 => _10.routes, 'access', _11 => _11[routeId], 'optionalAccess', _12 => _12.hasLoader]) === true,
|
||||
hasHydrateFallback: _optionalChain([ssrInfo, 'access', _13 => _13.routeModules, 'access', _14 => _14[routeId], 'optionalAccess', _15 => _15.HydrateFallback]) != null
|
||||
}),
|
||||
location: window.location,
|
||||
basename: _optionalChain([window, 'access', _16 => _16.__reactRouterContext, 'optionalAccess', _17 => _17.basename]),
|
||||
isSpaMode: ssrInfo.context.isSpaMode
|
||||
});
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = _reactrouter.UNSAFE_deserializeErrors.call(void 0, hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = _reactrouter.UNSAFE_createRouter.call(void 0, {
|
||||
routes,
|
||||
history: _reactrouter.UNSAFE_createBrowserHistory.call(void 0, ),
|
||||
basename: ssrInfo.context.basename,
|
||||
getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties: _reactrouter.UNSAFE_hydrationRouteProperties,
|
||||
mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
|
||||
future: {
|
||||
middleware: ssrInfo.context.future.v8_middleware
|
||||
},
|
||||
dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
|
||||
() => router2,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename
|
||||
),
|
||||
patchRoutesOnNavigation: _reactrouter.UNSAFE_getPatchRoutesOnNavigationFunction.call(void 0,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
_reactrouter.UNSAFE_createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
getContext: props.getContext
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? _optionalChain([ssrInfo, 'optionalAccess', _18 => _18.context, 'access', _19 => _19.criticalCss]) : void 0
|
||||
);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
setCriticalCss(void 0);
|
||||
}
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${_chunkLZYTN6SOjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location]);
|
||||
_reactrouter.UNSAFE_invariant.call(void 0, ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
_reactrouter.UNSAFE_useFogOFWarDiscovery.call(void 0,
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
_reactrouter.UNSAFE_FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode,
|
||||
routeDiscovery: ssrInfo.context.routeDiscovery
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
||||
RouterProvider,
|
||||
{
|
||||
router,
|
||||
unstable_onError: props.unstable_onError
|
||||
}
|
||||
))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
exports.HydratedRouter = HydratedRouter; exports.RouterProvider = RouterProvider;
|
||||
240
node_modules/react-router/dist/development/dom-export.mjs
generated
vendored
Normal file
240
node_modules/react-router/dist/development/dom-export.mjs
generated
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
deserializeErrors,
|
||||
getHydrationData
|
||||
} from "./chunk-65XJMMLO.mjs";
|
||||
import {
|
||||
CRITICAL_CSS_DATA_ATTRIBUTE,
|
||||
FrameworkContext,
|
||||
RemixErrorBoundary,
|
||||
RouterProvider,
|
||||
createBrowserHistory,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createRouter,
|
||||
decodeViaTurboStream,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties,
|
||||
invariant,
|
||||
mapRouteProperties,
|
||||
useFogOFWarDiscovery
|
||||
} from "./chunk-NISHYRIK.mjs";
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
function RouterProvider2(props) {
|
||||
return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
import * as React2 from "react";
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (importMap?.textContent) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
getContext
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
invariant(stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = createClientRoutes(
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
let { loaderData } = ssrInfo.context.state;
|
||||
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = getHydrationData({
|
||||
state: ssrInfo.context.state,
|
||||
routes,
|
||||
getRouteInfo: (routeId) => ({
|
||||
clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
|
||||
hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
|
||||
hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
|
||||
}),
|
||||
location: window.location,
|
||||
basename: window.__reactRouterContext?.basename,
|
||||
isSpaMode: ssrInfo.context.isSpaMode
|
||||
});
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = deserializeErrors(hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = createRouter({
|
||||
routes,
|
||||
history: createBrowserHistory(),
|
||||
basename: ssrInfo.context.basename,
|
||||
getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties,
|
||||
mapRouteProperties,
|
||||
future: {
|
||||
middleware: ssrInfo.context.future.v8_middleware
|
||||
},
|
||||
dataStrategy: getTurboStreamSingleFetchDataStrategy(
|
||||
() => router2,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename
|
||||
),
|
||||
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
getContext: props.getContext
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
||||
);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
setCriticalCss(void 0);
|
||||
}
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location]);
|
||||
invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
useFogOFWarDiscovery(
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode,
|
||||
routeDiscovery: ssrInfo.context.routeDiscovery
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
||||
RouterProvider2,
|
||||
{
|
||||
router,
|
||||
unstable_onError: props.unstable_onError
|
||||
}
|
||||
))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
export {
|
||||
HydratedRouter,
|
||||
RouterProvider2 as RouterProvider
|
||||
};
|
||||
2525
node_modules/react-router/dist/development/index-react-server-client-2EDmGlsZ.d.mts
generated
vendored
Normal file
2525
node_modules/react-router/dist/development/index-react-server-client-2EDmGlsZ.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2524
node_modules/react-router/dist/development/index-react-server-client-DKvU8YRr.d.ts
generated
vendored
Normal file
2524
node_modules/react-router/dist/development/index-react-server-client-DKvU8YRr.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
node_modules/react-router/dist/development/index-react-server-client.d.mts
generated
vendored
Normal file
4
node_modules/react-router/dist/development/index-react-server-client.d.mts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { aE as MemoryRouter, aF as Navigate, aG as Outlet, aH as Route, aI as Router, aJ as RouterProvider, aK as Routes, ar as UNSAFE_AwaitContextProvider, b1 as UNSAFE_WithComponentProps, b5 as UNSAFE_WithErrorBoundaryProps, b3 as UNSAFE_WithHydrateFallbackProps } from './context-BqL5Eckq.mjs';
|
||||
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-2EDmGlsZ.mjs';
|
||||
import 'react';
|
||||
import './route-data-CDwqkzPE.mjs';
|
||||
3
node_modules/react-router/dist/development/index-react-server-client.d.ts
generated
vendored
Normal file
3
node_modules/react-router/dist/development/index-react-server-client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { aY as MemoryRouter, aZ as Navigate, a_ as Outlet, a$ as Route, b0 as Router, b1 as RouterProvider, b2 as Routes, aJ as UNSAFE_AwaitContextProvider, bs as UNSAFE_WithComponentProps, bw as UNSAFE_WithErrorBoundaryProps, bu as UNSAFE_WithHydrateFallbackProps } from './routeModules-BmVo7q9e.js';
|
||||
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-DKvU8YRr.js';
|
||||
import 'react';
|
||||
61
node_modules/react-router/dist/development/index-react-server-client.js
generated
vendored
Normal file
61
node_modules/react-router/dist/development/index-react-server-client.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var _chunkEUCGRVHHjs = require('./chunk-EUCGRVHH.js');
|
||||
|
||||
|
||||
|
||||
|
||||
var _chunkLZYTN6SOjs = require('./chunk-LZYTN6SO.js');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exports.BrowserRouter = _chunkEUCGRVHHjs.BrowserRouter; exports.Form = _chunkEUCGRVHHjs.Form; exports.HashRouter = _chunkEUCGRVHHjs.HashRouter; exports.Link = _chunkEUCGRVHHjs.Link; exports.Links = _chunkLZYTN6SOjs.Links; exports.MemoryRouter = _chunkEUCGRVHHjs.MemoryRouter; exports.Meta = _chunkLZYTN6SOjs.Meta; exports.NavLink = _chunkEUCGRVHHjs.NavLink; exports.Navigate = _chunkEUCGRVHHjs.Navigate; exports.Outlet = _chunkEUCGRVHHjs.Outlet; exports.Route = _chunkEUCGRVHHjs.Route; exports.Router = _chunkEUCGRVHHjs.Router; exports.RouterProvider = _chunkEUCGRVHHjs.RouterProvider; exports.Routes = _chunkEUCGRVHHjs.Routes; exports.ScrollRestoration = _chunkEUCGRVHHjs.ScrollRestoration; exports.StaticRouter = _chunkEUCGRVHHjs.StaticRouter; exports.StaticRouterProvider = _chunkEUCGRVHHjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkLZYTN6SOjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkEUCGRVHHjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkEUCGRVHHjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkEUCGRVHHjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkEUCGRVHHjs.HistoryRouter;
|
||||
59
node_modules/react-router/dist/development/index-react-server-client.mjs
generated
vendored
Normal file
59
node_modules/react-router/dist/development/index-react-server-client.mjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
AwaitContextProvider,
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
HistoryRouter,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Outlet,
|
||||
Route,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
ScrollRestoration,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
WithComponentProps,
|
||||
WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps
|
||||
} from "./chunk-NISHYRIK.mjs";
|
||||
export {
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Outlet,
|
||||
Route,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
ScrollRestoration,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
AwaitContextProvider as UNSAFE_AwaitContextProvider,
|
||||
WithComponentProps as UNSAFE_WithComponentProps,
|
||||
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
|
||||
HistoryRouter as unstable_HistoryRouter
|
||||
};
|
||||
2430
node_modules/react-router/dist/development/index-react-server.d.mts
generated
vendored
Normal file
2430
node_modules/react-router/dist/development/index-react-server.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2430
node_modules/react-router/dist/development/index-react-server.d.ts
generated
vendored
Normal file
2430
node_modules/react-router/dist/development/index-react-server.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3332
node_modules/react-router/dist/development/index-react-server.js
generated
vendored
Normal file
3332
node_modules/react-router/dist/development/index-react-server.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3221
node_modules/react-router/dist/development/index-react-server.mjs
generated
vendored
Normal file
3221
node_modules/react-router/dist/development/index-react-server.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1681
node_modules/react-router/dist/development/index.d.mts
generated
vendored
Normal file
1681
node_modules/react-router/dist/development/index.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1723
node_modules/react-router/dist/development/index.d.ts
generated
vendored
Normal file
1723
node_modules/react-router/dist/development/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3132
node_modules/react-router/dist/development/index.js
generated
vendored
Normal file
3132
node_modules/react-router/dist/development/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
275
node_modules/react-router/dist/development/index.mjs
generated
vendored
Normal file
275
node_modules/react-router/dist/development/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,275 @@
|
||||
/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
RSCDefaultRootErrorBoundary,
|
||||
RSCHydratedRouter,
|
||||
RSCStaticRouter,
|
||||
ServerMode,
|
||||
ServerRouter,
|
||||
createCallServer,
|
||||
createCookie,
|
||||
createCookieSessionStorage,
|
||||
createMemorySessionStorage,
|
||||
createRequestHandler,
|
||||
createRoutesStub,
|
||||
createSession,
|
||||
createSessionStorage,
|
||||
deserializeErrors,
|
||||
getHydrationData,
|
||||
getRSCStream,
|
||||
href,
|
||||
isCookie,
|
||||
isSession,
|
||||
routeRSCServerRequest,
|
||||
setDevServerHooks
|
||||
} from "./chunk-65XJMMLO.mjs";
|
||||
import {
|
||||
Action,
|
||||
Await,
|
||||
AwaitContextProvider,
|
||||
BrowserRouter,
|
||||
DataRouterContext,
|
||||
DataRouterStateContext,
|
||||
ErrorResponseImpl,
|
||||
FetchersContext,
|
||||
Form,
|
||||
FrameworkContext,
|
||||
HashRouter,
|
||||
HistoryRouter,
|
||||
IDLE_BLOCKER,
|
||||
IDLE_FETCHER,
|
||||
IDLE_NAVIGATION,
|
||||
Link,
|
||||
Links,
|
||||
LocationContext,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
NavigationContext,
|
||||
Outlet,
|
||||
PrefetchPageLinks,
|
||||
RemixErrorBoundary,
|
||||
Route,
|
||||
RouteContext,
|
||||
Router,
|
||||
RouterContextProvider,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
SingleFetchRedirectSymbol,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
ViewTransitionContext,
|
||||
WithComponentProps,
|
||||
WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps,
|
||||
createBrowserHistory,
|
||||
createBrowserRouter,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createContext,
|
||||
createHashRouter,
|
||||
createMemoryRouter,
|
||||
createPath,
|
||||
createRouter,
|
||||
createRoutesFromChildren,
|
||||
createRoutesFromElements,
|
||||
createSearchParams,
|
||||
createStaticHandler2 as createStaticHandler,
|
||||
createStaticRouter,
|
||||
data,
|
||||
decodeViaTurboStream,
|
||||
generatePath,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties,
|
||||
invariant,
|
||||
isRouteErrorResponse,
|
||||
mapRouteProperties,
|
||||
matchPath,
|
||||
matchRoutes,
|
||||
parsePath,
|
||||
redirect,
|
||||
redirectDocument,
|
||||
renderMatches,
|
||||
replace,
|
||||
resolvePath,
|
||||
shouldHydrateRouteLoader,
|
||||
useActionData,
|
||||
useAsyncError,
|
||||
useAsyncValue,
|
||||
useBeforeUnload,
|
||||
useBlocker,
|
||||
useFetcher,
|
||||
useFetchers,
|
||||
useFogOFWarDiscovery,
|
||||
useFormAction,
|
||||
useHref,
|
||||
useInRouterContext,
|
||||
useLinkClickHandler,
|
||||
useLoaderData,
|
||||
useLocation,
|
||||
useMatch,
|
||||
useMatches,
|
||||
useNavigate,
|
||||
useNavigation,
|
||||
useNavigationType,
|
||||
useOutlet,
|
||||
useOutletContext,
|
||||
useParams,
|
||||
usePrompt,
|
||||
useResolvedPath,
|
||||
useRevalidator,
|
||||
useRouteError,
|
||||
useRouteLoaderData,
|
||||
useRoutes,
|
||||
useScrollRestoration,
|
||||
useSearchParams,
|
||||
useSubmit,
|
||||
useViewTransitionState,
|
||||
withComponentProps,
|
||||
withErrorBoundaryProps,
|
||||
withHydrateFallbackProps
|
||||
} from "./chunk-NISHYRIK.mjs";
|
||||
export {
|
||||
Await,
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
IDLE_BLOCKER,
|
||||
IDLE_FETCHER,
|
||||
IDLE_NAVIGATION,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Action as NavigationType,
|
||||
Outlet,
|
||||
PrefetchPageLinks,
|
||||
Route,
|
||||
Router,
|
||||
RouterContextProvider,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
ServerRouter,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
AwaitContextProvider as UNSAFE_AwaitContextProvider,
|
||||
DataRouterContext as UNSAFE_DataRouterContext,
|
||||
DataRouterStateContext as UNSAFE_DataRouterStateContext,
|
||||
ErrorResponseImpl as UNSAFE_ErrorResponseImpl,
|
||||
FetchersContext as UNSAFE_FetchersContext,
|
||||
FrameworkContext as UNSAFE_FrameworkContext,
|
||||
LocationContext as UNSAFE_LocationContext,
|
||||
NavigationContext as UNSAFE_NavigationContext,
|
||||
RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary,
|
||||
RemixErrorBoundary as UNSAFE_RemixErrorBoundary,
|
||||
RouteContext as UNSAFE_RouteContext,
|
||||
ServerMode as UNSAFE_ServerMode,
|
||||
SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol,
|
||||
ViewTransitionContext as UNSAFE_ViewTransitionContext,
|
||||
WithComponentProps as UNSAFE_WithComponentProps,
|
||||
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
|
||||
createBrowserHistory as UNSAFE_createBrowserHistory,
|
||||
createClientRoutes as UNSAFE_createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
||||
createRouter as UNSAFE_createRouter,
|
||||
decodeViaTurboStream as UNSAFE_decodeViaTurboStream,
|
||||
deserializeErrors as UNSAFE_deserializeErrors,
|
||||
getHydrationData as UNSAFE_getHydrationData,
|
||||
getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties as UNSAFE_hydrationRouteProperties,
|
||||
invariant as UNSAFE_invariant,
|
||||
mapRouteProperties as UNSAFE_mapRouteProperties,
|
||||
shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader,
|
||||
useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery,
|
||||
useScrollRestoration as UNSAFE_useScrollRestoration,
|
||||
withComponentProps as UNSAFE_withComponentProps,
|
||||
withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps,
|
||||
withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps,
|
||||
createBrowserRouter,
|
||||
createContext,
|
||||
createCookie,
|
||||
createCookieSessionStorage,
|
||||
createHashRouter,
|
||||
createMemoryRouter,
|
||||
createMemorySessionStorage,
|
||||
createPath,
|
||||
createRequestHandler,
|
||||
createRoutesFromChildren,
|
||||
createRoutesFromElements,
|
||||
createRoutesStub,
|
||||
createSearchParams,
|
||||
createSession,
|
||||
createSessionStorage,
|
||||
createStaticHandler,
|
||||
createStaticRouter,
|
||||
data,
|
||||
generatePath,
|
||||
href,
|
||||
isCookie,
|
||||
isRouteErrorResponse,
|
||||
isSession,
|
||||
matchPath,
|
||||
matchRoutes,
|
||||
parsePath,
|
||||
redirect,
|
||||
redirectDocument,
|
||||
renderMatches,
|
||||
replace,
|
||||
resolvePath,
|
||||
HistoryRouter as unstable_HistoryRouter,
|
||||
RSCHydratedRouter as unstable_RSCHydratedRouter,
|
||||
RSCStaticRouter as unstable_RSCStaticRouter,
|
||||
createCallServer as unstable_createCallServer,
|
||||
getRSCStream as unstable_getRSCStream,
|
||||
routeRSCServerRequest as unstable_routeRSCServerRequest,
|
||||
setDevServerHooks as unstable_setDevServerHooks,
|
||||
usePrompt as unstable_usePrompt,
|
||||
useActionData,
|
||||
useAsyncError,
|
||||
useAsyncValue,
|
||||
useBeforeUnload,
|
||||
useBlocker,
|
||||
useFetcher,
|
||||
useFetchers,
|
||||
useFormAction,
|
||||
useHref,
|
||||
useInRouterContext,
|
||||
useLinkClickHandler,
|
||||
useLoaderData,
|
||||
useLocation,
|
||||
useMatch,
|
||||
useMatches,
|
||||
useNavigate,
|
||||
useNavigation,
|
||||
useNavigationType,
|
||||
useOutlet,
|
||||
useOutletContext,
|
||||
useParams,
|
||||
useResolvedPath,
|
||||
useRevalidator,
|
||||
useRouteError,
|
||||
useRouteLoaderData,
|
||||
useRoutes,
|
||||
useSearchParams,
|
||||
useSubmit,
|
||||
useViewTransitionState
|
||||
};
|
||||
185
node_modules/react-router/dist/development/lib/types/internal.d.mts
generated
vendored
Normal file
185
node_modules/react-router/dist/development/lib/types/internal.d.mts
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-CDwqkzPE.mjs';
|
||||
import { L as Location, M as MiddlewareNextFunction, D as DataStrategyResult } from '../../context-BqL5Eckq.mjs';
|
||||
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
|
||||
import 'react';
|
||||
|
||||
type MaybePromise<T> = T | Promise<T>;
|
||||
type Props = {
|
||||
params: unknown;
|
||||
loaderData: unknown;
|
||||
actionData: unknown;
|
||||
};
|
||||
type RouteInfo = Props & {
|
||||
module: RouteModule;
|
||||
matches: Array<MatchInfo>;
|
||||
};
|
||||
type MatchInfo = {
|
||||
id: string;
|
||||
module: RouteModule;
|
||||
};
|
||||
type MetaMatch<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
meta: MetaDescriptor[];
|
||||
/** @deprecated Use `MetaMatch.loaderData` instead */
|
||||
data: GetLoaderData<T["module"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
handle?: unknown;
|
||||
error?: unknown;
|
||||
}>;
|
||||
type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
|
||||
type HasErrorBoundary<T extends RouteInfo> = T["module"] extends {
|
||||
ErrorBoundary: Func;
|
||||
} ? true : false;
|
||||
type CreateMetaArgs<T extends RouteInfo> = {
|
||||
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
||||
location: Location;
|
||||
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
|
||||
params: T["params"];
|
||||
/**
|
||||
* The return value for this route's server loader function
|
||||
*
|
||||
* @deprecated Use `Route.MetaArgs.loaderData` instead
|
||||
*/
|
||||
data: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
|
||||
/** The return value for this route's server loader function */
|
||||
loaderData: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
|
||||
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
|
||||
error?: unknown;
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: MetaMatches<T["matches"]>;
|
||||
};
|
||||
type MetaDescriptors = MetaDescriptor[];
|
||||
type HeadersArgs = {
|
||||
loaderHeaders: Headers;
|
||||
parentHeaders: Headers;
|
||||
actionHeaders: Headers;
|
||||
errorHeaders: Headers | undefined;
|
||||
};
|
||||
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
|
||||
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Record<string, DataStrategyResult>>) => MaybePromise<Record<string, DataStrategyResult> | void>;
|
||||
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
|
||||
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
|
||||
};
|
||||
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
||||
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
||||
};
|
||||
type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
|
||||
ServerComponent: Func;
|
||||
} ? true : false : false;
|
||||
type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
params: T["params"];
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData?: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type Match<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
/** @deprecated Use `Match.loaderData` instead */
|
||||
data: GetLoaderData<T["module"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
handle: unknown;
|
||||
}>;
|
||||
type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
|
||||
type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export default function Component({
|
||||
* params,
|
||||
* }: Route.ComponentProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: Matches<T["matches"]>;
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function ErrorBoundary({
|
||||
* params,
|
||||
* }: Route.ErrorBoundaryProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
error: unknown;
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData?: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
LinkDescriptors: LinkDescriptor[];
|
||||
LinksFunction: () => LinkDescriptor[];
|
||||
MetaArgs: CreateMetaArgs<Info>;
|
||||
MetaDescriptors: MetaDescriptors;
|
||||
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
||||
HeadersArgs: HeadersArgs;
|
||||
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
||||
MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
||||
ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
||||
LoaderArgs: CreateServerLoaderArgs<Info>;
|
||||
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
||||
ActionArgs: CreateServerActionArgs<Info>;
|
||||
ClientActionArgs: CreateClientActionArgs<Info>;
|
||||
HydrateFallbackProps: CreateHydrateFallbackProps<Info, RSCEnabled>;
|
||||
ComponentProps: CreateComponentProps<Info, RSCEnabled>;
|
||||
ErrorBoundaryProps: CreateErrorBoundaryProps<Info, RSCEnabled>;
|
||||
};
|
||||
|
||||
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
||||
|
||||
type GetInfo<T extends {
|
||||
file: keyof RouteFiles;
|
||||
module: RouteModule;
|
||||
}> = {
|
||||
params: Params<T["file"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
actionData: GetActionData<T["module"]>;
|
||||
};
|
||||
|
||||
export type { GetAnnotations, GetInfo };
|
||||
184
node_modules/react-router/dist/development/lib/types/internal.d.ts
generated
vendored
Normal file
184
node_modules/react-router/dist/development/lib/types/internal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
import { R as RouteModule, L as LinkDescriptor, a as Location, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, b as MiddlewareNextFunction, C as ClientDataFunctionArgs, D as DataStrategyResult, c as ServerDataFrom, N as Normalize, d as GetActionData } from '../../routeModules-BmVo7q9e.js';
|
||||
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.js';
|
||||
import 'react';
|
||||
|
||||
type MaybePromise<T> = T | Promise<T>;
|
||||
type Props = {
|
||||
params: unknown;
|
||||
loaderData: unknown;
|
||||
actionData: unknown;
|
||||
};
|
||||
type RouteInfo = Props & {
|
||||
module: RouteModule;
|
||||
matches: Array<MatchInfo>;
|
||||
};
|
||||
type MatchInfo = {
|
||||
id: string;
|
||||
module: RouteModule;
|
||||
};
|
||||
type MetaMatch<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
meta: MetaDescriptor[];
|
||||
/** @deprecated Use `MetaMatch.loaderData` instead */
|
||||
data: GetLoaderData<T["module"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
handle?: unknown;
|
||||
error?: unknown;
|
||||
}>;
|
||||
type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
|
||||
type HasErrorBoundary<T extends RouteInfo> = T["module"] extends {
|
||||
ErrorBoundary: Func;
|
||||
} ? true : false;
|
||||
type CreateMetaArgs<T extends RouteInfo> = {
|
||||
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
||||
location: Location;
|
||||
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
|
||||
params: T["params"];
|
||||
/**
|
||||
* The return value for this route's server loader function
|
||||
*
|
||||
* @deprecated Use `Route.MetaArgs.loaderData` instead
|
||||
*/
|
||||
data: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
|
||||
/** The return value for this route's server loader function */
|
||||
loaderData: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
|
||||
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
|
||||
error?: unknown;
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: MetaMatches<T["matches"]>;
|
||||
};
|
||||
type MetaDescriptors = MetaDescriptor[];
|
||||
type HeadersArgs = {
|
||||
loaderHeaders: Headers;
|
||||
parentHeaders: Headers;
|
||||
actionHeaders: Headers;
|
||||
errorHeaders: Headers | undefined;
|
||||
};
|
||||
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
|
||||
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Record<string, DataStrategyResult>>) => MaybePromise<Record<string, DataStrategyResult> | void>;
|
||||
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
|
||||
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
|
||||
};
|
||||
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
||||
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
||||
};
|
||||
type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
|
||||
ServerComponent: Func;
|
||||
} ? true : false : false;
|
||||
type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
params: T["params"];
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData?: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type Match<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
/** @deprecated Use `Match.loaderData` instead */
|
||||
data: GetLoaderData<T["module"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
handle: unknown;
|
||||
}>;
|
||||
type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
|
||||
type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export default function Component({
|
||||
* params,
|
||||
* }: Route.ComponentProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: Matches<T["matches"]>;
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function ErrorBoundary({
|
||||
* params,
|
||||
* }: Route.ErrorBoundaryProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
error: unknown;
|
||||
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
|
||||
/** The data returned from the `loader` */
|
||||
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
||||
/** The data returned from the `action` following an action submission. */
|
||||
actionData?: ServerDataFrom<T["module"]["action"]>;
|
||||
} : {
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData?: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
});
|
||||
type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
|
||||
LinkDescriptors: LinkDescriptor[];
|
||||
LinksFunction: () => LinkDescriptor[];
|
||||
MetaArgs: CreateMetaArgs<Info>;
|
||||
MetaDescriptors: MetaDescriptors;
|
||||
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
||||
HeadersArgs: HeadersArgs;
|
||||
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
||||
MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
||||
ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
||||
LoaderArgs: CreateServerLoaderArgs<Info>;
|
||||
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
||||
ActionArgs: CreateServerActionArgs<Info>;
|
||||
ClientActionArgs: CreateClientActionArgs<Info>;
|
||||
HydrateFallbackProps: CreateHydrateFallbackProps<Info, RSCEnabled>;
|
||||
ComponentProps: CreateComponentProps<Info, RSCEnabled>;
|
||||
ErrorBoundaryProps: CreateErrorBoundaryProps<Info, RSCEnabled>;
|
||||
};
|
||||
|
||||
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
||||
|
||||
type GetInfo<T extends {
|
||||
file: keyof RouteFiles;
|
||||
module: RouteModule;
|
||||
}> = {
|
||||
params: Params<T["file"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
actionData: GetActionData<T["module"]>;
|
||||
};
|
||||
|
||||
export type { GetAnnotations, GetInfo };
|
||||
10
node_modules/react-router/dist/development/lib/types/internal.js
generated
vendored
Normal file
10
node_modules/react-router/dist/development/lib/types/internal.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
10
node_modules/react-router/dist/development/lib/types/internal.mjs
generated
vendored
Normal file
10
node_modules/react-router/dist/development/lib/types/internal.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* react-router v7.9.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.mts
generated
vendored
Normal file
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.mts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
||||
* React Router should handle this for you via type generation.
|
||||
*
|
||||
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
||||
*/
|
||||
interface Register {
|
||||
}
|
||||
type AnyParams = Record<string, string | undefined>;
|
||||
type AnyPages = Record<string, {
|
||||
params: AnyParams;
|
||||
}>;
|
||||
type Pages = Register extends {
|
||||
pages: infer Registered extends AnyPages;
|
||||
} ? Registered : AnyPages;
|
||||
type AnyRouteFiles = Record<string, {
|
||||
id: string;
|
||||
page: string;
|
||||
}>;
|
||||
type RouteFiles = Register extends {
|
||||
routeFiles: infer Registered extends AnyRouteFiles;
|
||||
} ? Registered : AnyRouteFiles;
|
||||
|
||||
export type { Pages as P, RouteFiles as R, Register as a };
|
||||
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.ts
generated
vendored
Normal file
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
||||
* React Router should handle this for you via type generation.
|
||||
*
|
||||
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
||||
*/
|
||||
interface Register {
|
||||
}
|
||||
type AnyParams = Record<string, string | undefined>;
|
||||
type AnyPages = Record<string, {
|
||||
params: AnyParams;
|
||||
}>;
|
||||
type Pages = Register extends {
|
||||
pages: infer Registered extends AnyPages;
|
||||
} ? Registered : AnyPages;
|
||||
type AnyRouteFiles = Record<string, {
|
||||
id: string;
|
||||
page: string;
|
||||
}>;
|
||||
type RouteFiles = Register extends {
|
||||
routeFiles: infer Registered extends AnyRouteFiles;
|
||||
} ? Registered : AnyRouteFiles;
|
||||
|
||||
export type { Pages as P, RouteFiles as R, Register as a };
|
||||
473
node_modules/react-router/dist/development/route-data-CDwqkzPE.d.mts
generated
vendored
Normal file
473
node_modules/react-router/dist/development/route-data-CDwqkzPE.d.mts
generated
vendored
Normal file
@@ -0,0 +1,473 @@
|
||||
import { ComponentType, ReactElement } from 'react';
|
||||
import { A as ActionFunctionArgs, b as LoaderFunctionArgs, c as ActionFunction, d as LoaderFunction, P as Params, L as Location, e as DataRouteMatch, f as MiddlewareFunction, D as DataStrategyResult, S as ShouldRevalidateFunction, g as RouterContextProvider, h as DataWithResponseInit, i as MiddlewareEnabled } from './context-BqL5Eckq.mjs';
|
||||
|
||||
/**
|
||||
* An object of unknown type for route loaders and actions provided by the
|
||||
* server's `getLoadContext()` function. This is defined as an empty interface
|
||||
* specifically so apps can leverage declaration merging to augment this type
|
||||
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
||||
*/
|
||||
interface AppLoadContext {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
||||
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
||||
interface HtmlLinkProps {
|
||||
/**
|
||||
* Address of the hyperlink
|
||||
*/
|
||||
href?: string;
|
||||
/**
|
||||
* How the element handles crossorigin requests
|
||||
*/
|
||||
crossOrigin?: "anonymous" | "use-credentials";
|
||||
/**
|
||||
* Relationship between the document containing the hyperlink and the destination resource
|
||||
*/
|
||||
rel: LiteralUnion<"alternate" | "dns-prefetch" | "icon" | "manifest" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "search" | "stylesheet", string>;
|
||||
/**
|
||||
* Applicable media: "screen", "print", "(max-width: 764px)"
|
||||
*/
|
||||
media?: string;
|
||||
/**
|
||||
* Integrity metadata used in Subresource Integrity checks
|
||||
*/
|
||||
integrity?: string;
|
||||
/**
|
||||
* Language of the linked resource
|
||||
*/
|
||||
hrefLang?: string;
|
||||
/**
|
||||
* Hint for the type of the referenced resource
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* Referrer policy for fetches initiated by the element
|
||||
*/
|
||||
referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
|
||||
/**
|
||||
* Sizes of the icons (for rel="icon")
|
||||
*/
|
||||
sizes?: string;
|
||||
/**
|
||||
* Potential destination for a preload request (for rel="preload" and rel="modulepreload")
|
||||
*/
|
||||
as?: LiteralUnion<"audio" | "audioworklet" | "document" | "embed" | "fetch" | "font" | "frame" | "iframe" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "serviceworker" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt", string>;
|
||||
/**
|
||||
* Color to use when customizing a site's icon (for rel="mask-icon")
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Whether the link is disabled
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* The title attribute has special semantics on this element: Title of the link; CSS style sheet set name.
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Images to use in different situations, e.g., high-resolution displays,
|
||||
* small monitors, etc. (for rel="preload")
|
||||
*/
|
||||
imageSrcSet?: string;
|
||||
/**
|
||||
* Image sizes for different page layouts (for rel="preload")
|
||||
*/
|
||||
imageSizes?: string;
|
||||
}
|
||||
interface HtmlLinkPreloadImage extends HtmlLinkProps {
|
||||
/**
|
||||
* Relationship between the document containing the hyperlink and the destination resource
|
||||
*/
|
||||
rel: "preload";
|
||||
/**
|
||||
* Potential destination for a preload request (for rel="preload" and rel="modulepreload")
|
||||
*/
|
||||
as: "image";
|
||||
/**
|
||||
* Address of the hyperlink
|
||||
*/
|
||||
href?: string;
|
||||
/**
|
||||
* Images to use in different situations, e.g., high-resolution displays,
|
||||
* small monitors, etc. (for rel="preload")
|
||||
*/
|
||||
imageSrcSet: string;
|
||||
/**
|
||||
* Image sizes for different page layouts (for rel="preload")
|
||||
*/
|
||||
imageSizes?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a `<link>` element.
|
||||
*
|
||||
* WHATWG Specification: https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
|
||||
*/
|
||||
type HtmlLinkDescriptor = (HtmlLinkProps & Pick<Required<HtmlLinkProps>, "href">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "imageSizes">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "href"> & {
|
||||
imageSizes?: never;
|
||||
});
|
||||
interface PageLinkDescriptor extends Omit<HtmlLinkDescriptor, "href" | "rel" | "type" | "sizes" | "imageSrcSet" | "imageSizes" | "as" | "color" | "title"> {
|
||||
/**
|
||||
* A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
|
||||
* attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
|
||||
* element
|
||||
*/
|
||||
nonce?: string | undefined;
|
||||
/**
|
||||
* The absolute path of the page to prefetch, e.g. `/absolute/path`.
|
||||
*/
|
||||
page: string;
|
||||
}
|
||||
type LinkDescriptor = HtmlLinkDescriptor | PageLinkDescriptor;
|
||||
|
||||
interface RouteModules {
|
||||
[routeId: string]: RouteModule$1 | undefined;
|
||||
}
|
||||
/**
|
||||
* The shape of a route module shipped to the client
|
||||
*/
|
||||
interface RouteModule$1 {
|
||||
clientAction?: ClientActionFunction;
|
||||
clientLoader?: ClientLoaderFunction;
|
||||
clientMiddleware?: MiddlewareFunction<Record<string, DataStrategyResult>>[];
|
||||
ErrorBoundary?: ErrorBoundaryComponent;
|
||||
HydrateFallback?: HydrateFallbackComponent;
|
||||
Layout?: LayoutComponent;
|
||||
default: RouteComponent;
|
||||
handle?: RouteHandle;
|
||||
links?: LinksFunction;
|
||||
meta?: MetaFunction;
|
||||
shouldRevalidate?: ShouldRevalidateFunction;
|
||||
}
|
||||
/**
|
||||
* The shape of a route module on the server
|
||||
*/
|
||||
interface ServerRouteModule extends RouteModule$1 {
|
||||
action?: ActionFunction;
|
||||
headers?: HeadersFunction | {
|
||||
[name: string]: string;
|
||||
};
|
||||
loader?: LoaderFunction;
|
||||
middleware?: MiddlewareFunction<Response>[];
|
||||
}
|
||||
/**
|
||||
* A function that handles data mutations for a route on the client
|
||||
*/
|
||||
type ClientActionFunction = (args: ClientActionFunctionArgs) => ReturnType<ActionFunction>;
|
||||
/**
|
||||
* Arguments passed to a route `clientAction` function
|
||||
*/
|
||||
type ClientActionFunctionArgs = ActionFunctionArgs & {
|
||||
serverAction: <T = unknown>() => Promise<SerializeFrom<T>>;
|
||||
};
|
||||
/**
|
||||
* A function that loads data for a route on the client
|
||||
*/
|
||||
type ClientLoaderFunction = ((args: ClientLoaderFunctionArgs) => ReturnType<LoaderFunction>) & {
|
||||
hydrate?: boolean;
|
||||
};
|
||||
/**
|
||||
* Arguments passed to a route `clientLoader` function
|
||||
*/
|
||||
type ClientLoaderFunctionArgs = LoaderFunctionArgs & {
|
||||
serverLoader: <T = unknown>() => Promise<SerializeFrom<T>>;
|
||||
};
|
||||
/**
|
||||
* ErrorBoundary to display for this route
|
||||
*/
|
||||
type ErrorBoundaryComponent = ComponentType;
|
||||
type HeadersArgs = {
|
||||
loaderHeaders: Headers;
|
||||
parentHeaders: Headers;
|
||||
actionHeaders: Headers;
|
||||
errorHeaders: Headers | undefined;
|
||||
};
|
||||
/**
|
||||
* A function that returns HTTP headers to be used for a route. These headers
|
||||
* will be merged with (and take precedence over) headers from parent routes.
|
||||
*/
|
||||
interface HeadersFunction {
|
||||
(args: HeadersArgs): Headers | HeadersInit;
|
||||
}
|
||||
/**
|
||||
* `<Route HydrateFallback>` component to render on initial loads
|
||||
* when client loaders are present
|
||||
*/
|
||||
type HydrateFallbackComponent = ComponentType;
|
||||
/**
|
||||
* Optional, root-only `<Route Layout>` component to wrap the root content in.
|
||||
* Useful for defining the <html>/<head>/<body> document shell shared by the
|
||||
* Component, HydrateFallback, and ErrorBoundary
|
||||
*/
|
||||
type LayoutComponent = ComponentType<{
|
||||
children: ReactElement<unknown, ErrorBoundaryComponent | HydrateFallbackComponent | RouteComponent>;
|
||||
}>;
|
||||
/**
|
||||
* A function that defines `<link>` tags to be inserted into the `<head>` of
|
||||
* the document on route transitions.
|
||||
*
|
||||
* @see https://remix.run/route/meta
|
||||
*/
|
||||
interface LinksFunction {
|
||||
(): LinkDescriptor[];
|
||||
}
|
||||
interface MetaMatch<RouteId extends string = string, Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown> {
|
||||
id: RouteId;
|
||||
pathname: DataRouteMatch["pathname"];
|
||||
/** @deprecated Use `MetaMatch.loaderData` instead */
|
||||
data: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
|
||||
loaderData: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
|
||||
handle?: RouteHandle;
|
||||
params: DataRouteMatch["params"];
|
||||
meta: MetaDescriptor[];
|
||||
error?: unknown;
|
||||
}
|
||||
type MetaMatches<MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> = Array<{
|
||||
[K in keyof MatchLoaders]: MetaMatch<Exclude<K, number | symbol>, MatchLoaders[K]>;
|
||||
}[keyof MatchLoaders]>;
|
||||
interface MetaArgs<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
|
||||
/** @deprecated Use `MetaArgs.loaderData` instead */
|
||||
data: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
|
||||
loaderData: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
|
||||
params: Params;
|
||||
location: Location;
|
||||
matches: MetaMatches<MatchLoaders>;
|
||||
error?: unknown;
|
||||
}
|
||||
/**
|
||||
* A function that returns an array of data objects to use for rendering
|
||||
* metadata HTML tags in a route. These tags are not rendered on descendant
|
||||
* routes in the route hierarchy. In other words, they will only be rendered on
|
||||
* the route in which they are exported.
|
||||
*
|
||||
* @param Loader - The type of the current route's loader function
|
||||
* @param MatchLoaders - Mapping from a parent route's filepath to its loader
|
||||
* function type
|
||||
*
|
||||
* Note that parent route filepaths are relative to the `app/` directory.
|
||||
*
|
||||
* For example, if this meta function is for `/sales/customers/$customerId`:
|
||||
*
|
||||
* ```ts
|
||||
* // app/root.tsx
|
||||
* const loader = () => ({ hello: "world" })
|
||||
* export type Loader = typeof loader
|
||||
*
|
||||
* // app/routes/sales.tsx
|
||||
* const loader = () => ({ salesCount: 1074 })
|
||||
* export type Loader = typeof loader
|
||||
*
|
||||
* // app/routes/sales/customers.tsx
|
||||
* const loader = () => ({ customerCount: 74 })
|
||||
* export type Loader = typeof loader
|
||||
*
|
||||
* // app/routes/sales/customers/$customersId.tsx
|
||||
* import type { Loader as RootLoader } from "../../../root"
|
||||
* import type { Loader as SalesLoader } from "../../sales"
|
||||
* import type { Loader as CustomersLoader } from "../../sales/customers"
|
||||
*
|
||||
* const loader = () => ({ name: "Customer name" })
|
||||
*
|
||||
* const meta: MetaFunction<typeof loader, {
|
||||
* "root": RootLoader,
|
||||
* "routes/sales": SalesLoader,
|
||||
* "routes/sales/customers": CustomersLoader,
|
||||
* }> = ({ data, matches }) => {
|
||||
* const { name } = data
|
||||
* // ^? string
|
||||
* const { customerCount } = matches.find((match) => match.id === "routes/sales/customers").data
|
||||
* // ^? number
|
||||
* const { salesCount } = matches.find((match) => match.id === "routes/sales").data
|
||||
* // ^? number
|
||||
* const { hello } = matches.find((match) => match.id === "root").data
|
||||
* // ^? "world"
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface MetaFunction<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
|
||||
(args: MetaArgs<Loader, MatchLoaders>): MetaDescriptor[] | undefined;
|
||||
}
|
||||
type MetaDescriptor = {
|
||||
charSet: "utf-8";
|
||||
} | {
|
||||
title: string;
|
||||
} | {
|
||||
name: string;
|
||||
content: string;
|
||||
} | {
|
||||
property: string;
|
||||
content: string;
|
||||
} | {
|
||||
httpEquiv: string;
|
||||
content: string;
|
||||
} | {
|
||||
"script:ld+json": LdJsonObject;
|
||||
} | {
|
||||
tagName: "meta" | "link";
|
||||
[name: string]: string;
|
||||
} | {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
type LdJsonObject = {
|
||||
[Key in string]: LdJsonValue;
|
||||
} & {
|
||||
[Key in string]?: LdJsonValue | undefined;
|
||||
};
|
||||
type LdJsonArray = LdJsonValue[] | readonly LdJsonValue[];
|
||||
type LdJsonPrimitive = string | number | boolean | null;
|
||||
type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
||||
/**
|
||||
* A React component that is rendered for a route.
|
||||
*/
|
||||
type RouteComponent = ComponentType<{}>;
|
||||
/**
|
||||
* An arbitrary object that is associated with a route.
|
||||
*
|
||||
* @see https://remix.run/route/handle
|
||||
*/
|
||||
type RouteHandle = unknown;
|
||||
|
||||
type Serializable = undefined | null | boolean | string | symbol | number | Array<Serializable> | {
|
||||
[key: PropertyKey]: Serializable;
|
||||
} | bigint | Date | URL | RegExp | Error | Map<Serializable, Serializable> | Set<Serializable> | Promise<Serializable>;
|
||||
|
||||
type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
|
||||
type IsAny<T> = 0 extends 1 & T ? true : false;
|
||||
type Func = (...args: any[]) => unknown;
|
||||
type Pretty<T> = {
|
||||
[K in keyof T]: T[K];
|
||||
} & {};
|
||||
type Normalize<T> = _Normalize<UnionKeys<T>, T>;
|
||||
type _Normalize<Key extends keyof any, T> = T extends infer U ? Pretty<{
|
||||
[K in Key as K extends keyof U ? undefined extends U[K] ? never : K : never]: K extends keyof U ? U[K] : never;
|
||||
} & {
|
||||
[K in Key as K extends keyof U ? undefined extends U[K] ? K : never : never]?: K extends keyof U ? U[K] : never;
|
||||
} & {
|
||||
[K in Key as K extends keyof U ? never : K]?: undefined;
|
||||
}> : never;
|
||||
type UnionKeys<T> = T extends any ? keyof T : never;
|
||||
|
||||
type RouteModule = {
|
||||
meta?: Func;
|
||||
links?: Func;
|
||||
headers?: Func;
|
||||
loader?: Func;
|
||||
clientLoader?: Func;
|
||||
action?: Func;
|
||||
clientAction?: Func;
|
||||
HydrateFallback?: Func;
|
||||
default?: Func;
|
||||
ErrorBoundary?: Func;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* A brand that can be applied to a type to indicate that it will serialize
|
||||
* to a specific type when transported to the client from a loader.
|
||||
* Only use this if you have additional serialization/deserialization logic
|
||||
* in your application.
|
||||
*/
|
||||
type unstable_SerializesTo<T> = {
|
||||
unstable__ReactRouter_SerializesTo: [T];
|
||||
};
|
||||
|
||||
type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
|
||||
[K in keyof T]: Serialize<T[K]>;
|
||||
} : undefined;
|
||||
type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
|
||||
type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Func ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
|
||||
type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? U : T;
|
||||
type ServerData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
|
||||
type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
||||
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
||||
type ClientDataFunctionArgs<Params> = {
|
||||
/**
|
||||
* A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
|
||||
*
|
||||
* @note Because client data functions are called before a network request is made, the Request object does not include the headers which the browser automatically adds. React Router infers the "content-type" header from the enc-type of the form that performed the submission.
|
||||
**/
|
||||
request: Request;
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function clientLoader({
|
||||
* params,
|
||||
* }: Route.ClientLoaderArgs) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: Params;
|
||||
/**
|
||||
* When `future.v8_middleware` is not enabled, this is undefined.
|
||||
*
|
||||
* When `future.v8_middleware` is enabled, this is an instance of
|
||||
* `RouterContextProvider` and can be used to access context values
|
||||
* from your route middlewares. You may pass in initial context values in your
|
||||
* `<HydratedRouter getContext>` prop
|
||||
*/
|
||||
context: Readonly<RouterContextProvider>;
|
||||
};
|
||||
type ServerDataFunctionArgs<Params> = {
|
||||
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the url, method, headers (such as cookies), and request body from the request. */
|
||||
request: Request;
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function loader({
|
||||
* params,
|
||||
* }: Route.LoaderArgs) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: Params;
|
||||
/**
|
||||
* Without `future.v8_middleware` enabled, this is the context passed in
|
||||
* to your server adapter's `getLoadContext` function. It's a way to bridge the
|
||||
* gap between the adapter's request/response API with your React Router app.
|
||||
* It is only applicable if you are using a custom server adapter.
|
||||
*
|
||||
* With `future.v8_middleware` enabled, this is an instance of
|
||||
* `RouterContextProvider` and can be used for type-safe access to
|
||||
* context value set in your route middlewares. If you are using a custom
|
||||
* server adapter, you may provide an initial set of context values from your
|
||||
* `getLoadContext` function.
|
||||
*/
|
||||
context: MiddlewareEnabled extends true ? Readonly<RouterContextProvider> : AppLoadContext;
|
||||
};
|
||||
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [
|
||||
ClientLoaderFunctionArgs | ClientActionFunctionArgs | ClientDataFunctionArgs<unknown>
|
||||
] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
||||
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
||||
type IsHydrate<ClientLoader> = ClientLoader extends {
|
||||
hydrate: true;
|
||||
} ? true : ClientLoader extends {
|
||||
hydrate: false;
|
||||
} ? false : false;
|
||||
type GetLoaderData<T extends RouteModule> = _DataLoaderData<ServerDataFrom<T["loader"]>, ClientDataFrom<T["clientLoader"]>, IsHydrate<T["clientLoader"]>, T extends {
|
||||
HydrateFallback: Func;
|
||||
} ? true : false>;
|
||||
type _DataLoaderData<ServerLoaderData, ClientLoaderData, ClientLoaderHydrate extends boolean, HasHydrateFallback> = [
|
||||
HasHydrateFallback,
|
||||
ClientLoaderHydrate
|
||||
] extends [true, true] ? IsDefined<ClientLoaderData> extends true ? ClientLoaderData : undefined : [
|
||||
IsDefined<ClientLoaderData>,
|
||||
IsDefined<ServerLoaderData>
|
||||
] extends [true, true] ? ServerLoaderData | ClientLoaderData : IsDefined<ClientLoaderData> extends true ? ClientLoaderData : IsDefined<ServerLoaderData> extends true ? ServerLoaderData : undefined;
|
||||
type GetActionData<T extends RouteModule> = _DataActionData<ServerDataFrom<T["action"]>, ClientDataFrom<T["clientAction"]>>;
|
||||
type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
|
||||
IsDefined<ServerActionData>,
|
||||
IsDefined<ClientActionData>
|
||||
] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
|
||||
|
||||
export type { AppLoadContext as A, ClientDataFunctionArgs as C, Equal as E, Func as F, GetLoaderData as G, HeadersFunction as H, LinkDescriptor as L, MetaDescriptor as M, Normalize as N, Pretty as P, RouteModule as R, ServerDataFunctionArgs as S, ServerDataFrom as a, GetActionData as b, RouteModules as c, SerializeFrom as d, MetaFunction as e, LinksFunction as f, ClientActionFunction as g, ClientLoaderFunction as h, ClientActionFunctionArgs as i, ClientLoaderFunctionArgs as j, HeadersArgs as k, MetaArgs as l, PageLinkDescriptor as m, HtmlLinkDescriptor as n, ServerRouteModule as o, unstable_SerializesTo as u };
|
||||
3038
node_modules/react-router/dist/development/routeModules-BmVo7q9e.d.ts
generated
vendored
Normal file
3038
node_modules/react-router/dist/development/routeModules-BmVo7q9e.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user