UNPKG

@astro-utils/forms

Version:

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

29 lines (28 loc) 1.07 kB
import { BigFileUploadOptions } from './components/form/UploadBigFile/uploadBigFileClient.js'; import { LoadUploadFilesOptions } from './components/form/UploadBigFile/uploadBigFileServer.js'; import type { CSRFSettings } from './form-tools/csrf.js'; import { AstroLinkHTTP } from './utils.js'; export type FormsSettings = { csrf?: CSRFSettings; forms?: { viewStateFormFiled?: string; bigFilesUpload?: { bigFileClientOptions?: Partial<BigFileUploadOptions>; bigFileServerOptions?: Partial<LoadUploadFilesOptions>; }; }; session?: { cookieName?: string; cookieOptions?: { httpOnly?: boolean; sameSite?: boolean | 'lax' | 'strict' | 'none'; maxAge?: number; path?: string; secure?: boolean; }; }; secret?: string; logs?: (type: 'warn' | 'error' | 'log', message: string) => void; }; export declare const FORM_OPTIONS: FormsSettings; export declare function getFormOptions(Astro: AstroLinkHTTP): FormsSettings;