/** * Form Renderer Component * Renders JSON-driven forms with React FormValidator */ import React from 'react'; import { type FormSchema, type ButtonClickEventArgs } from './types/FormSchema'; import { type LayoutNode, type UIField, type DataField } from './json-converter'; export interface DataSchema { version: string; properties: Record; } export interface UISchema { properties: Record; layout: LayoutNode[]; } export interface ChangeEventArgs { field: string; value: any; } export interface SubmitEventArgs { data: Record; isValid: boolean; } /** * Form layout options (only applies when UI schema is NOT provided) */ export declare const FormLayout: { readonly SingleColumn: "single"; readonly TwoColumn: "twocolumn"; readonly ThreeColumn: "threecolumn"; readonly FourColumn: "fourcolumn"; }; export type FormLayout = typeof FormLayout[keyof typeof FormLayout]; export interface FormRendererProps extends Omit, 'onChange' | 'onSubmit' | 'onClick'> { /** * Data Schema - can be provided as: * - JSON string (parsed with UniversalJsonParser) * - FormSchema object (components converted to DataSchema) * - DataSchema object (used directly) */ schema?: DataSchema | string | FormSchema | any; /** * Specifies the locale/language for the form component. * Supports locale-specific formatting and translations. * @default 'en-US' */ locale?: string; /** * Callback invoked when the form is submitted. * Receives form data and validation status. * @param args - Object containing form data and isValid flag */ onSubmit?: (args: SubmitEventArgs) => void; /** * Callback invoked when any form field value changes. * Fired on user input for tracked fields. * @param args - Object containing changed field name and new value */ onChange?: (args: ChangeEventArgs) => void; /** * Callback invoked when a button in the form is clicked. * Applies to all button types (button, submit, splitButton). * @param args - Object containing button click event details */ onButtonClick?: (args: ButtonClickEventArgs) => void; /** * CSS class names to apply to the root form container element. * Supports space-separated multiple classes. */ className?: string; /** * Form layout configuration (only applies when UI schema is NOT provided). * Determines how form fields are arranged in columns. * @default FormLayout.SingleColumn */ layout?: FormLayout; /** * Called when all form elements are rendered and ready for interaction. * Useful for performing post-render initialization or setup. */ created?: () => void; } export declare const FormRenderer: React.ForwardRefExoticComponent>; export default FormRenderer;