UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

67 lines (66 loc) 2.29 kB
import { type SyntheticEvent } from 'react'; import * as React from 'react'; export interface ChildHandle { close: () => void; popupId: string; } export interface PopupState { open: (event?: React.MouseEvent | React.FocusEvent) => void; close: (event?: React.MouseEvent) => void; toggle: (event?: React.MouseEvent) => void; setOpen: (open: boolean, eventOrAnchorEl?: SyntheticEvent | Element) => void; isOpen: boolean; anchorEl: Element | undefined; setAnchorEl: (anchorEl: Element | undefined) => any; setAnchorElUsed: boolean; popupId: string | undefined; hovered: boolean; focused: boolean; _openEventType?: string; childHandle?: ChildHandle; setChildHandle: (popupState?: ChildHandle) => void; } export interface CoreState { isOpen: boolean; setAnchorElUsed: boolean; anchorEl: Element | undefined; hovered: boolean; focused: boolean; _openEventType?: string; _childHandle?: PopupState; } export declare function usePopupState(arg?: { parentPopupState?: PopupState; variant?: string; }): PopupState; export declare function bindTrigger(popupState: PopupState): { onClick: (event?: React.MouseEvent | React.FocusEvent) => void; }; export declare function bindToggle(popupState: PopupState): { onClick: (event?: React.MouseEvent) => void; }; export declare function bindHover(popupState: PopupState): { onMouseOver: (event?: React.MouseEvent | React.FocusEvent) => void; }; export declare function bindFocus(popupState: PopupState): { onFocus: (event?: React.MouseEvent | React.FocusEvent) => void; }; export declare function bindPopover({ isOpen, anchorEl, close, popupId }: PopupState): { id: string | undefined; anchorEl: Element | undefined; anchorReference: "anchorEl"; open: boolean; onClose: (event?: React.MouseEvent) => void; }; export declare function bindMenu({ isOpen, anchorEl, close, popupId }: PopupState): { id: string | undefined; anchorEl: Element | undefined; anchorReference: "anchorEl"; open: boolean; onClose: (event?: React.MouseEvent) => void; }; export declare function bindPopper({ isOpen, anchorEl, popupId }: PopupState): { id: string | undefined; anchorEl: Element | undefined; open: boolean; };