import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react'; import { type OpenMenu } from '../components/ContextMenu.js'; import type { MenuAction, MenuEntry, MenuSubmenu } from '../components/MenuEntries.js'; /** An action on a row, which its menu lists and its pinned buttons show, named by `key`. */ export type RowAction = MenuAction & { key: string; }; /** Assembles a row's context menu in the shared order: leading link(s) → middle * actions → extra items → Copy submenu → trailing (destructive) actions last. */ export declare function assembleRowMenu({ lead, actions, exclude, order, trailing, extra, copy, }: { /** Pre-built leading link(s), e.g. "View details". */ lead?: MenuEntry[]; /** The row's full action list. */ actions: RowAction[]; /** Keys already rendered in `lead`/`extra`; dropped from the middle. */ exclude?: string[]; /** Explicit middle order; keys absent from `actions` are skipped, keys absent from `order` are dropped. */ order?: string[]; /** Keys rendered last, in this order (default `['delete']`). */ trailing?: string[]; /** Items inserted after the middle actions and before Copy, e.g. a marketplace link. */ extra?: MenuEntry[]; /** The Copy submenu from `useCopySubmenu()`. */ copy?: MenuSubmenu | undefined; }): MenuEntry[]; /** The pointer leaves a row for its menu, dropping CSS :hover; wrap openMenu here * for an `active` flag that keeps the row lit while its menu is open. */ export declare function useRowMenuActive(openMenu: OpenMenu): { active: boolean; openMenu: OpenMenu; }; /** Opens the row's menu on a right-click; Shift+right-click, or a row with no items, keeps the * browser's own. Pass a function to build a large list's menus only when one opens, not on * every render. */ export declare function rowContextMenuProps(openMenu: OpenMenu, entries: MenuEntry[] | (() => MenuEntry[])): { onContextMenu: (e: ReactMouseEvent) => void; }; export interface CopyFields { name?: string | null | undefined; /** Overrides the "name" label (raw, pre-translated) for entities whose primary field isn't a name, e.g. "domain". */ nameLabel?: string; email?: string | null | undefined; username?: string | null | undefined; uid?: string | number | null | undefined; id?: string | null | undefined; url?: string | null | undefined; extra?: { label: string; value?: string | null | undefined; icon?: ReactNode; }[] | undefined; } export type CopySubmenu = (fields: CopyFields) => MenuSubmenu; /** Returns a builder for the Copy submenu, labeled from the provider's strings. */ export declare function useCopySubmenu(): CopySubmenu; /** Opens a row's menu under itself. Shows on the row's hover or focus, and * stays while its menu is `open`, though the pointer has left the row. A touch * screen has no hover, so there it always shows: the row's menu is otherwise * out of reach. */ export declare function MoreButton({ onOpen, items, open: openProp, visible: visibleProp, label, className, }: { /** Opens a menu of the host's own under the button. */ onOpen?: ((button: HTMLElement) => void) | undefined; /** The menu's rows, opened in the shared menu, which a second press closes. A function * builds them only when it opens. Use this or `onOpen`. */ items?: MenuEntry[] | (() => MenuEntry[]) | undefined; /** Whether its menu is open; with `items` the shared menu tells it. */ open?: boolean; /** Shows at rest too. */ visible?: boolean; /** Names the row the menu acts on, as "More actions for Core", for a list * of rows that would otherwise each read "More actions". */ label?: string | undefined; className?: string | undefined; }): import("react").JSX.Element;