UNPKG

@astro-utils/forms

Version:

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

15 lines (14 loc) 607 B
import { ZodError, type ZodFirstPartySchemaTypes } from 'zod'; import { BindForm } from './bind-form.js'; export default class AboutFormName { form: BindForm<any>; originalName: string; formValue?: any; errorMessage?: string; hadError: boolean; constructor(form: BindForm<any>, originalName: string, formValue?: any, errorMessage?: string); pushError(zodError: ZodError, overrideMessage?: string): void; pushErrorManually(code: string, errorMessage: string): void; catchParse(zObject: ZodFirstPartySchemaTypes, overrideMessage?: string): boolean; setValue(): void; }