/// 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 { readonly reportBi: ReportBI; readonly dragAndDropCategories?: (keyof F)[][] | null | undefined; forceRenderIndexes: undefined | number[]; readonly containerRect?: ClientRect; readonly _dnd?: DragAndDropState | null; } export interface DragAndDropCollection { getKeyedItem: (key: string) => KeyedItem | undefined | null; getKeyedItemByIndex: (ind: number) => KeyedItem | null; keyedItems: KeyedItem[]; originQuery: ComputedQueryFull; query: QueryState; total: number; } interface DragAndDropBaseBI { onDragStart: () => ((params: { endType?: 'clicked ESC' | 'drop outside' | null; }) => void) | undefined; onMoveCancelled: (move: ActionMoveBase) => void; onAttemptDragStart: (itemId: string) => () => void; } export interface DragAndDropStateParams extends DragAndDropBaseStateParams { move: (ev: { over: DragItemOver | null; }) => void; announcements?: Partial; bi?: DragAndDropBaseBI; } export interface DragAndDropBaseStateParams { container: WixPatternsContainer; collection: DragAndDropCollection; state: DragAndDropParentState; } 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 { readonly state: DragAndDropParentState; readonly container: WixPatternsContainer; readonly collection: DragAndDropCollection; 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; onBulkSubmit?: DragAndDropBulkSubmit; onCancel?: () => Promise; reorderModeState?: ReorderModeState | null; readonly bi: DragAndDropBaseBI | 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>; readonly containerEvents: Partial>; constructor(params: DragAndDropStateParams); onDropAnimationEnd: () => void; get active(): KeyedItem | null | undefined; get over(): KeyedItem | 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 | true, dragEndEvent: ActionMoveBase) => void; beforeDrop(event: { active: DragItemActive | null; over: DragItemOver | null; }): Promise; _createDragEndEvent(): { moveId: string; from: KeyedItem; over: KeyedItem; after: KeyedItem | null; query: ComputedQueryFull; filtersKeyHash: string; isFromHandle: boolean; } | null; _createSimpleDragEndEvent(event: ActionMove): CollectionDragEndEvent; 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