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 {
2828}
2929
3030interface 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 [ ] ;
3257}
3358
3459export const DesktopApi : DesktopApi = window . desktopApi ?? { } ;
You can’t perform that action at this time.
0 commit comments