From a2d365868a926c36e20065d481654e56ae072a91 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 5 Nov 2024 13:34:37 -0500 Subject: [PATCH 1/3] fix: update broken links in JSDoc --- .changeset/thick-mails-wonder.md | 5 +++++ packages/kit/src/exports/public.d.ts | 17 +++++++++-------- packages/kit/src/types/ambient.d.ts | 2 +- packages/kit/types/index.d.ts | 19 ++++++++++--------- 4 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 .changeset/thick-mails-wonder.md diff --git a/.changeset/thick-mails-wonder.md b/.changeset/thick-mails-wonder.md new file mode 100644 index 000000000000..36b3d813c0db --- /dev/null +++ b/.changeset/thick-mails-wonder.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: update broken links in JSDoc diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 77be062a3163..66f959f78fe8 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -79,11 +79,12 @@ export interface ActionFailure | undefined = u [uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure } -type UnpackValidationError = T extends ActionFailure - ? X - : T extends void - ? undefined // needs to be undefined, because void will corrupt union type - : T; +type UnpackValidationError = + T extends ActionFailure + ? 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. @@ -689,7 +690,7 @@ export type Handle = (input: { }) => MaybePromise; /** - * 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. @@ -702,7 +703,7 @@ export type HandleServerError = (input: { }) => MaybePromise; /** - * 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. @@ -715,7 +716,7 @@ export type HandleClientError = (input: { }) => MaybePromise; /** - * 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; diff --git a/packages/kit/src/types/ambient.d.ts b/packages/kit/src/types/ambient.d.ts index 16ef13016deb..496fc537cf4d 100644 --- a/packages/kit/src/types/ambient.d.ts +++ b/packages/kit/src/types/ambient.d.ts @@ -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 {} } diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 491de54d9698..0a26c7baddcf 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -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 extends ActionFailure - ? X - : T extends void - ? undefined // needs to be undefined, because void will corrupt union type - : T; + type UnpackValidationError = + T extends ActionFailure + ? 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. @@ -671,7 +672,7 @@ declare module '@sveltejs/kit' { }) => MaybePromise; /** - * 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. @@ -684,7 +685,7 @@ declare module '@sveltejs/kit' { }) => MaybePromise; /** - * 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. @@ -697,7 +698,7 @@ declare module '@sveltejs/kit' { }) => MaybePromise; /** - * 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; @@ -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 {} } From 43f0e4151275d5f95fca0923d208c37a2fa0602e Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 5 Nov 2024 13:41:48 -0500 Subject: [PATCH 2/3] bump --- packages/kit/src/exports/public.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 66f959f78fe8..92136d609c10 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -79,12 +79,11 @@ export interface ActionFailure | undefined = u [uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure } -type UnpackValidationError = - T extends ActionFailure - ? X - : T extends void - ? undefined // needs to be undefined, because void will corrupt union type - : T; +type UnpackValidationError = T extends ActionFailure + ? 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. From 15dcb8c77d9bb010af3936ce574b6f1b56929218 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 5 Nov 2024 13:43:52 -0500 Subject: [PATCH 3/3] I WILL STAB YOU --- packages/kit/types/index.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 0a26c7baddcf..3f04154119cf 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -61,12 +61,11 @@ declare module '@sveltejs/kit' { [uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure } - type UnpackValidationError = - T extends ActionFailure - ? X - : T extends void - ? undefined // needs to be undefined, because void will corrupt union type - : T; + type UnpackValidationError = T extends ActionFailure + ? 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.