// Type definitions for agate/ToggleButton

import { ButtonProps as agate_Button_ButtonProps } from "@enact/agate/Button";
import * as React from "react";
import { ToggleableProps as ui_Toggleable_ToggleableProps } from "@enact/ui/Toggleable";
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 ToggleButtonBaseProps extends agate_Button_ButtonProps {
  /**
 * The string to be displayed as the main content of the toggle button.
 * 
 * If  `toggleOffLabel`  and/or  `toggleOnLabel`  are provided, they will be used for the
respective states.
 */
  children?: React.ReactNode;
  /**
   * Disables the button.
   */
  disabled?: boolean;
  /**
   * The icon to display before the text.
   */
  icon?: string;
  /**
   * Determines whether the button is currently in an "on" or "off" state.
   */
  selected?: boolean;
  /**
   * The size of the button.
   */
  size?: "smallest" | "small" | "large" | "huge";
  /**
   * Button text displayed in the 'off' state.
   *
   * If not specified,  `children`  will be used for 'off' button text.
   */
  toggleOffLabel?: string;
  /**
   * Button text displayed in the 'on' state.
   *
   * If not specified,  `children`  will be used for 'on' button text.
   */
  toggleOnLabel?: string;
  /**
   * The button type.
   *
   * Grid buttons are intended to be grouped with other related buttons.
   */
  type?: "grid" | "standard";
  /**
   * Shows toggle indicator.
   */
  underline?: boolean;
}
/**
 * A stateless  Button   that can be toggled by changing its
 `selected`  property.
 */

export class ToggleButtonBase extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, ToggleButtonBaseProps>
> {}

export interface ToggleButtonDecoratorProps
  extends Merge<
    ui_Toggleable_ToggleableProps,
    agate_Skinnable_SkinnableProps
  > {}
export function ToggleButtonDecorator<P>(
  Component: React.ComponentType<P> | string
): React.ComponentType<P & ToggleButtonDecoratorProps>;

export interface ToggleButtonProps
  extends Merge<ToggleButtonBaseProps, ToggleButtonDecoratorProps> {}
/**
 * A toggleable button.
 * 
 * By default,  `ToggleButton`  maintains the state of its  `selected`  property.
Supply the  `defaultSelected`  property to control its initial value. If you
wish to directly control updates to the component, supply a value to  `selected`  at creation time
and update it in response to  `onToggle`  events.
 */

export class ToggleButton extends React.Component<
  Merge<React.HTMLProps<HTMLElement>, ToggleButtonProps>
> {}

export default ToggleButton;
