UNPKG

supapup

Version:

⚡ Lightning-fast MCP browser dev tool. Navigate → Get instant structured data. No screenshots needed! Puppeteer: 📸 → CSS selectors → JS eval. Supapup: semantic IDs ready to use. 10x faster, 90% fewer tokens.

53 lines 1.35 kB
/** * Form automation tools for Supapup * Enables filling entire forms with JSON data */ import { Page } from 'puppeteer'; export interface FormData { [fieldId: string]: string | boolean | number; } export interface FormFillResult { success: boolean; filled: string[]; errors: string[]; warnings: string[]; } export declare class FormTools { private page; constructor(page: Page); /** * Fill an entire form using a JSON object * Maps JSON keys to element IDs or data-mcp-ids */ fillForm(formData: FormData, options?: { formId?: string; submitAfter?: boolean; validateRequired?: boolean; }): Promise<FormFillResult>; /** * Submit a form by ID or find the first form */ submitForm(formId?: string): Promise<{ success: boolean; errors: string[]; }>; /** * Get current form data as JSON */ getFormData(formId?: string): Promise<FormData>; /** * Validate form data against rules */ validateForm(formId?: string): Promise<{ valid: boolean; errors: Array<{ field: string; message: string; }>; }>; /** * Detect all forms on the page and generate JSON templates */ detectForms(): Promise<any>; } //# sourceMappingURL=form-tools.d.ts.map