"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeFocusListener = makeFocusListener;
exports.listenFocus = listenFocus;
function makeFocusListener(listener) {
    return (component) => {
        return listenFocus(component, listener);
    };
}
function listenFocus(component, listener) {
    const { $element } = component;
    const focusListener = (_event) => {
        const { relatedTarget } = _event;
        listener({ relatedTarget }, _event);
    };
    $element.addEventListener('focus', focusListener);
    return () => {
        $element.removeEventListener('focus', focusListener);
    };
}
//# sourceMappingURL=focus.js.map