import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
import type { TableTypes } from './table-interface';
/**
 * Enables the search, filter and sort of tabular data.
 *
 * @version 3.0.0
 * @status stable
 *
 * @slot caption - The table's caption. You must either use this or the `caption` attribute.
 * @slot no-results - text to display when search or filtering yields no results
 */
export declare class NanoDataTable implements ComponentInterface {
    constructor();
    /** Function called whenever `col.cellTemplate` renders an unknown object.
     * The function should render a valid HTMLElement to the cell arg.
     * Example usage - render JSX from a 3rd party lib and append the result to the cell element. */
    customRenderer: (node: any, cell: HTMLElement | DocumentFragment) => void | Promise<string>;
    /** If true, will render any nested table in a scrollable container (using `overflow: auto`) */
    scrollable: boolean;
    /** A descriptive title of the table.
     * You must use this or the `slot="caption"` for accessibility */
    caption: string;
    /** Show the caption on-screen */
    showCaption: boolean;
    /** Will show a loading state when set to true.
     * By default, will be shown automatically if `rows` is a promise waiting to resolve / or falsy
     * *or* when performing custom filtering or sorting.
     * *Note* when set manually, will overwrite any internal loading state.
     * Set to 'undefined' to revert to default behaviour. */
    loading: boolean;
    get _loading(): boolean;
    set _loading(l: boolean);
    private debounceSetLoading;
    internalLoading: boolean;
    /** When loading rows asynchronously render this number of placeholder rows */
    placeholderSize: number;
    /** The data to place in the table */
    rows: TableTypes.NanoTable['rows'] | Promise<TableTypes.NanoTable['rows']>;
    handleRowsChange(): void;
    /** The column config used to present the rows of data */
    columns: TableTypes.NanoTable<any>['columns'];
    handleColsChange(): Promise<void>;
    /** Used for custom thead row rendering */
    headRender: TableTypes.HeadFootRenderer;
    /** Used for custom row rendering */
    rowRender: TableTypes.RowRenderer;
    /** Used for custom tfoot row rendering */
    footRender: TableTypes.HeadFootRenderer;
    /** Whether to show a `<tfoot>` component */
    showFooter: boolean;
    /** To improve performance, data is split into blocks
     * which are shown / hidden and rendered as they become visible.
     * Use this to control the number of hits within a block -
     * A block should fill a scrolling viewport.
     * The less perBlock the better for performance */
    perBlock: number;
    /** The number of total blocks currently rendered in the table. @readonly */
    get blocksLength(): number;
    /** Term to search for in the data */
    searchTerm: string;
    /** A custom filtering function. Should return a promise.
     * If the promise resolves as `true` the column UI will be updated.
     * If the promise resolves as falsy, the sort will be performed by the component.
     * A good use-case would be performing the filter on a server / via fetch.
     * Then on success, updating the table's data via the `rows` property */
    customFilterFn?: (filters: TableTypes.Filter[]) => Promise<true | TableTypes.Falsy>;
    /** A custom sorting function. Should return a promise.
     * If the promise resolves as `true` the column UI will be updated.
     * If the promise resolves as falsey, the sort will be performed by the component.
     * A good use-case would be performing the sort on a server / via fetch.
     * Then on success, updating the table's data via the `rows` property */
    customSortFn?: (property: TableTypes.Prop, order: TableTypes.Order) => Promise<true | TableTypes.Falsy>;
    /**
     * The default sortable option for all columns.
     * `true` will enable column sorting unless you set `sortable: false` on a column
     * `false` will disable column sorting unless you set `sortable: true` on a column
     */
    defaultSort: boolean;
    handleSearchTermChange(): void;
    /** If true, will show a spinner at the bottom of the table when loading */
    showPaginateSpinner: boolean;
    /** Use this to render the table with roughly the correct dimensions.
     * a use-case might be; fetch a small initial dataset to minimise load-time,
     * render the table with the correct dimensions, the table becomes interactive,
     * load the rest of the data
     */
    virtualTotalItems: number;
    virtualTotalItemsChangeHandler(): void;
    /** @readonly - shows the currently applied filters */
    get appliedFilters(): TableTypes.Filter[];
    /** Fired when the table has done it's first complete render */
    nanoTblReady: EventEmitter;
    /** Fired whenever a block is activated by scrolling into view / becoming visible
     * This could be leveraged for infinite scrolling / to fetch more data.
     */
    nanoTblBlockRendered: EventEmitter<{
        block: number;
        totalBlocks: number;
    }>;
    /** Fired before a column is sorted.
     * `event.preventDefault()` to stop sorting.  */
    nanoTblBeforeSort: EventEmitter<{
        column: TableTypes.Prop;
        order: TableTypes.Order;
    }>;
    /** Fired after a column is sorted */
    nanoTblAfterSort: EventEmitter<{
        column: TableTypes.Prop;
        order: TableTypes.Order;
    }>;
    /** Fired before a column is filtered.
     * `event.preventDefault()` to stop filtering. */
    nanoTblBeforeFilter: EventEmitter<{
        filters: TableTypes.Filter[];
    }>;
    /** Fired after a column is sorted */
    nanoTblAfterFilter: EventEmitter<{
        filters: TableTypes.Filter[];
    }>;
    /** Fired before a general search.
     * `event.preventDefault()` to stop searching.  */
    nanoTblBeforeSearch: EventEmitter<{
        term: string;
    }>;
    /** Fired after a general / cross column search */
    nanoTblAfterSearch: EventEmitter<{
        term: string;
    }>;
    /** Fired before a general search.
     * `event.preventDefault()` to stop searching.  */
    nanoTblBeforeEdit: EventEmitter<{
        term: string;
    }>;
    /** Remove any column sorts currently applied
     * @returns a promise which resolves when complete */
    resetSorting(): Promise<void>;
    /** Apply a sort on a column
     * @returns a promise which resolves when complete */
    addSort(column: TableTypes.Prop, order: TableTypes.Order): Promise<void>;
    /** Remove any column filters currently applied
     * @returns a promise which resolves when complete */
    resetFilters(): Promise<void>;
    /** Apply a filter on a column
     * @param filters - the filters to apply
     * @param additive - if true, will add the filters to any currently applied
     * @returns a promise which resolves when complete
     */
    addFilters(filters: TableTypes.Filter[], additive?: boolean): Promise<void>;
    /** Remove filters from a column
     * @param columnNames - the filters to apply
     * @returns a promise which resolves when complete
     */
    removeFilters(columnNames: TableTypes.Prop[]): Promise<void>;
    /** Updates a row model at a given index
     * @param row - the row to update.
     * @param rowIndex - the row index to insert this row
     */
    updateRow(row: TableTypes.RowData, rowIndex: number): Promise<void>;
    host: HTMLNanoDataTableElement;
    private renderId;
    private store;
    private filters;
    private currentFilters;
    private currentSort;
    private tableEle;
    private topAnchorEle;
    private activeWatcherIo;
    private tablePinnedService;
    private customFilterApplied;
    /** `tr` elements split into units - defined by `perBlock`
      These are show / hidden for perf */
    blocks: TableTypes.TBody[];
    activeBlocks: number[];
    private measureHeight;
    private blockElements;
    private blockHeights;
    private set measureEle(value);
    private unitHeight;
    private get scrollParent();
    private set scrollParent(value);
    private _scrollParent;
    private get primaryBlockIndex();
    private set primaryBlockIndex(value);
    private _primaryBlockIndex;
    private get isReady();
    private set isReady(value);
    private _isReady;
    private handleReady;
    /**
     * Start a sort - can be cancelled by `preventDefault`
     * @param order - column order
     * @param column - column config object
     * @returns A promise
     */
    private sortStart;
    /**
     * Complete a sort. Reflects the order to ui.
     * @param order - column order
     * @param column - column config object
     */
    private sortComplete;
    private searchStart;
    private filterStart;
    private filterComplete;
    /** Scrolls to the top immediately - used whilst sorting / filtering */
    private scrollToTop;
    private setMeasureElement;
    /**
     * Makes sure we have dimensions on at least one, active tbody element.
     * We'll use this is a yard stick for inactive tbody elements in future.
     * These elements have no natural height (on account of all their rows being hidden)
     */
    private setInitialBlockDimension;
    /** Apply initial columns settings */
    private columnInit;
    /** Split up all incoming rows into 'blocks' split amongst tbody elements.
     * These can then be hidden / shown to improve performance.
     */
    private setBlocks;
    /**
     * Returns a block render height.
     * If it's currently active - let auto do it's thing
     * If we've rendered it before - return that
     * If all else fails, let's guess it
     * @param blockIndex
     * @returns a height string (incl px)
     */
    private getBlockHeight;
    /** cache the height for all active blocks for later renders */
    private setBlockHeight;
    /**
     * On scroll, loop through all blocks' heights and cumulatively, add them together.
     * When we find that the scroll position is less than this cumulative block height -
     * stop loop - it's on the current active block.
     */
    private scrollHandler;
    /** Process slotted content */
    private processSlots;
    /** Adds an IO. Makes sure our scroll listener is only active when
     * the table is in viewport */
    private setupActiveWatcher;
    componentWillLoad(): Promise<void>;
    connectedCallback(): void;
    componentDidLoad(): void;
    componentShouldUpdate(_newVal: any, _oldVal: any, stateName: keyof NanoDataTable): boolean;
    componentWillRender(): void | Promise<void>;
    componentDidRender(): void;
    disconnectedCallback(): void;
    render(): any;
}
