/// <reference types="lodash" />
import { ActionMove, ActionMoveBase, ComputedQueryFull, FiltersMap, KeyedItem, QueryState, ReportBI, ToastConfig, WixPatternsContainer } from '@wix/bex-core';
import { CollectionDragEndEvent, DragAndDropBulkSubmit, DragAndDropSubmit } from './DragAndDrop';
import { HTMLAttributes, MutableRefObject } from 'react';
import { Announcements } from '@wix/wix-style-react-incubator/drag-and-drop';
import { ClientRect, DragStartEvent } from '@wix/wix-style-react-incubator/dnd-kit/core';
import { TypedEmitter } from '@wix/bex-core/events';
import { RectState } from '../../state/RectState';
import { ReorderModeState } from './ReorderModeState';
export interface DragAndDropParentState<T, F extends FiltersMap> {
    readonly reportBi: ReportBI;
    readonly dragAndDropCategories?: (keyof F)[][] | null | undefined;
    forceRenderIndexes: undefined | number[];
    readonly containerRect?: ClientRect;
    readonly _dnd?: DragAndDropState<T, F> | null;
}
export interface DragAndDropCollection<F extends FiltersMap> {
    getKeyedItem: (key: string) => KeyedItem<any> | undefined | null;
    getKeyedItemByIndex: (ind: number) => KeyedItem<any> | null;
    keyedItems: KeyedItem<any>[];
    originQuery: ComputedQueryFull<F>;
    query: QueryState<F>;
    total: number;
}
interface DragAndDropBaseBI<T> {
    onDragStart: () => ((params: {
        endType?: 'clicked ESC' | 'drop outside' | null;
    }) => void) | undefined;
    onMoveCancelled: (move: ActionMoveBase<T>) => void;
    onAttemptDragStart: (itemId: string) => () => void;
}
export interface DragAndDropStateParams<T, F extends FiltersMap> extends DragAndDropBaseStateParams<T, F> {
    move: (ev: {
        over: DragItemOver | null;
    }) => void;
    announcements?: Partial<Announcements>;
    bi?: DragAndDropBaseBI<T>;
}
export interface DragAndDropBaseStateParams<T, F extends FiltersMap> {
    container: WixPatternsContainer;
    collection: DragAndDropCollection<F>;
    state: DragAndDropParentState<T, F>;
}
interface DragItemActive {
    id: string | number;
    rect?: MutableRefObject<{
        initial: ClientRect | null;
        translated: ClientRect | null;
    }>;
}
export interface DragItemOver {
    id: string | number;
    rect?: ClientRect;
    disabled?: boolean;
}
export declare class DragAndDropState<T, F extends FiltersMap> {
    readonly state: DragAndDropParentState<T, F>;
    readonly container: WixPatternsContainer;
    readonly collection: DragAndDropCollection<F>;
    readonly events: TypedEmitter<{
        dropAnimationEnd: () => unknown;
        dragStart: () => unknown;
    }>;
    status: 'start' | 'over' | 'end' | 'cancel' | null | undefined;
    activeId: string | null | undefined;
    overlayRect: RectState;
    _moveDelta: {
        x: number;
    };
    overId: string | null | undefined;
    droppingId: string | null | undefined;
    droppedId: string | null | undefined;
    _dropAnimationId: string | null | undefined;
    scheduleDropEnd: import("lodash").DebouncedFunc<() => void>;
    scheduleIdle: import("lodash").DebouncedFunc<() => void>;
    move: (ev: {
        over: DragItemOver | null;
    }) => void;
    onSubmit?: DragAndDropSubmit<T, F>;
    onBulkSubmit?: DragAndDropBulkSubmit<T, F>;
    onCancel?: () => Promise<boolean | null>;
    reorderModeState?: ReorderModeState<T, F> | null;
    readonly bi: DragAndDropBaseBI<T> | undefined;
    _isHandleActive: boolean;
    _isKeyboardDragging: boolean;
    _moveId: string;
    _onDragEndBi?: ((params: {
        endType?: 'clicked ESC' | 'drop outside' | null;
    }) => void) | null;
    _endType: 'clicked ESC' | 'drop outside' | null;
    private readonly _baseAnimation;
    readonly sortableAnimation: {
        duration: number;
        easing: string;
    };
    readonly dropAnimation: {
        duration: number;
        easing: string;
        sideEffects: () => () => void;
    };
    readonly activationConstraint: {
        distance: number;
    };
    readonly keyboardCodes: {
        start: string[];
        cancel: string[];
        end: string[];
        move: string[];
    };
    readonly nullAnnouncements: Announcements;
    readonly handleEvents: Partial<HTMLAttributes<Element>>;
    readonly containerEvents: Partial<HTMLAttributes<Element>>;
    constructor(params: DragAndDropStateParams<T, F>);
    onDropAnimationEnd: () => void;
    get active(): KeyedItem<any> | null | undefined;
    get over(): KeyedItem<any> | null | undefined;
    get isDropping(): boolean;
    get activeIndex(): number | undefined;
    get isActive(): boolean;
    _onGlobalKeydown: (e: KeyboardEvent) => void;
    onDragMove(event: {
        active: {
            id: DragStartEvent['active']['id'];
            rect?: DragStartEvent['active']['rect'];
        };
        delta: {
            x: number;
        };
    }): void;
    onDragStart(event: {
        active: {
            id: DragStartEvent['active']['id'];
            rect?: DragStartEvent['active']['rect'];
        };
    }): void;
    attachDisabledDragAttempt: (itemId: string, downEvent: MouseEvent, axis: 'x' | 'y' | 'all') => void;
    get isActiveRectOutsideContainer(): boolean;
    _maybeShowErrorToast: (shouldCancel: Omit<ToastConfig, 'type' | 'biName'> | true, dragEndEvent: ActionMoveBase<T>) => void;
    beforeDrop(event: {
        active: DragItemActive | null;
        over: DragItemOver | null;
    }): Promise<boolean>;
    _createDragEndEvent(): {
        moveId: string;
        from: KeyedItem<any>;
        over: KeyedItem<any>;
        after: KeyedItem<any> | null;
        query: ComputedQueryFull<F>;
        filtersKeyHash: string;
        isFromHandle: boolean;
    } | null;
    _createSimpleDragEndEvent(event: ActionMove<T>): CollectionDragEndEvent<T, F>;
    onDragCancel(): void;
    onDragOver(event: {
        over: DragItemOver | null;
    }): void;
    onDragEnd(event: {
        over: DragItemOver | null;
    }): void;
    get isDisabled(): boolean;
    init(): () => void;
    focusDragHandleIfDropped(id: string | number, element: HTMLElement | null | undefined): void;
    get reportBi(): ReportBI;
}
export {};
//# sourceMappingURL=DragAndDropState.d.ts.map