
import { _MenuTrigger } from "./Menu/MenuTrigger.js";
import "./Menu/index.js";
import { ComponentProps, ComponentType, ReactElement, RefObject } from "react";

//#region src/components/actions/use-anchored-menu.d.ts
interface UseAnchoredMenuReturn<P, T> {
  /** Ref to attach to the anchor element for positioning the menu. */
  anchorRef: RefObject<HTMLElement | null>;
  /**
   * Programmatically opens the menu with the provided props.
   * @param props - Props to pass to the menu component
   * @param triggerProps - Additional props for MenuTrigger (merged with defaultTriggerProps)
   */
  open(props?: P, triggerProps?: T): void;
  /**
   * Updates the props of the currently open menu.
   * Props are merged if defaults are provided.
   */
  update(props: P, triggerProps?: T): void;
  /** Closes the menu programmatically. */
  close(): void;
  /** Current open/closed state of the menu. */
  isOpen: boolean;
  /**
   * JSX element that must be rendered in your component tree.
   * Contains the MenuTrigger and positioning logic.
   */
  get rendered(): ReactElement | null;
}
/**
 * Generic hook to manage an anchored menu component.
 *
 * @param Component - A React component that represents the menu content (Menu or CommandMenu).
 * @param defaultTriggerProps - Default props to pass to the MenuTrigger.
 * @param defaultMenuProps - Default props to pass to the Menu component.
 * @returns An object with `anchorRef` to position the menu, `open` function to open the menu with provided props, `close` function to close the menu, and `rendered` JSX element to include in your component tree.
 */
declare function useAnchoredMenu<P, T = ComponentProps<typeof _MenuTrigger>>(Component: ComponentType<P>, defaultTriggerProps?: Omit<ComponentProps<typeof _MenuTrigger>, 'children' | 'isOpen' | 'onOpenChange' | 'targetRef'>, defaultMenuProps?: P): UseAnchoredMenuReturn<P, T>;
//#endregion
export { UseAnchoredMenuReturn, useAnchoredMenu };
//# sourceMappingURL=use-anchored-menu.d.ts.map