import { BaseGridPlugin, CellClickEvent, PluginManifest } from '../../core/plugin/base-plugin';
import { GroupingRowsConfig, RenderRow } from './types';
/**
 * Group state information returned by getGroupState()
 */
export interface GroupState {
    /** Whether grouping is currently active */
    isActive: boolean;
    /** Number of expanded groups */
    expandedCount: number;
    /** Total number of groups */
    totalGroups: number;
    /** Array of expanded group keys */
    expandedKeys: string[];
}
/**
 * Row Grouping Plugin for tbw-grid
 *
 * Organizes rows into collapsible hierarchical groups. Perfect for organizing data
 * by category, department, status, or any other dimension—or even multiple dimensions
 * for nested grouping. Includes aggregation support for summarizing group data.
 *
 * ## Installation
 *
 * ```ts
 * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `groupOn` | `(row) => string[]` | - | Callback returning group path array |
 * | `defaultExpanded` | `boolean \\| number \\| string \\| string[]` | `false` | Initial expanded state |
 * | `showRowCount` | `boolean` | `true` | Show row count in group header |
 * | `indentWidth` | `number` | `20` | Indentation per level (pixels) |
 * | `fullWidth` | `boolean` | `true` | Group row spans full width |
 * | `animation` | `false \\| 'slide' \\| 'fade'` | `'slide'` | Expand/collapse animation |
 * | `accordion` | `boolean` | `false` | Only one group open at a time |
 *
 * ## Programmatic API
 *
 * | Method | Signature | Description |
 * |--------|-----------|-------------|
 * | `expandGroup` | `(path: string[]) => void` | Expand a specific group |
 * | `collapseGroup` | `(path: string[]) => void` | Collapse a specific group |
 * | `expandAll` | `() => void` | Expand all groups |
 * | `collapseAll` | `() => void` | Collapse all groups |
 * | `isGroupExpanded` | `(path: string[]) => boolean` | Check if group is expanded |
 * | `getGroupState` | `() => GroupState` | Get current grouping state |
 *
 * ## CSS Custom Properties
 *
 * | Property | Default | Description |
 * |----------|---------|-------------|
 * | `--tbw-group-indent-width` | `1.25em` | Indentation per group level |
 * | `--tbw-grouping-rows-bg` | `var(--tbw-color-panel-bg)` | Group row background |
 * | `--tbw-grouping-rows-count-color` | `var(--tbw-color-fg-muted)` | Count badge color |
 * | `--tbw-animation-duration` | `200ms` | Expand/collapse animation |
 *
 * @example Single-Level Grouping by Department
 * ```ts
 * import '@toolbox-web/grid';
 * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';
 *
 * const grid = document.querySelector('tbw-grid');
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'name', header: 'Employee' },
 *     { field: 'department', header: 'Department' },
 *     { field: 'salary', header: 'Salary', type: 'currency' },
 *   ],
 *   plugins: [
 *     new GroupingRowsPlugin({
 *       groupOn: (row) => [row.department],
 *       showRowCount: true,
 *       defaultExpanded: false,
 *     }),
 *   ],
 * };
 * ```
 *
 * @example Multi-Level Grouping
 * ```ts
 * new GroupingRowsPlugin({
 *   groupOn: (row) => [row.region, row.department, row.team],
 *   indentWidth: 24,
 *   animation: 'slide',
 * })
 * ```
 *
 * @see {@link GroupingRowsConfig} for all configuration options
 * @see {@link GroupState} for the group state structure
 *
 * @internal Extends BaseGridPlugin
 */
export declare class GroupingRowsPlugin extends BaseGridPlugin<GroupingRowsConfig> {
    /**
     * Plugin manifest - declares configuration validation rules.
     * @internal
     */
    static readonly manifest: PluginManifest<GroupingRowsConfig>;
    /** @internal */
    readonly name = "groupingRows";
    /** @internal */
    readonly styles: string;
    /** @internal */
    protected get defaultConfig(): Partial<GroupingRowsConfig>;
    private expandedKeys;
    private flattenedRows;
    private isActive;
    private previousVisibleKeys;
    private keysToAnimate;
    /** Track if initial defaultExpanded has been applied */
    private hasAppliedDefaultExpanded;
    /**
     * Get expand/collapse animation style from plugin config.
     * Uses base class isAnimationEnabled to respect grid-level settings.
     */
    private get animationStyle();
    /** @internal */
    detach(): void;
    /**
     * Auto-detect grouping configuration from grid config.
     * Called by plugin system to determine if plugin should activate.
     */
    static detect(rows: readonly any[], config: any): boolean;
    /** @internal */
    processRows(rows: readonly any[]): any[];
    /** @internal */
    onCellClick(event: CellClickEvent): boolean | void;
    /** @internal */
    onKeyDown(event: KeyboardEvent): boolean | void;
    /**
     * Render a row. Returns true if we handled the row (group row), false otherwise.
     * @internal
     */
    renderRow(row: any, rowEl: HTMLElement, _rowIndex: number): boolean;
    /** @internal */
    afterRender(): void;
    /**
     * Create a toggle button for expanding/collapsing a group.
     */
    private createToggleButton;
    /**
     * Get the formatted label text for a group.
     */
    private getGroupLabelText;
    private renderFullWidthGroupRow;
    private renderPerColumnGroupRow;
    /**
     * Expand all groups.
     */
    expandAll(): void;
    /**
     * Collapse all groups.
     */
    collapseAll(): void;
    /**
     * Toggle expansion of a specific group.
     * In accordion mode, expanding a group will collapse all sibling groups.
     * @param key - The group key to toggle
     */
    toggle(key: string): void;
    /**
     * Check if a specific group is expanded.
     * @param key - The group key to check
     * @returns Whether the group is expanded
     */
    isExpanded(key: string): boolean;
    /**
     * Expand a specific group.
     * @param key - The group key to expand
     */
    expand(key: string): void;
    /**
     * Collapse a specific group.
     * @param key - The group key to collapse
     */
    collapse(key: string): void;
    /**
     * Get the current group state.
     * @returns Group state information
     */
    getGroupState(): GroupState;
    /**
     * Get the total count of visible rows (including group headers).
     * @returns Number of visible rows
     */
    getRowCount(): number;
    /**
     * Refresh the grouped row model.
     * Call this after modifying groupOn or other config options.
     */
    refreshGroups(): void;
    /**
     * Get current expanded group keys.
     * @returns Array of expanded group keys
     */
    getExpandedGroups(): string[];
    /**
     * Get the flattened row model.
     * @returns Array of render rows (groups + data rows)
     */
    getFlattenedRows(): RenderRow[];
    /**
     * Check if grouping is currently active.
     * @returns Whether grouping is active
     */
    isGroupingActive(): boolean;
    /**
     * Set the groupOn function dynamically.
     * @param fn - The groupOn function or undefined to disable
     */
    setGroupOn(fn: ((row: any) => any[] | any | null | false) | undefined): void;
}
//# sourceMappingURL=GroupingRowsPlugin.d.ts.map