@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
package/lib/index.d.ts
CHANGED
|
@@ -1,812 +1,1002 @@
|
|
|
1
1
|
/// <reference path="./modules.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { Component } from '@qwik.dev/core';
|
|
4
|
-
import { Cookie } from '@qwik.dev/router/middleware/request-handler';
|
|
5
|
-
import { CookieOptions } from '@qwik.dev/router/middleware/request-handler';
|
|
6
|
-
import { CookieValue } from '@qwik.dev/router/middleware/request-handler';
|
|
7
|
-
import { DeferReturn } from '@qwik.dev/router/middleware/request-handler';
|
|
8
|
-
import type { EnvGetter } from '@qwik.dev/router/middleware/request-handler';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import type
|
|
24
|
-
import type {
|
|
25
|
-
import
|
|
26
|
-
import type
|
|
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
|
-
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (
|
|
55
|
-
<OBJ>(actionQrl: (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(
|
|
77
|
-
<OBJ>(actionQrl: QRL<(
|
|
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
|
-
* export
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* }
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
* action
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
readonly
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
readonly
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
readonly
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
declare type
|
|
177
|
-
|
|
178
|
-
declare type
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
export {
|
|
189
|
-
|
|
190
|
-
export {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/** @public */
|
|
296
|
-
export declare type
|
|
297
|
-
|
|
298
|
-
/** @public */
|
|
299
|
-
export declare
|
|
300
|
-
|
|
301
|
-
/** @public */
|
|
302
|
-
export declare
|
|
303
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/** @public */
|
|
362
|
-
export declare
|
|
363
|
-
|
|
364
|
-
/** @public */
|
|
365
|
-
export declare
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
*
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
/** @public */
|
|
411
|
-
declare type
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
declare type
|
|
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
|
-
|
|
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
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
*/
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
readonly
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
/** @public */
|
|
529
|
-
export declare
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
/** @public */
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
export
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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
|
-
export declare type
|
|
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
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/** @public */
|
|
651
|
-
export declare
|
|
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
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
*/
|
|
716
|
-
export declare const
|
|
717
|
-
|
|
718
|
-
/* Excluded from this release type:
|
|
719
|
-
|
|
720
|
-
/** @
|
|
721
|
-
export declare
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
<
|
|
732
|
-
<
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
3
|
+
import { Component } from '@qwik.dev/core';
|
|
4
|
+
import { Cookie } from '@qwik.dev/router/middleware/request-handler';
|
|
5
|
+
import { CookieOptions } from '@qwik.dev/router/middleware/request-handler';
|
|
6
|
+
import { CookieValue } from '@qwik.dev/router/middleware/request-handler';
|
|
7
|
+
import { DeferReturn } from '@qwik.dev/router/middleware/request-handler';
|
|
8
|
+
import type { EnvGetter } from '@qwik.dev/router/middleware/request-handler';
|
|
9
|
+
import { JSXOutput as JSXOutput_2 } from '@qwik.dev/core';
|
|
10
|
+
import { QRL } from '@qwik.dev/core';
|
|
11
|
+
import { QRLEventHandlerMulti } from '@qwik.dev/core';
|
|
12
|
+
import { QwikIntrinsicElements } from '@qwik.dev/core';
|
|
13
|
+
import { QwikJSX } from '@qwik.dev/core';
|
|
14
|
+
import type { ReadonlySignal } from '@qwik.dev/core';
|
|
15
|
+
import { Render } from '@qwik.dev/core/server';
|
|
16
|
+
import { RenderOptions } from '@qwik.dev/core/server';
|
|
17
|
+
import { RequestEvent } from '@qwik.dev/router/middleware/request-handler';
|
|
18
|
+
import { RequestEventAction } from '@qwik.dev/router/middleware/request-handler';
|
|
19
|
+
import { RequestEventBase } from '@qwik.dev/router/middleware/request-handler';
|
|
20
|
+
import { RequestEventCommon } from '@qwik.dev/router/middleware/request-handler';
|
|
21
|
+
import { RequestEventLoader } from '@qwik.dev/router/middleware/request-handler';
|
|
22
|
+
import { RequestHandler } from '@qwik.dev/router/middleware/request-handler';
|
|
23
|
+
import type { ResolveSyncValue } from '@qwik.dev/router/middleware/request-handler';
|
|
24
|
+
import type { SerializationStrategy } from '@qwik.dev/core/internal';
|
|
25
|
+
import type * as v from 'valibot';
|
|
26
|
+
import type { ValueOrPromise } from '@qwik.dev/core';
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
import type * as z_2 from 'zod';
|
|
29
|
+
|
|
30
|
+
/** @public */
|
|
31
|
+
export declare type Action<RETURN, INPUT = Record<string, unknown>, OPTIONAL extends boolean = true> = {
|
|
32
|
+
/**
|
|
33
|
+
* Returns the `ActionStore` containing the current action state and methods to invoke it from a
|
|
34
|
+
* component$(). Like all `use-` functions and methods, it can only be invoked within a
|
|
35
|
+
* `component$()`.
|
|
36
|
+
*/
|
|
37
|
+
(): ActionStore<RETURN, INPUT, OPTIONAL>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @public */
|
|
41
|
+
export declare type ActionConstructor = {
|
|
42
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {
|
|
43
|
+
readonly id?: string;
|
|
44
|
+
readonly validation: [VALIDATOR, ...REST];
|
|
45
|
+
}): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
46
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {
|
|
47
|
+
readonly id?: string;
|
|
48
|
+
readonly validation: [VALIDATOR];
|
|
49
|
+
}): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
50
|
+
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {
|
|
51
|
+
readonly id?: string;
|
|
52
|
+
readonly validation: REST;
|
|
53
|
+
}): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
54
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
55
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
56
|
+
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
57
|
+
<OBJ>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options?: {
|
|
58
|
+
readonly id?: string;
|
|
59
|
+
}): Action<StrictUnion<OBJ>>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @public */
|
|
63
|
+
declare type ActionConstructorQRL = {
|
|
64
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>>, options: {
|
|
65
|
+
readonly id?: string;
|
|
66
|
+
readonly validation: [VALIDATOR, ...REST];
|
|
67
|
+
}): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
68
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: QRL<(data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>>, options: {
|
|
69
|
+
readonly id?: string;
|
|
70
|
+
readonly validation: [VALIDATOR];
|
|
71
|
+
}): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
72
|
+
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>, options: {
|
|
73
|
+
readonly id?: string;
|
|
74
|
+
readonly validation: REST;
|
|
75
|
+
}): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
76
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>>, options: VALIDATOR, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
77
|
+
<OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: QRL<(data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>>, options: VALIDATOR): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;
|
|
78
|
+
<OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
79
|
+
<OBJ>(actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>, options?: {
|
|
80
|
+
readonly id?: string;
|
|
81
|
+
}): Action<StrictUnion<OBJ>>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @public */
|
|
85
|
+
export declare type ActionReturn<RETURN> = {
|
|
86
|
+
readonly status?: number;
|
|
87
|
+
readonly value: RETURN;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** @public */
|
|
91
|
+
export declare type ActionStore<RETURN, INPUT, OPTIONAL extends boolean = true> = {
|
|
92
|
+
/**
|
|
93
|
+
* It's the "action" path that a native `<form>` should have in order to call the action.
|
|
94
|
+
*
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <form action={action.actionPath} />
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* Most of the time this property should not be used directly, instead use the `Form` component:
|
|
100
|
+
*
|
|
101
|
+
* ```tsx
|
|
102
|
+
* import {action$, Form} from '@qwik.dev/router';
|
|
103
|
+
*
|
|
104
|
+
* export const useAddUser = action$(() => { ... });
|
|
105
|
+
*
|
|
106
|
+
* export default component$(() => {
|
|
107
|
+
* const action = useAddUser();
|
|
108
|
+
* return (
|
|
109
|
+
* <Form action={action}/>
|
|
110
|
+
* );
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
readonly actionPath: string;
|
|
115
|
+
/**
|
|
116
|
+
* Reactive property that becomes `true` only in the browser, when a form is submitted and
|
|
117
|
+
* switched back to false when the action finish, ie, it describes if the action is actively
|
|
118
|
+
* running.
|
|
119
|
+
*
|
|
120
|
+
* This property is specially useful to disable the submit button while the action is processing,
|
|
121
|
+
* to prevent multiple submissions, and to inform visually to the user that the action is actively
|
|
122
|
+
* running.
|
|
123
|
+
*
|
|
124
|
+
* It will be always `false` in the server, and only becomes `true` briefly while the action is
|
|
125
|
+
* running.
|
|
126
|
+
*/
|
|
127
|
+
readonly isRunning: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Returned HTTP status code of the action after its last execution.
|
|
130
|
+
*
|
|
131
|
+
* It's `undefined` before the action is first called.
|
|
132
|
+
*/
|
|
133
|
+
readonly status?: number;
|
|
134
|
+
/**
|
|
135
|
+
* When calling an action through a `<form>`, this property contains the previously submitted
|
|
136
|
+
* `FormData`.
|
|
137
|
+
*
|
|
138
|
+
* This is useful to keep the filled form data even after a full page reload.
|
|
139
|
+
*
|
|
140
|
+
* It's `undefined` before the action is first called.
|
|
141
|
+
*/
|
|
142
|
+
readonly formData: FormData | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Returned successful data of the action. This reactive property will contain the data returned
|
|
145
|
+
* inside the `action$` function.
|
|
146
|
+
*
|
|
147
|
+
* It's `undefined` before the action is first called.
|
|
148
|
+
*/
|
|
149
|
+
readonly value: RETURN | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Method to execute the action programmatically from the browser. Ie, instead of using a
|
|
152
|
+
* `<form>`, a 'click' handle can call the `run()` method of the action in order to execute the
|
|
153
|
+
* action in the server.
|
|
154
|
+
*/
|
|
155
|
+
readonly submit: QRL<OPTIONAL extends true ? (form?: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>> : (form: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>>;
|
|
156
|
+
/** Is action.submit was submitted */
|
|
157
|
+
readonly submitted: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
declare type AnchorAttributes = QwikIntrinsicElements['a'];
|
|
161
|
+
|
|
162
|
+
/** @public */
|
|
163
|
+
export declare interface ContentHeading {
|
|
164
|
+
readonly text: string;
|
|
165
|
+
readonly id: string;
|
|
166
|
+
readonly level: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @public */
|
|
170
|
+
export declare interface ContentMenu {
|
|
171
|
+
readonly text: string;
|
|
172
|
+
readonly href?: string;
|
|
173
|
+
readonly items?: ContentMenu[];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
declare type ContentModule = PageModule | LayoutModule;
|
|
177
|
+
|
|
178
|
+
declare type ContentModuleHead = DocumentHead | ResolvedDocumentHead;
|
|
179
|
+
|
|
180
|
+
declare type ContentModuleLoader = () => Promise<ContentModule>;
|
|
181
|
+
|
|
182
|
+
/** @public */
|
|
183
|
+
declare interface ContentState {
|
|
184
|
+
readonly headings: ContentHeading[] | undefined;
|
|
185
|
+
readonly menu: ContentMenu | undefined;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { Cookie }
|
|
189
|
+
|
|
190
|
+
export { CookieOptions }
|
|
191
|
+
|
|
192
|
+
export { CookieValue }
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Creates the `render()` function that is required by `createQwikRouter()`. It requires a function
|
|
196
|
+
* that returns the `jsx` and `options` for the renderer.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
*
|
|
200
|
+
* ```tsx
|
|
201
|
+
* const renderer = createRenderer((opts) => {
|
|
202
|
+
* if (opts.requestHeaders['x-hello'] === 'world') {
|
|
203
|
+
* return { jsx: <Hello />, options: opts };
|
|
204
|
+
* }
|
|
205
|
+
* return { jsx: <Root />, options: {
|
|
206
|
+
* ...opts,
|
|
207
|
+
* serverData: {
|
|
208
|
+
* ...opts.serverData,
|
|
209
|
+
* documentHead: {
|
|
210
|
+
* meta: [
|
|
211
|
+
* { name: 'renderedAt', content: new Date().toISOString() },
|
|
212
|
+
* ],
|
|
213
|
+
* },
|
|
214
|
+
* },
|
|
215
|
+
* } };
|
|
216
|
+
* });
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
export declare const createRenderer: (getOptions: (options: RendererOptions) => {
|
|
222
|
+
jsx: JSXOutput_2;
|
|
223
|
+
options: RendererOutputOptions;
|
|
224
|
+
}) => Render;
|
|
225
|
+
|
|
226
|
+
/** @public */
|
|
227
|
+
export declare type DataValidator<T extends Record<string, any> = {}> = {
|
|
228
|
+
validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<T>>;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export { DeferReturn }
|
|
232
|
+
|
|
233
|
+
/** @public */
|
|
234
|
+
declare interface DevJSX {
|
|
235
|
+
fileName: string;
|
|
236
|
+
lineNumber: number;
|
|
237
|
+
columnNumber: number;
|
|
238
|
+
stack?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** @public */
|
|
242
|
+
export declare type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);
|
|
243
|
+
|
|
244
|
+
/** @public */
|
|
245
|
+
export declare interface DocumentHeadProps extends RouteLocation {
|
|
246
|
+
readonly head: ResolvedDocumentHead;
|
|
247
|
+
readonly withLocale: <T>(fn: () => T) => T;
|
|
248
|
+
readonly resolveValue: ResolveSyncValue;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* This renders all the tags collected from `head`.
|
|
253
|
+
*
|
|
254
|
+
* You can partially override the head, for example if you want to change the title:
|
|
255
|
+
*
|
|
256
|
+
* ```tsx
|
|
257
|
+
* import { DocumentHeadTags, useDocumentHead } from '@qwik.dev/router';
|
|
258
|
+
*
|
|
259
|
+
* export default component$(() => {
|
|
260
|
+
* const head = useDocumentHead();
|
|
261
|
+
* return <DocumentHeadTags title={`${head.title} - My App`} />;
|
|
262
|
+
* });
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* You don't have to use this component, you can also do it yourself for full control. Just copy the
|
|
266
|
+
* code from this component and modify it to your needs.
|
|
267
|
+
*
|
|
268
|
+
* Note that this component normally only runs once, during SSR. You can use Signals in your
|
|
269
|
+
* `src/root.tsx` to make runtime changes to `<head>` if needed.
|
|
270
|
+
*
|
|
271
|
+
* @public
|
|
272
|
+
*/
|
|
273
|
+
export declare const DocumentHeadTags: Component<DocumentHeadValue<Record<string, unknown>>>;
|
|
274
|
+
|
|
275
|
+
/** @public */
|
|
276
|
+
export declare interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>> {
|
|
277
|
+
/** Sets `document.title`. */
|
|
278
|
+
readonly title?: string;
|
|
279
|
+
/** Used to manually set meta tags in the head. */
|
|
280
|
+
readonly meta?: readonly DocumentMeta[];
|
|
281
|
+
/** Used to manually append `<link>` elements to the `<head>`. */
|
|
282
|
+
readonly links?: readonly DocumentLink[];
|
|
283
|
+
/** Used to manually append `<style>` elements to the `<head>`. */
|
|
284
|
+
readonly styles?: readonly DocumentStyle[];
|
|
285
|
+
/** Used to manually append `<script>` elements to the `<head>`. */
|
|
286
|
+
readonly scripts?: readonly DocumentScript[];
|
|
287
|
+
/**
|
|
288
|
+
* Arbitrary object containing custom data. When the document head is created from markdown files,
|
|
289
|
+
* the frontmatter attributes that are not recognized as a well-known meta names (such as title,
|
|
290
|
+
* description, author, etc...), are stored in this property.
|
|
291
|
+
*/
|
|
292
|
+
readonly frontmatter?: Readonly<FrontMatter>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** @public */
|
|
296
|
+
export declare type DocumentLink = QwikIntrinsicElements['link'];
|
|
297
|
+
|
|
298
|
+
/** @public */
|
|
299
|
+
export declare type DocumentMeta = QwikIntrinsicElements['meta'];
|
|
300
|
+
|
|
301
|
+
/** @public */
|
|
302
|
+
export declare type DocumentScript = ((Omit<QwikIntrinsicElements['script'], 'dangerouslySetInnerHTML'> & {
|
|
303
|
+
props?: never;
|
|
304
|
+
}) | {
|
|
305
|
+
key?: string;
|
|
306
|
+
/**
|
|
307
|
+
* The props of the script element. @deprecated Prefer setting the properties directly instead
|
|
308
|
+
* of using this property.
|
|
309
|
+
*/
|
|
310
|
+
props: Readonly<QwikIntrinsicElements['script']>;
|
|
311
|
+
}) & ({
|
|
312
|
+
/** The inline script content. */
|
|
313
|
+
script?: string;
|
|
314
|
+
dangerouslySetInnerHTML?: never;
|
|
315
|
+
} | {
|
|
316
|
+
dangerouslySetInnerHTML?: string;
|
|
317
|
+
script?: never;
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
/** @public */
|
|
321
|
+
export declare type DocumentStyle = Readonly<((Omit<QwikIntrinsicElements['style'], 'dangerouslySetInnerHTML'> & {
|
|
322
|
+
props?: never;
|
|
323
|
+
}) | {
|
|
324
|
+
key?: string;
|
|
325
|
+
/**
|
|
326
|
+
* The props of the style element. @deprecated Prefer setting the properties directly
|
|
327
|
+
* instead of using this property.
|
|
328
|
+
*/
|
|
329
|
+
props: Readonly<QwikIntrinsicElements['style']>;
|
|
330
|
+
}) & ({
|
|
331
|
+
/** The inline style content. */
|
|
332
|
+
style?: string;
|
|
333
|
+
dangerouslySetInnerHTML?: never;
|
|
334
|
+
} | {
|
|
335
|
+
dangerouslySetInnerHTML?: string;
|
|
336
|
+
style?: never;
|
|
337
|
+
})>;
|
|
338
|
+
|
|
339
|
+
declare type EndpointModuleLoader = () => Promise<RouteModule>;
|
|
340
|
+
|
|
341
|
+
declare interface EndpointResponse {
|
|
342
|
+
status: number;
|
|
343
|
+
loaders: Record<string, unknown>;
|
|
344
|
+
loadersSerializationStrategy: Map<string, SerializationStrategy>;
|
|
345
|
+
formData?: FormData;
|
|
346
|
+
action?: string;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/** @public */
|
|
350
|
+
export declare const ErrorBoundary: Component<ErrorBoundaryProps>;
|
|
351
|
+
|
|
352
|
+
/** @public */
|
|
353
|
+
declare interface ErrorBoundaryProps {
|
|
354
|
+
fallback$?: QRL<(error: any) => any>;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare type Failed = {
|
|
358
|
+
failed: true;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/** @public */
|
|
362
|
+
export declare type FailOfRest<REST extends readonly DataValidator[]> = REST extends readonly DataValidator<infer ERROR>[] ? ERROR : never;
|
|
363
|
+
|
|
364
|
+
/** @public */
|
|
365
|
+
export declare type FailReturn<T> = T & Failed;
|
|
366
|
+
|
|
367
|
+
/** @public */
|
|
368
|
+
export declare const Form: <O, I>({ action, spaReset, reloadDocument, onSubmit$, ...rest }: FormProps<O, I>, key: string | null) => JSXOutput_2;
|
|
369
|
+
|
|
370
|
+
/** @public */
|
|
371
|
+
export declare interface FormProps<O, I> extends Omit<QwikJSX.IntrinsicElements['form'], 'action' | 'method'> {
|
|
372
|
+
/** Reference to the action returned by `action()`. */
|
|
373
|
+
action?: ActionStore<O, I, true | false>;
|
|
374
|
+
/**
|
|
375
|
+
* When `true` the form submission will cause a full page reload, even if SPA mode is enabled and
|
|
376
|
+
* JS is available.
|
|
377
|
+
*/
|
|
378
|
+
reloadDocument?: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* When `true` all the form inputs will be reset in SPA mode, just like happens in a full page
|
|
381
|
+
* form submission.
|
|
382
|
+
*
|
|
383
|
+
* Defaults to `false`
|
|
384
|
+
*/
|
|
385
|
+
spaReset?: boolean;
|
|
386
|
+
/** Event handler executed right when the form is submitted. */
|
|
387
|
+
onSubmit$?: QRLEventHandlerMulti<SubmitEvent, HTMLFormElement> | undefined;
|
|
388
|
+
/** Event handler executed right after the action is executed successfully and returns some data. */
|
|
389
|
+
onSubmitCompleted$?: QRLEventHandlerMulti<CustomEvent<FormSubmitSuccessDetail<O>>, HTMLFormElement> | undefined;
|
|
390
|
+
key?: string | number | null;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** @public */
|
|
394
|
+
export declare interface FormSubmitSuccessDetail<T> {
|
|
395
|
+
status: number;
|
|
396
|
+
value: T;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Any function taking a props object that returns JSXOutput.
|
|
401
|
+
*
|
|
402
|
+
* The `key`, `flags` and `dev` parameters are for internal use.
|
|
403
|
+
*
|
|
404
|
+
* @public
|
|
405
|
+
*/
|
|
406
|
+
declare type FunctionComponent<P = unknown> = {
|
|
407
|
+
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
|
|
408
|
+
}['renderFn'];
|
|
409
|
+
|
|
410
|
+
/** @public */
|
|
411
|
+
export declare type GetValidatorInputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferInput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z_2.input<TYPE> : never;
|
|
412
|
+
|
|
413
|
+
/** @public */
|
|
414
|
+
export declare type GetValidatorOutputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferOutput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z_2.output<TYPE> : never;
|
|
415
|
+
|
|
416
|
+
/** @public */
|
|
417
|
+
export declare type GetValidatorType<VALIDATOR extends TypedDataValidator> = GetValidatorOutputType<VALIDATOR>;
|
|
418
|
+
|
|
419
|
+
/** @public */
|
|
420
|
+
export declare const globalAction$: ActionConstructor;
|
|
421
|
+
|
|
422
|
+
/* Excluded from this release type: globalActionQrl */
|
|
423
|
+
|
|
424
|
+
declare type IsAny<Type> = 0 extends 1 & Type ? true : false;
|
|
425
|
+
|
|
426
|
+
/** @public */
|
|
427
|
+
export declare type JSONObject = {
|
|
428
|
+
[x: string]: JSONValue;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
/** @public */
|
|
432
|
+
export declare type JSONValue = string | number | boolean | {
|
|
433
|
+
[x: string]: JSONValue;
|
|
434
|
+
} | Array<JSONValue>;
|
|
435
|
+
|
|
436
|
+
/** @public */
|
|
437
|
+
declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
441
|
+
*
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
|
|
445
|
+
type: T;
|
|
446
|
+
props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
|
|
447
|
+
children: JSXChildren | null;
|
|
448
|
+
key: string | null;
|
|
449
|
+
dev?: DevJSX;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Any valid output for a component
|
|
454
|
+
*
|
|
455
|
+
* @public
|
|
456
|
+
*/
|
|
457
|
+
declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
|
|
458
|
+
|
|
459
|
+
declare interface LayoutModule extends RouteModule {
|
|
460
|
+
readonly default: unknown;
|
|
461
|
+
readonly head?: ContentModuleHead;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** @public */
|
|
465
|
+
export declare const Link: Component<LinkProps>;
|
|
466
|
+
|
|
467
|
+
/** @public */
|
|
468
|
+
export declare interface LinkProps extends AnchorAttributes {
|
|
469
|
+
/**
|
|
470
|
+
* **Defaults to _true_.**
|
|
471
|
+
*
|
|
472
|
+
* Whether Qwik should prefetch and cache the target page of this **`Link`**, this includes
|
|
473
|
+
* invoking any **`routeLoader$`**, **`onGet`**, etc.
|
|
474
|
+
*
|
|
475
|
+
* This **improves UX performance** for client-side (**SPA**) navigations.
|
|
476
|
+
*
|
|
477
|
+
* Prefetching occurs when a the Link enters the viewport in production (**`on:qvisible`**), or
|
|
478
|
+
* with **`mouseover`/`focus`** during dev.
|
|
479
|
+
*
|
|
480
|
+
* Prefetching will not occur if the user has the **data saver** setting enabled.
|
|
481
|
+
*
|
|
482
|
+
* Setting this value to **`"js"`** will prefetch only javascript bundles required to render this
|
|
483
|
+
* page on the client, **`false`** will disable prefetching altogether.
|
|
484
|
+
*/
|
|
485
|
+
prefetch?: boolean | 'js';
|
|
486
|
+
reload?: boolean;
|
|
487
|
+
replaceState?: boolean;
|
|
488
|
+
scroll?: boolean;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare type LoadedRoute = [
|
|
492
|
+
routeName: string,
|
|
493
|
+
params: PathParams,
|
|
494
|
+
mods: (RouteModule | ContentModule)[],
|
|
495
|
+
menu: ContentMenu | undefined,
|
|
496
|
+
routeBundleNames: string[] | undefined
|
|
497
|
+
];
|
|
498
|
+
|
|
499
|
+
/** @public */
|
|
500
|
+
declare type Loader_2<RETURN> = {
|
|
501
|
+
/**
|
|
502
|
+
* Returns the `Signal` containing the data returned by the `loader$` function. Like all `use-`
|
|
503
|
+
* functions and methods, it can only be invoked within a `component$()`.
|
|
504
|
+
*/
|
|
505
|
+
(): LoaderSignal<RETURN>;
|
|
506
|
+
};
|
|
507
|
+
export { Loader_2 as Loader }
|
|
508
|
+
|
|
509
|
+
/** @public */
|
|
510
|
+
declare type LoaderConstructor = {
|
|
511
|
+
<OBJ>(loaderFn: (event: RequestEventLoader) => ValueOrPromise<OBJ>, options?: LoaderOptions): Loader_2<[Extract<OBJ, Failed>] extends [never] ? OBJ : StrictUnion<OBJ>>;
|
|
512
|
+
<OBJ extends Record<string, any> | void | null, REST extends readonly DataValidator[]>(loaderFn: (event: RequestEventLoader) => ValueOrPromise<OBJ>, ...rest: REST): Loader_2<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
/** @public */
|
|
516
|
+
declare type LoaderConstructorQRL = {
|
|
517
|
+
<OBJ>(loaderQrl: QRL<(event: RequestEventLoader) => ValueOrPromise<OBJ>>, options?: LoaderOptions): Loader_2<[Extract<OBJ, Failed>] extends [never] ? OBJ : StrictUnion<OBJ>>;
|
|
518
|
+
<OBJ extends Record<string, any> | void | null, REST extends readonly DataValidator[]>(loaderQrl: QRL<(event: RequestEventLoader) => ValueOrPromise<OBJ>>, ...rest: REST): Loader_2<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
/** @public */
|
|
522
|
+
declare type LoaderOptions = {
|
|
523
|
+
readonly id?: string;
|
|
524
|
+
readonly validation?: DataValidator[];
|
|
525
|
+
readonly serializationStrategy?: SerializationStrategy;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/** @public */
|
|
529
|
+
export declare type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<infer VALIDATOR> ? ReadonlySignal<ValueOrPromise<VALIDATOR>> : ReadonlySignal<TYPE>;
|
|
530
|
+
|
|
531
|
+
/** @public */
|
|
532
|
+
export declare type MenuData = [pathname: string, menuLoader: MenuModuleLoader];
|
|
533
|
+
|
|
534
|
+
declare interface MenuModule {
|
|
535
|
+
readonly default: ContentMenu;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare type MenuModuleLoader = () => Promise<MenuModule>;
|
|
539
|
+
|
|
540
|
+
declare type ModuleLoader = ContentModuleLoader | EndpointModuleLoader;
|
|
541
|
+
|
|
542
|
+
/** @public */
|
|
543
|
+
declare type NavigationType_2 = 'initial' | 'form' | 'link' | 'popstate';
|
|
544
|
+
export { NavigationType_2 as NavigationType }
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Creates a new object from `obj` by omitting a set of `keys`.
|
|
548
|
+
*
|
|
549
|
+
* @beta
|
|
550
|
+
* @experimental
|
|
551
|
+
*/
|
|
552
|
+
export declare function omitProps<T, KEYS extends keyof T>(obj: T, keys: KEYS[]): Omit<T, KEYS>;
|
|
553
|
+
|
|
554
|
+
/** @public */
|
|
555
|
+
export declare interface PageModule extends RouteModule {
|
|
556
|
+
readonly default: unknown;
|
|
557
|
+
readonly head?: ContentModuleHead;
|
|
558
|
+
readonly headings?: ContentHeading[];
|
|
559
|
+
readonly onStaticGenerate?: StaticGenerateHandler;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/** @public */
|
|
563
|
+
export declare type PathParams = Record<string, string>;
|
|
564
|
+
|
|
565
|
+
declare type Prettify<T> = {} & {
|
|
566
|
+
[K in keyof T]: T[K];
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* @param url - The URL that the user is trying to navigate to, or a number to indicate the user is
|
|
571
|
+
* trying to navigate back/forward in the application history. If it is missing, the event is sent
|
|
572
|
+
* by the browser and the user is trying to reload or navigate away from the page. In this case,
|
|
573
|
+
* the function should decide the answer synchronously.
|
|
574
|
+
* @returns `true` to prevent navigation, `false` to allow navigation, or a Promise that resolves to
|
|
575
|
+
* `true` or `false`. For browser events, returning `true` or a Promise may show a confirmation
|
|
576
|
+
* dialog, at the browser's discretion. If the user confirms, the navigation will still be
|
|
577
|
+
* allowed.
|
|
578
|
+
* @public
|
|
579
|
+
*/
|
|
580
|
+
export declare type PreventNavigateCallback = (url?: number | URL) => ValueOrPromise<boolean>;
|
|
581
|
+
|
|
582
|
+
/** @public */
|
|
583
|
+
export declare const Q_ROUTE = "q:route";
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* @deprecated Use `QWIK_ROUTER_SCROLLER` instead (will be removed in V3)
|
|
587
|
+
* @public
|
|
588
|
+
*/
|
|
589
|
+
export declare const QWIK_CITY_SCROLLER = "_qCityScroller";
|
|
590
|
+
|
|
591
|
+
/** @public */
|
|
592
|
+
export declare const QWIK_ROUTER_SCROLLER = "_qRouterScroller";
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* @deprecated Use `QwikRouterMockProps` instead. will be removed in V3
|
|
596
|
+
* @public
|
|
597
|
+
*/
|
|
598
|
+
export declare type QwikCityMockProps = QwikRouterMockProps;
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* @deprecated Use `useQwikMockRouter()` instead. Will be removed in V3
|
|
602
|
+
* @public
|
|
603
|
+
*/
|
|
604
|
+
export declare const QwikCityMockProvider: Component<QwikRouterMockProps>;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @deprecated Use `QwikRouterConfig` instead. Will be removed in V3.
|
|
608
|
+
* @public
|
|
609
|
+
*/
|
|
610
|
+
export declare type QwikCityPlan = QwikRouterConfig;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* @deprecated Use `QwikRouterProps` instead. Will be removed in v3.
|
|
614
|
+
* @public
|
|
615
|
+
*/
|
|
616
|
+
export declare type QwikCityProps = QwikRouterProps;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* @deprecated Use `useQwikRouter()` instead. Will be removed in v3.
|
|
620
|
+
* @public
|
|
621
|
+
*/
|
|
622
|
+
export declare const QwikCityProvider: Component<QwikRouterProps>;
|
|
623
|
+
|
|
624
|
+
/** @public */
|
|
625
|
+
export declare interface QwikRouterConfig {
|
|
626
|
+
readonly routes: RouteData[];
|
|
627
|
+
readonly serverPlugins?: RouteModule[];
|
|
628
|
+
readonly basePathname?: string;
|
|
629
|
+
readonly menus?: MenuData[];
|
|
630
|
+
readonly trailingSlash?: boolean;
|
|
631
|
+
readonly cacheModules?: boolean;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/** @public */
|
|
635
|
+
export declare interface QwikRouterEnvData {
|
|
636
|
+
routeName: string;
|
|
637
|
+
ev: RequestEvent;
|
|
638
|
+
params: PathParams;
|
|
639
|
+
response: EndpointResponse;
|
|
640
|
+
loadedRoute: LoadedRoute | null;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/** @public */
|
|
644
|
+
export declare interface QwikRouterMockProps {
|
|
645
|
+
url?: string;
|
|
646
|
+
params?: Record<string, string>;
|
|
647
|
+
goto?: RouteNavigate;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/** @public */
|
|
651
|
+
export declare const QwikRouterMockProvider: Component<QwikRouterMockProps>;
|
|
652
|
+
|
|
653
|
+
/** @public */
|
|
654
|
+
export declare interface QwikRouterProps {
|
|
655
|
+
/**
|
|
656
|
+
* Enable the ViewTransition API
|
|
657
|
+
*
|
|
658
|
+
* Default: `true`
|
|
659
|
+
*
|
|
660
|
+
* @see https://github.com/WICG/view-transitions/blob/main/explainer.md
|
|
661
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
|
|
662
|
+
* @see https://caniuse.com/mdn_api_viewtransition
|
|
663
|
+
*/
|
|
664
|
+
viewTransition?: boolean;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/** @public This is a wrapper around the `useQwikRouter()` hook. We recommend using the hook instead of this component. */
|
|
668
|
+
export declare const QwikRouterProvider: Component<QwikRouterProps>;
|
|
669
|
+
|
|
670
|
+
/** @public */
|
|
671
|
+
declare interface ReadonlySignal_2<T = unknown> {
|
|
672
|
+
readonly value: T;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/** @public */
|
|
676
|
+
export declare type RendererOptions = Omit<RenderOptions, 'serverData'> & {
|
|
677
|
+
serverData: ServerData;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/** @public */
|
|
681
|
+
export declare type RendererOutputOptions = Omit<RenderOptions, 'serverData'> & {
|
|
682
|
+
serverData: ServerData & {
|
|
683
|
+
documentHead?: DocumentHeadValue;
|
|
684
|
+
} & Record<string, unknown>;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
export { RequestEvent }
|
|
688
|
+
|
|
689
|
+
export { RequestEventAction }
|
|
690
|
+
|
|
691
|
+
export { RequestEventBase }
|
|
692
|
+
|
|
693
|
+
export { RequestEventCommon }
|
|
694
|
+
|
|
695
|
+
export { RequestEventLoader }
|
|
696
|
+
|
|
697
|
+
export { RequestHandler }
|
|
698
|
+
|
|
699
|
+
/** @public */
|
|
700
|
+
export declare type ResolvedDocumentHead<FrontMatter extends Record<string, any> = Record<string, unknown>> = Required<DocumentHeadValue<FrontMatter>>;
|
|
701
|
+
|
|
702
|
+
/** @public */
|
|
703
|
+
export declare const routeAction$: ActionConstructor;
|
|
704
|
+
|
|
705
|
+
/* Excluded from this release type: routeActionQrl */
|
|
706
|
+
|
|
707
|
+
/** @public */
|
|
708
|
+
export declare type RouteData = [routeName: string, loaders: ModuleLoader[]] | [
|
|
709
|
+
routeName: string,
|
|
710
|
+
loaders: ModuleLoader[],
|
|
711
|
+
originalPathname: string,
|
|
712
|
+
routeBundleNames: string[]
|
|
713
|
+
];
|
|
714
|
+
|
|
715
|
+
/** @public */
|
|
716
|
+
export declare const routeLoader$: LoaderConstructor;
|
|
717
|
+
|
|
718
|
+
/* Excluded from this release type: routeLoaderQrl */
|
|
719
|
+
|
|
720
|
+
/** @public */
|
|
721
|
+
export declare interface RouteLocation {
|
|
722
|
+
readonly params: Readonly<Record<string, string>>;
|
|
723
|
+
readonly url: URL;
|
|
724
|
+
readonly isNavigating: boolean;
|
|
725
|
+
readonly prevUrl: URL | undefined;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
declare interface RouteModule<BODY = unknown> {
|
|
729
|
+
onDelete?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
730
|
+
onGet?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
731
|
+
onHead?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
732
|
+
onOptions?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
733
|
+
onPatch?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
734
|
+
onPost?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
735
|
+
onPut?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
736
|
+
onRequest?: RequestHandler<BODY> | RequestHandler<BODY>[];
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/** @public */
|
|
740
|
+
export declare type RouteNavigate = QRL<(path?: string | number | URL, options?: {
|
|
741
|
+
type?: Exclude<NavigationType_2, 'initial'>;
|
|
742
|
+
forceReload?: boolean;
|
|
743
|
+
replaceState?: boolean;
|
|
744
|
+
scroll?: boolean;
|
|
745
|
+
} | boolean) => Promise<void>>;
|
|
746
|
+
|
|
747
|
+
/** @public */
|
|
748
|
+
export declare const RouterOutlet: Component<unknown>;
|
|
749
|
+
|
|
750
|
+
/** @public */
|
|
751
|
+
export declare const server$: <T extends ServerFunction>(qrl: T, options?: ServerConfig | undefined) => ServerQRL<T>;
|
|
752
|
+
|
|
753
|
+
/** @public */
|
|
754
|
+
declare interface ServerConfig {
|
|
755
|
+
origin?: string;
|
|
756
|
+
method?: 'get' | 'post';
|
|
757
|
+
headers?: Record<string, string>;
|
|
758
|
+
fetchOptions?: any;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/** @public The server data that is provided by Qwik Router during SSR rendering. It can be retrieved with `useServerData(key)` in the server, but it is not available in the client. */
|
|
762
|
+
export declare type ServerData = {
|
|
763
|
+
url: string;
|
|
764
|
+
requestHeaders: Record<string, string>;
|
|
765
|
+
locale: string | undefined;
|
|
766
|
+
nonce: string | undefined;
|
|
767
|
+
containerAttributes: Record<string, string> & {
|
|
768
|
+
[Q_ROUTE]: string;
|
|
769
|
+
};
|
|
770
|
+
qwikrouter: QwikRouterEnvData;
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
/** @public */
|
|
774
|
+
export declare type ServerFunction = {
|
|
775
|
+
(this: RequestEventBase, ...args: any[]): any;
|
|
776
|
+
options?: ServerConfig;
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* You can pass an AbortSignal as the first argument of a `server$` function and it will use it to
|
|
781
|
+
* abort the fetch when fired.
|
|
782
|
+
*
|
|
783
|
+
* @public
|
|
784
|
+
*/
|
|
785
|
+
export declare type ServerQRL<T extends ServerFunction> = QRL<((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>) | ((...args: Parameters<T>) => ReturnType<T>)>;
|
|
786
|
+
|
|
787
|
+
/* Excluded from this release type: serverQrl */
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Loads the service workers that are defined in the routes. Any file named `service-worker.*` (all
|
|
791
|
+
* JS extensions are allowed) will be picked up, bundled into a separate file, and registered as a
|
|
792
|
+
* service worker.
|
|
793
|
+
*
|
|
794
|
+
* Qwik 1.14.0 and above now use `<link rel="modulepreload">` by default. If you didn't add custom
|
|
795
|
+
* service-worker logic, you should remove your service-worker.ts file(s) for the
|
|
796
|
+
* `ServiceWorkerRegister` Component to actually unregister the service-worker.js and delete its
|
|
797
|
+
* related cache. Make sure to keep the `ServiceWorkerRegister` Component in your app (without any
|
|
798
|
+
* service-worker.ts file) as long as you want to unregister the service-worker.js for your users.
|
|
799
|
+
*
|
|
800
|
+
* @public
|
|
801
|
+
*/
|
|
802
|
+
export declare const ServiceWorkerRegister: (props: {
|
|
803
|
+
nonce?: string;
|
|
804
|
+
}) => JSXOutput;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* A signal is a reactive value which can be read and written. When the signal is written, all tasks
|
|
808
|
+
* which are tracking the signal will be re-run and all components that read the signal will be
|
|
809
|
+
* re-rendered.
|
|
810
|
+
*
|
|
811
|
+
* Furthermore, when a signal value is passed as a prop to a component, the optimizer will
|
|
812
|
+
* automatically forward the signal. This means that `return <div title={signal.value}>hi</div>`
|
|
813
|
+
* will update the `title` attribute when the signal changes without having to re-render the
|
|
814
|
+
* component.
|
|
815
|
+
*
|
|
816
|
+
* @public
|
|
817
|
+
*/
|
|
818
|
+
declare interface Signal<T = any> extends ReadonlySignal_2<T> {
|
|
819
|
+
value: T;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** @public */
|
|
823
|
+
export declare interface StaticGenerate {
|
|
824
|
+
params?: PathParams[];
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/** @public */
|
|
828
|
+
export declare type StaticGenerateHandler = ({ env, }: {
|
|
829
|
+
env: EnvGetter;
|
|
830
|
+
}) => Promise<StaticGenerate> | StaticGenerate;
|
|
831
|
+
|
|
832
|
+
/** @public */
|
|
833
|
+
export declare type StrictUnion<T> = Prettify<StrictUnionHelper<T, T>>;
|
|
834
|
+
|
|
835
|
+
declare type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
|
|
836
|
+
|
|
837
|
+
/** @public */
|
|
838
|
+
export declare type TypedDataValidator = ValibotDataValidator | ZodDataValidator;
|
|
839
|
+
|
|
840
|
+
declare type UnionKeys<T> = T extends T ? keyof T : never;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* @beta
|
|
844
|
+
* @experimental
|
|
845
|
+
*/
|
|
846
|
+
export declare const untypedAppUrl: (route: string, params?: Record<string, string>, paramsPrefix?: string) => string;
|
|
847
|
+
|
|
848
|
+
/** @public */
|
|
849
|
+
export declare const useContent: () => ContentState;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Returns the document head for the current page. The generic type describes the front matter.
|
|
853
|
+
*
|
|
854
|
+
* @public
|
|
855
|
+
*/
|
|
856
|
+
export declare const useDocumentHead: <FrontMatter extends Record<string, unknown> = Record<string, any>>() => Required<ResolvedDocumentHead<FrontMatter>>;
|
|
857
|
+
|
|
858
|
+
/** @public */
|
|
859
|
+
export declare const useLocation: () => RouteLocation;
|
|
860
|
+
|
|
861
|
+
/** @public */
|
|
862
|
+
export declare const useNavigate: () => RouteNavigate;
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Prevent navigation attempts. This hook registers a callback that will be called before SPA or
|
|
866
|
+
* browser navigation.
|
|
867
|
+
*
|
|
868
|
+
* Return `true` to prevent navigation.
|
|
869
|
+
*
|
|
870
|
+
* #### SPA Navigation
|
|
871
|
+
*
|
|
872
|
+
* For Single-Page-App (SPA) navigation (via `<Link />`, `const nav = useNavigate()`, and browser
|
|
873
|
+
* backwards/forwards inside SPA history), the callback will be provided with the target, either a
|
|
874
|
+
* URL or a number. It will only be a number if `nav(number)` was called to navigate forwards or
|
|
875
|
+
* backwards in SPA history.
|
|
876
|
+
*
|
|
877
|
+
* If you return a Promise, the navigation will be blocked until the promise resolves.
|
|
878
|
+
*
|
|
879
|
+
* This can be used to show a nice dialog to the user, and wait for the user to confirm, or to
|
|
880
|
+
* record the url, prevent the navigation, and navigate there later via `nav(url)`.
|
|
881
|
+
*
|
|
882
|
+
* #### Browser Navigation
|
|
883
|
+
*
|
|
884
|
+
* However, when the user navigates away by clicking on a regular `<a />`, reloading, or moving
|
|
885
|
+
* backwards/forwards outside SPA history, this callback will not be awaited. This is because the
|
|
886
|
+
* browser does not provide a way to asynchronously prevent these navigations.
|
|
887
|
+
*
|
|
888
|
+
* In this case, returning returning `true` will tell the browser to show a confirmation dialog,
|
|
889
|
+
* which cannot be customized. You are also not able to show your own `window.confirm()` dialog
|
|
890
|
+
* during the callback, the browser won't allow it. If you return a Promise, it will be considered
|
|
891
|
+
* as `true`.
|
|
892
|
+
*
|
|
893
|
+
* When the callback is called from the browser, no url will be provided. Use this to know whether
|
|
894
|
+
* you can show a dialog or just return `true` to prevent the navigation.
|
|
895
|
+
*
|
|
896
|
+
* @public
|
|
897
|
+
*/
|
|
898
|
+
export declare const usePreventNavigate$: (qrl: PreventNavigateCallback) => void;
|
|
899
|
+
|
|
900
|
+
/* Excluded from this release type: usePreventNavigateQrl */
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* @public
|
|
904
|
+
* This hook initializes Qwik Router, providing the necessary context for it to work.
|
|
905
|
+
*
|
|
906
|
+
* This hook should be used once, at the root of your application.
|
|
907
|
+
*/
|
|
908
|
+
export declare const useQwikRouter: (props?: QwikRouterProps) => void;
|
|
909
|
+
|
|
910
|
+
/** @beta */
|
|
911
|
+
export declare const valibot$: ValibotConstructor;
|
|
912
|
+
|
|
913
|
+
/** @beta */
|
|
914
|
+
declare type ValibotConstructor = {
|
|
915
|
+
<T extends v.GenericSchema | v.GenericSchemaAsync>(schema: T): ValibotDataValidator<T>;
|
|
916
|
+
<T extends v.GenericSchema | v.GenericSchemaAsync>(schema: (ev: RequestEvent) => T): ValibotDataValidator<T>;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
/** @beta */
|
|
920
|
+
declare type ValibotConstructorQRL = {
|
|
921
|
+
<T extends v.GenericSchema | v.GenericSchemaAsync>(schema: QRL<T>): ValibotDataValidator<T>;
|
|
922
|
+
<T extends v.GenericSchema | v.GenericSchemaAsync>(schema: QRL<(ev: RequestEvent) => T>): ValibotDataValidator<T>;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
/** @beta */
|
|
926
|
+
declare type ValibotDataValidator<T extends v.GenericSchema | v.GenericSchemaAsync = v.GenericSchema | v.GenericSchemaAsync> = {
|
|
927
|
+
readonly __brand: 'valibot';
|
|
928
|
+
validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<ValidatorErrorType<v.InferInput<T>>>>;
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
/* Excluded from this release type: valibotQrl */
|
|
932
|
+
|
|
933
|
+
/** @public */
|
|
934
|
+
export declare const validator$: ValidatorConstructor;
|
|
935
|
+
|
|
936
|
+
declare type ValidatorConstructor = {
|
|
937
|
+
<T extends ValidatorReturn>(validator: (ev: RequestEvent, data: unknown) => ValueOrPromise<T>): T extends ValidatorReturnFail<infer ERROR> ? DataValidator<ERROR> : DataValidator<never>;
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
declare type ValidatorConstructorQRL = {
|
|
941
|
+
<T extends ValidatorReturn>(validator: QRL<(ev: RequestEvent, data: unknown) => ValueOrPromise<T>>): T extends ValidatorReturnFail<infer ERROR> ? DataValidator<ERROR> : DataValidator<never>;
|
|
942
|
+
};
|
|
943
|
+
|
|
944
|
+
/** @public */
|
|
945
|
+
export declare type ValidatorErrorKeyDotNotation<T, Prefix extends string = ''> = IsAny<T> extends true ? never : T extends object ? {
|
|
946
|
+
[K in keyof T & string]: IsAny<T[K]> extends true ? never : T[K] extends (infer U)[] ? IsAny<U> extends true ? never : U extends object ? `${Prefix}${K}[]` | ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`> : `${Prefix}${K}[]` : T[K] extends object ? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`> : `${Prefix}${K}`;
|
|
947
|
+
}[keyof T & string] : never;
|
|
948
|
+
|
|
949
|
+
/** @public */
|
|
950
|
+
export declare type ValidatorErrorType<T, U = string> = {
|
|
951
|
+
formErrors: U[];
|
|
952
|
+
fieldErrors: Partial<{
|
|
953
|
+
[K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}` ? U[] : U;
|
|
954
|
+
}>;
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
/* Excluded from this release type: validatorQrl */
|
|
958
|
+
|
|
959
|
+
/** @public */
|
|
960
|
+
export declare type ValidatorReturn<T extends Record<string, any> = {}> = ValidatorReturnSuccess | ValidatorReturnFail<T>;
|
|
961
|
+
|
|
962
|
+
declare type ValidatorReturnFail<T extends Record<string, any> = {}> = {
|
|
963
|
+
readonly success: false;
|
|
964
|
+
readonly error: T;
|
|
965
|
+
readonly status?: number;
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
declare type ValidatorReturnSuccess = {
|
|
969
|
+
readonly success: true;
|
|
970
|
+
readonly data?: unknown;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
export { z }
|
|
974
|
+
|
|
975
|
+
/** @public */
|
|
976
|
+
export declare const zod$: ZodConstructor;
|
|
977
|
+
|
|
978
|
+
/** @public */
|
|
979
|
+
export declare type ZodConstructor = {
|
|
980
|
+
<T extends z_2.ZodRawShape>(schema: T): ZodDataValidator<z_2.ZodObject<T>>;
|
|
981
|
+
<T extends z_2.ZodRawShape>(schema: (zod: typeof z_2.z, ev: RequestEvent) => T): ZodDataValidator<z_2.ZodObject<T>>;
|
|
982
|
+
<T extends z_2.Schema>(schema: T): ZodDataValidator<T>;
|
|
983
|
+
<T extends z_2.Schema>(schema: (zod: typeof z_2.z, ev: RequestEvent) => T): ZodDataValidator<T>;
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
/** @public */
|
|
987
|
+
declare type ZodConstructorQRL = {
|
|
988
|
+
<T extends z_2.ZodRawShape>(schema: QRL<T>): ZodDataValidator<z_2.ZodObject<T>>;
|
|
989
|
+
<T extends z_2.ZodRawShape>(schema: QRL<(zod: typeof z_2.z, ev: RequestEvent) => T>): ZodDataValidator<z_2.ZodObject<T>>;
|
|
990
|
+
<T extends z_2.Schema>(schema: QRL<T>): ZodDataValidator<T>;
|
|
991
|
+
<T extends z_2.Schema>(schema: QRL<(zod: typeof z_2.z, ev: RequestEvent) => T>): ZodDataValidator<T>;
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
/** @public */
|
|
995
|
+
declare type ZodDataValidator<T extends z_2.ZodType = z_2.ZodType> = {
|
|
996
|
+
readonly __brand: 'zod';
|
|
997
|
+
validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<ValidatorErrorType<z_2.input<T>>>>;
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
/* Excluded from this release type: zodQrl */
|
|
1001
|
+
|
|
1002
|
+
export { }
|