// Type definitions for agate/PopupMenu

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

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 PopupMenuBaseProps {
  /**
   * When true, popup displays a close button.
   */
  closeButton?: boolean;
  /**
   * The label for the close button.
   */
  closeButtonLabel?: string;
  /**
 * 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:
 * *  `popupMenu`  - The root class name
 * *  `body`  - Applied to the body content container
 * *  `popupTransitionContainer`  - Applied to the PopupMenu's outermost container. Sizing can be
applied here for percentage-of-screen values.
 */
  css?: object;
  /**
   * Disables transition animation.
   */
  noAnimation?: boolean;
  /**
   * Called when the popupMenu is closed.
   */
  onClose?: Function;
  /**
   * Called after the popupMenu's "hide" transition finishes.
   */
  onHide?: Function;
  /**
   * Called after the popup's "show" transition finishes.
   */
  onShow?: Function;
  /**
   * Controls the visibility of the PopupMenu.
   *
   * By default, the PopupMenu and its contents are not rendered until  `open` .
   */
  open?: boolean;
  /**
   * The container id for   .
   */
  spotlightId?: string;
  /**
   * The primary text of the popupMenu.
   */
  title?: string;
}
/**
 * The base popup menu component.
 */

export class PopupMenuBase extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, PopupMenuBaseProps>
> {}

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

export interface PopupMenuProps
  extends Merge<PopupMenuBaseProps, PopupMenuDecoratorProps> {}
/**
 * A stateful component that renders a popup menu.
 * 
 * Usage:
 * ```
<PopupMenu open title="Title">
  Hello!
</PopupMenu>
```
 */

export class PopupMenu extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, PopupMenuProps>
> {}

export default PopupMenu;
