import * as React from 'react'; import { PopoverProps, Placement, AppendTo } from 'wix-ui-core/dist/src/components/popover'; export { Placement, AppendTo }; export interface ClosablePopoverActions { /** Closes the popover content*/ close: () => void; } export interface ClosablePopoverOwnProps { /** Controls wether the popover's content is shown or not. * When undefined, then the component is Uncontrolled, * It is initially open, and it can be closed by close-action */ opened?: boolean; /** Controls wether the popover's content is initially opened (in Uncontrolled mode only) */ initiallyOpened?: boolean; /** The popover's content, given as a function that receives control-actions and renders the contet. * In Uncontrolled mode, this function is still called only once. */ content: (closable: ClosablePopoverActions) => React.ReactNode; /** The popover's target element*/ target: React.ReactNode; /** Callback to call when the popover content is requested to be opened (Uncontrolled mode only) */ onOpen?: Function; /** callback to call when the popover content is requested to be closed (Uncontrolled mode only). NOTE: this callback is called when the close timeout (if exists) starts */ onClose?: Function; /** Disable close on mouseLeave */ closeOnMouseLeave?: boolean; } export declare enum Mode { Hover = "hover", ClickToClose = "click-to-close" } export interface ClosablePopoverState { open?: boolean; mode?: Mode; } export declare type PickedPopoverProps = Pick; export declare type ClosablePopoverProps = PickedPopoverProps & ClosablePopoverOwnProps; /** * Closable Popover * Either a normal Controlled Popover, or a Popover that is inittialy opened and can be the closed by * calling a closeAction. */ export declare class ClosablePopover extends React.PureComponent { state: ClosablePopoverState; static defaultProps: Partial; private isControlled; open: () => void; private doOpen; close: () => void; private handleMouseEnter; private handleMouseLeave; render(): JSX.Element; actions: ClosablePopoverActions; }