@sveltejs/kit 1.22.2 → 1.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/src/core/adapt/builder.js +2 -10
- package/src/exports/public.d.ts +12 -10
- package/src/exports/vite/index.js +2 -1
- package/src/runtime/server/fetch.js +3 -1
- package/src/runtime/server/respond.js +7 -0
- package/src/version.js +1 -1
- package/types/index.d.ts +125 -312
- package/types/index.d.ts.map +2 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.4",
|
|
4
4
|
"description": "The fastest way to build Svelte apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"@types/node": "^16.18.6",
|
|
33
33
|
"@types/sade": "^1.7.4",
|
|
34
34
|
"@types/set-cookie-parser": "^2.4.2",
|
|
35
|
-
"dts-buddy": "^0.
|
|
35
|
+
"dts-buddy": "^0.1.9",
|
|
36
36
|
"marked": "^4.2.3",
|
|
37
37
|
"rollup": "^3.7.0",
|
|
38
38
|
"svelte": "^4.0.5",
|
|
39
39
|
"svelte-preprocess": "^5.0.4",
|
|
40
40
|
"typescript": "^4.9.4",
|
|
41
41
|
"vite": "^4.4.2",
|
|
42
|
-
"vitest": "^0.
|
|
42
|
+
"vitest": "^0.33.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"svelte": "^3.54.0 || ^4.0.0-next.0",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"test:cross-platform:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:build",
|
|
96
96
|
"test:unit": "vitest --config kit.vitest.config.js run",
|
|
97
97
|
"postinstall": "node postinstall.js",
|
|
98
|
-
"generate:version": "node scripts/generate-version.js"
|
|
98
|
+
"generate:version": "node scripts/generate-version.js",
|
|
99
|
+
"generate:types": "node scripts/generate-dts.js"
|
|
99
100
|
}
|
|
100
101
|
}
|
|
@@ -154,7 +154,7 @@ export function create_builder({
|
|
|
154
154
|
write(dest, fallback);
|
|
155
155
|
},
|
|
156
156
|
|
|
157
|
-
generateManifest
|
|
157
|
+
generateManifest({ relativePath, routes: subset }) {
|
|
158
158
|
return generate_manifest({
|
|
159
159
|
build_data,
|
|
160
160
|
relative_path: relativePath,
|
|
@@ -189,15 +189,7 @@ export function create_builder({
|
|
|
189
189
|
return Array.from(new Set([...server_assets, ...client_assets]));
|
|
190
190
|
},
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
writePrerendered(dest, opts) {
|
|
194
|
-
// TODO remove for 1.0
|
|
195
|
-
if (opts?.fallback) {
|
|
196
|
-
throw new Error(
|
|
197
|
-
'The fallback option no longer exists — use builder.generateFallback(fallback) instead'
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
|
|
192
|
+
writePrerendered(dest) {
|
|
201
193
|
const source = `${config.kit.outDir}/output/prerendered`;
|
|
202
194
|
return [...copy(`${source}/pages`, dest), ...copy(`${source}/dependencies`, dest)];
|
|
203
195
|
},
|
package/src/exports/public.d.ts
CHANGED
|
@@ -697,13 +697,13 @@ export interface LoadEvent<
|
|
|
697
697
|
/**
|
|
698
698
|
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
699
699
|
*
|
|
700
|
-
* -
|
|
701
|
-
* -
|
|
702
|
-
* -
|
|
703
|
-
* -
|
|
704
|
-
* -
|
|
700
|
+
* - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
|
|
701
|
+
* - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
|
|
702
|
+
* - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
|
|
703
|
+
* - 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://kit.svelte.dev/docs/hooks#server-hooks-handle)
|
|
704
|
+
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
|
|
705
705
|
*
|
|
706
|
-
*
|
|
706
|
+
* You can learn more about making credentialed requests with cookies [here](https://kit.svelte.dev/docs/load#cookies)
|
|
707
707
|
*/
|
|
708
708
|
fetch: typeof fetch;
|
|
709
709
|
/**
|
|
@@ -949,11 +949,13 @@ export interface RequestEvent<
|
|
|
949
949
|
/**
|
|
950
950
|
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
951
951
|
*
|
|
952
|
-
* -
|
|
953
|
-
* -
|
|
954
|
-
* -
|
|
952
|
+
* - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
|
|
953
|
+
* - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
|
|
954
|
+
* - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
|
|
955
|
+
* - 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://kit.svelte.dev/docs/hooks#server-hooks-handle)
|
|
956
|
+
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
|
|
955
957
|
*
|
|
956
|
-
*
|
|
958
|
+
* You can learn more about making credentialed requests with cookies [here](https://kit.svelte.dev/docs/load#cookies)
|
|
957
959
|
*/
|
|
958
960
|
fetch: typeof fetch;
|
|
959
961
|
/**
|
|
@@ -545,7 +545,8 @@ function kit({ svelte_config }) {
|
|
|
545
545
|
// E.g. Vite generates `new URL('/asset.png', import.meta).href` for a relative path vs just '/asset.png'.
|
|
546
546
|
// That's larger and takes longer to run and also causes an HTML diff between SSR and client
|
|
547
547
|
// causing us to do a more expensive hydration check.
|
|
548
|
-
const client_base =
|
|
548
|
+
const client_base =
|
|
549
|
+
kit.paths.relative !== false || kit.paths.assets ? './' : kit.paths.base || '/';
|
|
549
550
|
|
|
550
551
|
new_config = {
|
|
551
552
|
base: ssr ? assets_base(kit) : client_base,
|
|
@@ -51,7 +51,7 @@ export function create_fetch({ event, options, manifest, state, get_cookie_heade
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (url.origin !== event.url.origin) {
|
|
54
|
-
//
|
|
54
|
+
// Allow cookie passthrough for "credentials: same-origin" and "credentials: include"
|
|
55
55
|
// if SvelteKit is serving my.domain.com:
|
|
56
56
|
// - domain.com WILL NOT receive cookies
|
|
57
57
|
// - my.domain.com WILL receive cookies
|
|
@@ -59,6 +59,8 @@ export function create_fetch({ event, options, manifest, state, get_cookie_heade
|
|
|
59
59
|
// - sub.my.domain.com WILL receive cookies
|
|
60
60
|
// ports do not affect the resolution
|
|
61
61
|
// leading dot prevents mydomain.com matching domain.com
|
|
62
|
+
// Do not forward other cookies for "credentials: include" because we don't know
|
|
63
|
+
// which cookie belongs to which domain (browser does not pass this info)
|
|
62
64
|
if (`.${url.hostname}`.endsWith(`.${event.url.hostname}`) && credentials !== 'omit') {
|
|
63
65
|
const cookie = get_cookie_header(url, request.headers.get('cookie'));
|
|
64
66
|
if (cookie) request.headers.set('cookie', cookie);
|
|
@@ -440,6 +440,13 @@ export async function respond(request, options, manifest, state) {
|
|
|
440
440
|
?.split(',')
|
|
441
441
|
?.map((v) => v.trim().toLowerCase());
|
|
442
442
|
if (!(vary?.includes('accept') || vary?.includes('*'))) {
|
|
443
|
+
// the returned response might have immutable headers,
|
|
444
|
+
// so we have to clone them before trying to mutate them
|
|
445
|
+
response = new Response(response.body, {
|
|
446
|
+
status: response.status,
|
|
447
|
+
statusText: response.statusText,
|
|
448
|
+
headers: new Headers(response.headers)
|
|
449
|
+
});
|
|
443
450
|
response.headers.append('Vary', 'Accept');
|
|
444
451
|
}
|
|
445
452
|
}
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import 'vite/client';
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
/// <reference types="vite/client" />
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
declare module '@sveltejs/kit' {
|
|
5
|
+
import type { CompileOptions } from 'svelte/types/compiler/interfaces';
|
|
6
6
|
import type { PluginOptions } from '@sveltejs/vite-plugin-svelte';
|
|
7
|
-
export { ActionFailure };
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* [Adapters](https://kit.svelte.dev/docs/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing.
|
|
11
9
|
*/
|
|
@@ -16,7 +14,8 @@ declare module '@sveltejs/kit' {
|
|
|
16
14
|
name: string;
|
|
17
15
|
/**
|
|
18
16
|
* This function is called after SvelteKit has built your app.
|
|
19
|
-
*
|
|
17
|
+
* @param builder An object provided by SvelteKit that contains methods for adapting the app
|
|
18
|
+
*/
|
|
20
19
|
adapt(builder: Builder): MaybePromise<void>;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -75,7 +74,9 @@ declare module '@sveltejs/kit' {
|
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* Create separate functions that map to one or more routes of your app.
|
|
78
|
-
*
|
|
77
|
+
* @param fn A function that groups a set of routes into an entry point
|
|
78
|
+
* @deprecated Use `builder.routes` instead
|
|
79
|
+
*/
|
|
79
80
|
createEntries(fn: (route: RouteDefinition) => AdapterEntry): Promise<void>;
|
|
80
81
|
|
|
81
82
|
/**
|
|
@@ -85,12 +86,14 @@ declare module '@sveltejs/kit' {
|
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
88
|
* Generate a server-side manifest to initialise the SvelteKit [server](https://kit.svelte.dev/docs/types#public-types-server) with.
|
|
88
|
-
*
|
|
89
|
+
* @param opts a relative path to the base directory of the app and optionally in which format (esm or cjs) the manifest should be generated
|
|
90
|
+
*/
|
|
89
91
|
generateManifest(opts: { relativePath: string; routes?: RouteDefinition[] }): string;
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
94
|
* Resolve a path to the `name` directory inside `outDir`, e.g. `/path/to/.svelte-kit/my-adapter`.
|
|
93
|
-
*
|
|
95
|
+
* @param name path to the file, relative to the build directory
|
|
96
|
+
*/
|
|
94
97
|
getBuildDirectory(name: string): string;
|
|
95
98
|
/** Get the fully resolved path to the directory containing client-side assets, including the contents of your `static` directory. */
|
|
96
99
|
getClientDirectory(): string;
|
|
@@ -101,19 +104,30 @@ declare module '@sveltejs/kit' {
|
|
|
101
104
|
|
|
102
105
|
/**
|
|
103
106
|
* Write client assets to `dest`.
|
|
104
|
-
*
|
|
107
|
+
* @param dest the destination folder
|
|
108
|
+
* @returns an array of files written to `dest`
|
|
109
|
+
*/
|
|
105
110
|
writeClient(dest: string): string[];
|
|
106
111
|
/**
|
|
107
112
|
* Write prerendered files to `dest`.
|
|
108
|
-
*
|
|
113
|
+
* @param dest the destination folder
|
|
114
|
+
* @returns an array of files written to `dest`
|
|
115
|
+
*/
|
|
109
116
|
writePrerendered(dest: string): string[];
|
|
110
117
|
/**
|
|
111
118
|
* Write server-side code to `dest`.
|
|
112
|
-
*
|
|
119
|
+
* @param dest the destination folder
|
|
120
|
+
* @returns an array of files written to `dest`
|
|
121
|
+
*/
|
|
113
122
|
writeServer(dest: string): string[];
|
|
114
123
|
/**
|
|
115
124
|
* Copy a file or directory.
|
|
116
|
-
*
|
|
125
|
+
* @param from the source file or directory
|
|
126
|
+
* @param to the destination file or directory
|
|
127
|
+
* @param opts.filter a function to determine whether a file or directory should be copied
|
|
128
|
+
* @param opts.replace a map of strings to replace
|
|
129
|
+
* @returns an array of files that were copied
|
|
130
|
+
*/
|
|
117
131
|
copy(
|
|
118
132
|
from: string,
|
|
119
133
|
to: string,
|
|
@@ -125,7 +139,8 @@ declare module '@sveltejs/kit' {
|
|
|
125
139
|
|
|
126
140
|
/**
|
|
127
141
|
* Compress files in `directory` with gzip and brotli, where appropriate. Generates `.gz` and `.br` files alongside the originals.
|
|
128
|
-
*
|
|
142
|
+
* @param directory The directory containing the files to be compressed
|
|
143
|
+
*/
|
|
129
144
|
compress(directory: string): Promise<void>;
|
|
130
145
|
}
|
|
131
146
|
|
|
@@ -161,12 +176,15 @@ declare module '@sveltejs/kit' {
|
|
|
161
176
|
export interface Cookies {
|
|
162
177
|
/**
|
|
163
178
|
* Gets a cookie that was previously set with `cookies.set`, or from the request headers.
|
|
164
|
-
*
|
|
179
|
+
* @param name the name of the cookie
|
|
180
|
+
* @param opts the options, passed directly to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options)
|
|
181
|
+
*/
|
|
165
182
|
get(name: string, opts?: import('cookie').CookieParseOptions): string | undefined;
|
|
166
183
|
|
|
167
184
|
/**
|
|
168
185
|
* Gets all cookies that were previously set with `cookies.set`, or from the request headers.
|
|
169
|
-
*
|
|
186
|
+
* @param opts the options, passed directily to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options)
|
|
187
|
+
*/
|
|
170
188
|
getAll(opts?: import('cookie').CookieParseOptions): Array<{ name: string; value: string }>;
|
|
171
189
|
|
|
172
190
|
/**
|
|
@@ -175,14 +193,19 @@ declare module '@sveltejs/kit' {
|
|
|
175
193
|
* The `httpOnly` and `secure` options are `true` by default (except on http://localhost, where `secure` is `false`), and must be explicitly disabled if you want cookies to be readable by client-side JavaScript and/or transmitted over HTTP. The `sameSite` option defaults to `lax`.
|
|
176
194
|
*
|
|
177
195
|
* By default, the `path` of a cookie is the 'directory' of the current pathname. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app.
|
|
178
|
-
*
|
|
196
|
+
* @param name the name of the cookie
|
|
197
|
+
* @param value the cookie value
|
|
198
|
+
* @param opts the options, passed directory to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options)
|
|
199
|
+
*/
|
|
179
200
|
set(name: string, value: string, opts?: import('cookie').CookieSerializeOptions): void;
|
|
180
201
|
|
|
181
202
|
/**
|
|
182
203
|
* Deletes a cookie by setting its value to an empty string and setting the expiry date in the past.
|
|
183
204
|
*
|
|
184
205
|
* By default, the `path` of a cookie is the 'directory' of the current pathname. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app.
|
|
185
|
-
*
|
|
206
|
+
* @param name the name of the cookie
|
|
207
|
+
* @param opts the options, passed directory to `cookie.serialize`. The `path` must match the path of the cookie you want to delete. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options)
|
|
208
|
+
*/
|
|
186
209
|
delete(name: string, opts?: import('cookie').CookieSerializeOptions): void;
|
|
187
210
|
|
|
188
211
|
/**
|
|
@@ -192,7 +215,10 @@ declare module '@sveltejs/kit' {
|
|
|
192
215
|
*
|
|
193
216
|
* By default, the `path` of a cookie is the current pathname. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app.
|
|
194
217
|
*
|
|
195
|
-
*
|
|
218
|
+
* @param name the name of the cookie
|
|
219
|
+
* @param value the cookie value
|
|
220
|
+
* @param opts the options, passed directory to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options)
|
|
221
|
+
*/
|
|
196
222
|
serialize(name: string, value: string, opts?: import('cookie').CookieSerializeOptions): string;
|
|
197
223
|
}
|
|
198
224
|
|
|
@@ -651,13 +677,13 @@ declare module '@sveltejs/kit' {
|
|
|
651
677
|
/**
|
|
652
678
|
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
653
679
|
*
|
|
654
|
-
* -
|
|
655
|
-
* -
|
|
656
|
-
* -
|
|
657
|
-
* -
|
|
658
|
-
* -
|
|
680
|
+
* - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
|
|
681
|
+
* - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
|
|
682
|
+
* - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
|
|
683
|
+
* - 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://kit.svelte.dev/docs/hooks#server-hooks-handle)
|
|
684
|
+
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
|
|
659
685
|
*
|
|
660
|
-
*
|
|
686
|
+
* You can learn more about making credentialed requests with cookies [here](https://kit.svelte.dev/docs/load#cookies)
|
|
661
687
|
*/
|
|
662
688
|
fetch: typeof fetch;
|
|
663
689
|
/**
|
|
@@ -903,11 +929,13 @@ declare module '@sveltejs/kit' {
|
|
|
903
929
|
/**
|
|
904
930
|
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
905
931
|
*
|
|
906
|
-
* -
|
|
907
|
-
* -
|
|
908
|
-
* -
|
|
932
|
+
* - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
|
|
933
|
+
* - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
|
|
934
|
+
* - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
|
|
935
|
+
* - 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://kit.svelte.dev/docs/hooks#server-hooks-handle)
|
|
936
|
+
* - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
|
|
909
937
|
*
|
|
910
|
-
*
|
|
938
|
+
* You can learn more about making credentialed requests with cookies [here](https://kit.svelte.dev/docs/load#cookies)
|
|
911
939
|
*/
|
|
912
940
|
fetch: typeof fetch;
|
|
913
941
|
/**
|
|
@@ -992,17 +1020,21 @@ declare module '@sveltejs/kit' {
|
|
|
992
1020
|
* Applies custom transforms to HTML. If `done` is true, it's the final chunk. Chunks are not guaranteed to be well-formed HTML
|
|
993
1021
|
* (they could include an element's opening tag but not its closing tag, for example)
|
|
994
1022
|
* but they will always be split at sensible boundaries such as `%sveltekit.head%` or layout/page components.
|
|
995
|
-
*
|
|
1023
|
+
* @param input the html chunk and the info if this is the last chunk
|
|
1024
|
+
*/
|
|
996
1025
|
transformPageChunk?(input: { html: string; done: boolean }): MaybePromise<string | undefined>;
|
|
997
1026
|
/**
|
|
998
1027
|
* Determines which headers should be included in serialized responses when a `load` function loads a resource with `fetch`.
|
|
999
1028
|
* By default, none will be included.
|
|
1000
|
-
*
|
|
1029
|
+
* @param name header name
|
|
1030
|
+
* @param value header value
|
|
1031
|
+
*/
|
|
1001
1032
|
filterSerializedResponseHeaders?(name: string, value: string): boolean;
|
|
1002
1033
|
/**
|
|
1003
1034
|
* Determines what should be added to the `<head>` tag to preload it.
|
|
1004
1035
|
* By default, `js` and `css` files will be preloaded.
|
|
1005
|
-
*
|
|
1036
|
+
* @param input the type of the file and its path
|
|
1037
|
+
*/
|
|
1006
1038
|
preload?(input: { type: 'font' | 'css' | 'js' | 'asset'; path: string }): boolean;
|
|
1007
1039
|
}
|
|
1008
1040
|
|
|
@@ -1174,12 +1206,14 @@ declare module '@sveltejs/kit' {
|
|
|
1174
1206
|
action: URL;
|
|
1175
1207
|
/**
|
|
1176
1208
|
* use `formData` instead of `data`
|
|
1177
|
-
*
|
|
1209
|
+
* @deprecated
|
|
1210
|
+
*/
|
|
1178
1211
|
data: FormData;
|
|
1179
1212
|
formData: FormData;
|
|
1180
1213
|
/**
|
|
1181
1214
|
* use `formElement` instead of `form`
|
|
1182
|
-
*
|
|
1215
|
+
* @deprecated
|
|
1216
|
+
*/
|
|
1183
1217
|
form: HTMLFormElement;
|
|
1184
1218
|
formElement: HTMLFormElement;
|
|
1185
1219
|
controller: AbortController;
|
|
@@ -1190,19 +1224,22 @@ declare module '@sveltejs/kit' {
|
|
|
1190
1224
|
| ((opts: {
|
|
1191
1225
|
/**
|
|
1192
1226
|
* use `formData` instead of `data`
|
|
1193
|
-
*
|
|
1227
|
+
* @deprecated
|
|
1228
|
+
*/
|
|
1194
1229
|
data: FormData;
|
|
1195
1230
|
formData: FormData;
|
|
1196
1231
|
/**
|
|
1197
1232
|
* use `formElement` instead of `form`
|
|
1198
|
-
*
|
|
1233
|
+
* @deprecated
|
|
1234
|
+
*/
|
|
1199
1235
|
form: HTMLFormElement;
|
|
1200
1236
|
formElement: HTMLFormElement;
|
|
1201
1237
|
action: URL;
|
|
1202
1238
|
result: ActionResult<Success, Failure>;
|
|
1203
1239
|
/**
|
|
1204
1240
|
* Call this to get the default behavior of a form submission response.
|
|
1205
|
-
*
|
|
1241
|
+
* @param options Set `reset: false` if you don't want the `<form>` values to be reset after a successful submission.
|
|
1242
|
+
*/
|
|
1206
1243
|
update(options?: { reset: boolean }): Promise<void>;
|
|
1207
1244
|
}) => void)
|
|
1208
1245
|
>;
|
|
@@ -1214,7 +1251,7 @@ declare module '@sveltejs/kit' {
|
|
|
1214
1251
|
capture: () => T;
|
|
1215
1252
|
restore: (snapshot: T) => void;
|
|
1216
1253
|
}
|
|
1217
|
-
|
|
1254
|
+
interface AdapterEntry {
|
|
1218
1255
|
/**
|
|
1219
1256
|
* A string that uniquely identifies an HTTP service (e.g. serverless function) and is used for deduplication.
|
|
1220
1257
|
* For example, `/foo/a-[b]` and `/foo/[c]` are different routes, but would both
|
|
@@ -1264,7 +1301,7 @@ declare module '@sveltejs/kit' {
|
|
|
1264
1301
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1265
1302
|
// SOFTWARE.
|
|
1266
1303
|
|
|
1267
|
-
|
|
1304
|
+
namespace Csp {
|
|
1268
1305
|
type ActionSource = 'strict-dynamic' | 'report-sample';
|
|
1269
1306
|
type BaseSource =
|
|
1270
1307
|
| 'self'
|
|
@@ -1286,7 +1323,7 @@ declare module '@sveltejs/kit' {
|
|
|
1286
1323
|
type UriPath = `${HttpDelineator}${string}`;
|
|
1287
1324
|
}
|
|
1288
1325
|
|
|
1289
|
-
|
|
1326
|
+
interface CspDirectives {
|
|
1290
1327
|
'child-src'?: Csp.Sources;
|
|
1291
1328
|
'default-src'?: Array<Csp.Source | Csp.ActionSource>;
|
|
1292
1329
|
'frame-src'?: Csp.Sources;
|
|
@@ -1330,16 +1367,16 @@ declare module '@sveltejs/kit' {
|
|
|
1330
1367
|
'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>;
|
|
1331
1368
|
'upgrade-insecure-requests'?: boolean;
|
|
1332
1369
|
|
|
1333
|
-
|
|
1370
|
+
/** @deprecated */
|
|
1334
1371
|
'require-sri-for'?: Array<'script' | 'style' | 'script style'>;
|
|
1335
1372
|
|
|
1336
|
-
|
|
1373
|
+
/** @deprecated */
|
|
1337
1374
|
'block-all-mixed-content'?: boolean;
|
|
1338
1375
|
|
|
1339
|
-
|
|
1376
|
+
/** @deprecated */
|
|
1340
1377
|
'plugin-types'?: Array<`${string}/${string}` | 'none'>;
|
|
1341
1378
|
|
|
1342
|
-
|
|
1379
|
+
/** @deprecated */
|
|
1343
1380
|
referrer?: Array<
|
|
1344
1381
|
| 'no-referrer'
|
|
1345
1382
|
| 'no-referrer-when-downgrade'
|
|
@@ -1353,9 +1390,9 @@ declare module '@sveltejs/kit' {
|
|
|
1353
1390
|
>;
|
|
1354
1391
|
}
|
|
1355
1392
|
|
|
1356
|
-
|
|
1393
|
+
type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS';
|
|
1357
1394
|
|
|
1358
|
-
|
|
1395
|
+
interface Logger {
|
|
1359
1396
|
(msg: string): void;
|
|
1360
1397
|
success(msg: string): void;
|
|
1361
1398
|
error(msg: string): void;
|
|
@@ -1364,9 +1401,9 @@ declare module '@sveltejs/kit' {
|
|
|
1364
1401
|
info(msg: string): void;
|
|
1365
1402
|
}
|
|
1366
1403
|
|
|
1367
|
-
|
|
1404
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
1368
1405
|
|
|
1369
|
-
|
|
1406
|
+
interface Prerendered {
|
|
1370
1407
|
/**
|
|
1371
1408
|
* A map of `path` to `{ file }` objects, where a path like `/foo` corresponds to `foo.html` and a path like `/bar/` corresponds to `bar/index.html`.
|
|
1372
1409
|
*/
|
|
@@ -1401,7 +1438,7 @@ declare module '@sveltejs/kit' {
|
|
|
1401
1438
|
paths: string[];
|
|
1402
1439
|
}
|
|
1403
1440
|
|
|
1404
|
-
|
|
1441
|
+
interface PrerenderHttpErrorHandler {
|
|
1405
1442
|
(details: {
|
|
1406
1443
|
status: number;
|
|
1407
1444
|
path: string;
|
|
@@ -1411,17 +1448,17 @@ declare module '@sveltejs/kit' {
|
|
|
1411
1448
|
}): void;
|
|
1412
1449
|
}
|
|
1413
1450
|
|
|
1414
|
-
|
|
1451
|
+
interface PrerenderMissingIdHandler {
|
|
1415
1452
|
(details: { path: string; id: string; referrers: string[]; message: string }): void;
|
|
1416
1453
|
}
|
|
1417
1454
|
|
|
1418
|
-
|
|
1455
|
+
interface PrerenderEntryGeneratorMismatchHandler {
|
|
1419
1456
|
(details: { generatedFromId: string; entry: string; matchedId: string; message: string }): void;
|
|
1420
1457
|
}
|
|
1421
1458
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1459
|
+
type PrerenderHttpErrorHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderHttpErrorHandler;
|
|
1460
|
+
type PrerenderMissingIdHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderMissingIdHandler;
|
|
1461
|
+
type PrerenderEntryGeneratorMismatchHandlerValue =
|
|
1425
1462
|
| 'fail'
|
|
1426
1463
|
| 'warn'
|
|
1427
1464
|
| 'ignore'
|
|
@@ -1429,33 +1466,19 @@ declare module '@sveltejs/kit' {
|
|
|
1429
1466
|
|
|
1430
1467
|
export type PrerenderOption = boolean | 'auto';
|
|
1431
1468
|
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
export interface RequestOptions {
|
|
1469
|
+
interface RequestOptions {
|
|
1435
1470
|
getClientAddress(): string;
|
|
1436
1471
|
platform?: App.Platform;
|
|
1437
1472
|
}
|
|
1438
1473
|
|
|
1439
|
-
|
|
1474
|
+
interface RouteSegment {
|
|
1440
1475
|
content: string;
|
|
1441
1476
|
dynamic: boolean;
|
|
1442
1477
|
rest: boolean;
|
|
1443
1478
|
}
|
|
1444
1479
|
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
* This is a grotesque hack that, in dev, allows us to replace the implementations
|
|
1448
|
-
* of these classes that you'd get by importing them from `@sveltejs/kit` with the
|
|
1449
|
-
* ones that are imported via Vite and loaded internally, so that instanceof
|
|
1450
|
-
* checks work even though SvelteKit imports this module via Vite and consumers
|
|
1451
|
-
* import it via Node
|
|
1452
|
-
* */
|
|
1453
|
-
function replace_implementations(implementations: {
|
|
1454
|
-
ActionFailure: typeof ActionFailure;
|
|
1455
|
-
HttpError: typeof HttpError;
|
|
1456
|
-
Redirect: typeof Redirect;
|
|
1457
|
-
}): void;
|
|
1458
|
-
export class HttpError {
|
|
1480
|
+
type TrailingSlash = 'never' | 'always' | 'ignore';
|
|
1481
|
+
class HttpError_1 {
|
|
1459
1482
|
|
|
1460
1483
|
constructor(status: number, body: {
|
|
1461
1484
|
message: string;
|
|
@@ -1464,47 +1487,25 @@ declare module '@sveltejs/kit' {
|
|
|
1464
1487
|
body: App.Error;
|
|
1465
1488
|
toString(): string;
|
|
1466
1489
|
}
|
|
1467
|
-
|
|
1490
|
+
class Redirect_1 {
|
|
1468
1491
|
|
|
1469
1492
|
constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string);
|
|
1470
1493
|
status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308;
|
|
1471
1494
|
location: string;
|
|
1472
1495
|
}
|
|
1473
1496
|
|
|
1474
|
-
class ActionFailure<T extends Record<string, unknown> | undefined = undefined> {
|
|
1497
|
+
export class ActionFailure<T extends Record<string, unknown> | undefined = undefined> {
|
|
1475
1498
|
|
|
1476
1499
|
constructor(status: number, data?: T | undefined);
|
|
1477
1500
|
status: number;
|
|
1478
1501
|
data: T | undefined;
|
|
1479
1502
|
}
|
|
1480
|
-
import { SvelteComponent } from 'svelte';
|
|
1481
|
-
|
|
1482
|
-
interface ServerModule {
|
|
1483
|
-
Server: typeof InternalServer;
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
interface ServerInternalModule {
|
|
1487
|
-
set_building(building: boolean): void;
|
|
1488
|
-
set_assets(path: string): void;
|
|
1489
|
-
set_private_env(environment: Record<string, string>): void;
|
|
1490
|
-
set_public_env(environment: Record<string, string>): void;
|
|
1491
|
-
set_version(version: string): void;
|
|
1492
|
-
set_fix_stack_trace(fix_stack_trace: (stack: string) => string): void;
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
1503
|
interface Asset {
|
|
1496
1504
|
file: string;
|
|
1497
1505
|
size: number;
|
|
1498
1506
|
type: string | null;
|
|
1499
1507
|
}
|
|
1500
1508
|
|
|
1501
|
-
interface AssetDependencies {
|
|
1502
|
-
file: string;
|
|
1503
|
-
imports: string[];
|
|
1504
|
-
stylesheets: string[];
|
|
1505
|
-
fonts: string[];
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
1509
|
interface BuildData {
|
|
1509
1510
|
app_dir: string;
|
|
1510
1511
|
app_path: string;
|
|
@@ -1520,61 +1521,6 @@ declare module '@sveltejs/kit' {
|
|
|
1520
1521
|
server_manifest: import('vite').Manifest;
|
|
1521
1522
|
}
|
|
1522
1523
|
|
|
1523
|
-
interface CSRPageNode {
|
|
1524
|
-
component: typeof SvelteComponent;
|
|
1525
|
-
universal: {
|
|
1526
|
-
load?: Load;
|
|
1527
|
-
trailingSlash?: TrailingSlash;
|
|
1528
|
-
};
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
type CSRPageNodeLoader = () => Promise<CSRPageNode>;
|
|
1532
|
-
|
|
1533
|
-
/**
|
|
1534
|
-
* Definition of a client side route.
|
|
1535
|
-
* The boolean in the tuples indicates whether the route has a server load.
|
|
1536
|
-
*/
|
|
1537
|
-
type CSRRoute = {
|
|
1538
|
-
id: string;
|
|
1539
|
-
exec(path: string): undefined | Record<string, string>;
|
|
1540
|
-
errors: Array<CSRPageNodeLoader | undefined>;
|
|
1541
|
-
layouts: Array<[has_server_load: boolean, node_loader: CSRPageNodeLoader] | undefined>;
|
|
1542
|
-
leaf: [has_server_load: boolean, node_loader: CSRPageNodeLoader];
|
|
1543
|
-
};
|
|
1544
|
-
|
|
1545
|
-
interface Deferred {
|
|
1546
|
-
fulfil: (value: any) => void;
|
|
1547
|
-
reject: (error: Error) => void;
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
type GetParams = (match: RegExpExecArray) => Record<string, string>;
|
|
1551
|
-
|
|
1552
|
-
interface ServerHooks {
|
|
1553
|
-
handleFetch: HandleFetch;
|
|
1554
|
-
handle: Handle;
|
|
1555
|
-
handleError: HandleServerError;
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
interface ClientHooks {
|
|
1559
|
-
handleError: HandleClientError;
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
interface Env {
|
|
1563
|
-
private: Record<string, string>;
|
|
1564
|
-
public: Record<string, string>;
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
class InternalServer extends Server {
|
|
1568
|
-
init(options: ServerInitOptions): Promise<void>;
|
|
1569
|
-
respond(
|
|
1570
|
-
request: Request,
|
|
1571
|
-
options: RequestOptions & {
|
|
1572
|
-
prerendering?: PrerenderOptions;
|
|
1573
|
-
read: (file: string) => Buffer;
|
|
1574
|
-
}
|
|
1575
|
-
): Promise<Response>;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
1524
|
interface ManifestData {
|
|
1579
1525
|
assets: Asset[];
|
|
1580
1526
|
nodes: PageNode[];
|
|
@@ -1595,17 +1541,6 @@ declare module '@sveltejs/kit' {
|
|
|
1595
1541
|
child_pages?: PageNode[];
|
|
1596
1542
|
}
|
|
1597
1543
|
|
|
1598
|
-
interface PrerenderDependency {
|
|
1599
|
-
response: Response;
|
|
1600
|
-
body: null | string | Uint8Array;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
interface PrerenderOptions {
|
|
1604
|
-
cache?: string; // including this here is a bit of a hack, but it makes it easy to add <meta http-equiv>
|
|
1605
|
-
fallback?: boolean;
|
|
1606
|
-
dependencies: Map<string, PrerenderDependency>;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
1544
|
type RecursiveRequired<T> = {
|
|
1610
1545
|
// Recursive implementation of TypeScript's Required utility type.
|
|
1611
1546
|
// Will recursively continue until it reaches a primitive or Function
|
|
@@ -1614,8 +1549,6 @@ declare module '@sveltejs/kit' {
|
|
|
1614
1549
|
: T[K]; // Use the exact type for everything else
|
|
1615
1550
|
};
|
|
1616
1551
|
|
|
1617
|
-
type RequiredResolveOptions = Required<ResolveOptions>;
|
|
1618
|
-
|
|
1619
1552
|
interface RouteParam {
|
|
1620
1553
|
name: string;
|
|
1621
1554
|
matcher: string;
|
|
@@ -1652,85 +1585,6 @@ declare module '@sveltejs/kit' {
|
|
|
1652
1585
|
} | null;
|
|
1653
1586
|
}
|
|
1654
1587
|
|
|
1655
|
-
type ServerRedirectNode = {
|
|
1656
|
-
type: 'redirect';
|
|
1657
|
-
location: string;
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
|
-
type ServerNodesResponse = {
|
|
1661
|
-
type: 'data';
|
|
1662
|
-
/**
|
|
1663
|
-
* If `null`, then there was no load function <- TODO is this outdated now with the recent changes?
|
|
1664
|
-
*/
|
|
1665
|
-
nodes: Array<ServerDataNode | ServerDataSkippedNode | ServerErrorNode | null>;
|
|
1666
|
-
};
|
|
1667
|
-
|
|
1668
|
-
type ServerDataResponse = ServerRedirectNode | ServerNodesResponse;
|
|
1669
|
-
|
|
1670
|
-
/**
|
|
1671
|
-
* Signals a successful response of the server `load` function.
|
|
1672
|
-
* The `uses` property tells the client when it's possible to reuse this data
|
|
1673
|
-
* in a subsequent request.
|
|
1674
|
-
*/
|
|
1675
|
-
interface ServerDataNode {
|
|
1676
|
-
type: 'data';
|
|
1677
|
-
/**
|
|
1678
|
-
* The serialized version of this contains a serialized representation of any deferred promises,
|
|
1679
|
-
* which will be resolved later through chunk nodes.
|
|
1680
|
-
*/
|
|
1681
|
-
data: Record<string, any> | null;
|
|
1682
|
-
uses: Uses;
|
|
1683
|
-
slash?: TrailingSlash;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
/**
|
|
1687
|
-
* Resolved data/error of a deferred promise.
|
|
1688
|
-
*/
|
|
1689
|
-
interface ServerDataChunkNode {
|
|
1690
|
-
type: 'chunk';
|
|
1691
|
-
id: number;
|
|
1692
|
-
data?: Record<string, any>;
|
|
1693
|
-
error?: any;
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
/**
|
|
1697
|
-
* Signals that the server `load` function was not run, and the
|
|
1698
|
-
* client should use what it has in memory
|
|
1699
|
-
*/
|
|
1700
|
-
interface ServerDataSkippedNode {
|
|
1701
|
-
type: 'skip';
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
/**
|
|
1705
|
-
* Signals that the server `load` function failed
|
|
1706
|
-
*/
|
|
1707
|
-
interface ServerErrorNode {
|
|
1708
|
-
type: 'error';
|
|
1709
|
-
error: App.Error;
|
|
1710
|
-
/**
|
|
1711
|
-
* Only set for HttpErrors
|
|
1712
|
-
*/
|
|
1713
|
-
status?: number;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
interface ServerMetadataRoute {
|
|
1717
|
-
config: any;
|
|
1718
|
-
api: {
|
|
1719
|
-
methods: HttpMethod[];
|
|
1720
|
-
};
|
|
1721
|
-
page: {
|
|
1722
|
-
methods: Array<'GET' | 'POST'>;
|
|
1723
|
-
};
|
|
1724
|
-
methods: HttpMethod[];
|
|
1725
|
-
prerender: PrerenderOption | undefined;
|
|
1726
|
-
entries: Array<string> | undefined;
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
interface ServerMetadata {
|
|
1730
|
-
nodes: Array<{ has_server_load: boolean }>;
|
|
1731
|
-
routes: Map<string, ServerMetadataRoute>;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
1588
|
interface SSRComponent {
|
|
1735
1589
|
default: {
|
|
1736
1590
|
render(props: Record<string, any>): {
|
|
@@ -1786,31 +1640,6 @@ declare module '@sveltejs/kit' {
|
|
|
1786
1640
|
|
|
1787
1641
|
type SSRNodeLoader = () => Promise<SSRNode>;
|
|
1788
1642
|
|
|
1789
|
-
interface SSROptions {
|
|
1790
|
-
app_template_contains_nonce: boolean;
|
|
1791
|
-
csp: ValidatedConfig['kit']['csp'];
|
|
1792
|
-
csrf_check_origin: boolean;
|
|
1793
|
-
track_server_fetches: boolean;
|
|
1794
|
-
embedded: boolean;
|
|
1795
|
-
env_public_prefix: string;
|
|
1796
|
-
env_private_prefix: string;
|
|
1797
|
-
hooks: ServerHooks;
|
|
1798
|
-
preload_strategy: ValidatedConfig['kit']['output']['preloadStrategy'];
|
|
1799
|
-
root: SSRComponent['default'];
|
|
1800
|
-
service_worker: boolean;
|
|
1801
|
-
templates: {
|
|
1802
|
-
app(values: {
|
|
1803
|
-
head: string;
|
|
1804
|
-
body: string;
|
|
1805
|
-
assets: string;
|
|
1806
|
-
nonce: string;
|
|
1807
|
-
env: Record<string, string>;
|
|
1808
|
-
}): string;
|
|
1809
|
-
error(values: { message: string; status: number }): string;
|
|
1810
|
-
};
|
|
1811
|
-
version_hash: string;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
1643
|
interface PageNodeIndexes {
|
|
1815
1644
|
errors: Array<number | undefined>;
|
|
1816
1645
|
layouts: Array<number | undefined>;
|
|
@@ -1835,59 +1664,34 @@ declare module '@sveltejs/kit' {
|
|
|
1835
1664
|
endpoint_id?: string;
|
|
1836
1665
|
}
|
|
1837
1666
|
|
|
1838
|
-
interface SSRState {
|
|
1839
|
-
fallback?: string;
|
|
1840
|
-
getClientAddress(): string;
|
|
1841
|
-
/**
|
|
1842
|
-
* True if we're currently attempting to render an error page
|
|
1843
|
-
*/
|
|
1844
|
-
error: boolean;
|
|
1845
|
-
/**
|
|
1846
|
-
* Allows us to prevent `event.fetch` from making infinitely looping internal requests
|
|
1847
|
-
*/
|
|
1848
|
-
depth: number;
|
|
1849
|
-
platform?: any;
|
|
1850
|
-
prerendering?: PrerenderOptions;
|
|
1851
|
-
/**
|
|
1852
|
-
* When fetching data from a +server.js endpoint in `load`, the page's
|
|
1853
|
-
* prerender option is inherited by the endpoint, unless overridden
|
|
1854
|
-
*/
|
|
1855
|
-
prerender_default?: PrerenderOption;
|
|
1856
|
-
read?: (file: string) => Buffer;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
type StrictBody = string | ArrayBufferView;
|
|
1860
|
-
|
|
1861
|
-
interface Uses {
|
|
1862
|
-
dependencies: Set<string>;
|
|
1863
|
-
params: Set<string>;
|
|
1864
|
-
parent: boolean;
|
|
1865
|
-
route: boolean;
|
|
1866
|
-
url: boolean;
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
1667
|
type ValidatedConfig = RecursiveRequired<Config>;
|
|
1870
|
-
|
|
1871
|
-
type ValidatedKitConfig = RecursiveRequired<KitConfig>;
|
|
1872
|
-
export function error(status: number, body: App.Error): HttpError;
|
|
1668
|
+
export function error(status: number, body: App.Error): HttpError_1;
|
|
1873
1669
|
export function error(status: number, body?: {
|
|
1874
1670
|
message: string;
|
|
1875
|
-
} extends App.Error ? App.Error | string | undefined : never):
|
|
1671
|
+
} extends App.Error ? App.Error | string | undefined : never): HttpError_1;
|
|
1876
1672
|
/**
|
|
1877
1673
|
* Create a `Redirect` object. If thrown during request handling, SvelteKit will return a redirect response.
|
|
1878
1674
|
* Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
|
|
1879
|
-
*
|
|
1880
|
-
|
|
1675
|
+
* @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.
|
|
1676
|
+
* @param location The location to redirect to.
|
|
1677
|
+
*/
|
|
1678
|
+
export function redirect(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string): Redirect_1;
|
|
1881
1679
|
/**
|
|
1882
1680
|
* Create a JSON `Response` object from the supplied data.
|
|
1883
|
-
*
|
|
1681
|
+
* @param data The value that will be serialized as JSON.
|
|
1682
|
+
* @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.
|
|
1683
|
+
*/
|
|
1884
1684
|
export function json(data: any, init?: ResponseInit | undefined): Response;
|
|
1885
1685
|
/**
|
|
1886
1686
|
* Create a `Response` object from the supplied body.
|
|
1887
|
-
*
|
|
1687
|
+
* @param body The value that will be used as-is.
|
|
1688
|
+
* @param init Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically.
|
|
1689
|
+
*/
|
|
1888
1690
|
export function text(body: string, init?: ResponseInit | undefined): Response;
|
|
1889
1691
|
/**
|
|
1890
1692
|
* Create an `ActionFailure` object.
|
|
1693
|
+
* @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.
|
|
1694
|
+
* @param data Data associated with the failure (e.g. validation errors)
|
|
1891
1695
|
* */
|
|
1892
1696
|
export function fail<T extends Record<string, unknown> | undefined = undefined>(status: number, data?: T | undefined): ActionFailure<T>;
|
|
1893
1697
|
/**
|
|
@@ -1973,6 +1777,7 @@ declare module '@sveltejs/kit/hooks' {
|
|
|
1973
1777
|
* first post-processing
|
|
1974
1778
|
* ```
|
|
1975
1779
|
*
|
|
1780
|
+
* @param handlers The chain of `handle` functions
|
|
1976
1781
|
* */
|
|
1977
1782
|
export function sequence(...handlers: import('@sveltejs/kit').Handle[]): import('@sveltejs/kit').Handle;
|
|
1978
1783
|
}
|
|
@@ -2000,14 +1805,15 @@ declare module '@sveltejs/kit/node/polyfills' {
|
|
|
2000
1805
|
}
|
|
2001
1806
|
|
|
2002
1807
|
declare module '@sveltejs/kit/vite' {
|
|
1808
|
+
export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
2003
1809
|
/**
|
|
2004
1810
|
* Returns the SvelteKit Vite plugins.
|
|
2005
1811
|
* */
|
|
2006
1812
|
export function sveltekit(): Promise<import('vite').Plugin[]>;
|
|
2007
|
-
export { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
|
2008
1813
|
}
|
|
2009
1814
|
|
|
2010
1815
|
declare module '$app/environment' {
|
|
1816
|
+
export { building, version } from '__sveltekit/environment';
|
|
2011
1817
|
/**
|
|
2012
1818
|
* `true` if the app is running in the browser.
|
|
2013
1819
|
*/
|
|
@@ -2016,7 +1822,6 @@ declare module '$app/environment' {
|
|
|
2016
1822
|
* Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`.
|
|
2017
1823
|
*/
|
|
2018
1824
|
export const dev: boolean;
|
|
2019
|
-
export { building, version } from "__sveltekit/environment";
|
|
2020
1825
|
}
|
|
2021
1826
|
|
|
2022
1827
|
declare module '$app/forms' {
|
|
@@ -2061,7 +1866,9 @@ declare module '$app/forms' {
|
|
|
2061
1866
|
* - redirects to the nearest error page in case of an unexpected error
|
|
2062
1867
|
*
|
|
2063
1868
|
* If you provide a custom function with a callback and want to use the default behavior, invoke `update` in your callback.
|
|
2064
|
-
*
|
|
1869
|
+
* @param form_element The form element
|
|
1870
|
+
* @param submit Submit callback
|
|
1871
|
+
*/
|
|
2065
1872
|
export function enhance<Success extends Record<string, unknown> | undefined, Failure extends Record<string, unknown> | undefined>(form_element: HTMLFormElement, submit?: import("@sveltejs/kit").SubmitFunction<Success, Failure>): {
|
|
2066
1873
|
destroy(): void;
|
|
2067
1874
|
};
|
|
@@ -2077,6 +1884,10 @@ declare module '$app/navigation' {
|
|
|
2077
1884
|
* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
|
|
2078
1885
|
* For external URLs, use `window.location = url` instead of calling `goto(url)`.
|
|
2079
1886
|
*
|
|
1887
|
+
* @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
|
|
1888
|
+
* @param {Object} opts Options related to the navigation
|
|
1889
|
+
* @param invalidateAll If `true`, all `load` functions of the page will be rerun. See https://kit.svelte.dev/docs/load#rerunning-load-functions for more info on invalidation.
|
|
1890
|
+
* @param opts.state The state of the new/updated history entry
|
|
2080
1891
|
* */
|
|
2081
1892
|
export const goto: (url: string | URL, opts?: {
|
|
2082
1893
|
replaceState?: boolean;
|
|
@@ -2100,6 +1911,7 @@ declare module '$app/navigation' {
|
|
|
2100
1911
|
*
|
|
2101
1912
|
* invalidate((url) => url.pathname === '/path');
|
|
2102
1913
|
* ```
|
|
1914
|
+
* @param url The invalidated URL
|
|
2103
1915
|
* */
|
|
2104
1916
|
export const invalidate: (url: string | URL | ((url: URL) => boolean)) => Promise<void>;
|
|
2105
1917
|
/**
|
|
@@ -2115,6 +1927,7 @@ declare module '$app/navigation' {
|
|
|
2115
1927
|
* If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous.
|
|
2116
1928
|
* Returns a Promise that resolves when the preload is complete.
|
|
2117
1929
|
*
|
|
1930
|
+
* @param href Page to preload
|
|
2118
1931
|
* */
|
|
2119
1932
|
export const preloadData: (href: string) => Promise<void>;
|
|
2120
1933
|
/**
|
|
@@ -2147,7 +1960,7 @@ declare module '$app/navigation' {
|
|
|
2147
1960
|
}
|
|
2148
1961
|
|
|
2149
1962
|
declare module '$app/paths' {
|
|
2150
|
-
export { base, assets } from
|
|
1963
|
+
export { base, assets } from '__sveltekit/paths';
|
|
2151
1964
|
}
|
|
2152
1965
|
|
|
2153
1966
|
declare module '$app/stores' {
|
package/types/index.d.ts.map
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"SubmitFunction",
|
|
41
41
|
"Snapshot",
|
|
42
42
|
"AdapterEntry",
|
|
43
|
+
"Csp",
|
|
43
44
|
"CspDirectives",
|
|
44
45
|
"HttpMethod",
|
|
45
46
|
"Logger",
|
|
@@ -52,57 +53,26 @@
|
|
|
52
53
|
"PrerenderMissingIdHandlerValue",
|
|
53
54
|
"PrerenderEntryGeneratorMismatchHandlerValue",
|
|
54
55
|
"PrerenderOption",
|
|
55
|
-
"PrerenderMap",
|
|
56
56
|
"RequestOptions",
|
|
57
57
|
"RouteSegment",
|
|
58
58
|
"TrailingSlash",
|
|
59
|
-
"replace_implementations",
|
|
60
59
|
"ActionFailure",
|
|
61
|
-
"ServerModule",
|
|
62
|
-
"ServerInternalModule",
|
|
63
60
|
"Asset",
|
|
64
|
-
"AssetDependencies",
|
|
65
61
|
"BuildData",
|
|
66
|
-
"CSRPageNode",
|
|
67
|
-
"CSRPageNodeLoader",
|
|
68
|
-
"CSRRoute",
|
|
69
|
-
"Deferred",
|
|
70
|
-
"GetParams",
|
|
71
|
-
"ServerHooks",
|
|
72
|
-
"ClientHooks",
|
|
73
|
-
"Env",
|
|
74
|
-
"InternalServer",
|
|
75
62
|
"ManifestData",
|
|
76
63
|
"PageNode",
|
|
77
|
-
"PrerenderDependency",
|
|
78
|
-
"PrerenderOptions",
|
|
79
64
|
"RecursiveRequired",
|
|
80
|
-
"RequiredResolveOptions",
|
|
81
65
|
"RouteParam",
|
|
82
66
|
"RouteData",
|
|
83
|
-
"ServerRedirectNode",
|
|
84
|
-
"ServerNodesResponse",
|
|
85
|
-
"ServerDataResponse",
|
|
86
|
-
"ServerDataNode",
|
|
87
|
-
"ServerDataChunkNode",
|
|
88
|
-
"ServerDataSkippedNode",
|
|
89
|
-
"ServerErrorNode",
|
|
90
|
-
"ServerMetadataRoute",
|
|
91
|
-
"ServerMetadata",
|
|
92
67
|
"SSRComponent",
|
|
93
68
|
"SSRComponentLoader",
|
|
94
69
|
"SSRNode",
|
|
95
70
|
"SSRNodeLoader",
|
|
96
|
-
"SSROptions",
|
|
97
71
|
"PageNodeIndexes",
|
|
98
72
|
"PrerenderEntryGenerator",
|
|
99
73
|
"SSREndpoint",
|
|
100
74
|
"SSRRoute",
|
|
101
|
-
"SSRState",
|
|
102
|
-
"StrictBody",
|
|
103
|
-
"Uses",
|
|
104
75
|
"ValidatedConfig",
|
|
105
|
-
"ValidatedKitConfig",
|
|
106
76
|
"redirect",
|
|
107
77
|
"json",
|
|
108
78
|
"text",
|
|
@@ -164,5 +134,5 @@
|
|
|
164
134
|
null,
|
|
165
135
|
null
|
|
166
136
|
],
|
|
167
|
-
"mappings": "
|
|
137
|
+
"mappings": "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"
|
|
168
138
|
}
|