import { type ReactNode } from 'react'; import type { WithChildren } from '../../../core/types/with-children.js'; import type { HighlightLanguage } from '../HighlightExtended.js'; import { type CodeSnippetCopyProps } from './Copy.js'; import { type CodeSnippetDownloadProps } from './Download.js'; /** * Slot component that enables the actions menu in `CodeSnippet`. * * Whichever single one of `CodeSnippet.Copy` or `CodeSnippet.Download` * is present renders as a single button matching that action. * Having both present escalates the UI to a menu trigger. * @public */ export declare const ActionsMenu: (props: WithChildren) => null; /** * Which of the `CodeSnippet` actions are enabled, and how each one is configured. * An absent entry means that action isn't rendered. * @internal */ export interface ActionsMenuConfig { /** * Configuration of the Copy action, when enabled. */ copyConfig?: CodeSnippetCopyProps; /** * Configuration of the Download action, when enabled. */ downloadConfig?: CodeSnippetDownloadProps; } /** * Returns the configuration carried by the `CodeSnippet.ActionsMenu` slot among * `children`, or `undefined` when the slot isn't used at all. The distinction * matters: an unused slot falls back to the deprecated `allowCopy`/`showCopyAction` handling. * @param children - The children of the `CodeSnippet` itself. * @internal */ export declare function getActionsMenuSlotConfig(children: ReactNode): ActionsMenuConfig | undefined; /** * Props for the `ActionsMenuInternal` component. * @internal */ export interface ActionsMenuInternalProps { /** * Which actions to render, and how each one is configured. */ config: ActionsMenuConfig; /** * Layout size of the snippet, matched by the action buttons. */ size: 'default' | 'condensed'; /** * The snippet's plain-text content, copied to the clipboard or written to the * downloaded file. */ snippetContent: string; /** * The snippet's highlight language, used to derive the downloaded file's extension. */ language?: HighlightLanguage; } /** * Renders what `CodeSnippet.ActionsMenu` was configured with: * - A menu when both Copy and Download are present, * - A single button when only one of them is, * - Nothing when empty. * @internal */ export declare const ActionsMenuInternal: ({ config: { copyConfig, downloadConfig }, size, snippetContent, language, }: ActionsMenuInternalProps) => import("react").JSX.Element | null; //# sourceMappingURL=ActionsMenu.d.ts.map