import { type location } from "@synnaxlabs/x";
import { type Node } from './types';
import { Tabs } from '../tabs';
/**
 * Inserts a tab into a node in the mosaic. If the given key is not found,
 * the tab is inserted into the closest ancestor. This is to deal
 * with mosaic garbage collection.
 *
 * @param key - The key of the node to insert the tab into.
 * @param tab - The tab to insert.
 * @param loc - The location where the tab was 'dropped' relative to the node.
 */
export declare const insertTab: (root: Node, tab: Tabs.Tab, loc?: location.Location, key?: number) => Node;
/**
 * Automatically selects tabs for all nodes in the mosaic if they don't already have
 * a selection.
 *
 * @param root - The root of the mosaic.
 * @returns A shallow copy of the root with all nodes having a selection.
 */
export declare const autoSelectTabs: (root: Node) => [Node, string[]];
/**
 * Removes a tab from the mosaic and performs any necessary garbage collection.
 *
 * @param root - The root of the mosaic.
 * @param tabKey - The key of the tab to remove. This tab must exist in the mosaic.
 */
export declare const removeTab: (root: Node, tabKey: string) => [Node, string | null];
export declare const findSelected: (root: Node) => string | null;
/**
 * Marks the given tab as selected.
 *
 * @param root - The root of the mosaic.
 * @param tabKey - The key of the tab to select. This tab must exist in the mosaic.
 * @returns A shallow copy of the root of the mosaic with the tab selected.
 */
export declare const selectTab: (root: Node, tabKey: string) => Node;
/**
 * Moves a tab from one node to another.
 *
 * @param root - The root of the mosaic.
 * @param to - The key of the node to move the tab to.
 * @param tabKey - The key of the tab to move. This tab must exist in the mosaic.
 * @param loc - The location where the tab was 'dropped' relative to the node.
 * @returns A shallow copy of the root of the mosaic with the tab moved.
 */
export declare const moveTab: (root: Node, tabKey: string, loc: location.Location, to: number) => [Node, string | null];
/**
 * Resizes the given mosaic leaf.
 *
 * @param root - The root of the mosaic.
 * @param key  - The key of the leaf to resize.
 * @param size - The new size distribution for the leaf. Expressed as either a percentage
 * or a number of pixels of the first child.
 * @returns A shallow copy of the root of the mosaic with the leaf resized.
 */
export declare const resizeNode: (root: Node, key: number, size: number) => Node;
/**
 * Sets the title of a tab.
 *
 * @param root - The root of the mosaic.
 * @param tabKey  - The key of the tab to resize.
 * @param name - The new title of the tab.
 * @returns A shallow copy of the root of the mosaic with the tab title changed.
 */
export declare const renameTab: (root: Node, tabKey: string, name: string) => Node;
/***
 * @returns True if the given mosaic node is empty, false otherwise.
 */
export declare const isEmpty: (root: Node) => boolean;
