/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */
import type { CallbackRef } from '../../__types__';
import { useCallback, useRef } from 'react';
import { addEvent } from '#internal/addEvent';
import { useRefCallback } from '#internal/useRefCallback';
type FocusWithinConfig = {
  disabled?: ?boolean,
  // Called after a focused element is removed from the DOM and has been blurred
  // onAfterBlurWithin?: (e: SyntheticEvent<EventTarget>) => void,
  // Called before a focused element is removed from the DOM and will be blurred
  // onBeforeBlurWithin?: (e: SyntheticEvent<EventTarget>) => void,
  // Called once the target and all its descendants lose focus
  onBlurWithin?: ?(e: any) => void,
  // Called once the target element or a descendant receives focus
  onFocusWithin?: ?(e: any) => void,
  // Called each time the focus-within state changes
  onFocusWithinChange?: (isFocusWithin: boolean) => void,
};
/**
 * useFocusWithin implementation
 */

const passiveOptions = {
  passive: true
};
declare export function useFocusWithin(config: FocusWithinConfig): CallbackRef;