UNPKG

@pkerschbaum/code-oss-file-service

Version:

VS Code ([microsoft/vscode](https://github.com/microsoft/vscode)) includes a rich "`FileService`" and "`DiskFileSystemProvider`" abstraction built on top of Node.js core modules (`fs`, `path`) and Electron's `shell` module. This package allows to use that

116 lines 4.08 kB
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<IRunEvent>; readonly onBeforeRun: Event<IRunEvent>; 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<IActionChangeEvent>; readonly onDidChange: Event<IActionChangeEvent>; 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 | undefined; set checked(value: boolean | undefined); protected _setChecked(value: boolean | undefined): void; run(event?: unknown, data?: ITelemetryData): Promise<void>; } export interface IRunEvent { readonly action: IAction; readonly error?: Error; } export declare class ActionRunner extends Disposable implements IActionRunner { private _onBeforeRun; readonly onBeforeRun: Event<IRunEvent>; private _onDidRun; readonly onDidRun: Event<IRunEvent>; run(action: IAction, context?: unknown): Promise<void>; protected runAction(action: IAction, context?: unknown): Promise<void>; } 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: undefined; private readonly _actions; get actions(): readonly IAction[]; constructor(id: string, label: string, actions: readonly IAction[], cssClass?: string); dispose(): void; run(): Promise<void>; } 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