/// import { Component } from '@builder.io/qwik'; import { Cookie } from '@builder.io/qwik-city/middleware/request-handler'; import { CookieOptions } from '@builder.io/qwik-city/middleware/request-handler'; import { CookieValue } from '@builder.io/qwik-city/middleware/request-handler'; import { DeferReturn } from '@builder.io/qwik-city/middleware/request-handler'; import type { EnvGetter } from '@builder.io/qwik-city/middleware/request-handler'; import { JSXOutput } from '@builder.io/qwik'; import { QRL } from '@builder.io/qwik'; import { QRLEventHandlerMulti } from '@builder.io/qwik'; import { QwikIntrinsicElements } from '@builder.io/qwik'; import { QwikJSX } from '@builder.io/qwik'; import type { ReadonlySignal } from '@builder.io/qwik'; import { RequestEvent } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestEventAction } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestEventBase } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestEventCommon } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestEventLoader } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestHandler } from '@builder.io/qwik-city/middleware/request-handler'; import type { ResolveSyncValue } from '@builder.io/qwik-city/middleware/request-handler'; import type * as v from 'valibot'; import { ValueOrPromise } from '@builder.io/qwik'; import { z } from 'zod'; import type * as z_2 from 'zod'; /** @public */ export declare type Action, OPTIONAL extends boolean = true> = { /** * Returns the `ActionStore` containing the current action state and methods to invoke it from a * component$(). Like all `use-` functions and methods, it can only be invoked within a * `component$()`. */ (): ActionStore; }; /** @public */ export declare type ActionConstructor = { | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise, options: { readonly id?: string; readonly validation: [VALIDATOR, ...REST]; }): Action>> | FailReturn>>, GetValidatorInputType, false>; | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise, options: { readonly id?: string; readonly validation: [VALIDATOR]; }): Action>>>, GetValidatorInputType, false>; | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: JSONObject, event: RequestEventAction) => ValueOrPromise, options: { readonly id?: string; readonly validation: REST; }): Action>>>; | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise, options: VALIDATOR, ...rest: REST): Action>> | FailReturn>>, GetValidatorInputType, false>; | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise, options: VALIDATOR): Action>>>, GetValidatorInputType, false>; | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise, ...rest: REST): Action>>>; (actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise, options?: { readonly id?: string; }): Action>; }; /** @public */ declare type ActionConstructorQRL = { | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise>, options: { readonly id?: string; readonly validation: [VALIDATOR, ...REST]; }): Action>> | FailReturn>>, GetValidatorInputType, false>; | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: QRL<(data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise>, options: { readonly id?: string; readonly validation: [VALIDATOR]; }): Action>>>, GetValidatorInputType, false>; | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: JSONObject, event: RequestEventAction) => ValueOrPromise>, options: { readonly id?: string; readonly validation: REST; }): Action>>>; | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise>, options: VALIDATOR, ...rest: REST): Action>> | FailReturn>>, GetValidatorInputType, false>; | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: QRL<(data: GetValidatorOutputType, event: RequestEventAction) => ValueOrPromise>, options: VALIDATOR): Action>>>, GetValidatorInputType, false>; | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise>, ...rest: REST): Action>>>; (actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise>, options?: { readonly id?: string; }): Action>; }; /** @public */ export declare type ActionReturn = { readonly status?: number; readonly value: RETURN; }; /** @public */ export declare type ActionStore = { /** * It's the "action" path that a native `
` should have in order to call the action. * * ```tsx * * ``` * * Most of the time this property should not be used directly, instead use the `Form` component: * * ```tsx * import {action$, Form} from '@builder.io/qwik-city'; * * export const useAddUser = action$(() => { ... }); * * export default component$(() => { * const action = useAddUser(); * return ( * * ); * }); * ``` */ readonly actionPath: string; /** * Reactive property that becomes `true` only in the browser, when a form is submitted and * switched back to false when the action finish, ie, it describes if the action is actively * running. * * This property is specially useful to disable the submit button while the action is processing, * to prevent multiple submissions, and to inform visually to the user that the action is actively * running. * * It will be always `false` in the server, and only becomes `true` briefly while the action is * running. */ readonly isRunning: boolean; /** * Returned HTTP status code of the action after its last execution. * * It's `undefined` before the action is first called. */ readonly status?: number; /** * When calling an action through a ``, this property contains the previously submitted * `FormData`. * * This is useful to keep the filled form data even after a full page reload. * * It's `undefined` before the action is first called. */ readonly formData: FormData | undefined; /** * Returned successful data of the action. This reactive property will contain the data returned * inside the `action$` function. * * It's `undefined` before the action is first called. */ readonly value: RETURN | undefined; /** * Method to execute the action programmatically from the browser. Ie, instead of using a * ``, a 'click' handle can call the `run()` method of the action in order to execute the * action in the server. */ readonly submit: QRL Promise> : (form: INPUT | FormData | SubmitEvent) => Promise>>; /** Is action.submit was submitted */ readonly submitted: boolean; }; declare type AnchorAttributes = QwikIntrinsicElements['a']; /** @public */ export declare interface ContentHeading { readonly text: string; readonly id: string; readonly level: number; } /** @public */ export declare interface ContentMenu { readonly text: string; readonly href?: string; readonly items?: ContentMenu[]; } declare type ContentModule = PageModule | LayoutModule; declare type ContentModuleHead = DocumentHead | ResolvedDocumentHead; declare type ContentModuleLoader = () => Promise; /** @public */ declare interface ContentState { readonly headings: ContentHeading[] | undefined; readonly menu: ContentMenu | undefined; } export { Cookie } export { CookieOptions } export { CookieValue } /** @public */ export declare type DataValidator = {}> = { validate(ev: RequestEvent, data: unknown): Promise>; }; export { DeferReturn } /** @public */ export declare type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue); /** @public */ export declare interface DocumentHeadProps extends RouteLocation { readonly head: ResolvedDocumentHead; readonly withLocale: (fn: () => T) => T; readonly resolveValue: ResolveSyncValue; } /** @public */ export declare interface DocumentHeadValue = Record> { /** Sets `document.title`. */ readonly title?: string; /** * Used to manually set meta tags in the head. Additionally, the `data` property could be used to * set arbitrary data which the `` component could later use to generate `` tags. */ readonly meta?: readonly DocumentMeta[]; /** Used to manually append `` elements to the ``. */ readonly links?: readonly DocumentLink[]; /** Used to manually append `