Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
Maintainers
3
Versions
523
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 0.0.0-nightly-4996fbe2b-20240629 to 0.0.0-nightly-520ab610e-20240703

10

dist/index.d.ts
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, NavigationStates, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, unstable_HandlerResult } from "./lib/router";
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath, UNSAFE_ErrorResponseImpl } from "./lib/router";
import { Action as NavigationType, createPath, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath, UNSAFE_ErrorResponseImpl } from "./lib/router";
import type { AwaitProps, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RoutesProps, unstable_PatchRoutesOnMissFunction } from "./lib/components";

@@ -13,5 +13,5 @@ import { Await, MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, renderMatches, createMemoryRouter, mapRouteProperties } from "./lib/components";

export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, NavigationStates, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, unstable_HandlerResult, unstable_PatchRoutesOnMissFunction, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type { AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, HydrationState, InitialEntry, LowerCaseFormMethod, StaticHandler, TrackedPromise, FetcherStates, UpperCaseFormMethod, UNSAFE_DeferredData, } from "./lib/router";
export { getStaticContextFromError, stripBasename, UNSAFE_DEFERRED_SYMBOL, UNSAFE_convertRoutesToDataRoutes, } from "./lib/router";
export { Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type { AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, HydrationState, InitialEntry, LowerCaseFormMethod, StaticHandler, TrackedPromise, FetcherStates, UpperCaseFormMethod, } from "./lib/router";
export { getStaticContextFromError, stripBasename, UNSAFE_convertRoutesToDataRoutes, } from "./lib/router";
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, StaticHandlerContext, Submission, } from "./lib/router";

@@ -56,3 +56,3 @@ export type { BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, NavLinkRenderProps, FetcherFormProps, FormProps, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, FetcherSubmitFunction, FetcherWithComponents, RouterProviderProps, } from "./lib/dom/lib";

export type { PageLinkDescriptor, } from "./lib/server-runtime/links";
export type { TypedDeferredData, TypedResponse, } from "./lib/server-runtime/responses";
export type { TypedResponse } from "./lib/server-runtime/responses";
export type { DataFunctionArgs, HeadersArgs, HeadersFunction, } from "./lib/server-runtime/routeModules";

@@ -59,0 +59,0 @@ export type { RequestHandler } from "./lib/server-runtime/server";

@@ -29,3 +29,3 @@ import * as React from "react";

export declare function StaticRouterProvider({ context, router, hydrate, nonce, }: StaticRouterProviderProps): React.JSX.Element;
type CreateStaticHandlerOptions = Omit<RouterCreateStaticHandlerOptions, "detectErrorBoundary" | "mapRouteProperties">;
type CreateStaticHandlerOptions = Omit<RouterCreateStaticHandlerOptions, "mapRouteProperties">;
/**

@@ -32,0 +32,0 @@ * @category Utils

export type { ActionFunction, ActionFunctionArgs, AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, DataStrategyFunction as unstable_DataStrategyFunction, DataStrategyFunctionArgs as unstable_DataStrategyFunctionArgs, DataStrategyMatch as unstable_DataStrategyMatch, ErrorResponse, FormEncType, FormMethod, HandlerResult as unstable_HandlerResult, HTMLFormMethod, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, LowerCaseFormMethod, ParamParseKey, Params, AgnosticPatchRoutesOnMissFunction as unstable_AgnosticPatchRoutesOnMissFunction, PathMatch, PathParam, PathPattern, RedirectFunction, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, Submission, TrackedPromise, UIMatch, UpperCaseFormMethod, } from "./utils";
export { AbortedDeferredError, defer, generatePath, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, redirect, redirectDocument, resolvePath, resolveTo, stripBasename, } from "./utils";
export { generatePath, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, redirect, redirectDocument, resolvePath, resolveTo, stripBasename, } from "./utils";
export type { BrowserHistory, BrowserHistoryOptions, HashHistory, HashHistoryOptions, History, InitialEntry, Location, MemoryHistory, MemoryHistoryOptions, Path, To, } from "./history";

@@ -8,3 +8,3 @@ export { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath, } from "./history";

export type { RouteManifest as UNSAFE_RouteManifest } from "./utils";
export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, } from "./utils";
export { ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, } from "./utils";
export { invariant as UNSAFE_invariant, warning as UNSAFE_warning, } from "./history";
import type { History, Location, Path, To } from "./history";
import { Action as HistoryAction } from "./history";
import type { AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticRouteObject, DataStrategyFunction, DeferredData, DetectErrorBoundaryFunction, FormEncType, HTMLFormMethod, MapRoutePropertiesFunction, RouteData, Submission, UIMatch, AgnosticPatchRoutesOnMissFunction } from "./utils";
import type { AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticRouteObject, DataStrategyFunction, FormEncType, HTMLFormMethod, MapRoutePropertiesFunction, RouteData, Submission, UIMatch, AgnosticPatchRoutesOnMissFunction } from "./utils";
/**

@@ -188,9 +188,2 @@ * A Router instance manages all navigation and data loading/mutations

_internalFetchControllers: Map<string, AbortController>;
/**
* @private
* PRIVATE - DO NOT USE
*
* Internal pending DeferredData instances accessed by unit tests
*/
_internalActiveDeferreds: Map<string, DeferredData>;
}

