import { BaseGridPlugin, CellClickEvent, GridElement, RowClickEvent } from '../../core/plugin/base-plugin';
import { ColumnConfig } from '../../core/types';
import { MasterDetailConfig } from './types';
/**
 * Master-Detail Plugin for tbw-grid
 *
 * Creates expandable detail rows that reveal additional content beneath each master row.
 * Perfect for order/line-item UIs, employee/department views, or any scenario where
 * you need to show related data without navigating away.
 *
 * ## Installation
 *
 * ```ts
 * import { MasterDetailPlugin } from '@toolbox-web/grid/plugins/master-detail';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `detailRenderer` | `(row) => HTMLElement \| string` | required | Render function for detail content |
 * | `expandOnRowClick` | `boolean` | `false` | Expand when clicking the row |
 * | `detailHeight` | `number \| 'auto'` | `'auto'` | Fixed height or auto-size |
 * | `collapseOnClickOutside` | `boolean` | `false` | Collapse when clicking outside |
 * | `showExpandColumn` | `boolean` | `true` | Show expand/collapse column |
 * | `animation` | `false \| 'slide' \| 'fade'` | `'slide'` | Animation style |
 *
 * ## Programmatic API
 *
 * | Method | Signature | Description |
 * |--------|-----------|-------------|
 * | `expandRow` | `(rowIndex) => void` | Expand a specific row |
 * | `collapseRow` | `(rowIndex) => void` | Collapse a specific row |
 * | `toggleRow` | `(rowIndex) => void` | Toggle row expansion |
 * | `expandAll` | `() => void` | Expand all rows |
 * | `collapseAll` | `() => void` | Collapse all rows |
 * | `isRowExpanded` | `(rowIndex) => boolean` | Check if row is expanded |
 *
 * ## CSS Custom Properties
 *
 * | Property | Default | Description |
 * |----------|---------|-------------|
 * | `--tbw-master-detail-bg` | `var(--tbw-color-row-alt)` | Detail row background |
 * | `--tbw-master-detail-border` | `var(--tbw-color-border)` | Detail row border |
 * | `--tbw-detail-padding` | `1em` | Detail content padding |
 * | `--tbw-animation-duration` | `200ms` | Expand/collapse animation |
 *
 * @example Basic Master-Detail with HTML Template
 * ```ts
 * import '@toolbox-web/grid';
 * import { MasterDetailPlugin } from '@toolbox-web/grid/plugins/master-detail';
 *
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'orderId', header: 'Order ID' },
 *     { field: 'customer', header: 'Customer' },
 *     { field: 'total', header: 'Total', type: 'currency' },
 *   ],
 *   plugins: [
 *     new MasterDetailPlugin({
 *       detailRenderer: (row) => `
 *         <div class="order-details">
 *           <h4>Order Items</h4>
 *           <ul>${row.items.map(i => `<li>${i.name} - $${i.price}</li>`).join('')}</ul>
 *         </div>
 *       `,
 *     }),
 *   ],
 * };
 * ```
 *
 * @example Nested Grid in Detail
 * ```ts
 * new MasterDetailPlugin({
 *   detailRenderer: (row) => {
 *     const childGrid = document.createElement('tbw-grid');
 *     childGrid.style.height = '200px';
 *     childGrid.gridConfig = { columns: [...] };
 *     childGrid.rows = row.items || [];
 *     return childGrid;
 *   },
 * })
 * ```
 *
 * @see {@link MasterDetailConfig} for all configuration options
 * @see {@link DetailExpandDetail} for expand/collapse event details
 *
 * @internal Extends BaseGridPlugin
 */
