diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 732df205d0ae..92ebea6fc7b8 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -1026,8 +1026,8 @@ 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 + * - `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 * - `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 `` * - `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 `` * - `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 `` * - `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..2ae8aecc760b 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -1008,8 +1008,8 @@ 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 + * - `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 * - `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 `` * - `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 `` * - `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 `` * - `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. *