@remix-run/router 1.0.3 → 1.0.4-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/history.d.ts +3 -3
- package/dist/router.cjs.js +257 -166
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.d.ts +14 -2
- package/dist/router.js +257 -166
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +257 -166
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/dist/utils.d.ts +7 -3
- package/history.ts +12 -8
- package/package.json +1 -1
- package/router.ts +288 -183
- package/utils.ts +21 -5
package/dist/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { History, Location, To } from "./history";
|
|
1
|
+
import type { History, Location, Path, To } from "./history";
|
|
2
2
|
import { Action as HistoryAction } from "./history";
|
|
3
3
|
import type { AgnosticDataRouteMatch, AgnosticDataRouteObject, FormEncType, FormMethod, RouteData, AgnosticRouteObject, AgnosticRouteMatch } from "./utils";
|
|
4
4
|
import { DeferredData } from "./utils";
|
|
@@ -98,6 +98,15 @@ export interface Router {
|
|
|
98
98
|
* @param location
|
|
99
99
|
*/
|
|
100
100
|
createHref(location: Location | URL): string;
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
* PRIVATE - DO NOT USE
|
|
104
|
+
*
|
|
105
|
+
* Utility function to URL encode a destination path according to the internal
|
|
106
|
+
* history implementation
|
|
107
|
+
* @param to
|
|
108
|
+
*/
|
|
109
|
+
encodeLocation(to: To): Path;
|
|
101
110
|
/**
|
|
102
111
|
* @internal
|
|
103
112
|
* PRIVATE - DO NOT USE
|
|
@@ -211,6 +220,7 @@ export interface RouterInit {
|
|
|
211
220
|
* State returned from a server-side query() call
|
|
212
221
|
*/
|
|
213
222
|
export interface StaticHandlerContext {
|
|
223
|
+
basename: Router["basename"];
|
|
214
224
|
location: RouterState["location"];
|
|
215
225
|
matches: RouterState["matches"];
|
|
216
226
|
loaderData: RouterState["loaderData"];
|
|
@@ -348,7 +358,9 @@ export declare const IDLE_FETCHER: FetcherStates["Idle"];
|
|
|
348
358
|
* Create a router and listen to history POP navigations
|
|
349
359
|
*/
|
|
350
360
|
export declare function createRouter(init: RouterInit): Router;
|
|
351
|
-
export declare function unstable_createStaticHandler(routes: AgnosticRouteObject[]
|
|
361
|
+
export declare function unstable_createStaticHandler(routes: AgnosticRouteObject[], opts?: {
|
|
362
|
+
basename?: string;
|
|
363
|
+
}): StaticHandler;
|
|
352
364
|
/**
|
|
353
365
|
* Given an existing StaticHandlerContext and an error thrown at render time,
|
|
354
366
|
* provide an updated StaticHandlerContext suitable for a second SSR render
|