@solidjs/router 0.13.4 → 0.13.5
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/dist/index.d.ts +1 -1
- package/dist/routing.d.ts +4 -4
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export * from "./lifecycle.js";
|
|
|
4
4
|
export { useHref, useIsRouting, useLocation, useMatch, useCurrentMatches, useNavigate, useParams, useResolvedPath, useSearchParams, useBeforeLeave, } from "./routing.js";
|
|
5
5
|
export { mergeSearchString as _mergeSearchString } from "./utils.js";
|
|
6
6
|
export * from "./data/index.js";
|
|
7
|
-
export type { Location, LocationChange, MatchFilter, MatchFilters, NavigateOptions, Navigator, OutputMatch, Params, PathMatch, RouteSectionProps, RouteLoadFunc, RouteLoadFuncArgs, RouteDefinition,
|
|
7
|
+
export type { Location, LocationChange, MatchFilter, MatchFilters, NavigateOptions, Navigator, OutputMatch, Params, PathMatch, RouteSectionProps, RouteLoadFunc, RouteLoadFuncArgs, RouteDefinition, RouteDescription, RouteMatch, RouterIntegration, RouterUtils, SetParams, BeforeLeaveEventArgs } from "./types.js";
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, Accessor } from "solid-js";
|
|
2
|
-
import type { BeforeLeaveEventArgs, Branch, Intent, Location, MatchFilters, NavigateOptions, Navigator, Params,
|
|
2
|
+
import type { BeforeLeaveEventArgs, Branch, Intent, Location, MatchFilters, NavigateOptions, Navigator, Params, RouteDescription, RouteContext, RouteDefinition, RouteMatch, RouterContext, RouterIntegration, SetParams } from "./types.js";
|
|
3
3
|
export declare const RouterContextObj: import("solid-js").Context<RouterContext | undefined>;
|
|
4
4
|
export declare const RouteContextObj: import("solid-js").Context<RouteContext | undefined>;
|
|
5
5
|
export declare const useRouter: () => RouterContext;
|
|
@@ -14,9 +14,9 @@ export declare const useCurrentMatches: () => () => RouteMatch[];
|
|
|
14
14
|
export declare const useParams: <T extends Params>() => T;
|
|
15
15
|
export declare const useSearchParams: <T extends Params>() => [Partial<T>, (params: SetParams, options?: Partial<NavigateOptions>) => void];
|
|
16
16
|
export declare const useBeforeLeave: (listener: (e: BeforeLeaveEventArgs) => void) => void;
|
|
17
|
-
export declare function createRoutes(routeDef: RouteDefinition, base?: string):
|
|
18
|
-
export declare function createBranch(routes:
|
|
19
|
-
export declare function createBranches(routeDef: RouteDefinition | RouteDefinition[], base?: string, stack?:
|
|
17
|
+
export declare function createRoutes(routeDef: RouteDefinition, base?: string): RouteDescription[];
|
|
18
|
+
export declare function createBranch(routes: RouteDescription[], index?: number): Branch;
|
|
19
|
+
export declare function createBranches(routeDef: RouteDefinition | RouteDefinition[], base?: string, stack?: RouteDescription[], branches?: Branch[]): Branch[];
|
|
20
20
|
export declare function getRouteMatches(branches: Branch[], location: string): RouteMatch[];
|
|
21
21
|
export declare function createLocation(path: Accessor<string>, state: Accessor<any>): Location;
|
|
22
22
|
export declare function getIntent(): Intent | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export interface PathMatch {
|
|
|
86
86
|
path: string;
|
|
87
87
|
}
|
|
88
88
|
export interface RouteMatch extends PathMatch {
|
|
89
|
-
route:
|
|
89
|
+
route: RouteDescription;
|
|
90
90
|
}
|
|
91
91
|
export interface OutputMatch {
|
|
92
92
|
path: string;
|
|
@@ -95,7 +95,7 @@ export interface OutputMatch {
|
|
|
95
95
|
params: Params;
|
|
96
96
|
info?: Record<string, any>;
|
|
97
97
|
}
|
|
98
|
-
export interface
|
|
98
|
+
export interface RouteDescription {
|
|
99
99
|
key: unknown;
|
|
100
100
|
originalPath: string;
|
|
101
101
|
pattern: string;
|
|
@@ -106,7 +106,7 @@ export interface Route {
|
|
|
106
106
|
info?: Record<string, any>;
|
|
107
107
|
}
|
|
108
108
|
export interface Branch {
|
|
109
|
-
routes:
|
|
109
|
+
routes: RouteDescription[];
|
|
110
110
|
score: number;
|
|
111
111
|
matcher: (location: string) => RouteMatch[] | null;
|
|
112
112
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MatchFilters, Params, PathMatch,
|
|
1
|
+
import type { MatchFilters, Params, PathMatch, RouteDescription, SetParams } from "./types.ts";
|
|
2
2
|
export declare const mockBase = "http://sr";
|
|
3
3
|
export declare function normalizePath(path: string, omitSlash?: boolean): string;
|
|
4
4
|
export declare function resolvePath(base: string, path: string, from?: string): string | undefined;
|
|
@@ -6,7 +6,7 @@ export declare function invariant<T>(value: T | null | undefined, message: strin
|
|
|
6
6
|
export declare function joinPaths(from: string, to: string): string;
|
|
7
7
|
export declare function extractSearchParams(url: URL): Params;
|
|
8
8
|
export declare function createMatcher<S extends string>(path: S, partial?: boolean, matchFilters?: MatchFilters<S>): (location: string) => PathMatch | null;
|
|
9
|
-
export declare function scoreRoute(route:
|
|
9
|
+
export declare function scoreRoute(route: RouteDescription): number;
|
|
10
10
|
export declare function createMemoObject<T extends Record<string | symbol, unknown>>(fn: () => T): T;
|
|
11
11
|
export declare function mergeSearchString(search: string, params: SetParams): string;
|
|
12
12
|
export declare function expandOptionals(pattern: string): string[];
|