import { Directionality } from "@angular/cdk/bidi";
import { CollectionViewer } from "@angular/cdk/collections";
import { AfterContentChecked, ChangeDetectorRef, ElementRef, IterableDiffers, OnDestroy, OnInit, QueryList, TrackByFunction, ComponentFactoryResolver, EventEmitter } from "@angular/core";
import { BehaviorSubject } from "rxjs";
import { DxcColumnDef } from "./directives/dxc-column-def.directive";
import { PaginationService } from "./services/pagination.service";
import { SortService } from "./services/sort.service";
import { HeaderOutlet } from "./directives/header-outlet.directive";
import { DataRowOutlet } from "./directives/data-row-outlet.directive";
import { Space } from "./types/table-space.type";
import { Size } from "./types/table-size.type";
import * as i0 from "@angular/core";
/**
 * A data table that can render a header row, data rows, and a footer row.
 * Uses the dataSource input to determine the data to be rendered. The data can be provided either
 * as a data array, an Observable stream that emits the data array to render, or a DataSource with a
 * connect function that will return an Observable stream that emits the data array to render.
 */
export declare class DxcResultTable<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {
    protected readonly _differs: IterableDiffers;
    protected readonly _changeDetectorRef: ChangeDetectorRef;
    protected readonly _elementRef: ElementRef;
    protected readonly _dir: Directionality;
    private resolver;
    private paginationService;
    private sortService;
    /**
     * Number of items per page.
     */
    itemsPerPage: number;
    /**
     * An array of objects with the values to display in the table.
     * The key is the column and the value is the property to be displayed in the cell.
     */
    get collectionResource(): Array<any>;
    set collectionResource(value: Array<any>);
    private _collectionResource;
    /**
     * Size of the margin to be applied to the component
     * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
     * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
     * order to specify different padding sizes.
     */
    margin: Space | Size;
    /**
     * An array of numbers representing the items per page options.
     */
    itemsPerPageOptions: number[];
    /**
     * Show page navigation select.
     */
    showGoToPage: boolean;
    /**
     * Value of the tabindex attribute given to the sortable icon.
     */
    get tabIndexValue(): number;
    set tabIndexValue(value: number);
    private _tabIndexValue;
    /**
     *  This event will emit in case of the user selects an item per page
     * option. The value selected will be passed as a parameter.
     */
    itemsPerPageFunction: EventEmitter<number>;
    collectionData: BehaviorSubject<Array<any>>;
    displayedColumns: string[];
    totalItems: Number;
    fetchStatus: any;
    page: number;
    className: any;
    /** List of ordering directives. */
    private _allOrderingRefs;
    private _document;
    /** Latest data provided by the data source. */
    protected _data: T[] | ReadonlyArray<T>;
    /** Subject that emits when the component has been destroyed. */
    private _onDestroy;
    /** List of the rendered rows as identified by their `RenderRow` object. */
    private _renderRows;
    /** Subscription that listens for the data provided by the data source. */
    private _renderChangeSubscription;
    /**
     * Map of all the user's defined columns (header, data, and footer cell template) identified by
     * name. Collection populated by the column definitions gathered by `ContentChildren` as well as
     * any custom column definitions added to `_customColumnDefs`.
     */
    private _columnDefsByName;
    /**
     * Set of all row definitions that can be used by this table. Populated by the rows gathered by
     * using `ContentChildren` as well as any custom row definitions added to `_customRowDefs`.
     */
    /** Differ used to find the changes in the data provided by the data source. */
    private _dataDiffer;
    /**
     * Column definitions that were defined outside of the direct content children of the table.
     * These will be defined when, e.g., creating a wrapper around the cdkTable that has
     * column definitions as *its* content child.
     */
    private _customColumnDefs;
    /**
     * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
     * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
     * the cached `RenderRow` objects when possible, the row identity is preserved when the data
     * and row template matches, which allows the `IterableDiffer` to check rows by reference
     * and understand which rows are added/moved/removed.
     *
     * Implemented as a map of maps where the first key is the `data: T` object and the second is the
     * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
     * contains an array of created pairs. The array is necessary to handle cases where the data
     * array contains multiple duplicate data objects and each instantiated `RenderRow` must be
     * stored.
     */
    private _cachedRenderRowsMap;
    /** Whether the table is applied to a native `<table>`. */
    private _isNativeHtmlTable;
    /**
     * Tracking function that will be used to check the differences in data changes. Used similarly
     * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
     * relative to the function to know if a row should be added/removed/moved.
     * Accepts a function that takes two parameters, `index` and `item`.
     */
    get trackBy(): TrackByFunction<T>;
    set trackBy(fn: TrackByFunction<T>);
    private _trackByFn;
    private dataSource;
    /**
     * Stream containing the latest information on what rows are being displayed on screen.
     * Can be used by the data source to as a heuristic of what data should be provided.
     *
     * @docs-private
     */
    readonly viewChange: BehaviorSubject<{
        start: number;
        end: number;
    }>;
    _headerOutlet: HeaderOutlet;
    _rowOutlet: DataRowOutlet;
    /**
     * The column definitions provided by the user that contain what the header, data, and footer
     * cells should render for each column.
     */
    _contentColumnDefs: QueryList<DxcColumnDef>;
    constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, role: string, _dir: Directionality, _document: any, resolver: ComponentFactoryResolver, paginationService: PaginationService, sortService: SortService);
    ngOnInit(): void;
    ngOnChanges(): void;
    ngAfterContentChecked(): void;
    ngOnDestroy(): void;
    handleItemsPerPageSelect($event: any): void;
    renderHeaders(): void;
    /**
     * Renders rows based on the table's latest set of data, which was either provided directly as an
     * input or retrieved through an Observable stream (directly or from a DataSource).
     * Checks for differences in the data since the last diff to perform only the necessary
     * changes (add/remove/move rows).
     *
     * If the table's data source is a DataSource or Observable, this will be invoked automatically
     * each time the provided Observable stream emits a new data array. Otherwise if your data is
     * an array, this function will need to be called to render any changes.
     */
    renderRows(): void;
    /**
     * Get the list of RenderRow objects to render according to the current list of data and defined
     * row definitions. If the previous list already contained a particular pair, it should be reused
     * so that the differ equates their references.
     */
    private _getAllRenderRows;
    /**
     * Gets a list of `RenderRow<T>` for the provided data object and any `DxcRowDef` objects that
     * should be rendered for this data. Reuses the cached RenderRow objects if they match the same
     * `(T, DxcRowDef)` pair.
     */
    private _getRenderRowsForData;
    /** Update the map containing the content's column definitions. */
    private _cacheColumnDefs;
    /** Set up a subscription for the data provided by the data source. */
    private _observeRenderChanges;
    /**
     * Create the embedded view for the data row template and place it in the correct index location
     * within the data row view container.
     */
    private _insertRow;
    /**
     * Creates a new row template in the outlet and fills it with the set of cell templates.
     * Optionally takes a context to provide to the row and cells, as well as an optional index
     * of where to place the new row template in the outlet.
     */
    private _renderRow;
    /**
     * Updates the index-related context for each row to reflect any changes in the index of the rows,
     * e.g. first/last/even/odd.
     */
    private _updateRowIndexContext;
    /** Gets the column definitions for the provided row def. */
    private _getCellTemplates;
    /** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
    private _applyNativeTableSections;
    /** Filters definitions that belong to this table from a QueryList. */
    private _getOwnDefs;
    /** Calculate pagination for the data displayed in the table after click event */
    navigate(page: number, operation?: string): void;
    /** Set to default others header's states if they are different to default state ("up" or "down"). */
    removeOtherSorts(actualIdHeader: any): void;
    ngAfterViewInit(): void;
    /** Set to default all headers that are sortable. */
    setDefaultStateHeaders(): void;
    /** Register all ordering directives references. */
    registerOrderingRef(ref: ElementRef): void;
    /** Sort row elements from given column depending on given state. */
    sortCells(columnName: any, state: any): void;
    /** Sort row elements by ascendant */
    ascSort(columnName: any, start: any, end: any): any[];
    /** Sort row elements by descendant */
    descSort(columnName: any, start: any, end: any): any[];
    /** Change icon to up icon */
    changeAscIcon(el: ElementRef): void;
    /** Change icon to down icon */
    changeDescIcon(el: ElementRef): void;
    /** Change icon to default icon */
    changeDefaultIcon(el: ElementRef): void;
    /** Return map with header's states */
    getMapStateHeaders(): Map<any, any>;
    setClassName(): void;
    /** Utility function that gets a merged list of the entries in an array and values of a Set. */
    mergeArrayAndSet<T>(array: T[], set: Set<T>): T[];
    static ɵfac: i0.ɵɵFactoryDeclaration<DxcResultTable<any>, [null, null, null, { attribute: "role"; }, { optional: true; }, null, null, null, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DxcResultTable<any>, "dxc-resultset-table, table[dxc-resultset-table]", ["dxcResultsetTable"], { "itemsPerPage": "itemsPerPage"; "collectionResource": "collectionResource"; "margin": "margin"; "itemsPerPageOptions": "itemsPerPageOptions"; "showGoToPage": "showGoToPage"; "tabIndexValue": "tabIndexValue"; "trackBy": "trackBy"; }, { "itemsPerPageFunction": "itemsPerPageFunction"; }, ["_contentColumnDefs"], never>;
}
//# sourceMappingURL=table.d.ts.map