import { IRenderer, IRow, IRowManager, ScrollToRowPosition } from '../../../../../types/src/table';
import { default as CoreFeature } from './CoreFeature';
import { default as RowComponent } from './row/RowComponent';
import { default as Tabulator } from './Tabulator';
import { AddRowPos, RenderMode, RowLookup, RowRangeLookup } from './types';

interface DataPipelineHandler {
    handler: (rows: IRow[]) => IRow[];
    priority: number;
}
interface DisplayPipelineHandler {
    handler: (rows: IRow[], renderInPosition?: boolean) => IRow[];
    priority: number;
}
interface RedrawBlockRestoreConfig {
    handler?: any;
    index: number;
    renderInPosition?: boolean;
    skipStage?: boolean;
    stage: string;
}
export default class RowManager extends CoreFeature implements IRowManager {
    element: HTMLElement;
    wrapperElement: HTMLElement;
    tableElement: HTMLElement;
    heightFixer: HTMLElement;
    placeholder: HTMLElement | null;
    placeholderContents: HTMLElement | null;
    firstRender: boolean;
    renderMode?: RenderMode;
    /**
     * True when table has an explicit height (--table-height is set to a non-auto value (e.g. 100%, 500px));
     * false when height is variable (--table-height is "auto" or unset).
     * Computed on each read so it stays correct if --table-height is changed dynamically (e.g. via JS or CSS class).
     */
    get fixedHeight(): boolean;
    rows: IRow[];
    activeRowsPipeline: IRow[][];
    activeRows: IRow[];
    activeRowsCount: number;
    displayRows: IRow[][];
    displayRowsCount: number;
    scrollTop: number;
    scrollLeft: number;
    redrawBlock: boolean;
    redrawBlockRestoreConfig: RedrawBlockRestoreConfig | false;
    redrawBlockRenderInPosition: boolean;
    dataPipeline: DataPipelineHandler[];
    displayPipeline: DisplayPipelineHandler[];
    scrollbarWidth: number;
    renderer: IRenderer | null;
    redrawing?: boolean;
    table: Tabulator;
    rowIndexMap: Map<any, IRow>;
    constructor(table: Tabulator);
    createWrapperElement(): HTMLElement;
    createHolderElement(): HTMLElement;
    createTableElement(): HTMLElement;
    initializePlaceholder(): void;
    getElement(): HTMLElement;
    getTableElement(): HTMLElement;
    initialize(): void;
    /**
     * IRow Manipulation
     */
    findRow(subject: RowLookup): IRow | false;
    /**
     * Recursively search for a row by its HTML element, including nested children.
     */
    private findRowByElement;
    /**
     * Recursively search for a row by its index value, including nested children.
     * Used as fallback when map lookup fails.
     */
    private findRowByIndexRecursive;
    getRowFromDataObject(data: any): IRow | false;
    getRowFromPosition(position: number): IRow | undefined;
    /**
     * Register a row in the index map for O(1) lookup.
     * Also recursively registers any child rows.
     */
    registerRowInMap(row: IRow): void;
    /**
     * Unregister a row from the index map.
     * Also recursively unregisters any child rows.
     */
    unregisterRowFromMap(row: IRow): void;
    scrollToRow(row: IRow, position?: ScrollToRowPosition, ifVisible?: boolean): Promise<unknown> | undefined;
    /**
     * Data Handling
     */
    setData(data: any[], renderInPosition?: boolean, columnsChanged?: boolean): Promise<void>;
    _setDataActual(data: any[], renderInPosition?: boolean): void;
    _wipeElements(): void;
    destroy(): void;
    deleteRow(row: IRow, blockRedraw?: boolean): void;
    addRow(data: any | IRow, isTop?: boolean, index?: any, blockRedraw?: boolean): IRow;
    addRows(data: any[], pos?: AddRowPos, index?: undefined, refreshDisplayOnly?: boolean): Promise<Array<RowComponent | IRow>>;
    findAddRowPos(pos?: AddRowPos): boolean;
    addRowActual(data: any | IRow, pos: boolean, index?: any, blockRedraw?: boolean): IRow;
    moveRow(from: IRow, to: IRow, after?: boolean): void;
    moveRowActual(from: IRow, to: IRow, after?: boolean): void;
    moveRowInArray(rows: IRow[], from: IRow, to: IRow, after?: boolean): void;
    clearData(): void;
    getRowIndex(row: IRow): number | false;
    getDisplayRowIndex(row: IRow): number | false;
    nextDisplayRow(row: IRow, rowOnly?: boolean): IRow | false;
    prevDisplayRow(row: IRow, rowOnly?: boolean): IRow | false;
    findRowIndex(row: IRow, list: IRow[]): number | false;
    getData(active?: RowRangeLookup, transform?: string): any[];
    getComponents(active?: RowRangeLookup): RowComponent[];
    getDataCount(active?: RowRangeLookup): number;
    scrollHorizontal(left: number): void;
    registerDataPipelineHandler(handler: (rows: IRow[]) => IRow[], priority: number): void;
    registerDisplayPipelineHandler(handler: (rows: IRow[], renderInPosition?: boolean) => IRow[], priority: number): void;
    refreshActiveData(handler?: ((rows: IRow[]) => IRow[]) | string | false, skipStage?: boolean, renderInPosition?: boolean): void;
    refreshPipelines(handler: any, stage: string, index: number, renderInPosition?: boolean): void;
    regenerateRowPositions(): void;
    setActiveRows(activeRows: IRow[]): void;
    resetDisplayRows(): void;
    setDisplayRows(displayRows: IRow[], index: number): void;
    getDisplayRows(index?: number): IRow[];
    getVisibleRows(chain: boolean, viewable?: boolean): IRow[];
    displayRowIterator(callback: (rows: IRow[]) => void): void;
    getRows(type?: RowRangeLookup): IRow[];
    reRenderInPosition(callback?: () => void): void;
    scrollBarCheck(): void;
    initializeRenderer(): void;
    getRenderMode(): RenderMode | undefined;
    renderTable(): void;
    renderEmptyScroll(): void;
    _clearTable(): void;
    tableEmpty(): void;
    checkPlaceholder(): void;
    hasVisibleColumns(): boolean;
    shouldShowPlaceholder(): boolean;
    syncColumnVisibilityState(): void;
    _showPlaceholder(): void;
    /**
     * While the table is not yet initialized, still show placeholder element so that
     * table's height is not 0 (header-only), but hide the placeholder text
     */
    syncPlaceholderInitializationState(): void;
    _clearPlaceholder(): void;
    _positionPlaceholder(): void;
    styleRow(row: IRow, index: number): void;
    normalizeHeight(force?: boolean): void;
    /**
     * Detect whether the table has a fixed (explicit) height.
     * We read the CSS custom property --table-height (used by the table's height: var(--table-height)), since
     * getComputedStyle(el).height is always the resolved pixel value, never "auto".
     * fixedHeight = true: --table-height is set to a non-auto value (e.g. 100%, 500px). Not content-driven.
     * fixedHeight = false: --table-height is "auto" or unset — content-driven (variable) height.
     */
    private detectFixedHeight;
    adjustTableSize(): boolean;
    reinitialize(): void;
    blockRedraw(): void;
    restoreRedraw(): void;
    redraw(force?: boolean): void;
    resetScroll(): void;
}
export {};
