Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/base/parts/contextmenu/common/contextmenu.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
export interface ICommonContextMenuItem {
7
label?: string;
8
9
type?: 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio';
10
11
accelerator?: string;
12
13
enabled?: boolean;
14
visible?: boolean;
15
checked?: boolean;
16
}
17
18
export interface ISerializableContextMenuItem extends ICommonContextMenuItem {
19
id: number;
20
submenu?: ISerializableContextMenuItem[];
21
}
22
23
export interface IContextMenuItem extends ICommonContextMenuItem {
24
click?: (event: IContextMenuEvent) => void;
25
submenu?: IContextMenuItem[];
26
}
27
28
export interface IContextMenuEvent {
29
shiftKey?: boolean;
30
ctrlKey?: boolean;
31
altKey?: boolean;
32
metaKey?: boolean;
33
}
34
35
export interface IPopupOptions {
36
x?: number;
37
y?: number;
38
positioningItem?: number;
39
}
40
41
export const CONTEXT_MENU_CHANNEL = 'vscode:contextmenu';
42
export const CONTEXT_MENU_CLOSE_CHANNEL = 'vscode:onCloseContextMenu';
43
44