import { WixPatternsContainer, CollectionOptimisticActions, CollectionState, FiltersMap, ModalState, ReportBI, TaskState } from '@wix/bex-core';
import { TypedEmitter } from '@wix/bex-core/events';
import { ViewsService } from '../services';
import { AllItemsViewProps, BasicCategory, Category, PrivateView, View, ViewActionNameBI, ViewBase } from '../model';
import { AutoCompleteReadonlyState } from '../components/CollectionViewsDropdown/AutoCompleteReadonlyState';
import { ViewsLocalSearchState } from './ViewsLocalSearchState';
export interface ViewsStateParams<F extends FiltersMap> {
    oldNamespace: string;
    presets?: Category<F>[];
    container: WixPatternsContainer;
    fqdn: string;
    initialSelect?: true | ((item: View<F>, index: number) => boolean);
    allItemsViewProps?: AllItemsViewProps<F>;
    reportBI: ReportBI;
}
export declare class ViewsState<F extends FiltersMap> {
    currentView: PrivateView<F> | null;
    defaultViewId: string | null;
    _initialViewIdFromUrl?: string | null;
    readonly initialSelect?: true | ((item: View<F>, index: number) => boolean);
    readonly viewsService: ViewsService<F>;
    readonly collection: CollectionState<PrivateView<F>>;
    readonly optimisticActions: CollectionOptimisticActions<PrivateView<F>, FiltersMap>;
    readonly saveViewModal: ModalState;
    readonly renameViewModal: ModalState;
    readonly autoCompleteReadonlyState: AutoCompleteReadonlyState;
    readonly localSearchState: ViewsLocalSearchState<F>;
    readonly reportBI: ReportBI;
    readonly events: TypedEmitter<{
        selectAndRefresh: (needFiltersReset?: boolean) => unknown;
        beforeSelectView: () => unknown;
        afterSelectView: (params: {
            view: PrivateView<F>;
        }) => unknown;
        undoAction: (params: {
            actionName: ViewActionNameBI;
            viewId: string;
            newName?: string;
        }) => unknown;
        tryAgainAction: (params: {
            actionName: ViewActionNameBI;
        }) => unknown;
        errorAction: (params: {
            actionName: ViewActionNameBI;
            createdAt: number;
            viewId: string;
        }) => unknown;
    }>;
    readonly presets: Category<F>[];
    readonly allItemsViewProps: AllItemsViewProps<F>;
    readonly basicCategories: Record<string, BasicCategory>;
    readonly initTask: TaskState<unknown>;
    readonly container: WixPatternsContainer;
    _migrateOrdersViews?: (state: ViewsState<F>) => unknown;
    _fixMissingContactsViews?: (state: ViewsState<F>) => unknown;
    constructor(params: Readonly<ViewsStateParams<F>>);
    _getAllItemsAndPresetViews(): PrivateView<F>[];
    _getInitialSelectItem(items: PrivateView<F>[]): PrivateView<F> | undefined;
    _onActionUndo(id: string, actionName: ViewActionNameBI, newName?: string): void;
    _onTryAgain(actionName: ViewActionNameBI): void;
    _onError(actionName: ViewActionNameBI, createdAt: number, oldViewId?: string, viewId?: string): void;
    init(): () => void;
    getViews(): PrivateView<F>[];
    getView(viewId: string): PrivateView<F> | undefined;
    getDefaultPreset(): string | undefined;
    get isDefaultView(): boolean;
    saveViewChanges(viewBase: ViewBase<F>): Promise<PrivateView<F> | null>;
    createNewView(name: string, viewBase: ViewBase<F>): PrivateView<F>;
    saveView({ newView, hasUndo, isNew, oldViewId, }: {
        newView: PrivateView<F>;
        hasUndo?: boolean;
        isNew?: boolean;
        oldViewId?: string;
    }): Promise<PrivateView<F>>;
    deleteView(view: PrivateView<F>): Promise<void>;
    renameView(newView: PrivateView<F>, oldName: string): Promise<PrivateView<F>>;
    setAsDefaultView(newView: PrivateView<F>, isDefault: boolean): Promise<PrivateView<F>>;
    get isReady(): boolean;
    setDefaultViewId(defaultViewId: string | null): void;
    unselectView(): void;
    selectView({ id, needFiltersReset, }: {
        id: string;
        needFiltersReset?: boolean;
    }): void;
    get reachedViewsLimit(): boolean;
    get isCurrentViewSelected(): boolean;
    hasViewName(viewName: string): boolean;
}
//# sourceMappingURL=ViewsState.d.ts.map