@@ -276,6 +269,2 @@ /**

basename?: string;
/**
* @deprecated Use `mapRouteProperties` instead
*/
detectErrorBoundary?: DetectErrorBoundaryFunction;
mapRouteProperties?: MapRoutePropertiesFunction;

@@ -301,3 +290,2 @@ future?: Partial<FutureConfig>;

actionHeaders: Record<string, Headers>;
activeDeferreds: Record<string, DeferredData> | null;
_deepestRenderedBoundaryId?: string | null;

@@ -542,9 +530,4 @@ }

export declare function createRouter(init: RouterInit): Router;
export declare const UNSAFE_DEFERRED_SYMBOL: unique symbol;
export interface CreateStaticHandlerOptions {
basename?: string;
/**
* @deprecated Use `mapRouteProperties` instead
*/
detectErrorBoundary?: DetectErrorBoundaryFunction;
mapRouteProperties?: MapRoutePropertiesFunction;

@@ -561,8 +544,2 @@ future?: {};

export declare function getStaticContextFromError(routes: AgnosticDataRouteObject[], context: StaticHandlerContext, error: any): StaticHandlerContext;
export declare function isDeferredData(value: any): value is DeferredData;
export declare function createDeferred<T = unknown>(): {
promise: Promise<T>;
resolve: (val?: any) => Promise<void>;
reject: (error?: Error) => Promise<void>;
};
export {};

@@ -10,3 +10,2 @@ import type { Location, Path, To } from "./history";

data = "data",
deferred = "deferred",
redirect = "redirect",

@@ -25,11 +24,2 @@ error = "error"

/**
* Successful defer() result from a loader or action
*/
export interface DeferredResult {
type: ResultType.deferred;
deferredData: DeferredData;
statusCode?: number;
headers?: Headers;
}
/**
* Redirect result from a loader or action

@@ -53,3 +43,3 @@ */

*/
export type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
export type DataResult = SuccessResult | RedirectResult | ErrorResult;
/**

@@ -181,11 +171,2 @@ * Result from a loader or action called via dataStrategy

}
/**
* Function provided by the framework-aware layers to set `hasErrorBoundary`
* from the framework-aware `errorElement` prop
*
* @deprecated Use `mapRouteProperties` instead
*/
export interface DetectErrorBoundaryFunction {
(route: AgnosticRouteObject): boolean;
}
export interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {

@@ -466,29 +447,2 @@ shouldLoad: boolean;

}
export declare class AbortedDeferredError extends Error {
}
export declare class DeferredData {
private pendingKeysSet;
private controller;
private abortPromise;
private unlistenAbortSignal;
private subscribers;
data: Record<string, unknown>;
init?: ResponseInit;
deferredKeys: string[];
constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
private trackPromise;
private onSettle;
private emit;
subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
cancel(): void;
resolveData(signal: AbortSignal): Promise<boolean>;
get done(): boolean;
get unwrappedData(): {};
get pendingKeys(): string[];
}
export type DeferFunction = (data: Record<string, unknown>, init?: number | ResponseInit) => DeferredData;
/**
* @category Utils
*/
export declare const defer: DeferFunction;
export type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;

@@ -495,0 +449,0 @@ /**

@@ -1,9 +0,1 @@

import { type UNSAFE_DeferredData as DeferredData } from "../router";
import type { ServerMode } from "./mode";
declare const typedDeferredDataBrand: unique symbol;
export type TypedDeferredData<Data extends Record<string, unknown>> = Pick<DeferredData, "init"> & {
data: Data;
readonly [typedDeferredDataBrand]: "TypedDeferredData";
};
export type DeferFunction = <Data extends Record<string, unknown>>(data: Data, init?: number | ResponseInit) => TypedDeferredData<Data>;
export type JsonFunction = <Data>(data: Data, init?: number | ResponseInit) => TypedResponse<Data>;

@@ -20,8 +12,2 @@ export type TypedResponse<T = unknown> = Omit<Response, "json"> & {

export declare const json: JsonFunction;
/**
* This is a shortcut for creating Remix deferred responses
*
* @see https://remix.run/utils/defer
*/
export declare const defer: DeferFunction;
export type RedirectFunction = (url: string, init?: number | ResponseInit) => TypedResponse<never>;

@@ -43,7 +29,4 @@ /**

export declare const redirectDocument: RedirectFunction;
export declare function isDeferredData(value: any): value is DeferredData;
export declare function isResponse(value: any): value is Response;
export declare function isRedirectStatusCode(statusCode: number): boolean;
export declare function isRedirectResponse(response: Response): boolean;
export declare function createDeferredReadableStream(deferredData: DeferredData, signal: AbortSignal, serverMode: ServerMode): any;
export {};
/**
* React Router v0.0.0-nightly-4996fbe2b-20240629
* React Router v0.0.0-nightly-520ab610e-20240703
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

{
"name": "react-router",
"version": "0.0.0-nightly-4996fbe2b-20240629",
"version": "0.0.0-nightly-520ab610e-20240703",
"description": "Declarative routing for React",

@@ -31,3 +31,3 @@ "keywords": [

"turbo-stream": "^2.2.0",
"react-router": "0.0.0-nightly-4996fbe2b-20240629"
"react-router": "0.0.0-nightly-520ab610e-20240703"
},

@@ -34,0 +34,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc