// Type definitions for react-aria-menubutton 6.2 // Project: https://github.com/davidtheclark/react-aria-menubutton // Definitions by: Muhammad Fawwaz Orabi // Chris Rohlfs // Mats Roshauw // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; export interface WrapperState { isOpen: boolean; } export interface WrapperProps extends React.HTMLProps { /** * A callback to run when the user makes a selection * (i.e. clicks or presses Enter or Space on a `MenuItem`). * It will be passed the value of the selected `MenuItem` and * the React `SyntheticEvent`. */ onSelection?(value: any, event: React.SyntheticEvent): any; /** * A callback to run when the menu is opened or closed. */ onMenuToggle?(obj: WrapperState): any; /** * By default, it does automatically close. * If false, the menu will not automatically close when a * selection is made. Default: `true`. */ closeOnSelection?: boolean; /** * By default, it does automatically close. * If false, the menu will not automatically close when it * blurs. Default: `true`. */ closeOnBlur?: boolean; isOpen?: boolean; tag?: T["tagName"]; } /** * A simple component to group a `Button`/`Menu`/`MenuItem` set, * coordinating their interactions. It should wrap your entire menu button * widget. * All `Button`, `Menu`, and `MenuItem` components must be nested within a * `Wrapper` component. * Each wrapper can contain only one `Button`, only one `Menu`, and * multiple `MenuItem`s. */ export class Wrapper extends React.Component> {} export interface ButtonProps extends React.HTMLProps { /** * If true, the element is disabled * (aria-disabled='true', not in tab order, clicking has no effect). */ disabled?: boolean; /** * The HTML tag for this element. Default: 'span'. */ tag?: T["tagName"]; } /** * A React component to wrap the content of your * menu-button-pattern's button. * The `Button` component itself acts as a UI button (with tab-index, role, etc.), * so you probably do not want to pass an HTML `