hightable
Version:
A dynamic windowed scrolling table component for react
27 lines (26 loc) • 1.04 kB
TypeScript
export declare function cellStyle(width: number | undefined): {
minWidth: string | undefined;
maxWidth: string | undefined;
};
export declare function getOffsetWidth(element: Pick<HTMLElement, 'offsetWidth'>): number;
export declare function getClientWidth(element: Pick<HTMLElement, 'clientWidth'>): number;
export declare function isValidWidth(width: unknown): width is number;
export interface ColumnWidth {
measured?: number;
width?: number;
}
export interface FixedColumnWidth {
measured?: undefined;
width: number;
}
export type MaybeColumnWidth = ColumnWidth | undefined;
export declare function hasFixedWidth(columnWidth: MaybeColumnWidth): columnWidth is FixedColumnWidth;
/**
* Adjusts the widths of the measured columns to fill the available width.
*/
export declare function adjustMeasuredWidths({ columnWidths, availableWidth, clamp, numColumns, }: {
columnWidths: MaybeColumnWidth[];
availableWidth?: number;
clamp: (width: number) => number;
numColumns: number;
}): MaybeColumnWidth[];