import { v as MosaicKey, c as LegacyMosaicNode, h as MosaicNode, f as MosaicDirection, i as MosaicPath, k as MosaicSplitNode, l as MosaicTabsNode } from '../../types-BQA_Gcq_.js'; import 'immutability-helper'; import 'react'; declare enum Corner { TOP_LEFT = 1, TOP_RIGHT = 2, BOTTOM_LEFT = 3, BOTTOM_RIGHT = 4 } /** * Returns `true` if `node` is a MosaicSplitNode * @param node * @returns {boolean} */ declare function isSplitNode(node: MosaicNode | null): node is MosaicSplitNode; declare function isTabsNode(node: MosaicNode | null): node is MosaicTabsNode; declare function getParentNode(root: MosaicNode | null, path: MosaicPath): MosaicNode | null; declare function getParentPath(path: MosaicPath): MosaicPath; /** * Creates a balanced binary tree from `leaves` with the goal of making them as equal area as possible * @param leaves * @param startDirection * @returns {MosaicNode} */ declare function createBalancedTreeFromLeaves(leaves: MosaicNode[], startDirection?: MosaicDirection): MosaicNode | null; /** * Creates a balanced n-ary tree from `leaves` - alternative implementation * that creates splits with multiple children when beneficial * @param leaves * @param startDirection * @returns {MosaicNode} */ declare function createBalancedNaryTreeFromLeaves(leaves: MosaicNode[], startDirection?: MosaicDirection, maxChildrenPerSplit?: number): MosaicNode | null; /** * Gets the sibling index of the given child index * For n-ary structures, this concept is less clear, so we return adjacent indices * @param childIndex * @param totalChildren * @returns {number[]} Array of sibling indices */ declare function getOtherChildIndices(childIndex: number, totalChildren: number): number[]; /** * Gets the opposite of `direction` * @param direction * @returns {any} */ declare function getOtherDirection(direction: MosaicDirection): MosaicDirection; /** * Traverses `tree` to find the path to the specified `corner` * @param tree * @param corner * @returns {MosaicPath} */ declare function getPathToCorner(tree: MosaicNode, corner: Corner): MosaicPath; /** * Gets all leaves of `tree` * @param tree * @returns {T[]} */ declare function getLeaves(tree: MosaicNode | null): T[]; /** * Converts a legacy binary-tree MosaicNode to the new n-ary tree format. * - `LegacyMosaicParent` is converted to `MosaicSplitNode`. * - `splitPercentage` is converted to a `splitPercentages` array. * * @param legacyNode The node from the old binary tree structure. * @returns The equivalent node in the new n-ary tree structure. */ declare function convertLegacyToNary(legacyNode: null): null; declare function convertLegacyToNary(legacyNode: LegacyMosaicNode | MosaicNode): MosaicNode; declare function convertLegacyToNary(legacyNode: LegacyMosaicNode | MosaicNode | null): MosaicNode | null; /** * Recursively normalizes a mosaic tree to enforce logical constraints, returning a new tree. * - Flattens Split nodes that have only one child. * - Flattens Tabs nodes that have only one tab. * - Removes empty Split or Tabs nodes completely. * * This should be run after any operation that might change the tree structure. * * @param node The mosaic node to normalize. * @returns A normalized node, or null if the node becomes empty and should be removed. */ declare function normalizeMosaicTree(node: MosaicNode | null): MosaicNode | null; /** * Helper to retrieve a node from the tree at a given path. * Correctly traverses both 'split' and 'tabs' nodes. * * @param tree The root of the tree to search. * @param path The path to the desired node. * @returns The node at the path, or null if the path is invalid or the node doesn't exist. */ declare function getNodeAtPath(tree: MosaicNode | null, path: MosaicPath): MosaicNode | null; /** * Updates the split percentages for a node in the tree based on a local resize action. * This function only affects the two panes adjacent to the dragged splitter. * * @param tree The root of the mosaic tree. * @param path The path to the `MosaicSplitNode` being resized. * @param splitterIndex The index of the splitter being dragged (0 for the splitter between child 0 and 1). * @param deltaPercentage The percentage change to apply. Positive makes the first pane larger. * @param minimumPaneSizePercentage The minimum allowed size for a pane. * @returns A new, updated mosaic tree. */ declare function resizeSplit(tree: MosaicNode, path: MosaicPath, splitterIndex: number, deltaPercentage: number, minimumPaneSizePercentage?: number): MosaicNode; /** * Gets node at `path` from `tree` and verifies that neither `tree` nor the result are null * @param tree * @param path * @returns {MosaicNode} */ declare function getAndAssertNodeAtPathExists(tree: MosaicNode | null, path: MosaicPath): MosaicNode; /** * Helper function to get the parent node and child index for a given path * Useful for operations that need to modify a child * @param tree * @param path * @returns Object with parent node and child index, or null if not found */ declare function getParentAndChildIndex(tree: MosaicNode | null, path: MosaicPath): { parent: MosaicSplitNode | MosaicTabsNode; childIndex: number; } | null; export { Corner, convertLegacyToNary, createBalancedNaryTreeFromLeaves, createBalancedTreeFromLeaves, getAndAssertNodeAtPathExists, getLeaves, getNodeAtPath, getOtherChildIndices, getOtherDirection, getParentAndChildIndex, getParentNode, getParentPath, getPathToCorner, isSplitNode, isTabsNode, normalizeMosaicTree, resizeSplit };