/**
 * 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, MenuTextMatch, TriggerFn } from './shared/LexicalMenu';
import type { JSX } from 'react';
import { getScrollParent as getScrollParent_ } from '@lexical/utils';
import { CommandListenerPriority, LexicalCommand, TextNode } from 'lexical';
import { MenuOption } from './shared/LexicalMenu';
/**
 * The default set of punctuation characters (as a character-class fragment)
 * that terminate a typeahead query. Used as the default `punctuation` option of
 * {@link useBasicTypeaheadTriggerMatch}.
 */
export declare const PUNCTUATION = "\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";
export { useDynamicPositioning } from './shared/LexicalMenu';
/** @deprecated Moved to `@lexical/utils`. Import `getScrollParent` from there. */
export declare const getScrollParent: typeof getScrollParent_;
/**
 * Command dispatched while the typeahead menu is open to scroll the option at
 * the given `index` into view. The default menu renderer listens for it; custom
 * {@link MenuRenderFn}s can handle it to implement their own scrolling.
 */
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
    index: number;
    option: MenuOption;
}>;
/**
 * Builds a {@link TriggerFn} for the common case of a single-character
 * `trigger` (such as `@` or `#`) followed by a query. The returned function
 * matches when the trigger is preceded by whitespace or the start of the line
 * and is followed by between `minLength` and `maxLength` non-`punctuation`
 * characters (optionally allowing whitespace).
 *
 * @returns A memoized trigger function for {@link LexicalTypeaheadMenuPlugin}.
 */
export declare function useBasicTypeaheadTriggerMatch(trigger: string, { minLength, maxLength, punctuation, allowWhitespace, }: {
    minLength?: number;
    maxLength?: number;
    punctuation?: string;
    allowWhitespace?: boolean;
}): TriggerFn;
/**
 * Props for the {@link LexicalTypeaheadMenuPlugin} component.
 */
export type TypeaheadMenuPluginProps<TOption extends MenuOption> = {
    onQueryChange: (matchingString: string | null) => void;
    onSelectOption: (option: TOption, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void;
    options: TOption[];
    triggerFn: TriggerFn;
    menuRenderFn?: MenuRenderFn<TOption>;
    onOpen?: (resolution: MenuResolution) => void;
    onClose?: () => void | PromiseLike<void>;
    anchorClassName?: string;
    commandPriority?: CommandListenerPriority;
    parent?: HTMLElement;
    preselectFirstItem?: boolean;
    ignoreEntityBoundary?: boolean;
};
/**
 * Renders a floating menu (such as an `@`-mention or slash-command picker) while
 * the text before the cursor matches `triggerFn`. As the user types, the
 * current query is reported via `onQueryChange`; supply the `options` to show
 * and an `onSelectOption` handler to apply the chosen option. Use
 * {@link useBasicTypeaheadTriggerMatch} to build a simple `triggerFn`.
 *
 * @returns The floating menu element, or `null` when no query is active.
 */
export declare function LexicalTypeaheadMenuPlugin<TOption extends MenuOption>({ options, onQueryChange, onSelectOption, onOpen, onClose, menuRenderFn, triggerFn, anchorClassName, commandPriority, parent, preselectFirstItem, ignoreEntityBoundary, }: TypeaheadMenuPluginProps<TOption>): JSX.Element | null;
export { MenuOption, MenuRenderFn, MenuResolution, MenuTextMatch, TriggerFn };
