Skip to content

Commit

Permalink
fix: generate types
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 23, 2024
1 parent 4958421 commit f9a9816
Showing 1 changed file with 10 additions and 9 deletions.
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 @@ -706,7 +707,7 @@ declare module '@sveltejs/kit' {
}) => MaybePromise<Response>;

/**
* The [`reroute`](https://svelte.dev/docs/kit/hooks#universal-hooks-reroute) hook allows you to modify the URL before it is used to determine which route to render.
* The [`reroute`](https://svelte.dev/docs/kit/hooks#Universal-hooks-reroute) hook allows you to modify the URL before it is used to determine which route to render.
* @since 2.3.0
*/
export type Reroute = (event: { url: URL }) => void | string;
Expand Down Expand Up @@ -742,7 +743,7 @@ declare module '@sveltejs/kit' {
* - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
*
* You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#cookies)
* You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
*/
fetch: typeof fetch;
/**
Expand Down Expand Up @@ -1014,7 +1015,7 @@ declare module '@sveltejs/kit' {
}

/**
* The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#matching) for more info.
* The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#Matching) for more info.
*/
export type ParamMatcher = (param: string) => boolean;

Expand All @@ -1035,7 +1036,7 @@ declare module '@sveltejs/kit' {
* - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
*
* You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#cookies)
* You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
*/
fetch: typeof fetch;
/**
Expand Down

0 comments on commit f9a9816

Please sign in to comment.