import { EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, TemplateRef } from '@angular/core';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { ErrorService } from '../../core/error.service';
import { RowCountPipe } from '../../shared/display/pipes/row-count.pipe';
import { Overlay } from '../view-overlay/view-overlay.component';
import { ResizableColumnComponent } from './resizable-column.component';
import { PagingInfo } from './table-pagination.component';
import { TableSelectableRowContext } from './table-selectable-row.component';
import { TableSort } from './table.component';
import * as i0 from "@angular/core";
export type TableSearchResults = {
    items: unknown[];
    totalItems: number;
    totalItemsBeforePaging?: number;
};
export type SearchableTableRefreshOptions = {
    clearSearch?: boolean;
};
export declare class SearchableTableComponent implements OnInit, OnDestroy, OnChanges {
    private errorService;
    private translateService;
    private rowCountPipe;
    id: string;
    resizable: boolean;
    sortable: boolean;
    sort?: TableSort | TableSort[];
    autofocus: boolean;
    /**Set to a space-separated set of strings that should be added to the ec-table class attribute
     * this allows finer control over styling.
     */
    tableClasses: string;
    /** Emits when table sort has changed */
    sortChange: EventEmitter<TableSort | TableSort[]>;
    /** Emits when the table page has changed */
    pageChangeEmitter: EventEmitter<PagingInfo>;
    /** Placeholder text for the searchbox */
    searchboxPlaceholder: string;
    /**
     * FormGroup for the searchbox
     *
     * The referenced FormGroup **must** contain a FormControl called 'searchModel'.
     */
    formModel: UntypedFormGroup;
    /**
     * Displayed in overlay when no data is returned (without searching).
     *
     * Defaults to "SearchableTable_Default_NoData_SC"
     */
    noDataMessage: string;
    /**
     * Displayed in overlay when no data is returned (after searching).
     * Ensure translation has an interpolation placeholder for "searchText".
     *
     * Defaults to "SearchableTable_Default_NoMatches_SC"
     *
     * @example
     * // 7 requires single curly braces
     * No items found matching <strong>{{searchText}}</strong>
     */
    noSearchResultsMessage: string;
    /**
     * Indicates hosting page is ready for the table to load data.
     *
     * Next and Complete this observable after hosting page has made any preliminary
     * API (or other asynchronous) calls to load prerequisite data upon which the code
     * in the `getItems` function depends.  Use a `ReplaySubject` to ensure every component
     * that uses this observable gets the Next and Complete notifications.
     */
    ready: Observable<void>;
    /**
     * Function called to get items to display in the table.
     * If pageable is true, the TableSearchResults need to include totalItemsBeforePaging, which is the
     * count of items before you've applied any pagination (i.e. the total number of items that came back from the search).
     *
     * Make sure to bind the scope in the template
     * @example
     * [getItems]="yourFunction.bind(this)"
     */
    getItems: (search?: string, pageChangeInfo?: PagingInfo) => Observable<TableSearchResults>;
    /** Observable that will force the getItems function to get called again */
    refresh?: Observable<SearchableTableRefreshOptions | void>;
    /** Allow the host component to supply an overlay to control the pending state of the table */
    status: Overlay;
    /**
     * Sets the underlying table's layout to fixed.
     */
    tableLayoutFixed: boolean;
    /** Emits items returned by the getItems function, along with total count */
    itemsChange: EventEmitter<TableSearchResults>;
    /** Optional tab index for the searchbox */
    searchboxTabIndex?: number;
    /** Maximum number of items to show in the table (default: 100) */
    maxItemCount: number;
    /** Set to true to hide search box (does not hide the other searchable table controls */
    hideSearchControl: boolean;
    /** Set to true to hide the entire header */
    hideHeader: boolean;
    /** Type of object in the table. Displayed in footer (default: 'results')*/
    objectType: string;
    /** Set to true to hide the table footer */
    hideFooter: boolean;
    /**
     * Set to true to enable paging. If paging is enabled, pageSize must be provided.
     * getItems will be passed both a search and a PagingInfo object when called. It must include totalItemsBeforePaging in the TableSearchResults output.
     * Here is a simple implementation:
     * @example
     * getItems(search?: string, pageChangeInfo?: PagingInfo): Observable<TableSearchResults> {
        let results: SimpleItem[] = [...this.paginatedTableItems];
        //apply search
        if(search) {
          results = this.paginatedTableItems.filter(i => i.a.toLowerCase().includes(search.toLowerCase()));
        }
        //get count before applying paging
        let countBeforePaging = results.length;
        //apply paging
        if(pageChangeInfo) {
          results = results.slice(pageChangeInfo!.skip, pageChangeInfo!.skip + pageChangeInfo!.pageSize);
        }
        return of({ items: results, totalItems: results.length, totalItemsBeforePaging: countBeforePaging });
      }
    */
    pageable: boolean;
    /**
     * Max size of a page.
     */
    pageSize?: number;
    /**
   * Maximum number of page tabs to show
   */
    maxTabs?: number;
    /**
     * Makes the searchbox readonly if true.
     */
    searchboxReadonly: boolean;
    /** Passed to the inner TableComponent to enable row selection */
    selectionContext?: TableSelectableRowContext;
    /** Passed to the inner TableComponent to display a toolbar when 1 or more rows are selected. Requires `[selectionContext]` to be defined. */
    selectionToolbarTemplate?: TemplateRef<any>;
    resizableColumns: QueryList<ResizableColumnComponent>;
    /** Optional text to add to the results count in the table footer. This text will be added after the count and objectType. */
    additionalCountText: string;
    /** Enables table row selection and row highlighting styles when true */
    selectable: boolean;
    /**Defaults to undefined. Specify your own template if an ec-table wrapped around your transcluded content won't meet your needs
     */
    customContentTemplate?: TemplateRef<any>;
    /** When true, removes the card styles from the table wrapper */
    removeCard: boolean;
    /** Classes to add to the overlay/card element */
    overlayClasses: string;
    /** When true the overlay and table will not have flex-shrink-max but instead flex-grow */
    fillParentHeight?: boolean;
    /** Passed to the pagination control component. Used to disable the pagination controls */
    disablePaginationControls?: boolean;
    /**
     * PagingInfo for the current page.
     */
    pageInfo?: PagingInfo;
    /** Reference to the searchModel */
    get searchModel(): UntypedFormControl;
    /**
     * Text displayed in the footer.
     * Sometimes `noDataMessage`, sometimes `noSearchResultsMessage`
     */
    tableCaption: string;
    /** count of results displayed in the table */
    resultsCount: string;
    /** Items returned by the getItems function, along with total count */
    searchResults: TableSearchResults;
    /**
     * If passed an input for refresh, triggers reloading items.
     * Otherwise, completes immediately (will never trigger reload).
     */
    private refreshTrigger;
    private destroyed;
    private pageChanged;
    /** Triggers the initial load of the table */
    private initTable;
    constructor(errorService: ErrorService, translateService: TranslateService, rowCountPipe: RowCountPipe);
    ngOnChanges(changes: SimpleChanges): void;
    ngOnInit(): void;
    ngOnDestroy(): void;
    /** Pass along sort to parent component */
    onSortChange(sort: TableSort | TableSort[]): void;
    /**
     * When a page changes, store the new pagingInfo and emit the current value of the form to trigger getData.
     */
    onPageChange(pagingInfo: PagingInfo): void;
    /**
     * Wire up a handler to the `refresh` observable so that when
     * the host page context changes it can force the table to update as well.
     *
     * If the `refresh` observable passes options and the `clearSearch` property
     * is set to true, reset the searchModel and pass an empty string.
     *
     * If `refresh` observable does not pass options or the `clearSearch` property
     * is set to false, pass along the current searchModel Value.
     */
    private setUpRefreshTrigger;
    /** Get text to display in the footer. */
    private getCaption;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchableTableComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchableTableComponent, "ec-searchable-table", never, { "id": { "alias": "id"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "tableClasses": { "alias": "tableClasses"; "required": false; }; "searchboxPlaceholder": { "alias": "searchboxPlaceholder"; "required": false; }; "formModel": { "alias": "formModel"; "required": false; }; "noDataMessage": { "alias": "noDataMessage"; "required": false; }; "noSearchResultsMessage": { "alias": "noSearchResultsMessage"; "required": false; }; "ready": { "alias": "ready"; "required": false; }; "getItems": { "alias": "getItems"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "status": { "alias": "status"; "required": false; }; "tableLayoutFixed": { "alias": "tableLayoutFixed"; "required": false; }; "searchboxTabIndex": { "alias": "searchboxTabIndex"; "required": false; }; "maxItemCount": { "alias": "maxItemCount"; "required": false; }; "hideSearchControl": { "alias": "hideSearchControl"; "required": false; }; "hideHeader": { "alias": "hideHeader"; "required": false; }; "objectType": { "alias": "objectType"; "required": false; }; "hideFooter": { "alias": "hideFooter"; "required": false; }; "pageable": { "alias": "pageable"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "maxTabs": { "alias": "maxTabs"; "required": false; }; "searchboxReadonly": { "alias": "searchboxReadonly"; "required": false; }; "selectionContext": { "alias": "selectionContext"; "required": false; }; "selectionToolbarTemplate": { "alias": "selectionToolbarTemplate"; "required": false; }; "additionalCountText": { "alias": "additionalCountText"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "customContentTemplate": { "alias": "customContentTemplate"; "required": false; }; "removeCard": { "alias": "removeCard"; "required": false; }; "overlayClasses": { "alias": "overlayClasses"; "required": false; }; "fillParentHeight": { "alias": "fillParentHeight"; "required": false; }; "disablePaginationControls": { "alias": "disablePaginationControls"; "required": false; }; }, { "sortChange": "sortChange"; "pageChangeEmitter": "pageChange"; "itemsChange": "itemsChange"; }, ["resizableColumns"], [".searchable-table-controls", ".card-header", "*", ".searchable-table-footer"], false, never>;
}
