import React, { type ReactNode, type ReactElement, type ButtonHTMLAttributes, type Dispatch, type SetStateAction, type Ref } from "react"; import { Placement } from "@floating-ui/react"; export type ContextMenu2Anchor = { x: number; y: number; }; export declare const useContextMenu2Anchor: () => { position: ContextMenu2Anchor; setPosition: Dispatch>; }; type ContextMenu2Props = { /** * コンテキストメニューを開くかどうか。省略時は内部で開閉状態を管理される */ open?: boolean; /** * 開閉トリガーとなるボタン要素 */ trigger: ReactElement & { ref?: Ref; }, "button"> | ContextMenu2Anchor; /** * コンテキストメニューの幅(省略時は幅が内容にフィットする) */ width?: number; /** * コンテキストメニューの最小幅 */ minWidth?: number; /** * コンテキストメニューの最大高さ(省略時は80vh) */ maxHeight?: string | number; /** * メニュー内の項目。ContextMenu2*** のコンポーネントのみで構成する前提 */ children: ReactNode; /** * 開閉状態が変更されたときのコールバック */ onOpenChange?: (open: boolean) => void; /** * パネルの上部に固定表示される要素(検索窓など) */ stickyHeader?: ReactNode; /** * パネルの下部に固定表示される要素(適用ボタンなど) */ stickyFooter?: ReactNode; /** * 検索結果が0件の場合に表示するメッセージ */ noResultsMessage?: string; /** * Floating UIのplacement(表示位置)を外部から渡す(高度なカスタマイズ用) */ placement?: Placement; /** * Floating UIのmiddleware配列を外部から渡す(高度なカスタマイズ用) */ middleware?: Array; }; export declare const ContextMenu2: React.ForwardRefExoticComponent>; type ContextMenu2ContainerProps = { /** * ContextMenu2 を 1 つだけ含める */ children: ReactElement; }; export declare const ContextMenu2Container: ({ children, }: ContextMenu2ContainerProps) => React.JSX.Element; export {};