diff --git a/demo/src/lib/SubNav.svelte b/demo/src/lib/SubNav.svelte
index 47e67ee..93467d6 100644
--- a/demo/src/lib/SubNav.svelte
+++ b/demo/src/lib/SubNav.svelte
@@ -6,7 +6,7 @@
diff --git a/demo/src/lib/views/home/HomeView.svelte b/demo/src/lib/views/home/HomeView.svelte
index 90c5955..328ad2b 100644
--- a/demo/src/lib/views/home/HomeView.svelte
+++ b/demo/src/lib/views/home/HomeView.svelte
@@ -7,7 +7,7 @@
import Card from '../../Card.svelte';
import CardHeader from '../../CardHeader.svelte';
import CardBody from '../../CardBody.svelte';
- import { RouterTrace, Link } from '@wjfe/n-savant';
+ import { RouterTrace, Link } from '@svelte-router/core';
import xml from 'svelte-highlight/languages/xml';
import typescript from 'svelte-highlight/languages/typescript';
@@ -111,7 +111,7 @@
- 🎯 Why Choose @wjfe/n-savant?
+ 🎯 Why Choose @svelte-router/core?
@@ -176,7 +176,7 @@
🎮 Ready to Get Started?
- Explore the different routing modes and see the power of @wjfe/n-savant in action!
+ Explore the different routing modes and see the power of @svelte-router/core in action!
diff --git a/demo/src/lib/views/home/Quickstart.svelte b/demo/src/lib/views/home/Quickstart.svelte
index f93ba39..430d6c9 100644
--- a/demo/src/lib/views/home/Quickstart.svelte
+++ b/demo/src/lib/views/home/Quickstart.svelte
@@ -21,14 +21,14 @@
Install the package:
Then, in your Svelte app:
- import { Router, Route } from '@wjfe/n-savant';
+ import { Router, Route } from '@svelte-router/core';
import Hero from './lib/Hero.svelte';
import Features from './lib/Features.svelte';
diff --git a/demo/src/lib/views/path-routing/PathRoutingView.svelte b/demo/src/lib/views/path-routing/PathRoutingView.svelte
index 7e7e203..0a7cfc5 100644
--- a/demo/src/lib/views/path-routing/PathRoutingView.svelte
+++ b/demo/src/lib/views/path-routing/PathRoutingView.svelte
@@ -1,5 +1,5 @@
@@ -46,7 +46,7 @@ the MFE is meant to respond to sub-path routes only.
```svelte
@@ -61,7 +61,7 @@ as needed.
```svelte
@@ -93,7 +93,7 @@ Use the `fallback()` snippet of the router to present content when no routes mat
```svelte
@@ -118,7 +118,7 @@ Parameters are expressed in the form `:[?]`. The optional `"?"` makes the
```svelte
@@ -142,7 +142,7 @@ never use this name as a name for one of your parameters.
```svelte
diff --git a/src/lib/Router/Router.svelte b/src/lib/Router/Router.svelte
index 0614382..457a696 100644
--- a/src/lib/Router/Router.svelte
+++ b/src/lib/Router/Router.svelte
@@ -1,6 +1,6 @@
*
* {#snippet children(_, rs)}
diff --git a/src/lib/index.test.ts b/src/lib/index.test.ts
index b49dc10..8482f9f 100644
--- a/src/lib/index.test.ts
+++ b/src/lib/index.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
-import { routingOptions } from "./core/options.js";
-import { location } from "./core/Location.js";
+import { routingOptions } from "./kernel/options.js";
+import { location } from "./kernel/Location.js";
describe('index', () => {
test("Should export exactly the expected objects.", async () => {
diff --git a/src/lib/index.ts b/src/lib/index.ts
index 246cb7d..768c4b4 100644
--- a/src/lib/index.ts
+++ b/src/lib/index.ts
@@ -9,7 +9,7 @@ export { default as Router } from "./Router/Router.svelte";
export * from "./Fallback/Fallback.svelte";
export { default as Fallback } from "./Fallback/Fallback.svelte";
export type * from "./types.js";
-export { location } from "./core/Location.js";
+export { location } from "./kernel/Location.js";
export * from './RouterTrace/RouterTrace.svelte';
export { default as RouterTrace } from './RouterTrace/RouterTrace.svelte';
export * from "./public-utils.js";
diff --git a/src/lib/init.test.ts b/src/lib/init.test.ts
index b82eb01..e359904 100644
--- a/src/lib/init.test.ts
+++ b/src/lib/init.test.ts
@@ -1,8 +1,8 @@
import { describe, test, expect, afterEach } from "vitest";
import { init, initFull } from "./init.js";
-import { location } from "./core/Location.js";
-import { LocationLite } from "./core/LocationLite.svelte.js";
-import { LocationFull } from "./core/LocationFull.js";
+import { location } from "./kernel/Location.js";
+import { LocationLite } from "./kernel/LocationLite.svelte.js";
+import { LocationFull } from "./kernel/LocationFull.js";
let cleanup: (() => void) | undefined;
diff --git a/src/lib/init.ts b/src/lib/init.ts
index 6f4f5a2..62f21bf 100644
--- a/src/lib/init.ts
+++ b/src/lib/init.ts
@@ -1,7 +1,7 @@
-import { LocationFull } from "./core/LocationFull.js";
-import { LocationLite } from "./core/LocationLite.svelte.js";
+import { LocationFull } from "./kernel/LocationFull.js";
+import { LocationLite } from "./kernel/LocationLite.svelte.js";
import type { InitOptions } from "./types.js";
-import { initCore } from "./core/initCore.js";
+import { initCore } from "./kernel/initCore.js";
/**
* Initializes the routing library in normal mode. The following features are available:
diff --git a/src/lib/core/InterceptedHistoryApi.svelte.test.ts b/src/lib/kernel/InterceptedHistoryApi.svelte.test.ts
similarity index 100%
rename from src/lib/core/InterceptedHistoryApi.svelte.test.ts
rename to src/lib/kernel/InterceptedHistoryApi.svelte.test.ts
diff --git a/src/lib/core/InterceptedHistoryApi.svelte.ts b/src/lib/kernel/InterceptedHistoryApi.svelte.ts
similarity index 100%
rename from src/lib/core/InterceptedHistoryApi.svelte.ts
rename to src/lib/kernel/InterceptedHistoryApi.svelte.ts
diff --git a/src/lib/core/Location.test.ts b/src/lib/kernel/Location.test.ts
similarity index 100%
rename from src/lib/core/Location.test.ts
rename to src/lib/kernel/Location.test.ts
diff --git a/src/lib/core/Location.ts b/src/lib/kernel/Location.ts
similarity index 100%
rename from src/lib/core/Location.ts
rename to src/lib/kernel/Location.ts
diff --git a/src/lib/core/LocationFull.test.ts b/src/lib/kernel/LocationFull.test.ts
similarity index 100%
rename from src/lib/core/LocationFull.test.ts
rename to src/lib/kernel/LocationFull.test.ts
diff --git a/src/lib/core/LocationFull.ts b/src/lib/kernel/LocationFull.ts
similarity index 100%
rename from src/lib/core/LocationFull.ts
rename to src/lib/kernel/LocationFull.ts
diff --git a/src/lib/core/LocationLite.svelte.test.ts b/src/lib/kernel/LocationLite.svelte.test.ts
similarity index 100%
rename from src/lib/core/LocationLite.svelte.test.ts
rename to src/lib/kernel/LocationLite.svelte.test.ts
diff --git a/src/lib/core/LocationLite.svelte.ts b/src/lib/kernel/LocationLite.svelte.ts
similarity index 100%
rename from src/lib/core/LocationLite.svelte.ts
rename to src/lib/kernel/LocationLite.svelte.ts
diff --git a/src/lib/core/LocationState.svelte.test.ts b/src/lib/kernel/LocationState.svelte.test.ts
similarity index 100%
rename from src/lib/core/LocationState.svelte.test.ts
rename to src/lib/kernel/LocationState.svelte.test.ts
diff --git a/src/lib/core/LocationState.svelte.ts b/src/lib/kernel/LocationState.svelte.ts
similarity index 100%
rename from src/lib/core/LocationState.svelte.ts
rename to src/lib/kernel/LocationState.svelte.ts
diff --git a/src/lib/core/LocationState.test.ts b/src/lib/kernel/LocationState.test.ts
similarity index 100%
rename from src/lib/core/LocationState.test.ts
rename to src/lib/kernel/LocationState.test.ts
diff --git a/src/lib/core/Logger.test.ts b/src/lib/kernel/Logger.test.ts
similarity index 100%
rename from src/lib/core/Logger.test.ts
rename to src/lib/kernel/Logger.test.ts
diff --git a/src/lib/core/Logger.ts b/src/lib/kernel/Logger.ts
similarity index 100%
rename from src/lib/core/Logger.ts
rename to src/lib/kernel/Logger.ts
diff --git a/src/lib/core/RouterEngine.svelte.test.ts b/src/lib/kernel/RouterEngine.svelte.test.ts
similarity index 100%
rename from src/lib/core/RouterEngine.svelte.test.ts
rename to src/lib/kernel/RouterEngine.svelte.test.ts
diff --git a/src/lib/core/RouterEngine.svelte.ts b/src/lib/kernel/RouterEngine.svelte.ts
similarity index 100%
rename from src/lib/core/RouterEngine.svelte.ts
rename to src/lib/kernel/RouterEngine.svelte.ts
diff --git a/src/lib/core/StockHistoryApi.svelte.test.ts b/src/lib/kernel/StockHistoryApi.svelte.test.ts
similarity index 100%
rename from src/lib/core/StockHistoryApi.svelte.test.ts
rename to src/lib/kernel/StockHistoryApi.svelte.test.ts
diff --git a/src/lib/core/StockHistoryApi.svelte.ts b/src/lib/kernel/StockHistoryApi.svelte.ts
similarity index 100%
rename from src/lib/core/StockHistoryApi.svelte.ts
rename to src/lib/kernel/StockHistoryApi.svelte.ts
diff --git a/src/lib/core/calculateHref.test.ts b/src/lib/kernel/calculateHref.test.ts
similarity index 100%
rename from src/lib/core/calculateHref.test.ts
rename to src/lib/kernel/calculateHref.test.ts
diff --git a/src/lib/core/calculateHref.ts b/src/lib/kernel/calculateHref.ts
similarity index 100%
rename from src/lib/core/calculateHref.ts
rename to src/lib/kernel/calculateHref.ts
diff --git a/src/lib/core/calculateState.test.ts b/src/lib/kernel/calculateState.test.ts
similarity index 100%
rename from src/lib/core/calculateState.test.ts
rename to src/lib/kernel/calculateState.test.ts
diff --git a/src/lib/core/calculateState.ts b/src/lib/kernel/calculateState.ts
similarity index 100%
rename from src/lib/core/calculateState.ts
rename to src/lib/kernel/calculateState.ts
diff --git a/src/lib/core/dissectHrefs.test.ts b/src/lib/kernel/dissectHrefs.test.ts
similarity index 100%
rename from src/lib/core/dissectHrefs.test.ts
rename to src/lib/kernel/dissectHrefs.test.ts
diff --git a/src/lib/core/dissectHrefs.ts b/src/lib/kernel/dissectHrefs.ts
similarity index 100%
rename from src/lib/core/dissectHrefs.ts
rename to src/lib/kernel/dissectHrefs.ts
diff --git a/src/lib/core/index.test.ts b/src/lib/kernel/index.test.ts
similarity index 100%
rename from src/lib/core/index.test.ts
rename to src/lib/kernel/index.test.ts
diff --git a/src/lib/core/index.ts b/src/lib/kernel/index.ts
similarity index 100%
rename from src/lib/core/index.ts
rename to src/lib/kernel/index.ts
diff --git a/src/lib/core/initCore.test.ts b/src/lib/kernel/initCore.test.ts
similarity index 100%
rename from src/lib/core/initCore.test.ts
rename to src/lib/kernel/initCore.test.ts
diff --git a/src/lib/core/initCore.ts b/src/lib/kernel/initCore.ts
similarity index 100%
rename from src/lib/core/initCore.ts
rename to src/lib/kernel/initCore.ts
diff --git a/src/lib/core/isConformantState.test.ts b/src/lib/kernel/isConformantState.test.ts
similarity index 100%
rename from src/lib/core/isConformantState.test.ts
rename to src/lib/kernel/isConformantState.test.ts
diff --git a/src/lib/core/isConformantState.ts b/src/lib/kernel/isConformantState.ts
similarity index 100%
rename from src/lib/core/isConformantState.ts
rename to src/lib/kernel/isConformantState.ts
diff --git a/src/lib/core/options.test.ts b/src/lib/kernel/options.test.ts
similarity index 100%
rename from src/lib/core/options.test.ts
rename to src/lib/kernel/options.test.ts
diff --git a/src/lib/core/options.ts b/src/lib/kernel/options.ts
similarity index 100%
rename from src/lib/core/options.ts
rename to src/lib/kernel/options.ts
diff --git a/src/lib/core/preserveQuery.test.ts b/src/lib/kernel/preserveQuery.test.ts
similarity index 100%
rename from src/lib/core/preserveQuery.test.ts
rename to src/lib/kernel/preserveQuery.test.ts
diff --git a/src/lib/core/preserveQuery.ts b/src/lib/kernel/preserveQuery.ts
similarity index 100%
rename from src/lib/core/preserveQuery.ts
rename to src/lib/kernel/preserveQuery.ts
diff --git a/src/lib/core/resolveHashValue.ts b/src/lib/kernel/resolveHashValue.ts
similarity index 100%
rename from src/lib/core/resolveHashValue.ts
rename to src/lib/kernel/resolveHashValue.ts
diff --git a/src/lib/core/trace.svelte.ts b/src/lib/kernel/trace.svelte.ts
similarity index 100%
rename from src/lib/core/trace.svelte.ts
rename to src/lib/kernel/trace.svelte.ts
diff --git a/src/lib/core/trace.test.ts b/src/lib/kernel/trace.test.ts
similarity index 100%
rename from src/lib/core/trace.test.ts
rename to src/lib/kernel/trace.test.ts
diff --git a/src/lib/logo/logo.d.ts b/src/lib/logo/logo.d.ts
index 1604ec7..c3c968c 100644
--- a/src/lib/logo/logo.d.ts
+++ b/src/lib/logo/logo.d.ts
@@ -1,14 +1,14 @@
-declare module '@wjfe/n-savant/logo' {
+declare module '@svelte-router/core/logo' {
const content: string;
export default content;
}
-declare module '@wjfe/n-savant/logo64' {
+declare module '@svelte-router/core/logo64' {
const content: string;
export default content;
}
-declare module '@wjfe/n-savant/logo48' {
+declare module '@svelte-router/core/logo48' {
const content: string;
export default content;
}
diff --git a/src/lib/public-utils.ts b/src/lib/public-utils.ts
index 7eb0a29..d4405e1 100644
--- a/src/lib/public-utils.ts
+++ b/src/lib/public-utils.ts
@@ -1,4 +1,4 @@
-import { RouterEngine } from "./core/RouterEngine.svelte.js";
+import { RouterEngine } from "./kernel/RouterEngine.svelte.js";
import type { RouteStatus } from "./types.js";
/**
diff --git a/src/lib/utils.test.ts b/src/lib/utils.test.ts
index 4ac3c48..72f7d90 100644
--- a/src/lib/utils.test.ts
+++ b/src/lib/utils.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test, vi } from "vitest";
import { assertAllowedRoutingMode } from "./utils.js";
import { ALL_HASHES } from "../testing/test-utils.js";
-import { resetRoutingOptions, setRoutingOptions } from "./core/options.js";
+import { resetRoutingOptions, setRoutingOptions } from "./kernel/options.js";
import type { ExtendedRoutingOptions, Hash } from "./types.js";
const hashValues = Object.values(ALL_HASHES).filter(x => x !== undefined);
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index 60af0cc..9e2a2ae 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -1,5 +1,5 @@
import type { ActiveState, Hash } from "./types.js";
-import { routingOptions } from "./core/options.js";
+import { routingOptions } from "./kernel/options.js";
import type { HTMLAnchorAttributes } from "svelte/elements";
/**
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 87a3fd4..910550b 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -2,7 +2,7 @@
import Router from "$lib/Router/Router.svelte";
import Route from "$lib/Route/Route.svelte";
import RouterTrace from "$lib/RouterTrace/RouterTrace.svelte";
- import { RouterEngine } from "$lib/core/RouterEngine.svelte.js";
+ import { RouterEngine } from "$lib/kernel/RouterEngine.svelte.js";
const x = new RouterEngine();
diff --git a/src/testing/LinkContextSpy.svelte.d.ts b/src/testing/LinkContextSpy.svelte.d.ts
new file mode 100644
index 0000000..29e4811
--- /dev/null
+++ b/src/testing/LinkContextSpy.svelte.d.ts
@@ -0,0 +1,7 @@
+import { type ILinkContext } from "../lib/LinkContext/LinkContext.svelte";
+interface Props {
+ linkCtx?: ILinkContext;
+}
+declare const LinkContextSpy: import("svelte").Component;
+type LinkContextSpy = ReturnType;
+export default LinkContextSpy;
diff --git a/src/testing/TestActiveBehavior.svelte.d.ts b/src/testing/TestActiveBehavior.svelte.d.ts
new file mode 100644
index 0000000..c2d0842
--- /dev/null
+++ b/src/testing/TestActiveBehavior.svelte.d.ts
@@ -0,0 +1,10 @@
+import type { ActiveState, RouteStatus } from "$lib/types.js";
+type Props = {
+ routeStatus: Record;
+ key: string;
+ activeState?: ActiveState;
+ style?: string;
+};
+declare const TestActiveBehavior: import("svelte").Component;
+type TestActiveBehavior = ReturnType;
+export default TestActiveBehavior;
diff --git a/src/testing/TestLinkContextWithContextSpy.svelte.d.ts b/src/testing/TestLinkContextWithContextSpy.svelte.d.ts
new file mode 100644
index 0000000..f148791
--- /dev/null
+++ b/src/testing/TestLinkContextWithContextSpy.svelte.d.ts
@@ -0,0 +1,7 @@
+import { type ILinkContext } from "../lib/LinkContext/LinkContext.svelte";
+interface Props extends ILinkContext {
+ linkCtx?: ILinkContext;
+}
+declare const TestLinkContextWithContextSpy: import("svelte").Component;
+type TestLinkContextWithContextSpy = ReturnType;
+export default TestLinkContextWithContextSpy;
diff --git a/src/testing/TestRouteWithRouter.svelte.d.ts b/src/testing/TestRouteWithRouter.svelte.d.ts
new file mode 100644
index 0000000..07cf017
--- /dev/null
+++ b/src/testing/TestRouteWithRouter.svelte.d.ts
@@ -0,0 +1,16 @@
+import type { Snippet } from "svelte";
+interface Props {
+ hash?: boolean | string;
+ routeKey?: string;
+ routePath?: string | RegExp;
+ routeAnd?: (params: any) => boolean;
+ ignoreForFallback?: boolean;
+ caseSensitive?: boolean;
+ children?: Snippet;
+ routeChildren?: Snippet<[any, any, any]>;
+ routerInstance?: any;
+ params?: any;
+}
+declare const TestRouteWithRouter: import("svelte").Component;
+type TestRouteWithRouter = ReturnType;
+export default TestRouteWithRouter;
diff --git a/src/testing/test-utils.d.ts b/src/testing/test-utils.d.ts
new file mode 100644
index 0000000..8b2dd14
--- /dev/null
+++ b/src/testing/test-utils.d.ts
@@ -0,0 +1,223 @@
+import type { Hash, RouteInfo, RoutingOptions } from "$lib/types.js";
+import { RouterEngine } from "$lib/kernel/RouterEngine.svelte.js";
+/**
+ * Defines the necessary information to call the library's `init()` function for testing, plus additional metadata.
+ */
+export type RoutingUniverse = {
+ hash: Hash | undefined;
+ implicitMode: RoutingOptions['implicitMode'];
+ hashMode: Exclude;
+ /**
+ * Short universe identifier. Used in test titles and descriptions.
+ */
+ text: string;
+ /**
+ * Descriptive universe name. More of a document-by-code property. Not commonly used as it makes text very long.
+ */
+ name: string;
+};
+/**
+ * Standard routing universe test configurations
+ */
+export declare const ROUTING_UNIVERSES: RoutingUniverse[];
+/**
+ * All possible hash values for testing hash compatibility
+ */
+export declare const ALL_HASHES: {
+ readonly path: false;
+ readonly single: true;
+ readonly multi: "p1";
+ readonly implicit: undefined;
+};
+/**
+ * Creates a router and context setup for testing
+ */
+export declare function createRouterTestSetup(hash: Hash | undefined): {
+ readonly hash: Hash | undefined;
+ readonly router: RouterEngine;
+ readonly context: Map;
+ init: () => void;
+ dispose: () => void;
+};
+/**
+ * Creates a test snippet with the given content
+ */
+export declare function createTestSnippet(contentText: string): import("svelte").Snippet<[]>;
+/**
+ * Generates a new random route key
+ */
+export declare function newRandomRouteKey(): string;
+/**
+ * Adds a matching route to the router
+ */
+export declare function addMatchingRoute(router: RouterEngine, options?: RouteSpecs['specs']): string;
+/**
+ * Adds a non-matching route to the router
+ */
+export declare function addNonMatchingRoute(router: RouterEngine, options?: RouteSpecs['specs']): string;
+type RouteSpecs = {
+ count: number;
+ specs: Omit & {
+ name?: string;
+ };
+};
+export declare function addRoutes(router: RouterEngine, routes: {
+ matching?: number;
+ nonMatching?: number;
+}, ...add: (RouteInfo & {
+ name?: string;
+})[]): string[];
+export declare function addRoutes(router: RouterEngine, routes: {
+ matching?: RouteSpecs;
+ nonMatching?: RouteSpecs;
+}, ...add: (RouteInfo & {
+ name?: string;
+})[]): string[];
+/**
+ * Mock window.location object with getter/setter for href and other properties
+ */
+export declare function createLocationMock(initialUrl?: string): {
+ href: string;
+ readonly pathname: string;
+ search: string;
+ readonly hash: string;
+ readonly origin: string;
+ readonly protocol: string;
+ readonly host: string;
+ readonly hostname: string;
+ readonly port: string;
+};
+/**
+ * Mock window.history object with state management and navigation methods
+ */
+export declare function createHistoryMock(): {
+ state: any;
+ pushState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ replaceState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ readonly length: number;
+ go: import("vitest").Mock<(...args: any[]) => any>;
+ back: import("vitest").Mock<(...args: any[]) => any>;
+ forward: import("vitest").Mock<(...args: any[]) => any>;
+};
+/**
+ * Mock full window object with location, history, and event handling
+ */
+export declare function createWindowMock(initialUrl?: string): {
+ location: {
+ href: string;
+ readonly pathname: string;
+ search: string;
+ readonly hash: string;
+ readonly origin: string;
+ readonly protocol: string;
+ readonly host: string;
+ readonly hostname: string;
+ readonly port: string;
+ };
+ history: {
+ state: any;
+ pushState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ replaceState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ readonly length: number;
+ go: import("vitest").Mock<(...args: any[]) => any>;
+ back: import("vitest").Mock<(...args: any[]) => any>;
+ forward: import("vitest").Mock<(...args: any[]) => any>;
+ };
+ addEventListener: import("vitest").Mock<(type: string, listener: EventListener) => void>;
+ removeEventListener: import("vitest").Mock<(type: string, listener: EventListener) => void>;
+ dispatchEvent: import("vitest").Mock<(event: Event) => boolean>;
+ _getEventListeners: () => Map;
+ _clearEventListeners: () => void;
+};
+/**
+ * Sets up browser API mocks for testing
+ * Returns cleanup function to restore original values
+ */
+export declare function setupBrowserMocks(initialUrl?: string, libraryLocation?: {
+ url: {
+ href: string;
+ };
+}): {
+ window: {
+ location: {
+ href: string;
+ readonly pathname: string;
+ search: string;
+ readonly hash: string;
+ readonly origin: string;
+ readonly protocol: string;
+ readonly host: string;
+ readonly hostname: string;
+ readonly port: string;
+ };
+ history: {
+ state: any;
+ pushState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ replaceState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ readonly length: number;
+ go: import("vitest").Mock<(...args: any[]) => any>;
+ back: import("vitest").Mock<(...args: any[]) => any>;
+ forward: import("vitest").Mock<(...args: any[]) => any>;
+ };
+ addEventListener: import("vitest").Mock<(type: string, listener: EventListener) => void>;
+ removeEventListener: import("vitest").Mock<(type: string, listener: EventListener) => void>;
+ dispatchEvent: import("vitest").Mock<(event: Event) => boolean>;
+ _getEventListeners: () => Map;
+ _clearEventListeners: () => void;
+ };
+ location: {
+ href: string;
+ readonly pathname: string;
+ search: string;
+ readonly hash: string;
+ readonly origin: string;
+ readonly protocol: string;
+ readonly host: string;
+ readonly hostname: string;
+ readonly port: string;
+ };
+ history: {
+ state: any;
+ pushState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ replaceState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ readonly length: number;
+ go: import("vitest").Mock<(...args: any[]) => any>;
+ back: import("vitest").Mock<(...args: any[]) => any>;
+ forward: import("vitest").Mock<(...args: any[]) => any>;
+ };
+ cleanup: () => void;
+ setUrl: (url: string) => void;
+ setState: (state: any) => void;
+ triggerPopstate: (state?: any) => void;
+ triggerHashChange: () => void;
+ simulateHistoryChange: (state: any, url?: string) => void;
+};
+/**
+ * Simpler mock setup using vi.stubGlobal (alternative approach)
+ */
+export declare function setupSimpleBrowserMocks(initialUrl?: string): {
+ location: {
+ href: string;
+ readonly pathname: string;
+ search: string;
+ readonly hash: string;
+ readonly origin: string;
+ readonly protocol: string;
+ readonly host: string;
+ readonly hostname: string;
+ readonly port: string;
+ };
+ history: {
+ state: any;
+ pushState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ replaceState: import("vitest").Mock<(state: any, title: string, url?: string) => void>;
+ readonly length: number;
+ go: import("vitest").Mock<(...args: any[]) => any>;
+ back: import("vitest").Mock<(...args: any[]) => any>;
+ forward: import("vitest").Mock<(...args: any[]) => any>;
+ };
+ cleanup: () => void;
+ setUrl: (url: string) => void;
+ setState: (state: any) => void;
+};
+export {};
diff --git a/src/testing/test-utils.ts b/src/testing/test-utils.ts
index 3139470..d2171f5 100644
--- a/src/testing/test-utils.ts
+++ b/src/testing/test-utils.ts
@@ -1,8 +1,8 @@
import type { Hash, RouteInfo, RoutingOptions } from "$lib/types.js";
-import { RouterEngine } from "$lib/core/RouterEngine.svelte.js";
+import { RouterEngine } from "$lib/kernel/RouterEngine.svelte.js";
import { getRouterContextKey } from "../lib/Router/Router.svelte";
import { createRawSnippet } from "svelte";
-import { resolveHashValue } from "$lib/core/resolveHashValue.js";
+import { resolveHashValue } from "$lib/kernel/resolveHashValue.js";
import { vi } from "vitest";
/**