import { CollectionState, FiltersMap, SortOrder, WixPatternsContainer } from '@wix/bex-core'; import { ToolbarCollectionState, ToolbarCollectionStateParamsInitParams } from './ToolbarCollectionState'; import { TableVirtualState } from './TableVirtualState'; import { DragAndDropState } from '../components/DragAndDrop'; import { ICollectionComponentState } from './ICollectionComponentState'; import { LoadingRowState } from '../components/LoadingRow/LoadingRowState'; export interface TableStateParams { readonly collection: CollectionState; readonly container: WixPatternsContainer; readonly toolbar?: ToolbarCollectionState; } interface TableDragAndDropStateBase { getStickyColumnsCount: (params: { stickyColumns: number; }) => number; init: () => void; dnd: DragAndDropState; } export interface TableStateInitParams extends ToolbarCollectionStateParamsInitParams { hasMultiLevelSorting?: boolean; } export interface TableStatePublicAPI { /** * Underlying [CollectionState](./?path=/story/common-state--collectionstate) instance * @external */ readonly collection: CollectionState; /** * Underlying [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate) instance * @external */ readonly toolbar: ToolbarCollectionState; /** * Reset active filters & sorting and adds new items to the collection. * @external * @param items - new items to add to the collection */ onAddItemActionComplete(items: T[]): void; /** * Visible columns as selected via [CustomColumns](./?path=/story/features-display--customcolumns) * @external */ readonly visibleColumns: { id: string; }[]; /** * Sorts the collection by a specified column and optional sort direction. * @external */ sort: (columnId: string, params: { forceDirection?: SortOrder; }) => void; } export declare class TableState implements ICollectionComponentState, TableStatePublicAPI { readonly toolbar: ToolbarCollectionState; readonly virtual: TableVirtualState, T, F>; readonly loadingRowState: LoadingRowState; tableDragAndDropState: TableDragAndDropStateBase | null; /** The sticky table header element (column headers row) */ headerElement: HTMLElement | null; constructor(params: TableStateParams); get visibleColumns(): import("..").Column[]; get table(): ToolbarCollectionState; get collection(): CollectionState; get tableState(): this; get itemsContentWidth(): number; get itemsToRenderCount(): number; init(params: TableStateInitParams): () => void; get keyedItems(): import("@wix/bex-core").KeyedItem[]; getStickyColumnsCount(params: { stickyColumns?: number; horizontalScroll?: boolean; showSelection?: boolean; stickySelectionColumn?: boolean; }): number | undefined; get showEmptyState(): boolean; get hasAvailableItems(): boolean; get resultOriginQuerySearch(): string | undefined; get hasNonPersistentActiveFilters(): boolean; get showErrorState(): boolean; get errorStatus(): import("@wix/bex-core").QueryResultStatusError, F> | undefined; get showLoadingState(): boolean; get initTask(): import("@wix/bex-core").TaskState; retryErrorState: () => void; onAddItemActionComplete: (items: T[]) => Promise; sort: (columnId: string, { forceDirection }?: { forceDirection?: SortOrder | undefined; }) => void; } export {}; //# sourceMappingURL=TableState.d.ts.map