import type { CSSProperties } from 'react'; import { ParsedValue } from './units.js'; import { ResizeHandles, PanelSizesWithUnit, PanelChildren } from '../types/shared-panel-types.js'; /** * Get the initial styles for the root panel to ensure correct sizing and placement * of the registered children and resize handles. * @param rootWidth - Current width of the parent panel. * @param panels - All the registered child panels, sorted by their order. * @param resizeHandles - All the registered resize handles, sorted by their order. * @param useMinWidthPanels - An array of panel names where the initial width would be less than the panels minWidth. For these panels, we use the minWidth to recalculate the initial width of the panel. * @param recursions - Maximum number of recursions to check if all panels fit in the container. * @returns The grid template areas corresponding to the panels / resize handles and the template columns. /* Example: Container Size: 1000px Panel1 - minWidth: 500px Panel2 - minWidth: 300px Panel3 - no config Recursion || Sizes || useMinWidth || Panels fit container || Panel1 | Panel2 | Panel3 || || ----------------------------------------------------------------------------------------------- 0 || 33.33 = 328px | 33.33 = 328px | 33.33 = 328px || [Panel1] || false 1 || 50.81 = 500px | 24.59 = 242px | 24.59 = 242px || [Panel1, Panel3] || false 2 || 50.81 = 500px | 18.70 = 184px | 30.49 = 300px || [Panel1, Panel3] || true */ export declare function getInitialGridStylesAndSizes(rootWidth: number, panels: PanelChildren, resizeHandles: ResizeHandles, useMinWidthPanels?: string[], recursions?: number): { gridTemplateStyles: CSSProperties; initialPanelSizes: PanelSizesWithUnit; }; /** * Try to calculate new panel sizes, applying the given delta. * If the panels can't be resized by the given amount, returns undefined. */ export declare function applyDelta(sizes: PanelSizesWithUnit, sortedPanels: PanelChildren, sortedResizeHandles: ResizeHandles, delta: number, rootWidth: number, initialPanelIndex: number, direction?: 1 | -1, loop?: boolean, conditionallyRendered?: 'added' | 'dismissed'): PanelSizesWithUnit | undefined; /** * Resize all panels by the given delta and adjust the ParentPanel's template columns * to reflect the changes. * @returns The adjusted panel sizes and the corresponding grid template columns. */ export declare function resizePanels(handleIndex: number, sortedPanels: PanelChildren, sortedResizeHandles: ResizeHandles, sizes: Record, deltaX: number, rootWidth: number): { gridTemplateColumns: string; newSizes: PanelSizesWithUnit; } | undefined;