import type { FormSchema, FormComponent } from '../FormBuilder/types/FormSchema'; export declare const generateId: (type: string) => string; export declare const generateName: (type: string) => string; export interface UnifiedSchema { version: string; properties: Record; theme?: string; layout: LayoutNode[]; settings?: any; } export interface UnifiedField extends DataField, UIField { } export interface DataSchema { version: string; properties: Record; settings?: any; } export interface DataField { id: string; type: 'string' | 'number' | 'boolean' | 'array' | 'any' | 'button' | 'message' | 'sign' | 'image' | 'file' | 'color' | 'grid'; name: string; label?: string; format?: 'date' | 'date-time' | 'time' | 'email' | 'url'; defaultValue?: any; expressionValue?: string; content?: string; buttonType?: string; textboxType?: string; options?: string[] | any[]; required?: boolean; minLength?: number; maxLength?: number; minValue?: number; maxValue?: number; minDate?: string; maxDate?: string; minTime?: string; maxTime?: string; pattern?: string; } export interface UISchema { properties: Record; layout: LayoutNode[]; } export interface UIField { widget: string; _configured?: boolean; [key: string]: any; } export interface SplitSchema { dataSchema: DataSchema; uiSchema: UISchema; } export type LayoutNode = FieldNode | TableNode | PanelNode | TabsNode | CardNode; export interface FieldNode { type: 'field'; propertyId: string; } export interface TableNode { type: 'table'; id: string; name: string; label?: string; cssClass?: string; hideBorders?: boolean; rows: number; cols: number; cells: TableCell[][]; columnWidths?: { widths: (number | null)[]; }; conditions?: any; } export interface TableCell { row: number; col: number; children: LayoutNode[]; } export interface PanelNode { type: 'panel'; id: string; name: string; label?: string; cssClass?: string; hideBorders?: boolean; hideLabel?: boolean; children: LayoutNode[]; conditions?: any; } export interface TabsNode { type: 'tabs'; id: string; name: string; cssClass?: string; label?: string; tabOptions?: string[]; tabs: TabItem[]; conditions?: any; } export interface TabItem { header: string; children: LayoutNode[]; } export interface CardNode { type: 'card'; id: string; name: string; label?: string; cssClass?: string; hideLabel?: boolean; cardTitle?: string; cardSubtitle?: string; enableAction?: boolean; actionButtonLabel?: string; actionButtonType?: 'button' | 'submit'; children: LayoutNode[]; conditions?: any; } /** * Convert label to camelCase identifier * Examples: * "First Name" → "firstName" * "Email Address" → "emailAddress" * "Date of Birth" → "dateOfBirth" * "Phone Number (Mobile)" → "phoneNumberMobile" */ export declare function labelToFieldKey(label: string, fallbackId?: string): string; /** * Ensure field key is unique by appending a number if needed */ export declare function makeUniqueFieldKey(baseKey: string, existingKeys: Set, originalId?: string): string; export declare const UI_TYPE_TO_SEMANTIC_TYPE: Record; export declare function splitSchema(heartSchema: FormSchema): UnifiedSchema; /** * Merge unified schema back into heart schema * Reconstructs FormComponent array from unified properties and layout */ export declare function mergeSchema(unified: UnifiedSchema): FormSchema; /** * Infer widget type from semantic data type */ export declare function inferWidgetFromType(type: string, format?: string, hasOptions?: boolean): string; export interface FieldMatchResult { existingId: string; newDataId: string; confidence: 'exact' | 'high' | 'medium' | 'low'; method: 'id' | 'label-exact' | 'label-fuzzy' | 'new'; similarity?: number; } /** * Match a new data field with existing UI schema field * Preserves existing ID for stability */ export declare function matchFieldWithIDPreservation(newDataField: DataField, existingUISchema: UISchema): FieldMatchResult; /** * Merge with ID remapping for re-import scenarios * Preserves existing IDs to maintain layout stability */ export declare function mergeWithIDRemapping(newDataSchema: DataSchema, existingUISchema: UISchema): FormSchema; /** * Extract all field IDs from layout tree */ export declare function extractFieldIdsFromLayout(layout: LayoutNode[]): Set; /** * Convert parser output (FormComponent[]) to DataSchema format * This allows parser results to be merged with existing UI schemas */ export declare function convertComponentsToDataSchema(components: FormComponent[]): DataSchema;