@esmx/router 3.0.0-rc.41 → 3.0.0-rc.43

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 CHANGED
@@ -3,10 +3,12 @@ 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
5
  import type { Router } from './router';
6
+ import type { Route, RouteLocation, RouteLocationInput } from './types';
6
7
  /** @deprecated Use `Router` directly instead of `RouterInstance`. */
7
8
  export type RouterInstance = Router;
8
- import type { Route, RouteLocationInput } from './types';
9
9
  /** @deprecated Use `RouteLocationInput` directly instead of `RouterRawLocation`. */
10
10
  export type RouterRawLocation = RouteLocationInput;
11
- /** @deprecated Use `Route` directly instead of `RouterLocation`. */
12
- export type RouterLocation = Route;
11
+ /** @deprecated Use `RouteLocation` directly instead of `RouterLocation`. */
12
+ export type RouterLocation = RouteLocation;
13
+ /** @deprecated Use `Route` directly instead of `RouteRecord`. */
14
+ export type RouteRecord = Route;
package/dist/router.d.ts CHANGED
@@ -2,7 +2,7 @@ import { MicroApp } from './micro-app';
2
2
  import { Navigation } from './navigation';
3
3
  import { Route } from './route';
4
4
  import { RouteTransition } from './route-transition';
5
- import { RouteType } from './types';
5
+ import { RouteType, RouterMode } from './types';
6
6
  import type { RouteConfirmHook, RouteLayerResult, RouteLocationInput, RouteMatchType, RouteNotifyHook, RouterLinkProps, RouterLinkResolved, RouterOptions, RouterParsedOptions } from './types';
7
7
  export declare class Router {
8
8
  readonly options: RouterOptions;
@@ -13,6 +13,8 @@ export declare class Router {
13
13
  readonly transition: RouteTransition;
14
14
  get route(): Route;
15
15
  get root(): string | HTMLElement;
16
+ get mode(): RouterMode;
17
+ get base(): URL;
16
18
  get req(): import("http").IncomingMessage | null;
17
19
  get res(): import("http").ServerResponse<import("http").IncomingMessage> | null;
18
20
  constructor(options: RouterOptions);
package/dist/router.mjs CHANGED
@@ -44,6 +44,12 @@ export class Router {
44
44
  get root() {
45
45
  return this.parsedOptions.root;
46
46
  }
47
+ get mode() {
48
+ return this.parsedOptions.mode;
49
+ }
50
+ get base() {
51
+ return this.parsedOptions.base;
52
+ }
47
53
  get req() {
48
54
  var _a;
49
55
  return (_a = this.parsedOptions.req) != null ? _a : null;
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.41",
35
+ "@esmx/lint": "3.0.0-rc.43",
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.41",
44
+ "version": "3.0.0-rc.43",
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": "d3d8a4787b62ec580d61adc6bf2a907f27c413a9"
63
+ "gitHead": "ad53bf2019b9386abe0ad46feeccca2b97082419"
64
64
  }
package/src/index.ts CHANGED
@@ -52,18 +52,17 @@ export {
52
52
 
53
53
  // =================== Re-exporting deprecated types ===================
54
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
55
  import type { Router } from './router';
56
+ import type { Route, RouteLocation, RouteLocationInput } from './types';
57
+
62
58
  /** @deprecated Use `Router` directly instead of `RouterInstance`. */
63
59
  export type RouterInstance = Router;
64
60
 
65
- import type { Route, RouteLocationInput } from './types';
66
61
  /** @deprecated Use `RouteLocationInput` directly instead of `RouterRawLocation`. */
67
62
  export type RouterRawLocation = RouteLocationInput;
68
- /** @deprecated Use `Route` directly instead of `RouterLocation`. */
69
- export type RouterLocation = Route;
63
+
64
+ /** @deprecated Use `RouteLocation` directly instead of `RouterLocation`. */
65
+ export type RouterLocation = RouteLocation;
66
+
67
+ /** @deprecated Use `Route` directly instead of `RouteRecord`. */
68
+ export type RouteRecord = Route;
package/src/router.ts CHANGED
@@ -43,6 +43,12 @@ export class Router {
43
43
  public get root() {
44
44
  return this.parsedOptions.root;
45
45
  }
46
+ public get mode(): RouterMode {
47
+ return this.parsedOptions.mode;
48
+ }
49
+ public get base(): URL {
50
+ return this.parsedOptions.base;
51
+ }
46
52
  public get req() {
47
53
  return this.parsedOptions.req ?? null;
48
54
  }