File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,32 @@ declare global {
28
28
}
29
29
30
30
interface DesktopApi {
31
- selectApplication ?: ( ) => Promise < string | undefined >
31
+ selectApplication ?: ( ) => Promise < string | undefined > ;
32
+ openContextMenu ?: ( options : NativeContextMenuDefinition ) => Promise < string | undefined > ;
33
+ }
34
+
35
+ interface NativeContextMenuDefinition {
36
+ position : { x : number ; y : number } ;
37
+ items : readonly NativeContextMenuItem [ ] ;
38
+ }
39
+
40
+ export type NativeContextMenuItem =
41
+ | NativeContextMenuOption
42
+ | NativeContextMenuSubmenu
43
+ | { type : 'separator' } ;
44
+
45
+ interface NativeContextMenuOption {
46
+ type : 'option' ;
47
+ id : string ;
48
+ label : string ;
49
+ enabled ?: boolean ;
50
+ }
51
+
52
+ interface NativeContextMenuSubmenu {
53
+ type : 'submenu' ;
54
+ label : string ;
55
+ enabled ?: boolean ;
56
+ items : readonly NativeContextMenuItem [ ] ;
32
57
}
33
58
34
59
export const DesktopApi : DesktopApi = window . desktopApi ?? { } ;
You can’t perform that action at this time.
0 commit comments