export declare class MasterDetailPlugin extends BaseGridPlugin<MasterDetailConfig> {
    #private;
    /** @internal */
    readonly name = "masterDetail";
    /** @internal */
    readonly styles: string;
    /** @internal */
    protected get defaultConfig(): Partial<MasterDetailConfig>;
    /**
     * Called when plugin is attached to the grid.
     * Parses light DOM for `<tbw-grid-detail>` elements to configure detail templates.
     * @internal
     */
    attach(grid: GridElement): void;
    /**
     * Parse `<tbw-grid-detail>` elements from the grid's light DOM.
     *
     * Allows declarative configuration:
     * ```html
     * <tbw-grid [rows]="data">
     *   <tbw-grid-detail>
     *     <div class="detail-content">
     *       <p>Name: {{ row.name }}</p>
     *       <p>Email: {{ row.email }}</p>
     *     </div>
     *   </tbw-grid-detail>
     * </tbw-grid>
     * ```
     *
     * Attributes:
     * - `animation`: 'slide' | 'fade' | 'false' (default: 'slide')
     * - `show-expand-column`: 'true' | 'false' (default: 'true')
     * - `expand-on-row-click`: 'true' | 'false' (default: 'false')
     * - `collapse-on-click-outside`: 'true' | 'false' (default: 'false')
     * - `height`: number (pixels) or 'auto' (default: 'auto')
     */
    private parseLightDomDetail;
    /**
     * Get expand/collapse animation style from plugin config.
     * Uses base class isAnimationEnabled to respect grid-level settings.
     */
    private get animationStyle();
    /**
     * Apply expand animation to a detail element.
     */
    private animateExpand;
    /**
     * Apply collapse animation to a detail element and remove after animation.
     */
    private animateCollapse;
    private expandedRows;
    private detailElements;
    /** Default height for detail rows when not configured */
    private static readonly DEFAULT_DETAIL_HEIGHT;
    /**
     * Get the estimated height for a detail row.
     */
    private getDetailHeight;
    /**
     * Toggle a row's detail and emit event.
     */
    private toggleAndEmit;
    /** @internal */
    detach(): void;
    /** @internal */
    processColumns(columns: readonly ColumnConfig[]): ColumnConfig[];
    /** @internal */
    onRowClick(event: RowClickEvent): boolean | void;
    /** @internal */
    onCellClick(event: CellClickEvent): boolean | void;
    /** @internal */
    onKeyDown(event: KeyboardEvent): boolean | void;
    /** @internal */
    afterRender(): void;
    /**
     * Called on scroll to sync detail elements with visible rows.
     * Removes details for rows that scrolled out of view and reattaches for visible rows.
     * @internal
     */
    onScrollRender(): void;
    /**
     * Return total extra height from all expanded detail rows.
     * Used by grid virtualization to adjust scrollbar height.
     */
    getExtraHeight(): number;
    /**
     * Return extra height that appears before a given row index.
     * This is the sum of heights of all expanded details whose parent row is before the given index.
     */
    getExtraHeightBefore(beforeRowIndex: number): number;
    /**
     * Adjust the virtualization start index to keep expanded row visible while its detail is visible.
     * This ensures the detail scrolls smoothly out of view instead of disappearing abruptly.
     */
    adjustVirtualStart(start: number, scrollTop: number, rowHeight: number): number;
    /**
     * Expand the detail row at the given index.
     * @param rowIndex - Index of the row to expand
     */
    expand(rowIndex: number): void;
    /**
     * Collapse the detail row at the given index.
     * @param rowIndex - Index of the row to collapse
     */
    collapse(rowIndex: number): void;
    /**
     * Toggle the detail row at the given index.
     * @param rowIndex - Index of the row to toggle
     */
    toggle(rowIndex: number): void;
    /**
     * Check if the detail row at the given index is expanded.
     * @param rowIndex - Index of the row to check
     * @returns Whether the detail row is expanded
     */
    isExpanded(rowIndex: number): boolean;
    /**
     * Expand all detail rows.
     */
    expandAll(): void;
    /**
     * Collapse all detail rows.
     */
    collapseAll(): void;
    /**
     * Get the indices of all expanded rows.
     * @returns Array of row indices that are expanded
     */
    getExpandedRows(): number[];
    /**
     * Get the detail element for a specific row.
     * @param rowIndex - Index of the row
     * @returns The detail HTMLElement or undefined
     */
    getDetailElement(rowIndex: number): HTMLElement | undefined;
    /**
     * Re-parse light DOM to refresh the detail renderer.
     * Call this after framework templates are registered (e.g., Angular ngAfterContentInit).
     *
     * This allows frameworks to register templates asynchronously and then
     * update the plugin's detailRenderer.
     */
    refreshDetailRenderer(): void;
}
//# sourceMappingURL=MasterDetailPlugin.d.ts.map