import 'form-request-submit-polyfill'; import { PageDefault } from './page/page-info'; export declare type InputElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; /** * Find the nearest label to a given form element within the form * 1. searches for associated `labels` * 2. searches sibling element labels * 3. searches nearest parent that has a label and no other input children */ export declare function getNearestLabel(element: InputElement, others: InputElement[]): string; /** * Validates an email using native browser validity checks */ export declare function validEmail(value: unknown): boolean; interface FormDetails { action?: string; name?: string | null; method?: string; formData: { [key: string]: unknown; }; traits: { [key: string]: unknown; }; context: { page: PageDefault; selector?: string | null; }; } declare type FormDataCallback = (details: FormDetails) => Promise | void; export interface IgnoredForm { identifier_type: 'path'; identifier: string; } export interface FormCollectionOptions { ignoredForms?: IgnoredForm[]; } export declare function collectFormSubmissions(callback: FormDataCallback, options?: FormCollectionOptions): () => void | undefined; export declare function stopCollectingForms(): void; export {};