import { OneDArray, TColumn, TwoDArray } from './types'; import Base from './base'; import { UserConfig } from './config'; import { Component, ComponentChild, RefObject } from 'preact'; declare class Header extends Base { private _columns; constructor(); get columns(): OneDArray; set columns(columns: OneDArray); get visibleColumns(): OneDArray; /** * Tries to automatically adjust the width of columns based on: * - Header cell content * - Cell content of the first row * - Cell content of the last row * * @param container * @param tableRef * @param tempRef * @param autoWidth */ adjustWidth( container: Element, tableRef: RefObject, tempRef: RefObject, autoWidth?: boolean, ): this; private setSort; private setFixedHeader; private setID; private populatePlugins; static fromColumns( columns: OneDArray, ): Header; static fromUserConfig(userConfig: UserConfig): Header | null; static fromHTMLTable(element: HTMLElement): Header; /** * Converts the tree-like format of Header to a tabular format * * Example: * * H1 * H1-H1 * H1-H2 * H2 * H2-H1 * * becomes: * [ * [H1, H2], * [H1-H1, H1-H2, H2-H1] * ] * * @param columns */ static tabularFormat(columns: OneDArray): TwoDArray; /** * Returns an array of leaf columns (last columns in the tree) * * @param columns */ static leafColumns(columns: OneDArray): OneDArray; /** * Returns the maximum depth of a column tree * @param column */ static maximumDepth(column: TColumn): number; } export default Header;