"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makePasteListener = makePasteListener;
exports.listenPaste = listenPaste;
function makePasteListener(listener) {
    return (component) => {
        return listenPaste(component, (value, _event) => {
            listener(value, _event);
        });
    };
}
function listenPaste(component, listener) {
    const { $element } = component;
    const _listener = (_event) => {
        const { clipboardData } = _event;
        const value = (clipboardData && clipboardData.getData('text/plain')) || '';
        listener(value, _event);
    };
    $element.addEventListener('paste', _listener);
    return () => {
        $element.removeEventListener('paste', _listener);
    };
}
//# sourceMappingURL=paste.js.map