type LayoutModifier = (builder: LayoutBuilder) => LayoutBuilder | void; /** * LayoutBuilder provides a fluent API for modifying field layouts. * Supports adding fields to existing rows and inserting new rows at specific positions. * Callbacks can be queued and executed lazily for efficient composition. */ export declare class LayoutBuilder { private layout; private modifiers; constructor(existingLayout?: string[][]); /** * Set the layout from an array. * This replaces the current layout and clears any queued modifiers. */ setLayout(layout: string[][]): this; /** * Add a layout modifier callback to be executed later. * Modifiers are queued and executed only when build() is called. */ addModifier(modifier: LayoutModifier): this; /** * Add a field to the same row as the target field. * * @param field - The field to add * @param position - Position relative to target field * @throws Error if target field is not found */ addField(field: string, position: { after: string; } | { before: string; }): this; /** * Add a new row at the end of the layout. * * @param fields - Array of field IDs for the new row */ addRow(fields: string[]): this; /** * Insert a new row before or after the row containing the target field. * * @param fields - Array of field IDs for the new row * @param position - Position relative to target field's row * @throws Error if target field is not found */ insertRow(fields: string[], position: { after: string; } | { before: string; }): this; /** * Get the current layout without executing modifiers. * Used for cloning the builder state. */ getSnapshot(): { layout: string[][]; modifiers: LayoutModifier[]; }; /** * Build the final layout array. * Executes all queued modifiers before building. */ build(): string[][]; /** * Find the position of a field in the layout. * * @param field - The field ID to find * @returns Position object or null if not found */ private findFieldPosition; } export {};