import { type DragEvent, type DragEventHandler, type MutableRefObject, type PropsWithChildren } from "react";
import { type Key, type Optional } from "@synnaxlabs/x";
import { type state } from '../state';
export interface Item {
    key: Key;
    type: string;
    data?: unknown;
}
export interface DraggingState {
    source: Item;
    items: Item[];
}
export declare const ZERO_DRAGGING_STATE: DraggingState;
export interface ContextValue {
    state: DraggingState;
    start: (source: Item, items: Item[], onSuccessfulDrop?: (props: OnSuccessfulDropProps) => void) => void;
    end: () => void;
    drop: (target: Item, dropped: Item[]) => void;
}
export interface ProviderProps extends PropsWithChildren {
    useState?: state.PureUse<DraggingState>;
    onDropOutside?: (props: OnDropProps) => Item[];
}
export declare const useContext: () => ContextValue | null;
export declare const Provider: ({ children, useState, onDropOutside, }: ProviderProps) => JSX.Element;
export declare const useDraggingRef: () => MutableRefObject<DraggingState>;
export declare const useDraggingState: () => DraggingState;
export interface OnSuccessfulDropProps {
    target: Item;
    hauled: Item[];
    dropped: Item[];
}
export interface UseDragProps extends Optional<Item, "key"> {
}
export interface UseDragReturn {
    startDrag: (items: Item[], onSuccessfulDrop?: (props: OnSuccessfulDropProps) => void) => void;
    onDragEnd: () => void;
}
export declare const useDrag: ({ type, key }: UseDragProps) => UseDragReturn;
export type CanDrop = (state: DraggingState) => boolean;
export interface OnDropProps extends DraggingState {
    event: DragEvent;
}
export type OnDragOverProps = OnDropProps;
export interface UseDropProps extends Optional<Item, "key"> {
    canDrop: CanDrop;
    onDrop: (props: OnDropProps) => Item[];
    onDragOver?: (props: OnDragOverProps) => void;
}
export interface UseDropReturn {
    onDragOver: DragEventHandler;
    onDrop: DragEventHandler;
}
export declare const useDrop: ({ type, key, canDrop, onDrop, onDragOver, }: UseDropProps) => UseDropReturn;
export interface UseDragAndDropProps extends Omit<UseDragProps, "source">, Omit<UseDropProps, "target">, Optional<Item, "key"> {
}
export interface UseDragAndDropReturn extends UseDragReturn, UseDropReturn {
}
export declare const useDragAndDrop: ({ type, key, ...props }: UseDragAndDropProps) => UseDragAndDropReturn;
export declare const canDropOfType: (type: string) => CanDrop;
export declare const filterByType: (type: string, entities: Item[]) => Item[];
