@esmx/router 3.0.0-rc.40 → 3.0.0-rc.41
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 +8 -0
- package/dist/route.d.ts +4 -0
- package/dist/route.mjs +8 -0
- package/package.json +3 -3
- package/src/index.ts +18 -0
- package/src/route.ts +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,11 @@ export { Router } from './router';
|
|
|
2
2
|
export { Route } from './route';
|
|
3
3
|
export { RouterMode, RouteType, type RouteConfirmHook, type RouteConfirmHookResult, type RouteVerifyHook, type RouteHandleHook, type RouteNotifyHook, type RouteMeta, type RouteState, type RouteHandleResult, type RouteMatchType, type RouteLocation, type RouteLocationInput, type RouteConfig, type RouteParsedConfig, type RouteMatchResult, type RouteMatcher, type RouteOptions, type RouteLayerOptions, type RouteLayerResult, type RouterLayerOptions, type RouterMicroApp, type RouterMicroAppCallback, type RouterMicroAppOptions, type RouterOptions, type RouterParsedOptions, type RouterLinkType, type RouterLinkAttributes, type RouterLinkProps, type RouterLinkResolved } from './types';
|
|
4
4
|
export { RouteError, RouteTaskCancelledError, RouteTaskExecutionError, RouteNavigationAbortedError, RouteSelfRedirectionError } from './error';
|
|
5
|
+
import type { Router } from './router';
|
|
6
|
+
/** @deprecated Use `Router` directly instead of `RouterInstance`. */
|
|
7
|
+
export type RouterInstance = Router;
|
|
8
|
+
import type { Route, RouteLocationInput } from './types';
|
|
9
|
+
/** @deprecated Use `RouteLocationInput` directly instead of `RouterRawLocation`. */
|
|
10
|
+
export type RouterRawLocation = RouteLocationInput;
|
|
11
|
+
/** @deprecated Use `Route` directly instead of `RouterLocation`. */
|
|
12
|
+
export type RouterLocation = Route;
|
package/dist/route.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export declare class Route {
|
|
|
42
42
|
readonly meta: RouteMeta;
|
|
43
43
|
readonly matched: readonly RouteParsedConfig[];
|
|
44
44
|
readonly config: RouteParsedConfig | null;
|
|
45
|
+
/** @deprecated Use `url.pathname` instead. */
|
|
46
|
+
get pathname(): string;
|
|
47
|
+
/** @deprecated Use `url.href` instead. */
|
|
48
|
+
get href(): string;
|
|
45
49
|
constructor(routeOptions?: Partial<RouteOptions>);
|
|
46
50
|
get isPush(): boolean;
|
|
47
51
|
get handle(): RouteHandleHook | null;
|
package/dist/route.mjs
CHANGED
|
@@ -118,6 +118,14 @@ export class Route {
|
|
|
118
118
|
Object.defineProperty(this, property, { enumerable: false });
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/** @deprecated Use `url.pathname` instead. */
|
|
122
|
+
get pathname() {
|
|
123
|
+
return this.url.pathname;
|
|
124
|
+
}
|
|
125
|
+
/** @deprecated Use `url.href` instead. */
|
|
126
|
+
get href() {
|
|
127
|
+
return this.url.href;
|
|
128
|
+
}
|
|
121
129
|
get isPush() {
|
|
122
130
|
return this.type.startsWith("push");
|
|
123
131
|
}
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@biomejs/biome": "1.9.4",
|
|
35
|
-
"@esmx/lint": "3.0.0-rc.
|
|
35
|
+
"@esmx/lint": "3.0.0-rc.41",
|
|
36
36
|
"@types/node": "^24.0.0",
|
|
37
37
|
"@vitest/coverage-v8": "3.2.4",
|
|
38
38
|
"happy-dom": "^18.0.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"unbuild": "3.5.0",
|
|
42
42
|
"vitest": "3.2.4"
|
|
43
43
|
},
|
|
44
|
-
"version": "3.0.0-rc.
|
|
44
|
+
"version": "3.0.0-rc.41",
|
|
45
45
|
"type": "module",
|
|
46
46
|
"private": false,
|
|
47
47
|
"exports": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"template",
|
|
61
61
|
"public"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "d3d8a4787b62ec580d61adc6bf2a907f27c413a9"
|
|
64
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -49,3 +49,21 @@ export {
|
|
|
49
49
|
RouteNavigationAbortedError,
|
|
50
50
|
RouteSelfRedirectionError
|
|
51
51
|
} from './error';
|
|
52
|
+
|
|
53
|
+
// =================== Re-exporting deprecated types ===================
|
|
54
|
+
|
|
55
|
+
// Cannot propagate deprecated JSDoc when re-export due to TypeScript bug: https://github.com/microsoft/TypeScript/issues/53960
|
|
56
|
+
// export type {
|
|
57
|
+
// /** @deprecated Use `Router` directly instead of `RouterInstance`. */
|
|
58
|
+
// Router as RouterInstance
|
|
59
|
+
// } from './router';
|
|
60
|
+
|
|
61
|
+
import type { Router } from './router';
|
|
62
|
+
/** @deprecated Use `Router` directly instead of `RouterInstance`. */
|
|
63
|
+
export type RouterInstance = Router;
|
|
64
|
+
|
|
65
|
+
import type { Route, RouteLocationInput } from './types';
|
|
66
|
+
/** @deprecated Use `RouteLocationInput` directly instead of `RouterRawLocation`. */
|
|
67
|
+
export type RouterRawLocation = RouteLocationInput;
|
|
68
|
+
/** @deprecated Use `Route` directly instead of `RouterLocation`. */
|
|
69
|
+
export type RouterLocation = Route;
|
package/src/route.ts
CHANGED
|
@@ -127,6 +127,16 @@ export class Route {
|
|
|
127
127
|
public readonly matched: readonly RouteParsedConfig[];
|
|
128
128
|
public readonly config: RouteParsedConfig | null;
|
|
129
129
|
|
|
130
|
+
/** @deprecated Use `url.pathname` instead. */
|
|
131
|
+
public get pathname(): string {
|
|
132
|
+
return this.url.pathname;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @deprecated Use `url.href` instead. */
|
|
136
|
+
public get href(): string {
|
|
137
|
+
return this.url.href;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
constructor(routeOptions: Partial<RouteOptions> = {}) {
|
|
131
141
|
const {
|
|
132
142
|
toType = RouteType.push,
|