import type { ReactiveController } from 'lit'; import type { GridHost } from '../internal/types.js'; /** * The default expansion configuration used when the grid has none set. * * @remarks * `detailTemplate` defaults to `null` here — the controller will refuse to * toggle rows when the configuration is missing or no template is provided. */ export declare const DEFAULT_EXPANSION_CONFIG: Readonly<{ enabled: false; showToggleColumn: true; }>; /** * Reactive controller backing row expansion (master-detail). * * @remarks * Expansion state is reference-based — the controller holds a `Set` of row * data references so the expansion set survives sort / filter / pagination as * long as those operations preserve row identity (the default in-place * pipeline does). Replacing {@link ApexGrid.data} wholesale invalidates any * expanded rows that are no longer present; consumers should call * {@link collapseAll} or re-apply expansion afterwards. * * Mutations go through the cancellable `rowExpanding` event and emit a * follow-up `rowExpanded` event, mirroring the pattern used by selection * and editing. */ export declare class ExpansionController implements ReactiveController { #private; protected host: GridHost; /** Set of currently expanded row data references. */ expanded: Set; constructor(host: GridHost); hostConnected(): void; /** Whether expansion is enabled at the grid level. */ get enabled(): boolean; /** Whether the built-in chevron toggle column should be rendered. */ get showToggleColumn(): boolean; /** Whether `row` is currently expanded. */ isExpanded(row: T): boolean; /** * Whether `row` is permitted to expand. Combines the grid-wide `enabled` * flag, the presence of a `detailTemplate`, and the optional per-row * `isExpandable` predicate. */ canExpand(row: T): boolean; /** Snapshot of currently expanded rows in insertion order. */ expandedRows(): T[]; /** Toggles the expansion of `row`. */ toggleRow(row: T): Promise; /** Expands `row`. No-op when the row is already expanded or not expandable. */ expandRow(row: T): Promise; /** Collapses `row`. No-op when the row is not expanded. */ collapseRow(row: T): Promise; /** * Expands every expandable row in {@link ApexGrid.dataView}. Skips rows * the optional `isExpandable` predicate rejects. */ expandAll(): Promise; /** Collapses every currently expanded row. */ collapseAll(): Promise; /** * Replaces the expansion set with `rows`. Used by the public * {@link ApexGrid.expandedRows} setter for programmatic control. */ replaceExpansion(rows: ReadonlyArray): Promise; }