// @flow
import { type Node } from 'react';
import type { PopperArrowProps } from 'react-popper';
import type {
  PopperPlacement,
  ReferenceProps as PopperReferenceProps,
} from '../popper/popper.proptypes';
import { type TranslatedContent } from '../../../types';

export type ReferenceArgs = {|
  ref: (?HTMLElement) => void,
  referenceProps?: {|
    ...PopperReferenceProps,
    onMouseEnter?: () => void,
    onMouseLeave?: () => void,
    onFocus?: () => void,
    onBlur?: () => void,
  |},
|};

export type TooltipProps = {|
  reference: (ReferenceArgs) => Node,
  placement: PopperPlacement,
  children: TranslatedContent | Node,
  isVisible?: boolean,
|};

export type TooltipViewProps = {|
  placement: PopperPlacement,
  popperId: string,
  arrowProps: PopperArrowProps,
  ref: (?HTMLElement) => void,
  style: CSSStyleDeclaration,
  children: Node | TranslatedContent,
|};
