"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeDragEnterListener = makeDragEnterListener;
exports.listenDragEnter = listenDragEnter;
const pointer_1 = require("../pointer");
function makeDragEnterListener(listener, _global = false) {
    return (component) => {
        return listenDragEnter(component, listener, _global);
    };
}
function listenDragEnter(component, listener, _global = false) {
    const { $element } = component;
    const dragEnterListener = (_event) => {
        const { $context } = component;
        const event = {
            ...(0, pointer_1.applyContextTransformToPointerEvent)($context, _event),
            dataTransfer: null,
        };
        listener(event, _event);
    };
    $element.addEventListener('dragenter', dragEnterListener, _global);
    return () => {
        $element.removeEventListener('dragenter', dragEnterListener, _global);
    };
}
//# sourceMappingURL=dragenter.js.map