import 'rollup-plugin-inject-process-env'; /** * Action response data object */ export interface FormActionResponseData { result: Record; step: string; form: string; final: boolean; /** * Non-PII passthrough sent to the backend on FORM_SUBMIT. Carries the shared * `eventId` and Meta `fbp`/`fbc` cookies for deduplicated, high-match * server-side Conversions API tracking. Populated by FormWidget. */ extras?: { eventId?: string; fbp?: string; fbc?: string; }; } /** * Data sent with FORM_NEXT action request when transitioning between steps. */ export interface FormNextData { result: Record; form: string; step: string; nextStep: string; } /** * Shape of a `FORM_STEP_UPDATE` display, as returned by either a FORM_NEXT or a * FORM_SUBMIT response. `externalWidget.config` is shallow-merged over the * target step's static `externalWidget.config`, with the response winning on * conflict; every other `externalWidget` property always comes from the step * definition and is never taken from the response. */ export interface FormStepUpdateDisplay { type?: string; step?: string; fields?: unknown[]; externalWidget?: { config?: Record; }; } export interface FormFieldProps { /** * Is the field visible */ hidden?: true; /** * Listens to changes in the field * * @param fieldName * @param fieldValue * @returns */ onFieldChange: (fieldName: string, fieldValue: string | string[] | object | undefined) => void; errorMessage?: string; required?: boolean; /** * Error message for free-form input fields (used by dropdown with free-form input). * This is separate from errorMessage which displays on the main field. */ freeFormErrorMessage?: string; }