@sveltejs/kit 3.0.0-next.14 → 3.0.0-next.16
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 +6 -3
- package/src/cli.js +6 -3
- package/src/core/adapt/builder.js +12 -5
- package/src/core/config/index.js +4 -5
- package/src/core/env.js +3 -3
- package/src/core/postbuild/prerender.js +6 -10
- package/src/core/sync/sync.js +3 -2
- package/src/core/sync/utils.js +2 -2
- package/src/core/sync/write_tsconfig/index.js +71 -53
- package/src/core/sync/write_tsconfig/utils.js +0 -61
- package/src/core/sync/write_tsconfig/validate.js +128 -0
- package/src/core/sync/write_types/index.js +2 -2
- package/src/exports/public.d.ts +22 -16
- package/src/exports/vite/build/build_server.js +2 -3
- package/src/exports/vite/dev/index.js +44 -36
- package/src/exports/vite/index.js +46 -5
- package/src/exports/vite/utils.js +61 -8
- package/src/runner.js +4 -2
- package/src/runtime/app/forms.js +4 -7
- package/src/runtime/app/internal/transport.js +53 -0
- package/src/runtime/app/paths/client.js +2 -2
- package/src/runtime/app/paths/internal/client.js +2 -2
- package/src/runtime/app/server/remote/prerender.js +6 -10
- package/src/runtime/app/server/remote/query.js +3 -3
- package/src/runtime/app/server/remote/requested.js +2 -2
- package/src/runtime/app/server/remote/shared.js +1 -16
- package/src/runtime/client/client.js +29 -25
- package/src/runtime/client/parse.js +1 -1
- package/src/runtime/client/remote-functions/command.svelte.js +1 -2
- package/src/runtime/client/remote-functions/prerender.svelte.js +1 -1
- package/src/runtime/client/remote-functions/query/proxy.js +2 -2
- package/src/runtime/client/remote-functions/query-live/proxy.js +2 -2
- package/src/runtime/pathname.js +7 -1
- package/src/runtime/server/data/index.js +5 -8
- package/src/runtime/server/dev.js +22 -0
- package/src/runtime/server/endpoint.js +3 -4
- package/src/runtime/server/fetch.js +22 -24
- package/src/runtime/server/index.js +54 -22
- package/src/runtime/server/internal.js +12 -5
- package/src/runtime/server/page/actions.js +18 -43
- package/src/runtime/server/page/data_serializer.js +12 -13
- package/src/runtime/server/page/index.js +16 -32
- package/src/runtime/server/page/load_data.js +26 -15
- package/src/runtime/server/page/render.js +9 -11
- package/src/runtime/server/page/respond_with_error.js +8 -20
- package/src/runtime/server/remote-functions.js +11 -15
- package/src/runtime/server/respond.js +26 -31
- package/src/runtime/server/state.js +36 -19
- package/src/runtime/server/utils.js +0 -20
- package/src/runtime/shared.js +16 -38
- package/src/types/internal.d.ts +45 -52
- package/src/utils/filesystem.js +1 -23
- package/src/version.js +1 -1
- package/types/index.d.ts +24 -18
- package/types/index.d.ts.map +1 -1
- package/src/runtime/server/app.js +0 -9
package/src/runtime/shared.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** @import { Transport } from '@sveltejs/kit' */
|
|
2
1
|
import * as devalue from 'devalue';
|
|
3
2
|
import { base64_decode, base64_encode, text_decoder, text_encoder } from './utils.js';
|
|
3
|
+
import { decoders, encoders } from '#app/internal/transport';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @param {string} route_id
|
|
@@ -39,17 +39,6 @@ export function validate_load_response(data, location_description) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* Try to `devalue.stringify` the data object using the provided transport encoders.
|
|
44
|
-
* @param {any} data
|
|
45
|
-
* @param {Transport} transport
|
|
46
|
-
*/
|
|
47
|
-
export function stringify(data, transport) {
|
|
48
|
-
const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));
|
|
49
|
-
|
|
50
|
-
return devalue.stringify(data, encoders);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
42
|
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)
|
|
54
43
|
.sort()
|
|
55
44
|
.join('\0');
|
|
@@ -102,11 +91,9 @@ const remote_regex_guard = '__skrag';
|
|
|
102
91
|
const remote_arg_marker = Symbol(remote_object);
|
|
103
92
|
|
|
104
93
|
/**
|
|
105
|
-
* @param {Transport} transport
|
|
106
94
|
* @param {boolean} sort
|
|
107
|
-
* @param {Map<any, any>} remote_arg_clones
|
|
108
95
|
*/
|
|
109
|
-
function create_remote_arg_reducers(
|
|
96
|
+
function create_remote_arg_reducers(sort) {
|
|
110
97
|
/** @type {Record<string, (value: unknown) => unknown>} */
|
|
111
98
|
const remote_fns_reducers = {
|
|
112
99
|
/** @param {unknown} value */
|
|
@@ -118,6 +105,8 @@ function create_remote_arg_reducers(transport, sort, remote_arg_clones) {
|
|
|
118
105
|
};
|
|
119
106
|
|
|
120
107
|
if (sort) {
|
|
108
|
+
const clones = new Map();
|
|
109
|
+
|
|
121
110
|
/** @type {(value: unknown) => Array<[unknown, unknown]> | undefined} */
|
|
122
111
|
remote_fns_reducers[remote_map] = (value) => {
|
|
123
112
|
if (!(value instanceof Map)) {
|
|
@@ -167,18 +156,15 @@ function create_remote_arg_reducers(transport, sort, remote_arg_clones) {
|
|
|
167
156
|
return;
|
|
168
157
|
}
|
|
169
158
|
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
159
|
+
if (clones.has(value)) {
|
|
160
|
+
return clones.get(value);
|
|
172
161
|
}
|
|
173
162
|
|
|
174
|
-
return to_sorted(value,
|
|
163
|
+
return to_sorted(value, clones);
|
|
175
164
|
};
|
|
176
165
|
}
|
|
177
166
|
|
|
178
|
-
const
|
|
179
|
-
Object.entries(transport).map(([k, v]) => [k, v.encode])
|
|
180
|
-
);
|
|
181
|
-
const all_reducers = { ...user_reducers, ...remote_fns_reducers };
|
|
167
|
+
const all_reducers = { ...encoders, ...remote_fns_reducers };
|
|
182
168
|
|
|
183
169
|
/** @type {(value: unknown) => string} */
|
|
184
170
|
const stringify = (value) => devalue.stringify(value, all_reducers);
|
|
@@ -186,8 +172,7 @@ function create_remote_arg_reducers(transport, sort, remote_arg_clones) {
|
|
|
186
172
|
return all_reducers;
|
|
187
173
|
}
|
|
188
174
|
|
|
189
|
-
|
|
190
|
-
function create_remote_arg_revivers(transport) {
|
|
175
|
+
function create_remote_arg_revivers() {
|
|
191
176
|
const remote_fns_revivers = {
|
|
192
177
|
/** @type {(value: unknown) => unknown} */
|
|
193
178
|
[remote_object]: (value) => value,
|
|
@@ -251,11 +236,7 @@ function create_remote_arg_revivers(transport) {
|
|
|
251
236
|
}
|
|
252
237
|
};
|
|
253
238
|
|
|
254
|
-
const
|
|
255
|
-
Object.entries(transport).map(([k, v]) => [k, v.decode])
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
const all_revivers = { ...user_revivers, ...remote_fns_revivers };
|
|
239
|
+
const all_revivers = { ...decoders, ...remote_fns_revivers };
|
|
259
240
|
|
|
260
241
|
/** @type {(data: string) => unknown} */
|
|
261
242
|
const parse = (data) => devalue.parse(data, all_revivers);
|
|
@@ -267,13 +248,12 @@ function create_remote_arg_revivers(transport) {
|
|
|
267
248
|
* Stringifies the argument (if any) for a remote function in such a way that
|
|
268
249
|
* it is both a valid URL and a valid file name (necessary for prerendering).
|
|
269
250
|
* @param {any} value
|
|
270
|
-
* @param {Transport} transport
|
|
271
251
|
*/
|
|
272
|
-
export function stringify_remote_arg(value
|
|
252
|
+
export function stringify_remote_arg(value) {
|
|
273
253
|
if (value === undefined) return '';
|
|
274
254
|
|
|
275
255
|
// If people hit file/url size limits, we can look into using something like compress_and_encode_text from svelte.dev beyond a certain size
|
|
276
|
-
const json = devalue.stringify(value, create_remote_arg_reducers(
|
|
256
|
+
const json = devalue.stringify(value, create_remote_arg_reducers(true));
|
|
277
257
|
|
|
278
258
|
return url_friendly_base64_encode(json);
|
|
279
259
|
}
|
|
@@ -281,12 +261,11 @@ export function stringify_remote_arg(value, transport) {
|
|
|
281
261
|
/**
|
|
282
262
|
* Stringifies command arguments, including `File` objects.
|
|
283
263
|
* @param {any} value
|
|
284
|
-
* @param {Transport} transport
|
|
285
264
|
*/
|
|
286
|
-
export async function stringify_command_arg(value
|
|
265
|
+
export async function stringify_command_arg(value) {
|
|
287
266
|
if (value === undefined) return '';
|
|
288
267
|
|
|
289
|
-
const reducers = create_remote_arg_reducers(
|
|
268
|
+
const reducers = create_remote_arg_reducers(false);
|
|
290
269
|
|
|
291
270
|
/** @type {Set<Promise<any>>} */
|
|
292
271
|
const allowed_promises = new Set();
|
|
@@ -338,9 +317,8 @@ function url_friendly_base64_encode(string) {
|
|
|
338
317
|
/**
|
|
339
318
|
* Parses the argument (if any) for a remote function
|
|
340
319
|
* @param {string} string
|
|
341
|
-
* @param {Transport} transport
|
|
342
320
|
*/
|
|
343
|
-
export function parse_remote_arg(string
|
|
321
|
+
export function parse_remote_arg(string) {
|
|
344
322
|
if (!string) return undefined;
|
|
345
323
|
|
|
346
324
|
const json_string = text_decoder.decode(
|
|
@@ -349,7 +327,7 @@ export function parse_remote_arg(string, transport) {
|
|
|
349
327
|
base64_decode(string.replaceAll('-', '+').replaceAll('_', '/'))
|
|
350
328
|
);
|
|
351
329
|
|
|
352
|
-
return devalue.parse(json_string, create_remote_arg_revivers(
|
|
330
|
+
return devalue.parse(json_string, create_remote_arg_revivers());
|
|
353
331
|
}
|
|
354
332
|
|
|
355
333
|
/**
|
package/src/types/internal.d.ts
CHANGED
|
@@ -158,7 +158,7 @@ export interface ServerHooks {
|
|
|
158
158
|
handleError: HandleServerError;
|
|
159
159
|
handleValidationError: HandleValidationError;
|
|
160
160
|
reroute: Reroute;
|
|
161
|
-
transport
|
|
161
|
+
transport?: Transport;
|
|
162
162
|
init?: ServerInit;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -174,24 +174,23 @@ export interface Env {
|
|
|
174
174
|
public: Record<string, string>;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
export interface InternalRequestOptions extends RequestOptions {
|
|
178
|
+
prerendering?: PrerenderOptions;
|
|
179
|
+
/** @internal for saving dependencies during prerendering and generating fallback pages */
|
|
180
|
+
read: (file: string) => Buffer<ArrayBuffer>;
|
|
181
|
+
/** @internal used during development to check feature availability depending on the current route */
|
|
182
|
+
before_handle?: (
|
|
183
|
+
event: RequestEvent,
|
|
184
|
+
config: any,
|
|
185
|
+
prerender: PrerenderOption,
|
|
186
|
+
handle: () => Promise<Response>
|
|
187
|
+
) => Promise<Response>;
|
|
188
|
+
emulator?: Emulator;
|
|
189
|
+
}
|
|
190
|
+
|
|
177
191
|
export class InternalServer extends Server {
|
|
178
192
|
init(options: ServerInitOptions): Promise<void>;
|
|
179
|
-
respond(
|
|
180
|
-
request: Request,
|
|
181
|
-
options: RequestOptions & {
|
|
182
|
-
prerendering?: PrerenderOptions;
|
|
183
|
-
/** @internal for saving dependencies during prerendering and generating fallback pages */
|
|
184
|
-
read: (file: string) => Buffer<ArrayBuffer>;
|
|
185
|
-
/** @internal used during development to check feature availability depending on the current route */
|
|
186
|
-
before_handle?: (
|
|
187
|
-
event: RequestEvent,
|
|
188
|
-
config: any,
|
|
189
|
-
prerender: PrerenderOption,
|
|
190
|
-
handle: () => Promise<Response>
|
|
191
|
-
) => Promise<Response>;
|
|
192
|
-
emulator?: Emulator;
|
|
193
|
-
}
|
|
194
|
-
): Promise<Response>;
|
|
193
|
+
respond(request: Request, options: InternalRequestOptions): Promise<Response>;
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
export interface ManifestData {
|
|
@@ -537,38 +536,6 @@ export interface SSRClientRoute {
|
|
|
537
536
|
leaf: [has_server_load: boolean, node_id: number];
|
|
538
537
|
}
|
|
539
538
|
|
|
540
|
-
export interface SSRState {
|
|
541
|
-
getClientAddress(): string;
|
|
542
|
-
/**
|
|
543
|
-
* True if we're currently attempting to render an error page.
|
|
544
|
-
*/
|
|
545
|
-
error: boolean;
|
|
546
|
-
/**
|
|
547
|
-
* Allows us to prevent `event.fetch` from making infinitely looping internal requests.
|
|
548
|
-
*/
|
|
549
|
-
depth: number;
|
|
550
|
-
platform?: any;
|
|
551
|
-
prerendering?: PrerenderOptions;
|
|
552
|
-
/**
|
|
553
|
-
* When fetching data from a +server.js endpoint in `load`, the page's
|
|
554
|
-
* prerender option is inherited by the endpoint, unless overridden.
|
|
555
|
-
*/
|
|
556
|
-
prerender_default?: PrerenderOption;
|
|
557
|
-
/** @internal reads from the filesystem when user code tries to fetch a static asset */
|
|
558
|
-
read?: (file: string) => Buffer<ArrayBuffer>;
|
|
559
|
-
/**
|
|
560
|
-
* Used to set up `__SVELTEKIT_TRACK__` which checks if a used feature is supported.
|
|
561
|
-
* E.g. if `read` from `$app/server` is used, it checks whether the route's config is compatible.
|
|
562
|
-
*/
|
|
563
|
-
before_handle?: (
|
|
564
|
-
event: RequestEvent,
|
|
565
|
-
config: Record<string, any>,
|
|
566
|
-
prerender: PrerenderOption,
|
|
567
|
-
handle: () => Promise<Response>
|
|
568
|
-
) => Promise<Response>;
|
|
569
|
-
emulator?: Emulator;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
539
|
export type StrictBody = string | ArrayBufferView;
|
|
573
540
|
|
|
574
541
|
export interface Uses {
|
|
@@ -682,8 +649,35 @@ export type RecordSpan = <T>(options: {
|
|
|
682
649
|
* used for tracking things like remote function calls
|
|
683
650
|
*/
|
|
684
651
|
export interface RequestState {
|
|
685
|
-
readonly
|
|
686
|
-
readonly
|
|
652
|
+
readonly getClientAddress: () => string;
|
|
653
|
+
readonly platform?: any;
|
|
654
|
+
/** @internal reads from the filesystem when user code tries to fetch a static asset */
|
|
655
|
+
readonly read?: (file: string) => Buffer<ArrayBuffer>;
|
|
656
|
+
/**
|
|
657
|
+
* Used to set up `__SVELTEKIT_TRACK__` which checks if a used feature is supported.
|
|
658
|
+
* E.g. if `read` from `$app/server` is used, it checks whether the route's config is compatible.
|
|
659
|
+
*/
|
|
660
|
+
readonly before_handle?: (
|
|
661
|
+
event: RequestEvent,
|
|
662
|
+
config: Record<string, any>,
|
|
663
|
+
prerender: PrerenderOption,
|
|
664
|
+
handle: () => Promise<Response>
|
|
665
|
+
) => Promise<Response>;
|
|
666
|
+
readonly emulator?: Emulator;
|
|
667
|
+
readonly prerendering?: PrerenderOptions;
|
|
668
|
+
/**
|
|
669
|
+
* When fetching data from a +server.js endpoint in `load`, the page's
|
|
670
|
+
* prerender option is inherited by the endpoint, unless overridden.
|
|
671
|
+
*/
|
|
672
|
+
prerender_default?: PrerenderOption;
|
|
673
|
+
/**
|
|
674
|
+
* True if we're currently attempting to render an error page.
|
|
675
|
+
*/
|
|
676
|
+
error: boolean;
|
|
677
|
+
/**
|
|
678
|
+
* Allows us to prevent `event.fetch` from making infinitely looping internal requests.
|
|
679
|
+
*/
|
|
680
|
+
readonly depth: number;
|
|
687
681
|
readonly handleValidationError: ServerHooks['handleValidationError'];
|
|
688
682
|
readonly tracing: {
|
|
689
683
|
record_span: RecordSpan;
|
|
@@ -738,7 +732,6 @@ export interface RequestState {
|
|
|
738
732
|
readonly is_in_remote_query: boolean;
|
|
739
733
|
readonly is_in_remote_prerender: boolean;
|
|
740
734
|
readonly is_in_render: boolean;
|
|
741
|
-
readonly is_in_universal_load: boolean;
|
|
742
735
|
/**
|
|
743
736
|
* The event before `derive_remote_function_event` hid or stubbed properties.
|
|
744
737
|
* Hooks like `handleValidationError` receive this so `url` etc. stay accessible
|
package/src/utils/filesystem.js
CHANGED
|
@@ -2,28 +2,6 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { posixify } from './os.js';
|
|
4
4
|
|
|
5
|
-
/** @param {string} dir */
|
|
6
|
-
export function mkdirp(dir) {
|
|
7
|
-
try {
|
|
8
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
9
|
-
} catch (/** @type {any} */ e) {
|
|
10
|
-
if (e.code === 'EEXIST') {
|
|
11
|
-
if (!fs.statSync(dir).isDirectory()) {
|
|
12
|
-
throw new Error(`Cannot create directory ${dir}, a file already exists at this position`, {
|
|
13
|
-
cause: e
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
throw e;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** @param {string} path */
|
|
23
|
-
export function rimraf(path) {
|
|
24
|
-
fs.rmSync(path, { force: true, recursive: true });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
5
|
/**
|
|
28
6
|
* @param {string} source
|
|
29
7
|
* @param {string} target
|
|
@@ -58,7 +36,7 @@ export function copy(source, target, opts = {}) {
|
|
|
58
36
|
go(path.join(from, file), path.join(to, file));
|
|
59
37
|
});
|
|
60
38
|
} else {
|
|
61
|
-
|
|
39
|
+
fs.mkdirSync(path.dirname(to), { recursive: true });
|
|
62
40
|
|
|
63
41
|
if (opts.replace) {
|
|
64
42
|
const data = fs.readFileSync(from, 'utf-8');
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -95,9 +95,15 @@ declare module '@sveltejs/kit' {
|
|
|
95
95
|
export interface Builder {
|
|
96
96
|
/** Print messages to the console. `log.info` and `log.minor` are silent unless Vite's `logLevel` is `info`. */
|
|
97
97
|
log: Logger;
|
|
98
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Remove `dir` and all its contents.
|
|
100
|
+
* @deprecated Use `fs.rmSync(dir, { force: true, recursive: true })` instead
|
|
101
|
+
*/
|
|
99
102
|
rimraf: (dir: string) => void;
|
|
100
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Create `dir` and any required parent directories.
|
|
105
|
+
* @deprecated Use `fs.mkdirSync(dir, { recursive: true })` instead
|
|
106
|
+
*/
|
|
101
107
|
mkdirp: (dir: string) => void;
|
|
102
108
|
|
|
103
109
|
/** The fully resolved SvelteKit config. */
|
|
@@ -1584,7 +1590,7 @@ declare module '@sveltejs/kit' {
|
|
|
1584
1590
|
/**
|
|
1585
1591
|
* Get or set cookies related to the current request
|
|
1586
1592
|
*/
|
|
1587
|
-
cookies: Cookies;
|
|
1593
|
+
readonly cookies: Cookies;
|
|
1588
1594
|
/**
|
|
1589
1595
|
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
1590
1596
|
*
|
|
@@ -1596,15 +1602,15 @@ declare module '@sveltejs/kit' {
|
|
|
1596
1602
|
*
|
|
1597
1603
|
* You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies).
|
|
1598
1604
|
*/
|
|
1599
|
-
fetch: typeof fetch;
|
|
1605
|
+
readonly fetch: typeof fetch;
|
|
1600
1606
|
/**
|
|
1601
1607
|
* The client's IP address, set by the adapter.
|
|
1602
1608
|
*/
|
|
1603
|
-
getClientAddress: () => string;
|
|
1609
|
+
readonly getClientAddress: () => string;
|
|
1604
1610
|
/**
|
|
1605
1611
|
* Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#handle).
|
|
1606
1612
|
*/
|
|
1607
|
-
locals: App.Locals;
|
|
1613
|
+
readonly locals: App.Locals;
|
|
1608
1614
|
/**
|
|
1609
1615
|
* The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
|
|
1610
1616
|
*
|
|
@@ -1613,19 +1619,19 @@ declare module '@sveltejs/kit' {
|
|
|
1613
1619
|
* the remote function was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use it
|
|
1614
1620
|
* to determine whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1615
1621
|
*/
|
|
1616
|
-
params: Params;
|
|
1622
|
+
readonly params: Params;
|
|
1617
1623
|
/**
|
|
1618
1624
|
* Additional data made available through the adapter.
|
|
1619
1625
|
*/
|
|
1620
|
-
platform: Readonly<App.Platform> | undefined;
|
|
1626
|
+
readonly platform: Readonly<App.Platform> | undefined;
|
|
1621
1627
|
/**
|
|
1622
1628
|
* The original request object.
|
|
1623
1629
|
*/
|
|
1624
|
-
request: Request;
|
|
1630
|
+
readonly request: Request;
|
|
1625
1631
|
/**
|
|
1626
1632
|
* Info about the current route.
|
|
1627
1633
|
*/
|
|
1628
|
-
route: {
|
|
1634
|
+
readonly route: {
|
|
1629
1635
|
/**
|
|
1630
1636
|
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
|
|
1631
1637
|
*
|
|
@@ -1658,7 +1664,7 @@ declare module '@sveltejs/kit' {
|
|
|
1658
1664
|
*
|
|
1659
1665
|
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead.
|
|
1660
1666
|
*/
|
|
1661
|
-
setHeaders: (headers: Record<string, string>) => void;
|
|
1667
|
+
readonly setHeaders: (headers: Record<string, string>) => void;
|
|
1662
1668
|
/**
|
|
1663
1669
|
* The requested URL.
|
|
1664
1670
|
*
|
|
@@ -1667,22 +1673,22 @@ declare module '@sveltejs/kit' {
|
|
|
1667
1673
|
* the remote function was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use it
|
|
1668
1674
|
* to determine whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1669
1675
|
*/
|
|
1670
|
-
url: URL;
|
|
1676
|
+
readonly url: URL;
|
|
1671
1677
|
/**
|
|
1672
1678
|
* `true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information
|
|
1673
1679
|
* related to the data request in this case. Use this property instead if the distinction is important to you.
|
|
1674
1680
|
*/
|
|
1675
|
-
isDataRequest: boolean;
|
|
1681
|
+
readonly isDataRequest: boolean;
|
|
1676
1682
|
/**
|
|
1677
1683
|
* `true` for `+server.js` calls coming from SvelteKit without the overhead of actually making an HTTP request. This happens when you make same-origin `fetch` requests on the server.
|
|
1678
1684
|
*/
|
|
1679
|
-
isSubRequest: boolean;
|
|
1685
|
+
readonly isSubRequest: boolean;
|
|
1680
1686
|
|
|
1681
1687
|
/**
|
|
1682
1688
|
* Access to spans for tracing. If tracing is not enabled, these spans will do nothing.
|
|
1683
1689
|
* @since 2.31.0
|
|
1684
1690
|
*/
|
|
1685
|
-
tracing: {
|
|
1691
|
+
readonly tracing: {
|
|
1686
1692
|
/** Whether tracing is enabled. */
|
|
1687
1693
|
enabled: boolean;
|
|
1688
1694
|
/** The root span for the request. This span is named `sveltekit.handle.root`. */
|
|
@@ -1695,7 +1701,7 @@ declare module '@sveltejs/kit' {
|
|
|
1695
1701
|
* `true` if the request comes from the client via a remote function. The `url` property will be stripped of the internal information
|
|
1696
1702
|
* related to the data request in this case. Use this property instead if the distinction is important to you.
|
|
1697
1703
|
*/
|
|
1698
|
-
isRemoteRequest: boolean;
|
|
1704
|
+
readonly isRemoteRequest: boolean;
|
|
1699
1705
|
}
|
|
1700
1706
|
|
|
1701
1707
|
/**
|
|
@@ -3275,7 +3281,7 @@ declare module '$app/navigation' {
|
|
|
3275
3281
|
}
|
|
3276
3282
|
|
|
3277
3283
|
declare module '$app/paths' {
|
|
3278
|
-
import type { AssetPath, RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname,
|
|
3284
|
+
import type { AssetPath, RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname, RouteId, RouteParams } from '$app/types';
|
|
3279
3285
|
/**
|
|
3280
3286
|
* Resolve the URL of an asset in your `static` directory, by prefixing it with [`config.paths.assets`](https://svelte.dev/docs/kit/configuration#paths) if configured, or otherwise by prefixing it with the base path.
|
|
3281
3287
|
*
|
|
@@ -3332,7 +3338,7 @@ declare module '$app/paths' {
|
|
|
3332
3338
|
* @since 2.52.0
|
|
3333
3339
|
*
|
|
3334
3340
|
* */
|
|
3335
|
-
export function match(url:
|
|
3341
|
+
export function match(url: URL | string): Promise<{ [K in RouteId]: {
|
|
3336
3342
|
id: K;
|
|
3337
3343
|
params: RouteParams<K>;
|
|
3338
3344
|
}; }[RouteId] | null>;
|
package/types/index.d.ts.map
CHANGED
|
@@ -226,6 +226,6 @@
|
|
|
226
226
|
null,
|
|
227
227
|
null
|
|
228
228
|
],
|
|
229
|
-
"mappings": ";;;;;;;;;MAmCKA,IAAIA;;MAEJC,0BAA0BA;;;;;kBAKdC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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