/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import type { MenuRenderFn, MenuResolution } from './shared/LexicalMenu'; import { CommandListenerPriority, LexicalNode } from 'lexical'; import { MutableRefObject, ReactPortal } from 'react'; import { MenuOption } from './shared/LexicalMenu'; export type ContextMenuRenderFn = (anchorElementRef: MutableRefObject, itemProps: { selectedIndex: number | null; selectOptionAndCleanUp: (option: TOption) => void; setHighlightedIndex: (index: number) => void; options: Array; }, menuProps: { setMenuRef: (element: HTMLElement | null) => void; }) => ReactPortal | JSX.Element | null; export type LexicalContextMenuPluginProps = { onSelectOption: (option: TOption, textNodeContainingQuery: LexicalNode | null, closeMenu: () => void, matchingString: string) => void; options: Array; onClose?: () => void; onWillOpen?: (event: MouseEvent) => void; onOpen?: (resolution: MenuResolution) => void; menuRenderFn: ContextMenuRenderFn; anchorClassName?: string; commandPriority?: CommandListenerPriority; parent?: HTMLElement; }; export declare function LexicalContextMenuPlugin({ options, onWillOpen, onClose, onOpen, onSelectOption, menuRenderFn: contextMenuRenderFn, anchorClassName, commandPriority, parent, }: LexicalContextMenuPluginProps): JSX.Element | null; export { MenuOption, MenuRenderFn, MenuResolution };