"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useFocusRequest = exports.FocusRequest = void 0;
const useKeypress_1 = require("./useKeypress");
var FocusRequest;
(function (FocusRequest) {
    FocusRequest["BEFORE"] = "before";
    FocusRequest["AFTER"] = "after";
})(FocusRequest || (exports.FocusRequest = FocusRequest = {}));
const useFocusRequest = function ({ active }, handler, deps) {
    (0, useKeypress_1.useKeypress)({ active }, (ch, key) => {
        if (key.name === `tab`) {
            if (key.shift) {
                handler(FocusRequest.BEFORE);
            }
            else {
                handler(FocusRequest.AFTER);
            }
        }
    }, deps);
};
exports.useFocusRequest = useFocusRequest;
