import { IContextMenuProvider } from "../../contextmenu.js"; import { ActionBar, ActionsOrientation, IActionViewItemProvider } from "../actionbar/actionbar.js"; import { AnchorAlignment } from "../contextview/contextview.js"; import { Action, IAction, IActionRunner } from "../../../common/actions.js"; import { ThemeIcon } from "../../../common/themables.js"; import { ResolvedKeybinding } from "../../../common/keybindings.js"; import { Disposable } from "../../../common/lifecycle.js"; import { IHoverDelegate } from "../hover/hoverDelegate.js"; export interface IToolBarOptions { orientation?: ActionsOrientation; actionViewItemProvider?: IActionViewItemProvider; ariaLabel?: string; getKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined; actionRunner?: IActionRunner; toggleMenuTitle?: string; anchorAlignmentProvider?: () => AnchorAlignment; renderDropdownAsChildElement?: boolean; moreIcon?: ThemeIcon; allowContextMenu?: boolean; skipTelemetry?: boolean; hoverDelegate?: IHoverDelegate; trailingSeparator?: boolean; /** * If true, toggled primary items are highlighted with a background color. */ highlightToggledItems?: boolean; /** * Render action with icons (default: `true`) */ icon?: boolean; /** * Render action with label (default: `false`) */ label?: boolean; /** * Controls the responsive behavior of the primary group of the toolbar. * - `enabled`: Whether the responsive behavior is enabled. * - `kind`: The kind of responsive behavior to apply. Can be either `last` to only shrink the last item, or `all` to shrink all items equally. * - `minItems`: The minimum number of items that should always be visible. * - `actionMinWidth`: The minimum width of each action item. Defaults to `ACTION_MIN_WIDTH` (24px). */ responsiveBehavior?: { enabled: boolean; kind: "last" | "all"; minItems?: number; actionMinWidth?: number; }; } /** * A widget that combines an action bar for primary actions and a dropdown for secondary actions. */ export declare class ToolBar extends Disposable { private readonly container; private options; protected readonly actionBar: ActionBar; private toggleMenuAction; private toggleMenuActionViewItem; private submenuActionViewItems; private hasSecondaryActions; private readonly element; private _onDidChangeDropdownVisibility; get onDidChangeDropdownVisibility(): import("../../../common/event.js").Event; private originalPrimaryActions; private originalSecondaryActions; private hiddenActions; private readonly disposables; private readonly actionMinWidth; constructor(container: HTMLElement, contextMenuProvider: IContextMenuProvider, options?: IToolBarOptions); set actionRunner(actionRunner: IActionRunner); get actionRunner(): IActionRunner; set context(context: unknown); getElement(): HTMLElement; focus(): void; getItemsWidth(): number; getItemAction(indexOrElement: number | HTMLElement): IAction | undefined; getItemWidth(index: number): number; getItemsLength(): number; setAriaLabel(label: string): void; setActions(primaryActions: ReadonlyArray, secondaryActions?: ReadonlyArray): void; isEmpty(): boolean; private getKeybindingLabel; private updateActions; private clear; dispose(): void; } export declare class ToggleMenuAction extends Action { static readonly ID = "toolbar.toggle.more"; private _menuActions; private toggleDropdownMenu; constructor(toggleDropdownMenu: () => void, title?: string); run(): Promise; get menuActions(): ReadonlyArray; set menuActions(actions: ReadonlyArray); }