UNPKG

@deephaven/js-plugin-ag-grid

Version:
44 lines 2 kB
import type { dh as DhType } from '@deephaven/jsapi-types'; import type { ColDef, SideBarDef } from 'ag-grid-community'; import type { dh as CorePlusDhType } from '@deephaven-enterprise/jsapi-coreplus-types'; import { AgGridTableType } from '../types'; export type SingleRowData = { [columnKey: string]: unknown; }; export type AgGridViewportRowData = { [rowIndex: number]: SingleRowData; }; export declare const TREE_NODE_KEY = "__dhTreeNodeKey__"; export type TreeNode = { hasChildren: boolean; isExpanded: boolean; depth: number; index: number; }; export declare function isPivotTable(table: AgGridTableType): table is CorePlusDhType.coreplus.pivot.PivotTable; export declare function isTable(table: AgGridTableType): table is DhType.Table; export declare function isTreeTable(table: AgGridTableType): table is DhType.TreeTable; /** * Returns whether the given data type is groupable using Deephaven. * @param dataType The data type to check * @returns True if the data type is groupable, false otherwise */ export declare function isRowGroupable(dataType: string): boolean; /** * Get the cell style function for a specific data type. * @param dataType Data type of the column * @returns A function to style the cell based on its data type */ export declare function getCellStyleFunction(dataType: string): ColDef['cellStyle']; /** * Converts a Deephaven column to an AG Grid ColDef with appropriate properties. * * @param column Deephaven column to map * @param templateColDef Template ColDef to use as a base * @returns The equivalent AG Grid ColDef */ export declare function convertColumnToColDef(column: DhType.Column, templateColDef?: Partial<ColDef>): ColDef; export declare function getColumnDefs(table: AgGridTableType): ColDef[]; export declare function getSideBar(table: AgGridTableType): SideBarDef; export declare function extractViewportRow(row: DhType.Row, columns: DhType.Column[]): SingleRowData; //# sourceMappingURL=AgGridTableUtils.d.ts.map