import { CollectionOptimisticSequenceExecutor, FiltersMap, OptionalFiltersMap, QueryState, ReportBI, TaskState, WixPatternsContainer } from '@wix/bex-core';
import { ToolbarCollectionState } from '../ToolbarCollectionState';
import { TableState } from '../TableState';
import { NestedTableColumn } from './NestedTableColumn';
import { NestedTableNestedModeState } from './NestedTableNestedModeState';
import { NestedTableFlatModeState } from './NestedTableFlatModeState';
import { NestedTableLevelDescriptor } from './NestedTableLevelDescriptor';
import { EagerLazyModeOptions } from './types';
import { ICollectionComponentState } from '../ICollectionComponentState';
import { NestedTableNodeStatePublicAPI } from './NestedTableNodeStatePublicAPI';
export interface NestedTableStateBaseParams<C extends string, F extends FiltersMap = OptionalFiltersMap> {
    /**
     * If the total items in the server are less or equal to this threshold, all items will be fetched and rendered at once, in expanded state (referred to as "Eager" mode).
     * @default 1000
     */
    fetchAllLimit?: number;
    /**
     * @deprecated Use `fetchAllLimit` instead.
     */
    fetchAllThreshold?: number;
    /**
     * In "Eager" mode, items will be in expanded state. This threshold allows to use collapsed state if the total items in the server are greater than this threshold.
     * @default `fetchAllThreshold`
     */
    expandAllThreshold?: number;
    /**
     * Columns to be rendered in the nested table. Same as [TableColumn](./?path=/story/common-types--tablecolumn) - just without rendering logic of cells (`render` prop will be defined for each level individually in the `levels` prop).
     * @overrideType [TableColumn](./?path=/story/common-types--tablecolumn)[]
     */
    columns: NestedTableColumn<C>[];
    /**
     * Main column of the nested table.
     * An object with the following properties:
     *  - `title`: The title of the column. @default ''
     *  - `width`: The width of the column. Can be a number (in pixels) or a string (percentage). @default '326px'
     */
    mainColumn?: {
        title?: string;
        width?: number | string;
    };
    /**
     * Configuration of the nested table levels. Use one of the helper function to create the levels configuration:
     * - [createNestedTableLevel](./?path=/story/base-components-collections-nestedtable--createnestedtablelevel) - for cases where each level if of a different entity type.
     * - [createNestedTableSingleEntityLevels](./?path=/story/base-components-collections-nestedtable--createnestedtablesingleentitylevels) - for cases where all levels are of the same entity type.
     * @overrideType [NestedTableLevel](./?path=/story/base-components-collections-nestedtable--nestedtablelevel)[]
     */
    levels: Omit<NestedTableLevelDescriptor<C, any, any>, 'depth'>[];
    filters?: F;
}
export interface NestedTableStateParams<C extends string, F extends FiltersMap = OptionalFiltersMap> extends NestedTableStateBaseParams<C, F> {
    container: WixPatternsContainer;
}
export interface NestedTableStatePublicAPI<C extends string> {
    /**
     * Underlying [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate) instance
     * @overrideType [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate)
     */
    readonly toolbar: ToolbarCollectionState<unknown, {}>;
    /**
     * Underlying [TableState](./?path=/story/base-components-collections-table-tablestate--tablestate) instance
     * @overrideType [TableState](./?path=/story/base-components-collections-table-tablestate--tablestate)
     */
    readonly tableState: TableState<unknown, {}>;
    /**
     * Get the node this item is the parent of. i.e. this node's collection items' parent id is the `key`
     * @param key
     * @overrideType (key: string) => [NestedTableNodeState](./?path=/story/base-components-collections-nestedtable--nestedtablenodestate) | undefined
     */
    getNode<TD, FD extends FiltersMap>(key: string): NestedTableNodeStatePublicAPI<C, TD, FD> | undefined;
    /**
     * Get the root node of the nested table, this node's collection items' parent id is `null`, the items are the top level items
     */
    getRootNode<TD, FD extends FiltersMap>(): NestedTableNodeStatePublicAPI<C, TD, FD>;
    /**
     * Get all the nodes in the table
     */
    getAllNodes<TD, FD extends FiltersMap>(): NestedTableNodeStatePublicAPI<C, TD, FD>[];
    /**
     * An API to refresh all items in the nested table.
     */
    readonly refreshAll: () => void;
}
export declare class NestedTableState<C extends string = string, F extends FiltersMap = OptionalFiltersMap> implements ICollectionComponentState, NestedTableStatePublicAPI<C> {
    readonly container: WixPatternsContainer;
    readonly reportBi: ReportBI;
    readonly toolbar: ToolbarCollectionState<any, any>;
    readonly tableState: TableState<any, any>;
    readonly mainColumn: {
        title?: string | undefined;
        width?: string | number | undefined;
    } | undefined;
    readonly options: EagerLazyModeOptions;
    readonly initTask: TaskState<unknown>;
    readonly levels: NestedTableLevelDescriptor<C, any, any>[];
    readonly rootNodeCollection: {
        collection: import("@wix/bex-core").CollectionState<any, any>;
        parentFilter?: import("@wix/bex-core").Filter<string[]> | undefined;
    };
    readonly query: QueryState<{}>;
    readonly nested: NestedTableNestedModeState<C>;
    readonly flat: NestedTableFlatModeState<C>;
    readonly sequences: Map<string, CollectionOptimisticSequenceExecutor>;
    constructor(params: NestedTableStateParams<C, F>);
    get nestedMode(): NestedTableNestedModeState<C>;
    get flatMode(): NestedTableFlatModeState<C>;
    getNode<TD, FD extends FiltersMap>(key: string): NestedTableNodeStatePublicAPI<C, TD, FD> | undefined;
    getRootNode<TD, FD extends FiltersMap>(): NestedTableNodeStatePublicAPI<C, TD, FD>;
    /**
     * Get all the nodes in the table
     */
    getAllNodes<TD, FD extends FiltersMap>(): NestedTableNodeStatePublicAPI<C, TD, FD>[];
    get isFetchAllAborted(): boolean | null;
    get expandAll(): boolean;
    get nestedCollection(): import("./NestedCollectionState").NestedCollectionState;
    _attemptFetchAllAndPopulateCache(): {
        initTask: TaskState<unknown>;
        init: ({ invalidate }?: {
            invalidate: boolean;
        }) => () => void;
    };
    refreshAll({ invalidate }?: {
        invalidate?: boolean;
    }): void;
    get isFlatMode(): boolean;
    _addFilterListeners(): (() => void)[];
    init(): () => void;
}
//# sourceMappingURL=NestedTableState.d.ts.map