*
* ```
*/
depends: (...deps: Array<`${string}:${string}`>) => void;
/**
* Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example:
*
* ```js
* /// file: src/routes/+page.server.js
* export async function load({ untrack, url }) {
* // Untrack url.pathname so that path changes don't trigger a rerun
* if (untrack(() => url.pathname === '/')) {
* return { message: 'Welcome!' };
* }
* }
* ```
*/
untrack: (fn: () => T) => T;
}
export interface NavigationEvent<
Params extends Partial> = Partial>,
RouteId extends string | null = string | null
> {
/**
* The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object
*/
params: Params;
/**
* Info about the current route
*/
route: {
/**
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
*/
id: RouteId;
};
/**
* The URL of the current page
*/
url: URL;
}
/**
* Information about the target of a specific navigation.
*/
export interface NavigationTarget {
/**
* Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
* Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
*/
params: Record | null;
/**
* Info about the target route
*/
route: {
/**
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
*/
id: string | null;
};
/**
* The URL that is navigated to
*/
url: URL;
}
/**
* - `enter`: The app has hydrated/started
* - `form`: The user submitted a `