@qwik.dev/router 2.0.0-alpha.9 → 2.0.0-beta.10
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/README.md +1 -1
- package/adapters/static/vite.d.ts +1 -1
- package/lib/adapters/azure-swa/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/azure-swa/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/azure-swa/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/azure-swa/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/azure-swa/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/azure-swa/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/azure-swa/vite/index.cjs +5 -96
- package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
- package/lib/adapters/azure-swa/vite/index.mjs +201 -26
- package/lib/adapters/bun-server/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/bun-server/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/bun-server/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/bun-server/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/bun-server/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/bun-server/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/bun-server/vite/index.cjs +5 -50
- package/lib/adapters/bun-server/vite/index.d.ts +14 -14
- package/lib/adapters/bun-server/vite/index.mjs +196 -12
- package/lib/adapters/cloud-run/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/cloud-run/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/cloud-run/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/cloud-run/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/cloud-run/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/cloud-run/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/cloud-run/vite/index.cjs +5 -47
- package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
- package/lib/adapters/cloud-run/vite/index.mjs +195 -11
- package/lib/adapters/cloudflare-pages/vite/index-BIeHg2Cj.cjs +5 -0
- package/lib/adapters/cloudflare-pages/vite/index-C455V8_A.cjs +1 -0
- package/lib/adapters/cloudflare-pages/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/cloudflare-pages/vite/index-D3HITboM.js +645 -0
- package/lib/adapters/cloudflare-pages/vite/index-DKcVHRBy.cjs +11 -0
- package/lib/adapters/cloudflare-pages/vite/index-DwovcBp3.js +22 -0
- package/lib/adapters/cloudflare-pages/vite/index-bogwy7wh.js +250 -0
- package/lib/adapters/cloudflare-pages/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/cloudflare-pages/vite/index.cjs +1 -115
- package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
- package/lib/adapters/cloudflare-pages/vite/index.mjs +4 -78
- package/lib/adapters/deno-server/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/deno-server/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/deno-server/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/deno-server/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/deno-server/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/deno-server/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/deno-server/vite/index.cjs +5 -62
- package/lib/adapters/deno-server/vite/index.d.ts +14 -14
- package/lib/adapters/deno-server/vite/index.mjs +198 -14
- package/lib/adapters/netlify-edge/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/netlify-edge/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/netlify-edge/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/netlify-edge/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/netlify-edge/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/netlify-edge/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/netlify-edge/vite/index.cjs +6 -129
- package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
- package/lib/adapters/netlify-edge/vite/index.mjs +240 -60
- package/lib/adapters/node-server/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/node-server/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/node-server/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/node-server/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/node-server/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/node-server/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/node-server/vite/index.cjs +5 -50
- package/lib/adapters/node-server/vite/index.d.ts +14 -14
- package/lib/adapters/node-server/vite/index.mjs +196 -12
- package/lib/adapters/shared/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/shared/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/shared/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/shared/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/shared/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/shared/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/shared/vite/index.cjs +5 -371
- package/lib/adapters/shared/vite/index.d.ts +108 -114
- package/lib/adapters/shared/vite/index.mjs +158 -288
- package/lib/adapters/ssg/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/ssg/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/ssg/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/ssg/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/ssg/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/ssg/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/ssg/vite/index.cjs +5 -0
- package/lib/adapters/ssg/vite/index.d.ts +13 -0
- package/lib/adapters/ssg/vite/index.mjs +201 -0
- package/lib/adapters/vercel-edge/vite/index-BqUeglYs.cjs +1 -0
- package/lib/adapters/vercel-edge/vite/index-CBIchDYq.js +651 -0
- package/lib/adapters/vercel-edge/vite/index-ClHGw5z1.js +6 -0
- package/lib/adapters/vercel-edge/vite/index-CrwlB95_.js +22 -0
- package/lib/adapters/vercel-edge/vite/index-DTIOTwZo.cjs +11 -0
- package/lib/adapters/vercel-edge/vite/index-vQuPcef3.cjs +1 -0
- package/lib/adapters/vercel-edge/vite/index.cjs +5 -118
- package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
- package/lib/adapters/vercel-edge/vite/index.mjs +230 -51
- package/lib/index.d.ts +1000 -810
- package/lib/index.qwik.cjs +438 -203
- package/lib/index.qwik.mjs +440 -205
- package/lib/middleware/aws-lambda/index.cjs +1 -0
- package/lib/middleware/aws-lambda/index.d.ts +49 -48
- package/lib/middleware/aws-lambda/index.mjs +27 -41
- package/lib/middleware/azure-swa/index.cjs +1 -0
- package/lib/middleware/azure-swa/index.d.ts +28 -28
- package/lib/middleware/azure-swa/index.mjs +46 -269
- package/lib/middleware/bun/index.cjs +1 -0
- package/lib/middleware/bun/index.d.ts +35 -35
- package/lib/middleware/bun/index.mjs +68 -120
- package/lib/middleware/cloudflare-pages/index.cjs +1 -0
- package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
- package/lib/middleware/cloudflare-pages/index.mjs +48 -80
- package/lib/middleware/deno/index.cjs +1 -0
- package/lib/middleware/deno/index.d.ts +47 -47
- package/lib/middleware/deno/index.mjs +63 -110
- package/lib/middleware/firebase/index.cjs +1 -0
- package/lib/middleware/firebase/index.d.ts +26 -26
- package/lib/middleware/firebase/index.mjs +16 -28
- package/lib/middleware/netlify-edge/index.cjs +1 -0
- package/lib/middleware/netlify-edge/index.d.ts +27 -27
- package/lib/middleware/netlify-edge/index.mjs +36 -64
- package/lib/middleware/node/index.cjs +1 -314
- package/lib/middleware/node/index.d.ts +64 -64
- package/lib/middleware/node/index.mjs +116 -198
- package/lib/middleware/request-handler/index.cjs +11 -1538
- package/lib/middleware/request-handler/index.d.ts +711 -676
- package/lib/middleware/request-handler/index.mjs +895 -1281
- package/lib/middleware/vercel-edge/index.cjs +1 -0
- package/lib/middleware/vercel-edge/index.d.ts +26 -26
- package/lib/middleware/vercel-edge/index.mjs +47 -82
- package/lib/modules.d.ts +4 -12
- package/lib/service-worker.cjs +1 -267
- package/lib/service-worker.d.ts +15 -4
- package/lib/service-worker.mjs +3 -263
- package/lib/ssg/deno.cjs +1 -0
- package/lib/ssg/deno.mjs +6 -0
- package/lib/ssg/index-CBIchDYq.js +651 -0
- package/lib/ssg/index-ClHGw5z1.js +6 -0
- package/lib/ssg/index-DTIOTwZo.cjs +11 -0
- package/lib/ssg/index-vQuPcef3.cjs +1 -0
- package/lib/ssg/index.cjs +1 -0
- package/lib/{static → ssg}/index.d.ts +96 -96
- package/lib/ssg/index.mjs +22 -0
- package/lib/ssg/node.cjs +11 -0
- package/lib/ssg/node.mjs +651 -0
- package/lib/vite/index.cjs +29 -27484
- package/lib/vite/index.d.ts +170 -154
- package/lib/vite/index.mjs +1422 -27288
- package/modules.d.ts +4 -12
- package/package.json +51 -40
- package/ssg.d.ts +2 -0
- package/static.d.ts +1 -1
- package/lib/adapters/static/vite/index.cjs +0 -361
- package/lib/adapters/static/vite/index.d.ts +0 -10
- package/lib/adapters/static/vite/index.mjs +0 -324
- package/lib/static/deno.mjs +0 -8
- package/lib/static/index.cjs +0 -67
- package/lib/static/index.mjs +0 -48
- package/lib/static/node.cjs +0 -1124
- package/lib/static/node.mjs +0 -1086
- package/middleware/request-handler/generated/not-found-paths.ts +0 -7
- package/middleware/request-handler/generated/static-paths.ts +0 -35
|
@@ -1,676 +1,711 @@
|
|
|
1
|
-
import type { Action } from '@qwik.dev/router';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import
|
|
14
|
-
import type {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
readonly
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
readonly
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
declare type
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
/** Gets
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
readonly
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
readonly
|
|
217
|
-
/**
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/** @public */
|
|
276
|
-
declare interface
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
/** @public */
|
|
283
|
-
export declare
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
export declare function
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* HTTP Informational Status Codes Status codes in the 1xx range indicate that the server has
|
|
294
|
-
* received and is processing the request, but no response is available yet.
|
|
295
|
-
*/
|
|
296
|
-
declare type InformationalCode = 100 | 101 | 102 | 103;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
declare
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
declare interface
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* HTTP Redirect Status Codes Status codes in the 3xx range indicate that further action must be
|
|
340
|
-
* taken by the client to complete the request.
|
|
341
|
-
*/
|
|
342
|
-
declare type RedirectCode = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
343
|
-
|
|
344
|
-
/** @public */
|
|
345
|
-
export declare class RedirectMessage extends AbortMessage {
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/** @public */
|
|
349
|
-
export declare interface RequestEvent<PLATFORM = QwikRouterPlatform> extends RequestEventCommon<PLATFORM> {
|
|
350
|
-
/** True if headers have been sent, preventing any more headers from being set. */
|
|
351
|
-
readonly headersSent: boolean;
|
|
352
|
-
/** True if the middleware chain has finished executing. */
|
|
353
|
-
readonly exited: boolean;
|
|
354
|
-
/**
|
|
355
|
-
* Low-level access to write to the HTTP response stream. Once `getWritableStream()` is called,
|
|
356
|
-
* the status and headers can no longer be modified and will be sent over the network.
|
|
357
|
-
*/
|
|
358
|
-
readonly getWritableStream: () => WritableStream<Uint8Array>;
|
|
359
|
-
/**
|
|
360
|
-
* Invoke the next middleware function in the chain.
|
|
361
|
-
*
|
|
362
|
-
* NOTE: Ensure that the call to `next()` is `await`ed.
|
|
363
|
-
*/
|
|
364
|
-
readonly next: () => Promise<void>;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/** @public */
|
|
368
|
-
export declare interface RequestEventAction<PLATFORM = QwikRouterPlatform> extends RequestEventCommon<PLATFORM> {
|
|
369
|
-
fail: <T extends Record<string, any>>(status: number, returnData: T) => FailReturn<T>;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/** @public */
|
|
373
|
-
export declare interface RequestEventBase<PLATFORM = QwikRouterPlatform> {
|
|
374
|
-
/**
|
|
375
|
-
* HTTP response headers. Notice it will be empty until you first add a header. If you want to
|
|
376
|
-
* read the request headers, use `request.headers` instead.
|
|
377
|
-
*
|
|
378
|
-
* https://developer.mozilla.org/en-US/docs/Glossary/Response_header
|
|
379
|
-
*/
|
|
380
|
-
readonly headers: Headers;
|
|
381
|
-
/**
|
|
382
|
-
* HTTP request and response cookie. Use the `get()` method to retrieve a request cookie value.
|
|
383
|
-
* Use the `set()` method to set a response cookie value.
|
|
384
|
-
*
|
|
385
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
|
|
386
|
-
*/
|
|
387
|
-
readonly cookie: Cookie;
|
|
388
|
-
/**
|
|
389
|
-
* HTTP request method.
|
|
390
|
-
*
|
|
391
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
|
|
392
|
-
*/
|
|
393
|
-
readonly method: string;
|
|
394
|
-
/**
|
|
395
|
-
* URL pathname. Does not include the protocol, domain, query string (search params) or hash.
|
|
396
|
-
*
|
|
397
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname
|
|
398
|
-
*/
|
|
399
|
-
readonly pathname: string;
|
|
400
|
-
/**
|
|
401
|
-
* URL path params which have been parsed from the current url pathname segments. Use `query` to
|
|
402
|
-
* instead retrieve the query string search params.
|
|
403
|
-
*/
|
|
404
|
-
readonly params: Readonly<Record<string, string>>;
|
|
405
|
-
/**
|
|
406
|
-
* URL Query Strings (URL Search Params). Use `params` to instead retrieve the route params found
|
|
407
|
-
* in the url pathname.
|
|
408
|
-
*
|
|
409
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
|
410
|
-
*/
|
|
411
|
-
readonly query: URLSearchParams;
|
|
412
|
-
/** HTTP request URL. */
|
|
413
|
-
readonly url: URL;
|
|
414
|
-
/**
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
*
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
*
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*/
|
|
465
|
-
readonly
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*/
|
|
490
|
-
readonly
|
|
491
|
-
/**
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
* response
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
declare
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
/** @
|
|
567
|
-
declare
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
/** @public */
|
|
639
|
-
export declare
|
|
640
|
-
|
|
641
|
-
/** @
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
1
|
+
import type { Action } from '@qwik.dev/router';
|
|
2
|
+
import type { EnvGetter as EnvGetter_2 } from '@qwik.dev/router/middleware/request-handler';
|
|
3
|
+
import type { FailReturn } from '@qwik.dev/router';
|
|
4
|
+
import type { Loader as Loader_2 } from '@qwik.dev/router';
|
|
5
|
+
import type { QwikCityPlan } from '@qwik.dev/router';
|
|
6
|
+
import type { QwikIntrinsicElements } from '@qwik.dev/core';
|
|
7
|
+
import type { QwikRouterConfig } from '@qwik.dev/router';
|
|
8
|
+
import type { Render } from '@qwik.dev/core/server';
|
|
9
|
+
import type { RenderOptions } from '@qwik.dev/core/server';
|
|
10
|
+
import { RequestEvent as RequestEvent_2 } from '@qwik.dev/router/middleware/request-handler';
|
|
11
|
+
import type { RequestHandler as RequestHandler_2 } from '@qwik.dev/router/middleware/request-handler';
|
|
12
|
+
import type { ResolveSyncValue as ResolveSyncValue_2 } from '@qwik.dev/router/middleware/request-handler';
|
|
13
|
+
import { SerializationStrategy } from '@qwik.dev/core/internal';
|
|
14
|
+
import type { ValueOrPromise } from '@qwik.dev/core';
|
|
15
|
+
|
|
16
|
+
/** @public */
|
|
17
|
+
export declare class AbortMessage {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** @public */
|
|
21
|
+
export declare type CacheControl = CacheControlOptions | number | 'day' | 'week' | 'month' | 'year' | 'no-cache' | 'immutable' | 'private';
|
|
22
|
+
|
|
23
|
+
/** @public */
|
|
24
|
+
declare interface CacheControlOptions {
|
|
25
|
+
/**
|
|
26
|
+
* The max-age=N response directive indicates that the response remains fresh until N seconds
|
|
27
|
+
* after the response is generated. Note that max-age is not the elapsed time since the response
|
|
28
|
+
* was received; it is the elapsed time since the response was generated on the origin server. So
|
|
29
|
+
* if the other cache(s) — on the network route taken by the response — store the response for 100
|
|
30
|
+
* seconds (indicated using the Age response header field), the browser cache would deduct 100
|
|
31
|
+
* seconds from its freshness lifetime.
|
|
32
|
+
*/
|
|
33
|
+
maxAge?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The s-maxage response directive also indicates how long the response is fresh for (similar to
|
|
36
|
+
* max-age) — but it is specific to shared caches, and they will ignore max-age when it is
|
|
37
|
+
* present.
|
|
38
|
+
*/
|
|
39
|
+
sMaxAge?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The stale-while-revalidate response directive indicates that the cache could reuse a stale
|
|
42
|
+
* response while it revalidates it to a cache.
|
|
43
|
+
*/
|
|
44
|
+
staleWhileRevalidate?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The stale-if-error response directive that indicates if a stale response can be used when
|
|
47
|
+
* there's an error from the origin.
|
|
48
|
+
*/
|
|
49
|
+
staleIfError?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The no-store response directive indicates that any caches of any kind (private or shared)
|
|
52
|
+
* should not store this response.
|
|
53
|
+
*/
|
|
54
|
+
noStore?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The no-cache response directive indicates that the response can be stored in caches, but the
|
|
57
|
+
* response must be validated with the origin server before each reuse, even when the cache is
|
|
58
|
+
* disconnected from the origin server.
|
|
59
|
+
*/
|
|
60
|
+
noCache?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The public response directive indicates that the response can be stored in a shared cache.
|
|
63
|
+
* Responses for requests with Authorization header fields must not be stored in a shared cache;
|
|
64
|
+
* however, the public directive will cause such responses to be stored in a shared cache.
|
|
65
|
+
*/
|
|
66
|
+
public?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The private response directive indicates that the response can be stored only in a private
|
|
69
|
+
* cache (e.g. local caches in browsers). You should add the private directive for
|
|
70
|
+
* user-personalized content, especially for responses received after login and for sessions
|
|
71
|
+
* managed via cookies. If you forget to add private to a response with personalized content, then
|
|
72
|
+
* that response can be stored in a shared cache and end up being reused for multiple users, which
|
|
73
|
+
* can cause personal information to leak.
|
|
74
|
+
*/
|
|
75
|
+
private?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The immutable response directive indicates that the response will not be updated while it's
|
|
78
|
+
* fresh.
|
|
79
|
+
*
|
|
80
|
+
* A modern best practice for static resources is to include version/hashes in their URLs, while
|
|
81
|
+
* never modifying the resources — but instead, when necessary, updating the resources with newer
|
|
82
|
+
* versions that have new version-numbers/hashes, so that their URLs are different. That's called
|
|
83
|
+
* the cache-busting pattern.
|
|
84
|
+
*/
|
|
85
|
+
immutable?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @public */
|
|
89
|
+
declare type CacheControlTarget = 'Cache-Control' | 'CDN-Cache-Control' | 'Cloudflare-CDN-Cache-Control' | 'Vercel-CDN-Cache-Control' | '~ANY-OTHER-STRING' | (string & {});
|
|
90
|
+
|
|
91
|
+
/** @public */
|
|
92
|
+
export declare interface ClientConn {
|
|
93
|
+
ip?: string;
|
|
94
|
+
country?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* HTTP Client Error Status Codes Status codes in the 4xx range indicate that the client's request
|
|
99
|
+
* was malformed or invalid and could not be understood or processed by the server.
|
|
100
|
+
*/
|
|
101
|
+
declare type ClientErrorCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 499;
|
|
102
|
+
|
|
103
|
+
/** @public */
|
|
104
|
+
declare interface ContentHeading {
|
|
105
|
+
readonly text: string;
|
|
106
|
+
readonly id: string;
|
|
107
|
+
readonly level: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** @public */
|
|
111
|
+
declare interface ContentMenu {
|
|
112
|
+
readonly text: string;
|
|
113
|
+
readonly href?: string;
|
|
114
|
+
readonly items?: ContentMenu[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare type ContentModule = PageModule | LayoutModule;
|
|
118
|
+
|
|
119
|
+
declare type ContentModuleHead = DocumentHead | ResolvedDocumentHead;
|
|
120
|
+
|
|
121
|
+
/** @public */
|
|
122
|
+
export declare interface Cookie {
|
|
123
|
+
/** Gets a `Request` cookie header value by name. */
|
|
124
|
+
get(name: string): CookieValue | null;
|
|
125
|
+
/** Gets all `Request` cookie headers. */
|
|
126
|
+
getAll(): Record<string, CookieValue>;
|
|
127
|
+
/** Checks if the `Request` cookie header name exists. */
|
|
128
|
+
has(name: string): boolean;
|
|
129
|
+
/** Sets a `Response` cookie header using the `Set-Cookie` header. */
|
|
130
|
+
set(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;
|
|
131
|
+
/**
|
|
132
|
+
* Appends a `Response` cookie header using the `Set-Cookie` header.
|
|
133
|
+
*
|
|
134
|
+
* The difference between `set()` and `append()` is that if the specified header already exists,
|
|
135
|
+
* `set()` will overwrite the existing value with the new one, whereas `append()` will append the
|
|
136
|
+
* new value onto the end of the set of values.
|
|
137
|
+
*/
|
|
138
|
+
append(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;
|
|
139
|
+
/** Deletes cookie value by name using the `Response` cookie header. */
|
|
140
|
+
delete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>): void;
|
|
141
|
+
/** Returns an array of all the set `Response` `Set-Cookie` header values. */
|
|
142
|
+
headers(): string[];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** @public */
|
|
146
|
+
/**
|
|
147
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
|
|
148
|
+
*
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
export declare interface CookieOptions {
|
|
152
|
+
/**
|
|
153
|
+
* Defines the host to which the cookie will be sent. If omitted, this attribute defaults to the
|
|
154
|
+
* host of the current document URL, not including subdomains.
|
|
155
|
+
*/
|
|
156
|
+
domain?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. If both `expires` and
|
|
159
|
+
* `maxAge` are set, `maxAge` has precedence.
|
|
160
|
+
*/
|
|
161
|
+
expires?: Date | string;
|
|
162
|
+
/**
|
|
163
|
+
* Forbids JavaScript from accessing the cookie, for example, through the `document.cookie`
|
|
164
|
+
* property.
|
|
165
|
+
*/
|
|
166
|
+
httpOnly?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Indicates the number of seconds until the cookie expires. A zero or negative number will expire
|
|
169
|
+
* the cookie immediately. If both `expires` and `maxAge` are set, `maxAge` has precedence. You
|
|
170
|
+
* can also use the array syntax to set the max-age using minutes, hours, days or weeks. For
|
|
171
|
+
* example, `{ maxAge: [3, "days"] }` would set the cookie to expire in 3 days.
|
|
172
|
+
*/
|
|
173
|
+
maxAge?: number | [number, 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks'];
|
|
174
|
+
/**
|
|
175
|
+
* Indicates the path that must exist in the requested URL for the browser to send the Cookie
|
|
176
|
+
* header.
|
|
177
|
+
*/
|
|
178
|
+
path?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Controls whether or not a cookie is sent with cross-site requests, providing some protection
|
|
181
|
+
* against cross-site request forgery attacks (CSRF).
|
|
182
|
+
*/
|
|
183
|
+
sameSite?: 'strict' | 'lax' | 'none' | 'Strict' | 'Lax' | 'None' | boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Indicates that the cookie is sent to the server only when a request is made with the `https:`
|
|
186
|
+
* scheme (except on localhost)
|
|
187
|
+
*/
|
|
188
|
+
secure?: boolean;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** @public */
|
|
192
|
+
export declare interface CookieValue {
|
|
193
|
+
value: string;
|
|
194
|
+
json: <T = unknown>() => T;
|
|
195
|
+
number: () => number;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @public */
|
|
199
|
+
export declare type DeferReturn<T> = () => Promise<T>;
|
|
200
|
+
|
|
201
|
+
/** @public */
|
|
202
|
+
declare type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);
|
|
203
|
+
|
|
204
|
+
/** @public */
|
|
205
|
+
declare interface DocumentHeadProps extends RouteLocation {
|
|
206
|
+
readonly head: ResolvedDocumentHead;
|
|
207
|
+
readonly withLocale: <T>(fn: () => T) => T;
|
|
208
|
+
readonly resolveValue: ResolveSyncValue_2;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** @public */
|
|
212
|
+
declare interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>> {
|
|
213
|
+
/** Sets `document.title`. */
|
|
214
|
+
readonly title?: string;
|
|
215
|
+
/** Used to manually set meta tags in the head. */
|
|
216
|
+
readonly meta?: readonly DocumentMeta[];
|
|
217
|
+
/** Used to manually append `<link>` elements to the `<head>`. */
|
|
218
|
+
readonly links?: readonly DocumentLink[];
|
|
219
|
+
/** Used to manually append `<style>` elements to the `<head>`. */
|
|
220
|
+
readonly styles?: readonly DocumentStyle[];
|
|
221
|
+
/** Used to manually append `<script>` elements to the `<head>`. */
|
|
222
|
+
readonly scripts?: readonly DocumentScript[];
|
|
223
|
+
/**
|
|
224
|
+
* Arbitrary object containing custom data. When the document head is created from markdown files,
|
|
225
|
+
* the frontmatter attributes that are not recognized as a well-known meta names (such as title,
|
|
226
|
+
* description, author, etc...), are stored in this property.
|
|
227
|
+
*/
|
|
228
|
+
readonly frontmatter?: Readonly<FrontMatter>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** @public */
|
|
232
|
+
declare type DocumentLink = QwikIntrinsicElements['link'];
|
|
233
|
+
|
|
234
|
+
/** @public */
|
|
235
|
+
declare type DocumentMeta = QwikIntrinsicElements['meta'];
|
|
236
|
+
|
|
237
|
+
/** @public */
|
|
238
|
+
declare type DocumentScript = ((Omit<QwikIntrinsicElements['script'], 'dangerouslySetInnerHTML'> & {
|
|
239
|
+
props?: never;
|
|
240
|
+
}) | {
|
|
241
|
+
key?: string;
|
|
242
|
+
/**
|
|
243
|
+
* The props of the script element. @deprecated Prefer setting the properties directly instead
|
|
244
|
+
* of using this property.
|
|
245
|
+
*/
|
|
246
|
+
props: Readonly<QwikIntrinsicElements['script']>;
|
|
247
|
+
}) & ({
|
|
248
|
+
/** The inline script content. */
|
|
249
|
+
script?: string;
|
|
250
|
+
dangerouslySetInnerHTML?: never;
|
|
251
|
+
} | {
|
|
252
|
+
dangerouslySetInnerHTML?: string;
|
|
253
|
+
script?: never;
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
/** @public */
|
|
257
|
+
declare type DocumentStyle = Readonly<((Omit<QwikIntrinsicElements['style'], 'dangerouslySetInnerHTML'> & {
|
|
258
|
+
props?: never;
|
|
259
|
+
}) | {
|
|
260
|
+
key?: string;
|
|
261
|
+
/**
|
|
262
|
+
* The props of the style element. @deprecated Prefer setting the properties directly
|
|
263
|
+
* instead of using this property.
|
|
264
|
+
*/
|
|
265
|
+
props: Readonly<QwikIntrinsicElements['style']>;
|
|
266
|
+
}) & ({
|
|
267
|
+
/** The inline style content. */
|
|
268
|
+
style?: string;
|
|
269
|
+
dangerouslySetInnerHTML?: never;
|
|
270
|
+
} | {
|
|
271
|
+
dangerouslySetInnerHTML?: string;
|
|
272
|
+
style?: never;
|
|
273
|
+
})>;
|
|
274
|
+
|
|
275
|
+
/** @public */
|
|
276
|
+
export declare interface EnvGetter {
|
|
277
|
+
get(key: string): string | undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare type ErrorCodes = ClientErrorCode | ServerErrorCode;
|
|
281
|
+
|
|
282
|
+
/** @public */
|
|
283
|
+
export declare function getErrorHtml(status: number, e: any): string;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Return the HTML for a 404 page.
|
|
287
|
+
*
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
290
|
+
export declare function getNotFound(prefix: string): string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* HTTP Informational Status Codes Status codes in the 1xx range indicate that the server has
|
|
294
|
+
* received and is processing the request, but no response is available yet.
|
|
295
|
+
*/
|
|
296
|
+
declare type InformationalCode = 100 | 101 | 102 | 103;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Decide whether a given request path is a static path, for optimizing file access.
|
|
300
|
+
*
|
|
301
|
+
* @internal
|
|
302
|
+
*/
|
|
303
|
+
export declare function isStaticPath(method: string, url: URL): boolean;
|
|
304
|
+
|
|
305
|
+
declare interface LayoutModule extends RouteModule {
|
|
306
|
+
readonly default: unknown;
|
|
307
|
+
readonly head?: ContentModuleHead;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
declare type LoadedRoute = [
|
|
311
|
+
routeName: string,
|
|
312
|
+
params: PathParams,
|
|
313
|
+
mods: (RouteModule | ContentModule)[],
|
|
314
|
+
menu: ContentMenu | undefined,
|
|
315
|
+
routeBundleNames: string[] | undefined
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
/** @public */
|
|
319
|
+
export declare const mergeHeadersCookies: (headers: Headers, cookies: Cookie) => Headers;
|
|
320
|
+
|
|
321
|
+
/** @public */
|
|
322
|
+
declare interface PageModule extends RouteModule {
|
|
323
|
+
readonly default: unknown;
|
|
324
|
+
readonly head?: ContentModuleHead;
|
|
325
|
+
readonly headings?: ContentHeading[];
|
|
326
|
+
readonly onStaticGenerate?: StaticGenerateHandler;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** @public */
|
|
330
|
+
declare type PathParams = Record<string, string>;
|
|
331
|
+
|
|
332
|
+
declare interface QwikRouterRun<T> {
|
|
333
|
+
response: Promise<T | null>;
|
|
334
|
+
requestEv: RequestEvent_2;
|
|
335
|
+
completion: Promise<unknown>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* HTTP Redirect Status Codes Status codes in the 3xx range indicate that further action must be
|
|
340
|
+
* taken by the client to complete the request.
|
|
341
|
+
*/
|
|
342
|
+
declare type RedirectCode = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
343
|
+
|
|
344
|
+
/** @public */
|
|
345
|
+
export declare class RedirectMessage extends AbortMessage {
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** @public */
|
|
349
|
+
export declare interface RequestEvent<PLATFORM = QwikRouterPlatform> extends RequestEventCommon<PLATFORM> {
|
|
350
|
+
/** True if headers have been sent, preventing any more headers from being set. */
|
|
351
|
+
readonly headersSent: boolean;
|
|
352
|
+
/** True if the middleware chain has finished executing. */
|
|
353
|
+
readonly exited: boolean;
|
|
354
|
+
/**
|
|
355
|
+
* Low-level access to write to the HTTP response stream. Once `getWritableStream()` is called,
|
|
356
|
+
* the status and headers can no longer be modified and will be sent over the network.
|
|
357
|
+
*/
|
|
358
|
+
readonly getWritableStream: () => WritableStream<Uint8Array>;
|
|
359
|
+
/**
|
|
360
|
+
* Invoke the next middleware function in the chain.
|
|
361
|
+
*
|
|
362
|
+
* NOTE: Ensure that the call to `next()` is `await`ed.
|
|
363
|
+
*/
|
|
364
|
+
readonly next: () => Promise<void>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** @public */
|
|
368
|
+
export declare interface RequestEventAction<PLATFORM = QwikRouterPlatform> extends RequestEventCommon<PLATFORM> {
|
|
369
|
+
fail: <T extends Record<string, any>>(status: number, returnData: T) => FailReturn<T>;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** @public */
|
|
373
|
+
export declare interface RequestEventBase<PLATFORM = QwikRouterPlatform> {
|
|
374
|
+
/**
|
|
375
|
+
* HTTP response headers. Notice it will be empty until you first add a header. If you want to
|
|
376
|
+
* read the request headers, use `request.headers` instead.
|
|
377
|
+
*
|
|
378
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Response_header
|
|
379
|
+
*/
|
|
380
|
+
readonly headers: Headers;
|
|
381
|
+
/**
|
|
382
|
+
* HTTP request and response cookie. Use the `get()` method to retrieve a request cookie value.
|
|
383
|
+
* Use the `set()` method to set a response cookie value.
|
|
384
|
+
*
|
|
385
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
|
|
386
|
+
*/
|
|
387
|
+
readonly cookie: Cookie;
|
|
388
|
+
/**
|
|
389
|
+
* HTTP request method.
|
|
390
|
+
*
|
|
391
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
|
|
392
|
+
*/
|
|
393
|
+
readonly method: string;
|
|
394
|
+
/**
|
|
395
|
+
* URL pathname. Does not include the protocol, domain, query string (search params) or hash.
|
|
396
|
+
*
|
|
397
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname
|
|
398
|
+
*/
|
|
399
|
+
readonly pathname: string;
|
|
400
|
+
/**
|
|
401
|
+
* URL path params which have been parsed from the current url pathname segments. Use `query` to
|
|
402
|
+
* instead retrieve the query string search params.
|
|
403
|
+
*/
|
|
404
|
+
readonly params: Readonly<Record<string, string>>;
|
|
405
|
+
/**
|
|
406
|
+
* URL Query Strings (URL Search Params). Use `params` to instead retrieve the route params found
|
|
407
|
+
* in the url pathname.
|
|
408
|
+
*
|
|
409
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
|
410
|
+
*/
|
|
411
|
+
readonly query: URLSearchParams;
|
|
412
|
+
/** HTTP request URL. */
|
|
413
|
+
readonly url: URL;
|
|
414
|
+
/**
|
|
415
|
+
* The original HTTP request URL.
|
|
416
|
+
*
|
|
417
|
+
* This property was introduced to support the rewrite feature.
|
|
418
|
+
*
|
|
419
|
+
* If rewrite is called, the url property will be changed to the rewritten url. while originalUrl
|
|
420
|
+
* will stay the same(e.g the url inserted to the address bar).
|
|
421
|
+
*
|
|
422
|
+
* If rewrite is never called as part of the request, the url property and the originalUrl are
|
|
423
|
+
* equal.
|
|
424
|
+
*/
|
|
425
|
+
readonly originalUrl: URL;
|
|
426
|
+
/** The base pathname of the request, which can be configured at build time. Defaults to `/`. */
|
|
427
|
+
readonly basePathname: string;
|
|
428
|
+
/** HTTP request information. */
|
|
429
|
+
readonly request: Request;
|
|
430
|
+
/** Platform specific data and functions */
|
|
431
|
+
readonly platform: PLATFORM;
|
|
432
|
+
/** Platform provided environment variables. */
|
|
433
|
+
readonly env: EnvGetter;
|
|
434
|
+
/**
|
|
435
|
+
* Shared Map across all the request handlers. Every HTTP request will get a new instance of the
|
|
436
|
+
* shared map. The shared map is useful for sharing data between request handlers.
|
|
437
|
+
*/
|
|
438
|
+
readonly sharedMap: Map<string, any>;
|
|
439
|
+
/**
|
|
440
|
+
* This method will check the request headers for a `Content-Type` header and parse the body
|
|
441
|
+
* accordingly. It supports `application/json`, `application/x-www-form-urlencoded`, and
|
|
442
|
+
* `multipart/form-data` content types.
|
|
443
|
+
*
|
|
444
|
+
* If the `Content-Type` header is not set, it will return `null`.
|
|
445
|
+
*/
|
|
446
|
+
readonly parseBody: () => Promise<unknown>;
|
|
447
|
+
/**
|
|
448
|
+
* Convenience method to set the Cache-Control header. Depending on your CDN, you may want to add
|
|
449
|
+
* another cacheControl with the second argument set to `CDN-Cache-Control` or any other value (we
|
|
450
|
+
* provide the most common values for auto-complete, but you can use any string you want).
|
|
451
|
+
*
|
|
452
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and
|
|
453
|
+
* https://qwik.dev/docs/caching/#CDN-Cache-Controls for more information.
|
|
454
|
+
*/
|
|
455
|
+
readonly cacheControl: (cacheControl: CacheControl, target?: CacheControlTarget) => void;
|
|
456
|
+
/**
|
|
457
|
+
* Provides information about the client connection, such as the IP address and the country the
|
|
458
|
+
* request originated from.
|
|
459
|
+
*/
|
|
460
|
+
readonly clientConn: ClientConn;
|
|
461
|
+
/**
|
|
462
|
+
* Request's AbortSignal (same as `request.signal`). This signal indicates that the request has
|
|
463
|
+
* been aborted.
|
|
464
|
+
*/
|
|
465
|
+
readonly signal: AbortSignal;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/** @public */
|
|
469
|
+
export declare interface RequestEventCommon<PLATFORM = QwikRouterPlatform> extends RequestEventBase<PLATFORM> {
|
|
470
|
+
/**
|
|
471
|
+
* HTTP response status code. Sets the status code when called with an argument. Always returns
|
|
472
|
+
* the status code, so calling `status()` without an argument will can be used to return the
|
|
473
|
+
* current status code.
|
|
474
|
+
*
|
|
475
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
|
|
476
|
+
*/
|
|
477
|
+
readonly status: (statusCode?: StatusCodes) => number;
|
|
478
|
+
/**
|
|
479
|
+
* Which locale the content is in.
|
|
480
|
+
*
|
|
481
|
+
* The locale value can be retrieved from selected methods using `getLocale()`:
|
|
482
|
+
*/
|
|
483
|
+
readonly locale: (local?: string) => string;
|
|
484
|
+
/**
|
|
485
|
+
* URL to redirect to. When called, the response will immediately end with the correct redirect
|
|
486
|
+
* status and headers.
|
|
487
|
+
*
|
|
488
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
|
|
489
|
+
*/
|
|
490
|
+
readonly redirect: (statusCode: RedirectCode, url: string) => RedirectMessage;
|
|
491
|
+
/**
|
|
492
|
+
* When called, qwik-router will execute the path's matching route flow.
|
|
493
|
+
*
|
|
494
|
+
* The url in the browser will remain unchanged.
|
|
495
|
+
*
|
|
496
|
+
* @param pathname - The pathname to rewrite to.
|
|
497
|
+
*/
|
|
498
|
+
readonly rewrite: (pathname: string) => RewriteMessage;
|
|
499
|
+
/**
|
|
500
|
+
* When called, the response will immediately end with the given status code. This could be useful
|
|
501
|
+
* to end a response with `404`, and use the 404 handler in the routes directory. See
|
|
502
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for which status code should be used.
|
|
503
|
+
*/
|
|
504
|
+
readonly error: <T = any>(statusCode: ErrorCodes, message: T) => ServerError<T>;
|
|
505
|
+
/**
|
|
506
|
+
* Convenience method to send an text body response. The response will be automatically set the
|
|
507
|
+
* `Content-Type` header to`text/plain; charset=utf-8`. An `text()` response can only be called
|
|
508
|
+
* once.
|
|
509
|
+
*/
|
|
510
|
+
readonly text: (statusCode: StatusCodes, text: string) => AbortMessage;
|
|
511
|
+
/**
|
|
512
|
+
* Convenience method to send an HTML body response. The response will be automatically set the
|
|
513
|
+
* `Content-Type` header to`text/html; charset=utf-8`. An `html()` response can only be called
|
|
514
|
+
* once.
|
|
515
|
+
*/
|
|
516
|
+
readonly html: (statusCode: StatusCodes, html: string) => AbortMessage;
|
|
517
|
+
/**
|
|
518
|
+
* Convenience method to JSON stringify the data and send it in the response. The response will be
|
|
519
|
+
* automatically set the `Content-Type` header to `application/json; charset=utf-8`. A `json()`
|
|
520
|
+
* response can only be called once.
|
|
521
|
+
*/
|
|
522
|
+
readonly json: (statusCode: StatusCodes, data: any) => AbortMessage;
|
|
523
|
+
/**
|
|
524
|
+
* Send a body response. The `Content-Type` response header is not automatically set when using
|
|
525
|
+
* `send()` and must be set manually. A `send()` response can only be called once.
|
|
526
|
+
*/
|
|
527
|
+
readonly send: SendMethod;
|
|
528
|
+
readonly exit: () => AbortMessage;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
declare interface RequestEventInternal extends RequestEvent, RequestEventLoader {
|
|
532
|
+
[RequestEvLoaders]: Record<string, ValueOrPromise<unknown> | undefined>;
|
|
533
|
+
[RequestEvLoaderSerializationStrategyMap]: Map<string, SerializationStrategy>;
|
|
534
|
+
[RequestEvMode]: ServerRequestMode;
|
|
535
|
+
[RequestEvRoute]: LoadedRoute | null;
|
|
536
|
+
/**
|
|
537
|
+
* Check if this request is already written to.
|
|
538
|
+
*
|
|
539
|
+
* @returns `true`, if `getWritableStream()` has already been called.
|
|
540
|
+
*/
|
|
541
|
+
isDirty(): boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Reset the request event to the given route data.
|
|
544
|
+
*
|
|
545
|
+
* @param loadedRoute - The new loaded route.
|
|
546
|
+
* @param requestHandlers - The new request handlers.
|
|
547
|
+
* @param url - The new URL of the route.
|
|
548
|
+
*/
|
|
549
|
+
resetRoute(loadedRoute: LoadedRoute | null, requestHandlers: RequestHandler<any>[], url: URL): void;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/** @public */
|
|
553
|
+
export declare interface RequestEventLoader<PLATFORM = QwikRouterPlatform> extends RequestEventAction<PLATFORM> {
|
|
554
|
+
resolveValue: ResolveValue;
|
|
555
|
+
defer: <T>(returnData: Promise<T> | (() => Promise<T>)) => DeferReturn<T>;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare const RequestEvLoaders: unique symbol;
|
|
559
|
+
|
|
560
|
+
declare const RequestEvLoaderSerializationStrategyMap: unique symbol;
|
|
561
|
+
|
|
562
|
+
declare const RequestEvMode: unique symbol;
|
|
563
|
+
|
|
564
|
+
declare const RequestEvRoute: unique symbol;
|
|
565
|
+
|
|
566
|
+
/** @internal */
|
|
567
|
+
export declare const RequestEvShareQData = "qData";
|
|
568
|
+
|
|
569
|
+
/** @public */
|
|
570
|
+
export declare type RequestHandler<PLATFORM = QwikRouterPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* The request handler for QwikRouter. Called by every integration.
|
|
574
|
+
*
|
|
575
|
+
* @public
|
|
576
|
+
*/
|
|
577
|
+
export declare function requestHandler<T = unknown>(serverRequestEv: ServerRequestEvent<T>, opts: ServerRenderOptions): Promise<QwikRouterRun<T> | null>;
|
|
578
|
+
|
|
579
|
+
/** @public */
|
|
580
|
+
declare type ResolvedDocumentHead<FrontMatter extends Record<string, any> = Record<string, unknown>> = Required<DocumentHeadValue<FrontMatter>>;
|
|
581
|
+
|
|
582
|
+
/** @public */
|
|
583
|
+
export declare interface ResolveSyncValue {
|
|
584
|
+
<T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Awaited<T>;
|
|
585
|
+
<T>(action: Action<T>): Awaited<T> | undefined;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/** @public */
|
|
589
|
+
export declare interface ResolveValue {
|
|
590
|
+
<T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Promise<T>;
|
|
591
|
+
<T>(action: Action<T>): Promise<T | undefined>;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/** @public */
|
|
595
|
+
export declare class RewriteMessage extends AbortMessage {
|
|
596
|
+
readonly pathname: string;
|
|
597
|
+
constructor(pathname: string);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** @public */
|
|
601
|
+
declare interface RouteLocation {
|
|
602
|
+
readonly params: Readonly<Record<string, string>>;
|
|
603
|
+
readonly url: URL;
|
|
604
|
+
readonly isNavigating: boolean;
|
|
605
|
+
readonly prevUrl: URL | undefined;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
declare interface RouteModule<BODY = unknown> {
|
|
609
|
+
onDelete?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
610
|
+
onGet?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
611
|
+
onHead?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
612
|
+
onOptions?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
613
|
+
onPatch?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
614
|
+
onPost?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
615
|
+
onPut?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
616
|
+
onRequest?: RequestHandler_2<BODY> | RequestHandler_2<BODY>[];
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/** @public */
|
|
620
|
+
declare interface SendMethod {
|
|
621
|
+
(statusCode: StatusCodes, data: any): AbortMessage;
|
|
622
|
+
(response: Response): AbortMessage;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/** @public */
|
|
626
|
+
export declare class ServerError<T = any> extends Error {
|
|
627
|
+
status: number;
|
|
628
|
+
data: T;
|
|
629
|
+
constructor(status: number, data: T);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* HTTP Server Error Status Codes Status codes in the 5xx range indicate that the server encountered
|
|
634
|
+
* an error or was unable to fulfill the request due to unexpected conditions.
|
|
635
|
+
*/
|
|
636
|
+
declare type ServerErrorCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
637
|
+
|
|
638
|
+
/** @public */
|
|
639
|
+
export declare interface ServerRenderOptions extends RenderOptions {
|
|
640
|
+
render: Render;
|
|
641
|
+
/** @deprecated Not used */
|
|
642
|
+
qwikCityPlan?: QwikCityPlan;
|
|
643
|
+
/** @deprecated Not used */
|
|
644
|
+
qwikRouterConfig?: QwikRouterConfig;
|
|
645
|
+
/**
|
|
646
|
+
* Protection against cross-site request forgery (CSRF) attacks.
|
|
647
|
+
*
|
|
648
|
+
* When `true`, for every incoming POST, PUT, PATCH, or DELETE form submissions, the request
|
|
649
|
+
* origin is checked to match the server's origin. `lax-proto` is for SSL-terminating proxies
|
|
650
|
+
*
|
|
651
|
+
* Be careful when disabling this option as it may lead to CSRF attacks.
|
|
652
|
+
*
|
|
653
|
+
* Defaults to `true`.
|
|
654
|
+
*/
|
|
655
|
+
checkOrigin?: boolean | 'lax-proto';
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* @public
|
|
660
|
+
* Request event created by the server.
|
|
661
|
+
*/
|
|
662
|
+
export declare interface ServerRequestEvent<T = unknown> {
|
|
663
|
+
mode: ServerRequestMode;
|
|
664
|
+
url: URL;
|
|
665
|
+
locale: string | undefined;
|
|
666
|
+
platform: QwikRouterPlatform;
|
|
667
|
+
request: Request;
|
|
668
|
+
env: EnvGetter;
|
|
669
|
+
getClientConn: () => ClientConn;
|
|
670
|
+
getWritableStream: ServerResponseHandler<T>;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/** @public */
|
|
674
|
+
export declare type ServerRequestMode = 'dev' | 'static' | 'server';
|
|
675
|
+
|
|
676
|
+
/** @public */
|
|
677
|
+
export declare type ServerResponseHandler<T = any> = (status: number, headers: Headers, cookies: Cookie, resolve: (response: T) => void, requestEv: RequestEventInternal) => WritableStream<Uint8Array>;
|
|
678
|
+
|
|
679
|
+
/** @public */
|
|
680
|
+
declare interface StaticGenerate {
|
|
681
|
+
params?: PathParams[];
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/** @public */
|
|
685
|
+
declare type StaticGenerateHandler = ({ env, }: {
|
|
686
|
+
env: EnvGetter_2;
|
|
687
|
+
}) => Promise<StaticGenerate> | StaticGenerate;
|
|
688
|
+
|
|
689
|
+
declare type StatusCodes = InformationalCode | SuccessCode | ClientErrorCode | ServerErrorCode | RedirectCode | number;
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* HTTP Success Status Codes Status codes in the 2xx range indicate that the client's request was
|
|
693
|
+
* successfully received, understood, and accepted by the server.
|
|
694
|
+
*/
|
|
695
|
+
declare type SuccessCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* TextEncoderStream polyfill based on Node.js' implementation
|
|
699
|
+
* https://github.com/nodejs/node/blob/3f3226c8e363a5f06c1e6a37abd59b6b8c1923f1/lib/internal/webstreams/encoding.js#L38-L119
|
|
700
|
+
* (MIT License)
|
|
701
|
+
*/
|
|
702
|
+
/** @internal */
|
|
703
|
+
export declare class _TextEncoderStream_polyfill {
|
|
704
|
+
#private;
|
|
705
|
+
get encoding(): string;
|
|
706
|
+
get readable(): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
707
|
+
get writable(): WritableStream<string>;
|
|
708
|
+
get [Symbol.toStringTag](): string;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export { }
|