UNPKG

@asup/context-menu

Version:
68 lines (66 loc) 2.2 kB
import React, { RefAttributes, ForwardRefExoticComponent, ReactNode } from "react"; interface AutoHeightProps extends React.HTMLAttributes<HTMLDivElement> { children: React.ReactNode; hide?: boolean; duration?: number; } export function AutoHeight({ children, hide, duration, ...rest }: AutoHeightProps): JSX.Element; export declare namespace AutoHeight { var displayName: string; } interface MenuItem { label: string | JSX.Element; disabled?: boolean; action?: (target?: Range | null, reactEvent?: React.MouseEvent) => Promise<void> | void; group?: MenuItem[]; } interface ContextMenuProps { visible: boolean; entries: MenuItem[]; xPos: number; yPos: number; toClose: () => void; } export const ContextMenu: ForwardRefExoticComponent<ContextMenuProps & RefAttributes<HTMLDivElement>>; interface ClickForMenuProps extends React.HTMLAttributes<HTMLDivElement> { id: string; menuItems?: MenuItem[]; chidren?: React.ReactNode; } export const ClickForMenu: { ({ id, menuItems, children, ...rest }: ClickForMenuProps): JSX.Element; displayName: string; }; interface ContextMenuHandlerProps extends React.HTMLAttributes<HTMLDivElement> { children: React.ReactNode; menuItems: MenuItem[]; showLowMenu?: boolean; } export const ContextMenuHandler: { ({ children, menuItems, showLowMenu, ...rest }: ContextMenuHandlerProps): JSX.Element; displayName: string; }; interface ContextWindowStackProps { id?: string; minZIndex?: number; children?: JSX.Element[] | JSX.Element; } export const ContextWindowStack: { ({ minZIndex, children, }: ContextWindowStackProps): JSX.Element; displayName: string; }; interface ContextWindowProps extends React.HTMLAttributes<HTMLDivElement> { id: string; visible: boolean; onOpen?: () => void; onClose?: () => void; title: string; titleElement?: ReactNode; style?: React.CSSProperties; children: React.ReactNode; } export const ContextWindow: { ({ id, visible, title, titleElement, children, onOpen, onClose, ...rest }: ContextWindowProps): JSX.Element; displayName: string; }; //# sourceMappingURL=context-menu.d.ts.map