import type { ColumnConfiguration, GridExpansionConfiguration } from 'apex-grid'; /** Per-master-row context handed to the detail callbacks. */ export interface MasterDetailContext { /** The master row's data. */ readonly data: T; /** The view-relative index of the master row. */ readonly rowIndex: number; } /** * Declarative master/detail configuration. Each expanded master row renders a * nested grid of related rows — the manager creates, caches, and (optionally * async-) populates that child grid for you, instead of hand-writing a * `detailTemplate`. */ export interface MasterDetailConfig> { /** Child-grid columns — static, or derived per master row. */ columns: ColumnConfiguration[] | ((row: T) => ColumnConfiguration[]); /** Resolve the detail rows for a master row (sync array or a Promise). */ getDetailData: (row: T) => C[] | Promise; /** * Which element the detail grid uses. `'apex-grid'` (community, default) keeps * detail grids light + watermark-free; `'apex-grid-enterprise'` gives the * detail its own enterprise features. */ detailTag?: 'apex-grid' | 'apex-grid-enterprise'; /** Detail-grid block size (number = px). Defaults to `220`. */ detailHeight?: number | string; /** Gate which master rows can expand. Expandable by default. */ isExpandable?: (row: T) => boolean; /** Hook to set extra properties on the freshly-created detail grid. */ configureDetail?: (grid: HTMLElement, context: MasterDetailContext) => void; } /** * Builds and caches the per-row detail grids for a {@link MasterDetailConfig}, * and exposes a `detailTemplate` ready to drop into the grid's expansion config. * * The child grid is created once per master row (keyed by row identity) and * reused across re-renders, so its own state and scroll position survive a * collapse/expand. Async `getDetailData` resolves into the cached grid and * requests a host update. */ export declare class MasterDetailManager { #private; private config; private requestUpdate; constructor(config: MasterDetailConfig, requestUpdate: () => void); /** The expansion configuration to assign to the grid. */ buildExpansion(): GridExpansionConfiguration; /** Drop the cached detail grid for a row (e.g. to force a data refresh). */ invalidate(row: T): void; }