Files
vscode/src/vs/base/browser/contextmenu.ts
T
Benjamin Pasero 8d72e849d3 Debt: avoid electron remote module (#57134)
* debt - avoid usages of electron remote module

* debt - comment out remote & sendSync from electron.d.ts
2018-08-24 09:54:25 +02:00

36 lines
1.4 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IAction, IActionRunner } from 'vs/base/common/actions';
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { TPromise } from 'vs/base/common/winjs.base';
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
import { SubmenuAction } from 'vs/base/browser/ui/menu/menu';
export interface IContextMenuEvent {
shiftKey?: boolean;
ctrlKey?: boolean;
altKey?: boolean;
metaKey?: boolean;
}
export class ContextSubMenu extends SubmenuAction {
constructor(label: string, public entries: (ContextSubMenu | IAction)[]) {
super(label, entries, 'contextsubmenu');
}
}
export interface IContextMenuDelegate {
getAnchor(): HTMLElement | { x: number; y: number; };
getActions(): TPromise<(IAction | ContextSubMenu)[]>;
getActionItem?(action: IAction): IActionItem;
getActionsContext?(event?: IContextMenuEvent): any;
getKeyBinding?(action: IAction): ResolvedKeybinding;
getMenuClassName?(): string;
onHide?(didCancel: boolean): void;
actionRunner?: IActionRunner;
autoSelectFirstItem?: boolean;
}