Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thick-mails-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: update broken links in JSDoc
6 changes: 3 additions & 3 deletions packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ export type Handle = (input: {
}) => MaybePromise<Response>;

/**
* The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#shared-hooks-handleError) hook runs when an unexpected error is thrown while responding to a request.
* The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while responding to a request.
*
* If an unexpected error is thrown during loading or rendering, this function will be called with the error and the event.
* Make sure that this function _never_ throws an error.
Expand All @@ -702,7 +702,7 @@ export type HandleServerError = (input: {
}) => MaybePromise<void | App.Error>;

/**
* The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#shared-hooks-handleError) hook runs when an unexpected error is thrown while navigating.
* The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while navigating.
*
* If an unexpected error is thrown during loading or the following render, this function will be called with the error and the event.
* Make sure that this function _never_ throws an error.
Expand All @@ -715,7 +715,7 @@ export type HandleClientError = (input: {
}) => MaybePromise<void | App.Error>;

/**
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering)
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering)
*/
export type HandleFetch = (input: {
event: RequestEvent;
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ declare namespace App {
export interface PageState {}

/**
* If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#platform-specific-context) via `event.platform`, you can specify it here.
* If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#Platform-specific-context) via `event.platform`, you can specify it here.
*/
export interface Platform {}
}
Expand Down
19 changes: 10 additions & 9 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ declare module '@sveltejs/kit' {
[uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure
}

type UnpackValidationError<T> = T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;
type UnpackValidationError<T> =
T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;

/**
* This object is passed to the `adapt` function of adapters.
Expand Down Expand Up @@ -671,7 +672,7 @@ declare module '@sveltejs/kit' {
}) => MaybePromise<Response>;

/**
* The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#shared-hooks-handleError) hook runs when an unexpected error is thrown while responding to a request.
* The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while responding to a request.
*
* If an unexpected error is thrown during loading or rendering, this function will be called with the error and the event.
* Make sure that this function _never_ throws an error.
Expand All @@ -684,7 +685,7 @@ declare module '@sveltejs/kit' {
}) => MaybePromise<void | App.Error>;

/**
* The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#shared-hooks-handleError) hook runs when an unexpected error is thrown while navigating.
* The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while navigating.
*
* If an unexpected error is thrown during loading or the following render, this function will be called with the error and the event.
* Make sure that this function _never_ throws an error.
Expand All @@ -697,7 +698,7 @@ declare module '@sveltejs/kit' {
}) => MaybePromise<void | App.Error>;

/**
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering)
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering)
*/
export type HandleFetch = (input: {
event: RequestEvent;
Expand Down Expand Up @@ -2287,7 +2288,7 @@ declare namespace App {
export interface PageState {}

/**
* If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#platform-specific-context) via `event.platform`, you can specify it here.
* If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#Platform-specific-context) via `event.platform`, you can specify it here.
*/
export interface Platform {}
}
Expand Down
Loading