import { BaseGridPlugin, CellClickEvent, HeaderClickEvent } from '../../core/plugin/base-plugin';
import { ColumnConfig } from '../../core/types';
import { FlattenedTreeRow, TreeConfig, TreeRow } from './types';
/**
 * Tree Data Plugin for tbw-grid
 *
 * Transforms your flat grid into a hierarchical tree view with expandable parent-child
 * relationships. Ideal for file explorers, organizational charts, nested categories,
 * or any data with a natural hierarchy.
 *
 * ## Installation
 *
 * ```ts
 * import { TreePlugin } from '@toolbox-web/grid/plugins/tree';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `childrenField` | `string` | `'children'` | Field containing child array |
 * | `autoDetect` | `boolean` | `true` | Auto-detect tree structure from data |
 * | `defaultExpanded` | `boolean` | `false` | Expand all nodes initially |
 * | `indentWidth` | `number` | `20` | Indentation per level (pixels) |
 * | `showExpandIcons` | `boolean` | `true` | Show expand/collapse toggle icons |
 * | `animation` | `false \| 'slide' \| 'fade'` | `'slide'` | Animation style for expand/collapse |
 *
 * ## Programmatic API
 *
 * | Method | Signature | Description |
 * |--------|-----------|-------------|
 * | `expand` | `(nodeId) => void` | Expand a specific node |
 * | `collapse` | `(nodeId) => void` | Collapse a specific node |
 * | `toggle` | `(nodeId) => void` | Toggle a node's expanded state |
 * | `expandAll` | `() => void` | Expand all nodes |
 * | `collapseAll` | `() => void` | Collapse all nodes |
 * | `getExpandedNodes` | `() => Set<string>` | Get currently expanded node keys |
 *
 * ## CSS Custom Properties
 *
 * | Property | Default | Description |
 * |----------|---------|-------------|
 * | `--tbw-tree-toggle-size` | `1.25em` | Toggle icon width |
 * | `--tbw-tree-indent-width` | `var(--tbw-tree-toggle-size)` | Indentation per level |
 * | `--tbw-tree-accent` | `var(--tbw-color-accent)` | Toggle icon hover color |
 * | `--tbw-animation-duration` | `200ms` | Expand/collapse animation duration |
 * | `--tbw-animation-easing` | `ease-out` | Animation curve |
 *
 * @example Basic Tree with Nested Children
 * ```ts
 * import '@toolbox-web/grid';
 * import { TreePlugin } from '@toolbox-web/grid/plugins/tree';
 *
 * const grid = document.querySelector('tbw-grid');
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'name', header: 'Name' },
 *     { field: 'type', header: 'Type' },
 *     { field: 'size', header: 'Size' },
 *   ],
 *   plugins: [new TreePlugin({ childrenField: 'children', indentWidth: 24 })],
 * };
 * grid.rows = [
 *   {
 *     id: 1,
 *     name: 'Documents',
 *     type: 'folder',
 *     children: [
 *       { id: 2, name: 'Report.docx', type: 'file', size: '24 KB' },
 *     ],
 *   },
 * ];
 * ```
 *
 * @example Expanded by Default with Custom Animation
 * ```ts
 * new TreePlugin({
 *   defaultExpanded: true,
 *   animation: 'fade', // 'slide' | 'fade' | false
 *   indentWidth: 32,
 * })
 * ```
 *
 * @see {@link TreeConfig} for all configuration options
 * @see {@link FlattenedTreeRow} for the flattened row structure
 *
 * @internal Extends BaseGridPlugin
 */
export declare class TreePlugin extends BaseGridPlugin<TreeConfig> {
    /** @internal */
    readonly name = "tree";
    /** @internal */
    readonly styles: string;
    /** @internal */
    protected get defaultConfig(): Partial<TreeConfig>;
    private expandedKeys;
    private initialExpansionDone;
    private flattenedRows;
    private rowKeyMap;
    private previousVisibleKeys;
    private keysToAnimate;
    private sortState;
    /** @internal */
    detach(): void;
    /**
     * Get expand/collapse animation style from plugin config.
     * Uses base class isAnimationEnabled to respect grid-level settings.
     */
    private get animationStyle();
    detect(rows: readonly unknown[]): boolean;
    /** @internal */
    processRows(rows: readonly unknown[]): TreeRow[];
    /** Assign stable keys to rows (preserves key across sort operations) */
    private withStableKeys;
    /** Flatten tree using stable keys */
    private flattenTree;
    /** Sort tree recursively, keeping children with parents */
    private sortTree;
    /** @internal */
    processColumns(columns: readonly ColumnConfig[]): ColumnConfig[];
    /** @internal */
    onCellClick(event: CellClickEvent): boolean;
    /** @internal */
    onKeyDown(event: KeyboardEvent): boolean | void;
    /** @internal */
    onHeaderClick(event: HeaderClickEvent): boolean;
    /** @internal */
    afterRender(): void;
    expand(key: string): void;
    collapse(key: string): void;
    toggle(key: string): void;
    expandAll(): void;
    collapseAll(): void;
    isExpanded(key: string): boolean;
    getExpandedKeys(): string[];
    getFlattenedRows(): FlattenedTreeRow[];
    getRowByKey(key: string): TreeRow | undefined;
    expandToKey(key: string): void;
}
//# sourceMappingURL=TreePlugin.d.ts.map