import { Emitter, Event } from '../../base/common/event'; import { Disposable, IDisposable } from '../../base/common/lifecycle'; export interface ITelemetryData { readonly from?: string; readonly target?: string; [key: string]: unknown; } export declare type WorkbenchActionExecutedClassification = { id: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; }; from: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; }; }; export declare type WorkbenchActionExecutedEvent = { id: string; from: string; }; export interface IAction extends IDisposable { readonly id: string; label: string; tooltip: string; class: string | undefined; enabled: boolean; checked: boolean; run(event?: unknown): unknown; } export interface IActionRunner extends IDisposable { readonly onDidRun: Event; readonly onBeforeRun: Event; run(action: IAction, context?: unknown): unknown; } export interface IActionChangeEvent { readonly label?: string; readonly tooltip?: string; readonly class?: string; readonly enabled?: boolean; readonly checked?: boolean; } export declare class Action extends Disposable implements IAction { protected _onDidChange: Emitter; readonly onDidChange: Event; protected readonly _id: string; protected _label: string; protected _tooltip: string | undefined; protected _cssClass: string | undefined; protected _enabled: boolean; protected _checked: boolean; protected readonly _actionCallback?: (event?: unknown) => unknown; constructor(id: string, label?: string, cssClass?: string, enabled?: boolean, actionCallback?: (event?: unknown) => unknown); get id(): string; get label(): string; set label(value: string); private _setLabel; get tooltip(): string; set tooltip(value: string); protected _setTooltip(value: string): void; get class(): string | undefined; set class(value: string | undefined); protected _setClass(value: string | undefined): void; get enabled(): boolean; set enabled(value: boolean); protected _setEnabled(value: boolean): void; get checked(): boolean; set checked(value: boolean); protected _setChecked(value: boolean): void; run(event?: unknown, data?: ITelemetryData): Promise; } export interface IRunEvent { readonly action: IAction; readonly error?: Error; } export declare class ActionRunner extends Disposable implements IActionRunner { private _onBeforeRun; readonly onBeforeRun: Event; private _onDidRun; readonly onDidRun: Event; run(action: IAction, context?: unknown): Promise; protected runAction(action: IAction, context?: unknown): Promise; } export declare class Separator extends Action { /** * Joins all non-empty lists of actions with separators. */ static join(...actionLists: readonly IAction[][]): IAction[]; static readonly ID = "vs.actions.separator"; constructor(label?: string); } export declare class SubmenuAction implements IAction { readonly id: string; readonly label: string; readonly class: string | undefined; readonly tooltip: string; readonly enabled: boolean; readonly checked: boolean; private readonly _actions; get actions(): readonly IAction[]; constructor(id: string, label: string, actions: readonly IAction[], cssClass?: string); dispose(): void; run(): Promise; } export declare class EmptySubmenuAction extends Action { static readonly ID = "vs.actions.empty"; constructor(); } export declare function toAction(props: { id: string; label: string; enabled?: boolean; checked?: boolean; run: Function; }): IAction; //# sourceMappingURL=actions.d.ts.map