Skip to content

Commit 102e4a5

Browse files
fix: goto type include state (#11398)
* fix: goto type include state * Create mighty-rockets-work.md * generate types * fix type
1 parent 56eb028 commit 102e4a5

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/mighty-rockets-work.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sveltejs/kit": patch
3+
---
4+
5+
fix: goto type include state

packages/kit/src/runtime/app/navigation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const disableScrollHandling = /* @__PURE__ */ client_method('disable_scro
1111
* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
1212
* For external URLs, use `window.location = url` instead of calling `goto(url)`.
1313
*
14-
* @type {(url: string | URL, opts?: { replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; }) => Promise<void>}
14+
* @type {(url: string | URL, opts?: { replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; state?: App.PageState }) => Promise<void>}
1515
* @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
1616
* @param {Object} [opts] Options related to the navigation
1717
* @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState`

packages/kit/types/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,7 @@ declare module '$app/navigation' {
19591959
noScroll?: boolean;
19601960
keepFocus?: boolean;
19611961
invalidateAll?: boolean;
1962+
state?: App.PageState;
19621963
}) => Promise<void>;
19631964
/**
19641965
* Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated.

0 commit comments

Comments
 (0)