@qwik.dev/router 2.0.0-alpha.9 → 2.0.0-beta.2

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