// Type definitions for agate/Popup

import * as React from "react";
import { SlottableProps as ui_Slottable_SlottableProps } from "@enact/ui/Slottable";
import { SkinnableProps as agate_Skinnable_SkinnableProps } from "@enact/agate/Skinnable";

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;

export interface PopupBaseProps {
  /**
   * Buttons to be included within the Popup component.
   *
   * Typically, these buttons would be used to close or take action on the dialog.
   */
  buttons?: JSX.Element | JSX.Element[];
  /**
   * Centers the contents.
   */
  centered?: boolean;
  /**
   * When true, popup displays a close button.
   */
  closeButton?: boolean;
  /**
 * Customizes the component by mapping the supplied collection of CSS class names to the
corresponding internal elements and states of this component.
 * 
 * The following classes are supported:
 * *  `popup`  - The root class name
 * *  `body`  - Applied to the body content container
 * *  `popupTransitionContainer`  - Applied to the Popup's outermost container. Sizing can be
                             applied here for percentage-of-screen values.
 * *  `top`  - Applied when the  `position`  is 'top'
 * *  `right`  - Applied when the  `position`  is 'right'
 * *  `bottom`  - Applied when the  `position`  is 'bottom'
 * *  `left`  - Applied when the  `position`  is 'left'
 */
  css?: object;
  /**
 * Controls how long the transition should take.
Supported preset durations are:  `'short'`  (250ms),  `'medium'`  (500ms), and  `'long'`  (1s).
 `'short'`  (250ms) is default when no others are specified.
 */
  duration?: string;
  /**
   * Disables transition animation.
   */
  noAnimation?: boolean;
  /**
   * Called when the popup is closed.
   */
  onClose?: Function;
  /**
   * Called after the popup's "hide" transition finishes.
   */
  onHide?: Function;
  /**
   * Controls the visibility of the Popup.
   *
   * By default, the Popup and its contents are not rendered until  `open` .
   */
  open?: boolean;
  /**
   * Sets the position of the popup on the screen.
   */
  position?: "bottom" | "center" | "fullscreen" | "left" | "right" | "top";
  /**
   * The primary text of the popup.
   */
  title?: string;
  /**
   * The type of transition to affect the content.
   *
   * Supported types are:  `'slide'`  and  `'fade'` .
   */
  type?: string;
}
/**
 * The base popup component.
 */

export class PopupBase extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, PopupBaseProps>
> {}

export interface PopupDecoratorProps
  extends Merge<ui_Slottable_SlottableProps, agate_Skinnable_SkinnableProps> {}
export function PopupDecorator<P>(
  Component: React.ComponentType<P> | string
): React.ComponentType<P & PopupDecoratorProps>;

export interface PopupProps
  extends Merge<PopupBaseProps, PopupDecoratorProps> {}
/**
 * A stateful component that renders a popup in a
 FloatingLayer  .
 */

export class Popup extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, PopupProps>
> {}

export default Popup;
