import React from 'react'; import { TextOverflow, TableHeaderVisibility, TableAlignment, CellRenderers, SparklineType, ColumnAlignment } from '@splunk/visualization-schemas'; import { FieldEntry } from '@splunk/visualizations-shared/dataSourceUtils'; interface TextOverFlowStyles { maxWidth?: string; overflow?: React.CSSProperties['overflow']; overflowWrap?: React.CSSProperties['overflowWrap']; textOverflow?: React.CSSProperties['textOverflow']; whiteSpace?: React.CSSProperties['whiteSpace']; wordBreak?: React.CSSProperties['wordBreak']; wordWrap?: React.CSSProperties['wordWrap']; } interface TableHeaderCell { key: string; value: string; align: TableAlignment; columnId: string; sortKey: string; truncate?: boolean; width?: number; style?: TextOverFlowStyles; textOverflowType?: string; showCell: boolean; } export interface TableHeaderStyle extends TextOverFlowStyles { backgroundColor?: string; color?: string; } export interface TableFooterStyle extends TableHeaderStyle { dividerColor?: string; } export interface TableHeader { visibility: TableHeaderVisibility; cells: TableHeaderCell[]; style: TableHeaderStyle; } export interface TableFooter { rows: TableRow[]; } export type TableCellValueType = string | number | (string | number)[]; interface TableRowStyles extends TextOverFlowStyles { backgroundColor?: string; color?: string; width?: number | 'auto'; } export type SparklineNullValueDisplay = 'gaps' | 'zero' | 'connect'; export interface TableRowCell { key: string; value: TableCellValueType; rawValue: TableCellValueType; align: TableAlignment; cellType: CellRenderers; columnIndex: number; rowIndex: number; sparklineAreaColor?: string; sparklineColor?: string; sparklineType: SparklineType; sparklineNullValueDisplay: SparklineNullValueDisplay; header: string; style: TableRowStyles; showCell: boolean; } interface TableRow { key: string; index: number; cells: TableRowCell[]; } export interface TableBody { rows: TableRow[]; } export interface TableStructure { tableHeader: TableHeader; tableBody: TableBody; tableFooter?: TableFooter; } export interface TableFormat { align: TableAlignment[][] | TableAlignment; cellTypes: CellRenderers[][]; data: TableCellValueType[][]; headerAlign: TableAlignment; headerBackgroundColor: string; headerColor: string; rowBackgroundColors: string[] | string[][]; rowColors: string[] | string[][]; sparklineAreaColors: string[][]; sparklineColors: string[][]; sparklineTypes: SparklineType[][]; sparklineNullValueDisplay?: SparklineNullValueDisplay; textOverflow?: TextOverflow; } interface ColumnFormatter { align: ColumnAlignment[] | ColumnAlignment; cellTypes: CellRenderers[]; data: TableCellValueType[]; headerAlign: ColumnAlignment; rowBackgroundColors: string[]; rowColors: string[]; sparklineAreaColors: string[]; sparklineColors: string[]; sparklineTypes: SparklineType[]; sparklineNullValueDisplay?: SparklineNullValueDisplay; width: number | 'auto'; textOverflow: TextOverflow; footer: string[]; } export interface ColumnFormat { [k: string]: Partial; } export type ThemeFunc = (themeVar: string) => string | undefined; export interface UseTableArgs { headers?: string[]; headersMetadata?: FieldEntry[]; columnIds?: string[]; table?: TableCellValueType[][]; headerVisibility?: TableHeaderVisibility; showRowNumbers?: boolean; showInternalFields?: boolean; showFooterTotals?: boolean; showFooterPercentages?: boolean; tableFormat?: Partial; columnFormat?: Partial; paginationOffset?: number; count?: number; themeFunc?: ThemeFunc; } interface GetOverflowStylesArgs { textOverflow: TextOverflow; } export declare const getOverflowStyles: ({ textOverflow }: GetOverflowStylesArgs) => TextOverFlowStyles; export declare const getTextOverflowType: (columnFormat: Partial, columnId: string, tableFormat?: Partial, currentColumn?: string, defaultValue?: TextOverflow | undefined) => string | undefined; export declare const useTable: (tableArgs?: UseTableArgs) => TableStructure; export {}; //# sourceMappingURL=hooks.d.ts.map