import { AnimationType } from "../render/utils/types.js";
import { useDomEvent } from "../events/use-dom-event.js";
function useFocusGesture(_a) {
  var whileFocus = _a.whileFocus, visualElement = _a.visualElement;
  var onFocus = function() {
    var _a2;
    (_a2 = visualElement.animationState) === null || _a2 === void 0 ? void 0 : _a2.setActive(AnimationType.Focus, true);
  };
  var onBlur = function() {
    var _a2;
    (_a2 = visualElement.animationState) === null || _a2 === void 0 ? void 0 : _a2.setActive(AnimationType.Focus, false);
  };
  useDomEvent(visualElement, "focus", whileFocus ? onFocus : void 0);
  useDomEvent(visualElement, "blur", whileFocus ? onBlur : void 0);
}
export {
  useFocusGesture
};
//# sourceMappingURL=use-focus-gesture.js.map
