UNPKG

@astro-utils/forms

Version:

Server component for Astro (call server functions from client side with validation and state management)

21 lines (20 loc) 861 B
import type { ValidRedirectStatus } from 'astro'; import { AstroLinkHTTP } from 'src/utils.js'; export default class FormsReact { private _astro; scriptToRun: string; overrideResponse: Response | null; constructor(_astro: AstroLinkHTTP); redirectTimeoutSeconds(location: string, timeoutSec?: number): void; redirect(location: string, status?: ValidRedirectStatus): void; updateSearchParams(): { search: URLSearchParams; redirect(status?: ValidRedirectStatus, removeEmptyParams?: boolean): void; }; updateOneSearchParam(key: string, value?: string, status?: ValidRedirectStatus): void; alert(message: string): void; console(type: keyof Console, ...messages: any[]): void; consoleLog(...messages: any[]): void; callFunction(func: string, ...args: any[]): void; private _escapeParentheses; }