import { ButtonBar } from "../../../base/browser/ui/button/button.js"; import { IAction, IRunEvent } from "../../../base/common/actions.js"; import { Event } from "../../../base/common/event.js"; import { IMarkdownString } from "../../../base/common/htmlContent.js"; import { DisposableStore } from "../../../base/common/lifecycle.js"; import { IObservable } from "../../../base/common/observable.js"; import { IToolBarRenderOptions } from "./toolbar.js"; import { MenuId, IMenuActionOptions } from "../common/actions.js"; import { IMenuService } from "../common/actions.service.js"; import { IContextKeyService } from "../../contextkey/common/contextkey.service.js"; import { IContextMenuService } from "../../contextview/browser/contextView.service.js"; import { IHoverService } from "../../hover/browser/hover.service.js"; import { IKeybindingService } from "../../keybinding/common/keybinding.service.js"; import { ITelemetryService } from "../../telemetry/common/telemetry.service.js"; export interface IButtonConfig { showIcon?: boolean; showLabel?: boolean; isSecondary?: boolean; customLabel?: string | IMarkdownString; customLabelObs?: IObservable; customClass?: string; /** * Renders an animated spinner ahead of the label, for a button whose work * is currently in flight rather than waiting to be started. * * The spinner occupies the button's leading slot. Where the button renders * an icon at rest — `showIcon` with an action that carries one — the spinner * takes that icon's place rather than adding to it, so the button keeps its * width while its work runs. A button with nothing in that slot at rest * grows by the width of the spinner instead. */ showSpinner?: boolean; } export type IButtonConfigProvider = (action: IAction, index: number) => IButtonConfig | undefined; export interface IWorkbenchButtonBarOptions { telemetrySource?: string; buttonConfigProvider?: IButtonConfigProvider; small?: boolean; disableWhileRunning?: boolean; renderSecondaryActions?: boolean; } export declare class WorkbenchButtonBar extends ButtonBar { private readonly _options; private readonly _contextMenuService; private readonly _keybindingService; private readonly _hoverService; protected readonly _store: DisposableStore; protected readonly _updateStore: DisposableStore; private readonly _actionRunner; private readonly _onDidChange; readonly onDidChange: Event; get onWillRun(): Event; get onDidRun(): Event; constructor(container: HTMLElement, _options: IWorkbenchButtonBarOptions | undefined, _contextMenuService: IContextMenuService, _keybindingService: IKeybindingService, telemetryService: ITelemetryService, _hoverService: IHoverService); dispose(): void; update(actions: IAction[], secondary: IAction[]): void; } export interface IMenuWorkbenchButtonBarOptions extends IWorkbenchButtonBarOptions { menuOptions?: IMenuActionOptions; toolbarOptions?: IToolBarRenderOptions; } export declare class MenuWorkbenchButtonBar extends WorkbenchButtonBar { constructor(container: HTMLElement, menuId: MenuId, options: IMenuWorkbenchButtonBarOptions | undefined, menuService: IMenuService, contextKeyService: IContextKeyService, contextMenuService: IContextMenuService, keybindingService: IKeybindingService, telemetryService: ITelemetryService, hoverService: IHoverService); dispose(): void; update(_actions: IAction[]): void; }