From 1f00492aee1c6df66eeeafe4e9dc8ca1f3841c68 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Tue, 25 Mar 2025 16:22:32 +0800 Subject: [PATCH 1/2] . --- packages/kit/src/exports/public.d.ts | 8 ++++---- packages/kit/types/index.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 732df205d0ae..51923a5076ac 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -1027,7 +1027,7 @@ export interface NavigationTarget { /** * - `enter`: The app has hydrated/started * - `form`: The user submitted a `
` with a GET method - * - `leave`: The user is leaving the app by closing the tab or using the back/forward buttons to go to a different document + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1045,7 +1045,7 @@ export interface Navigation { to: NavigationTarget | null; /** * The type of navigation: - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1083,7 +1083,7 @@ export interface BeforeNavigate extends Navigation { export interface OnNavigate extends Navigation { /** * The type of navigation: - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1102,7 +1102,7 @@ export interface AfterNavigate extends Omit { /** * The type of navigation: * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 3ac640b17196..39c48391d146 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -1009,7 +1009,7 @@ declare module '@sveltejs/kit' { /** * - `enter`: The app has hydrated/started * - `form`: The user submitted a `` with a GET method - * - `leave`: The user is leaving the app by closing the tab or using the back/forward buttons to go to a different document + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1027,7 +1027,7 @@ declare module '@sveltejs/kit' { to: NavigationTarget | null; /** * The type of navigation: - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1065,7 +1065,7 @@ declare module '@sveltejs/kit' { export interface OnNavigate extends Navigation { /** * The type of navigation: - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1084,7 +1084,7 @@ declare module '@sveltejs/kit' { /** * The type of navigation: * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` + * - `form`: The user submitted a `` with a GET method * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation From 955418fa9058da8532c2c697e2b5cee09f992ac1 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 12 Aug 2025 13:37:54 -0400 Subject: [PATCH 2/2] clarify --- packages/kit/src/exports/public.d.ts | 8 ++++---- packages/kit/types/index.d.ts | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 51923a5076ac..92ebea6fc7b8 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -1026,7 +1026,7 @@ export interface NavigationTarget { /** * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1045,7 +1045,7 @@ export interface Navigation { to: NavigationTarget | null; /** * The type of navigation: - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1083,7 +1083,7 @@ export interface BeforeNavigate extends Navigation { export interface OnNavigate extends Navigation { /** * The type of navigation: - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1102,7 +1102,7 @@ export interface AfterNavigate extends Omit { /** * The type of navigation: * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 39c48391d146..2ae8aecc760b 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -1008,7 +1008,7 @@ declare module '@sveltejs/kit' { /** * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1027,7 +1027,7 @@ declare module '@sveltejs/kit' { to: NavigationTarget | null; /** * The type of navigation: - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect @@ -1065,7 +1065,7 @@ declare module '@sveltejs/kit' { export interface OnNavigate extends Navigation { /** * The type of navigation: - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1084,7 +1084,7 @@ declare module '@sveltejs/kit' { /** * The type of navigation: * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` with a GET method + * - `form`: The user submitted a `` * - `link`: Navigation was triggered by a link click * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect * - `popstate`: Navigation was triggered by back/forward navigation @@ -1963,7 +1963,7 @@ declare module '@sveltejs/kit' { * Checks whether this is an error thrown by {@link error}. * @param status The status to filter for. * */ - export function isHttpError(e: unknown, status?: T | undefined): e is (HttpError_1 & { + export function isHttpError(e: unknown, status?: T): e is (HttpError_1 & { status: T extends undefined ? never : T; }); /** @@ -1993,13 +1993,13 @@ declare module '@sveltejs/kit' { * @param data The value that will be serialized as JSON. * @param init Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically. */ - export function json(data: any, init?: ResponseInit | undefined): Response; + export function json(data: any, init?: ResponseInit): Response; /** * Create a `Response` object from the supplied body. * @param body The value that will be used as-is. * @param init Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically. */ - export function text(body: string, init?: ResponseInit | undefined): Response; + export function text(body: string, init?: ResponseInit): Response; /** * Create an `ActionFailure` object. * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. @@ -2298,7 +2298,7 @@ declare module '$app/navigation' { invalidateAll?: boolean | undefined; invalidate?: (string | URL | ((url: URL) => boolean))[] | undefined; state?: App.PageState | undefined; - } | undefined): Promise; + }): Promise; /** * 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. *