Skip to content

Commit 7804846

Browse files
Sync kit docs (#1424)
sync kit docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 1be9b8d commit 7804846

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Checks whether this is an error thrown by `error`.
150150
```dts
151151
function isHttpError<T extends number>(
152152
e: unknown,
153-
status?: T
153+
status?: T | undefined
154154
): e is HttpError_1 & {
155155
status: T extends undefined ? never : T;
156156
};
@@ -181,7 +181,10 @@ Create a JSON `Response` object from the supplied data.
181181
<div class="ts-block">
182182

183183
```dts
184-
function json(data: any, init?: ResponseInit): Response;
184+
function json(
185+
data: any,
186+
init?: ResponseInit | undefined
187+
): Response;
185188
```
186189

187190
</div>
@@ -264,7 +267,10 @@ Create a `Response` object from the supplied body.
264267
<div class="ts-block">
265268

266269
```dts
267-
function text(body: string, init?: ResponseInit): Response;
270+
function text(
271+
body: string,
272+
init?: ResponseInit | undefined
273+
): Response;
268274
```
269275

270276
</div>
@@ -2472,7 +2478,7 @@ A map of environment variables.
24722478
<div class="ts-block-property">
24732479

24742480
```dts
2475-
read?: (file: string) => ReadableStream;
2481+
read?: (file: string) => MaybePromise<ReadableStream | null>;
24762482
```
24772483

24782484
<div class="ts-block-property-details">

apps/svelte.dev/content/docs/kit/98-reference/20-$app-navigation.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,18 @@ For external URLs, use `window.location = url` instead of calling `goto(url)`.
9595
```dts
9696
function goto(
9797
url: string | URL,
98-
opts?: {
99-
replaceState?: boolean | undefined;
100-
noScroll?: boolean | undefined;
101-
keepFocus?: boolean | undefined;
102-
invalidateAll?: boolean | undefined;
103-
invalidate?:
104-
| (string | URL | ((url: URL) => boolean))[]
105-
| undefined;
106-
state?: App.PageState | undefined;
107-
}
98+
opts?:
99+
| {
100+
replaceState?: boolean | undefined;
101+
noScroll?: boolean | undefined;
102+
keepFocus?: boolean | undefined;
103+
invalidateAll?: boolean | undefined;
104+
invalidate?:
105+
| (string | URL | ((url: URL) => boolean))[]
106+
| undefined;
107+
state?: App.PageState | undefined;
108+
}
109+
| undefined
108110
): Promise<void>;
109111
```
110112

0 commit comments

Comments
 (0)