"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenDragDrop = exports.makeDragDropListener = void 0;
function makeDragDropListener(listener, _global = false) {
    return (component) => {
        return listenDragDrop(component, listener, _global);
    };
}
exports.makeDragDropListener = makeDragDropListener;
function listenDragDrop(component, listener, _global = false) {
    const { $element } = component;
    const dragOverListener = (_event) => {
        const { detail } = _event;
        listener(detail);
    };
    $element.addEventListener('_dragdrop', dragOverListener, _global);
    return () => {
        $element.removeEventListener('_dragdrop', dragOverListener, _global);
    };
}
exports.listenDragDrop = listenDragDrop;
//# sourceMappingURL=dragdrop.js.map