import type { GridApi } from '../api/gridApi'; import type { Bean } from '../context/bean'; import type { GridOptions } from '../entities/gridOptions'; import type { RowNode } from '../entities/rowNode'; import type { ICellRendererParams } from '../rendering/cellRenderers/iCellRenderer'; import type { RowCtrl } from '../rendering/row/rowCtrl'; import type { RefreshModelParams } from './iClientSideRowModel'; import type { FindDetailGridCellRendererParams } from './iFind'; import type { IRowNode } from './iRowNode'; export interface IDetailCellRenderer { toggleCss(cssClassName: string, on: boolean): void; toggleDetailGridCss(cssClassName: string, on: boolean): void; setDetailGrid(gridOptions: GridOptions): void; setRowData(rowData: TData[]): void; getGui(): HTMLElement; } export interface IDetailCellRendererParams extends ICellRendererParams, FindDetailGridCellRendererParams { /** * Provide Grid Options to use for the Detail Grid. */ detailGridOptions: GridOptions; /** A function that provides what rows to display in the Detail Grid. */ getDetailRowData: GetDetailRowData; /** Defines how to refresh the Detail Grids as data is changing in the Master Grid. */ refreshStrategy: 'rows' | 'everything' | 'nothing'; /** Allows changing the template used around the Detail Grid. */ template: string | TemplateFunc; /** @deprecated v32.2 This property is no longer used */ agGridReact: any; /** @deprecated v32.2 This property is no longer used */ frameworkComponentWrapper: any; pinned: 'left' | 'right' | null | undefined; } export type GetDetailRowData = (params: GetDetailRowDataParams) => void; export interface GetDetailRowDataParams { /** Row node for the details request. */ node: IRowNode; /** Data for the current row. */ data: TData; /** Success callback: pass the rows back for the grid request. */ successCallback(rowData: TDetail[]): void; } type TemplateFunc = (params: ICellRendererParams) => string; export interface IDetailCellRendererCtrl extends Bean { init(comp: IDetailCellRenderer, params: IDetailCellRendererParams): void; registerDetailWithMaster(api: GridApi): void; refresh(): boolean; } export interface IMasterDetailService { store: { [id: string]: DetailGridInfo | undefined; }; setupDetailRowAutoHeight(rowCtrl: RowCtrl, eDetailGui: HTMLElement): void; setMaster(row: RowNode, created: boolean, updated: boolean): void; /** Used by flatten stage to get or create a detail node from a master node */ getDetail(masterNode: RowNode): RowNode | null; refreshModel(params: RefreshModelParams): void; } export interface DetailGridInfo { /** * Id of the detail grid, the format is `detail_{ROW-ID}`, * where `ROW-ID` is the `id` of the parent row. */ id: string; /** Grid api of the detail grid. */ api?: GridApi; } export {};