import { CollectionState, CollectionStateParams, DataResultRaw, FiltersMap, OptionalFiltersMap, WixPatternsContainer, stringFilter, ComputedQuery } from '@wix/bex-core';
import { ICollectionComponentState } from '../ICollectionComponentState';
import { ToolbarCollectionState } from '../ToolbarCollectionState';
import { KanbanDragEndItemEvent } from './KanbanDragEndEvent';
import { KanbanStageState } from './KanbanStageState';
import { KanbanDragAndDropState } from '../../components/KanbanDragAndDropDndKit/KanbanCardDragAndDrop';
import { TypedEmitter } from '@wix/bex-core/events';
import { KanbanStateBIReporter } from './KanbanStateBIReporter';
export declare const KanbanComponentType = "TableKanbanSwitch";
export type stageType = 'DONE' | 'NONE';
export interface KanbanStateBaseParams<T, S, F extends FiltersMap = OptionalFiltersMap> {
    fqdn?: string;
    kanbanId: string;
    stages: {
        fetchData: CollectionStateParams<S, F>['fetchData'];
        stageKey: CollectionStateParams<S, F>['itemKey'];
        stageName: CollectionStateParams<S, F>['itemName'];
        stageType?(stage: S): stageType;
    };
    items: {
        fetchData: CollectionStateParams<T, F>['fetchData'];
        itemKey: CollectionStateParams<T, F>['itemKey'];
        itemName: CollectionStateParams<T, F>['itemName'];
        stageField: string;
        fetchAllByStageIds?: (params: {
            ids: string[];
            filters: ComputedQuery<F>['filters'];
            search?: ComputedQuery<F>['search'];
        }) => Promise<Record<string, DataResultRaw<T>>>;
        dragAndDrop?: {
            onSubmit?: (event: KanbanDragEndItemEvent<T, S>) => Promise<T>;
        };
        create?: {
            navigateToEntityPage: ({ stage }: {
                stage: S;
            }) => void;
            title: string;
        };
    };
}
export interface KanbanStateParams<T, S, F extends FiltersMap = OptionalFiltersMap> extends KanbanStateBaseParams<T, S, F> {
    readonly container: WixPatternsContainer;
}
export interface KanbanStateParamsAPI<T, F extends FiltersMap = OptionalFiltersMap> {
    readonly toolbar: ToolbarCollectionState<T, F>;
}
export declare class KanbanState<T, S, F extends FiltersMap = OptionalFiltersMap> implements ICollectionComponentState, KanbanStateParamsAPI<T, F> {
    readonly container: WixPatternsContainer;
    kanbanStageStates: Record<string, KanbanStageState<T, S, F & {
        stageId: ReturnType<typeof stringFilter>;
    }>>;
    private stageStateDisposers;
    readonly toolbar: ToolbarCollectionState<T, F>;
    readonly stagesCollectionState: CollectionState<S, F>;
    readonly toolbarQueryCollectionState: CollectionState<T, F>;
    readonly dragAndDropState: KanbanDragAndDropState<T, S, F & {
        stageId: ReturnType<typeof stringFilter>;
    }>;
    readonly debouncedStagesRefresh: () => unknown;
    readonly stageType: KanbanStateBaseParams<T, S, F>['stages']['stageType'];
    items: KanbanStateBaseParams<T, S, F>['items'];
    isRefetching: boolean;
    isChangingFiltersValue: boolean;
    private stagesOptimisticActions;
    readonly events: TypedEmitter<{
        scrollToStage: (params: {
            stageKey: string;
        }) => void;
        scrollToCardInStage: (params: {
            stageKey: string;
            cardKey: string;
        }) => void;
    }>;
    readonly kanbanStateBIReporter: KanbanStateBIReporter<T, S, F>;
    readonly kanbanId: string;
    private _searchResultsBiEventCallback;
    constructor(params: KanbanStateParams<T, S, F>);
    get query(): import("@wix/bex-core").QueryState<F>;
    get queryComputed(): import("@wix/bex-core").ComputedQueryFull<F>;
    triggerDebouncedStagesRefresh(): void;
    init(): Promise<() => void>;
    loadStages(): Promise<void>;
    initializeStageStates(): Promise<void>;
    get stages(): any[];
    getStageState(stage: S): KanbanStageState<T, S, F & {
        stageId: import("@wix/bex-core").StringFilterState;
    }>;
    getStageStateByKey(stageKey: string): KanbanStageState<T, S, F & {
        stageId: import("@wix/bex-core").StringFilterState;
    }>;
    get isLoading(): boolean;
    get isLoadingStages(): boolean;
    isInSearchMode(): boolean | "" | undefined;
    isInFilterMode(): boolean;
    getIsChangingFiltersValue(): boolean;
    stageKey(stage: S): string;
    get hasStagesError(): boolean;
    refetchKanban(): Promise<void>;
    showErrorToast(error: unknown): void;
    private createToolbarQueryCollectionState;
    private createStagesCollectionState;
    private fetchStagesData;
    private getStageIds;
    private processAllStages;
    private cleanupUnusedStageStates;
    private disposeStageState;
    private processCurrentStages;
    private createNewStageState;
    private updateExistingStageState;
    private getInitialPageData;
    private getStageIdFromItem;
    updateStage(originalStage: S, updatedStage: S): void;
    createStage(stage: S): void;
    scrollToStage({ stageKey }: {
        stageKey: string;
    }): void;
    scrollToCardInStage({ stageKey, cardKey, }: {
        stageKey: string;
        cardKey: string;
    }): void;
    deleteStage(stage: S): void;
    reorderStages(fromIndex: number, toIndex: number): void;
    moveItemBetweenStages(originalItem: T, updatedItem: T, fromStageId: string, toStageId: string): void;
    deleteCard(card: T): void;
    createCard(card: T): void;
    updateCard(card: T): void;
    getStageIndexByKey(stageKey: string): number;
    getStageNameByKey(stageKey: string): string;
    getStageById(stageKey: string): S | undefined;
}
//# sourceMappingURL=KanbanState.d.ts.map