/**
 * 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 type { TouchActionValue } from '../../__types__/styles';
import { addEvent } from '#internal/addEvent';
import checkTargetContainsSelection from '#internal/checkTargetContainsSelection';
import { getActiveModality } from '#internal/modality';
import supportsDOM from '#internal/supportsDOM';
import { useCallback, useRef } from 'react';
import { useKeyboard } from '../use-keyboard';
import useLayoutEffect from '#internal/useLayoutEffect';
import { useMergeRefs } from '../use-merge-refs';
import { useResponder } from '../use-responder';
type PressConfig = $ReadOnly<{|
  delayLongPress?: ?number,
  disabled?: ?boolean,
  onLongPress?: ?(e: any) => void,
  onPress?: ?(e: any) => void,
  onPressCancel?: ?(e: any) => void,
  onPressChange?: ?(isPressed: boolean) => void,
  onPressEnd?: (e: any) => void,
  onPressStart?: (e: any) => void,
  touchAction?: TouchActionValue,
|}>;
type PressState = {
  active: boolean,
  initialX: ?number,
  initialY: ?number,
  isLongPress: boolean,
  longPressTimeout: ?TimeoutID,
};
const emptyObject = {};
const MOVE_THRESHOLD_PX = 10;
const DEFAULT_LONG_PRESS_DELAY_MS = 500;
const captureOptions = {
  capture: true
};
declare function getTouchFromResponderEvent(event: any): any;
declare function isKeyActivator(key: any): any;
declare function isKeySpacebar(key: any): any;
declare function isTargetDisabled(target: any): any;
declare function isTargetNativelyInteractive(target: any): any;
declare function shouldSpacebarActivate(event: any): any;
declare function useClick(listener: any): any;
declare function useContextMenu(listener: any): any;
declare export function usePress(config: PressConfig): CallbackRef;