@openvcs/sdk 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/menubar.d.ts +46 -0
- package/lib/types/menubar.js +4 -0
- package/package.json +1 -1
- package/src/lib/types/index.ts +1 -0
- package/src/lib/types/menubar.ts +48 -0
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
__exportStar(require("./host"), exports);
|
|
20
|
+
__exportStar(require("./menubar"), exports);
|
|
20
21
|
__exportStar(require("./plugin"), exports);
|
|
21
22
|
__exportStar(require("./protocol"), exports);
|
|
22
23
|
__exportStar(require("./vcs"), exports);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** API for manipulating top-level application menus. */
|
|
2
|
+
export interface MenubarManager {
|
|
3
|
+
/** Gets a menu by ID (e.g., 'file', 'repository', 'help'). Returns null if not found. */
|
|
4
|
+
get(menuId: string): MenubarMenu | null;
|
|
5
|
+
/** Gets a menu by ID, creating it if it doesn't exist. */
|
|
6
|
+
getOrCreate(menuId: string, label: string): MenubarMenu;
|
|
7
|
+
/** Creates a new menu at the specified position. */
|
|
8
|
+
create(menuId: string, label: string, options?: {
|
|
9
|
+
before?: string;
|
|
10
|
+
after?: string;
|
|
11
|
+
}): MenubarMenu;
|
|
12
|
+
/** Removes a menu entirely. */
|
|
13
|
+
remove(menuId: string): void;
|
|
14
|
+
/** Hides a menu (visibility: hidden). */
|
|
15
|
+
hide(menuId: string): void;
|
|
16
|
+
/** Shows a hidden menu. */
|
|
17
|
+
show(menuId: string): void;
|
|
18
|
+
}
|
|
19
|
+
/** Handle for manipulating a specific menu. */
|
|
20
|
+
export interface MenubarMenu {
|
|
21
|
+
/** Menu ID. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Adds an item to this menu. */
|
|
24
|
+
addItem(item: MenubarItem): void;
|
|
25
|
+
/** Adds a separator to this menu. */
|
|
26
|
+
addSeparator(beforeAction?: string): void;
|
|
27
|
+
/** Removes an item by action ID. */
|
|
28
|
+
removeItem(actionId: string): void;
|
|
29
|
+
/** Hides an item by action ID. */
|
|
30
|
+
hideItem(actionId: string): void;
|
|
31
|
+
/** Shows a hidden item. */
|
|
32
|
+
showItem(actionId: string): void;
|
|
33
|
+
}
|
|
34
|
+
/** Descriptor for a menu item. */
|
|
35
|
+
export interface MenubarItem {
|
|
36
|
+
/** Display label. */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Action ID (plugin must register handler separately). */
|
|
39
|
+
action: string;
|
|
40
|
+
/** Optional tooltip. */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Insert before this action ID. */
|
|
43
|
+
before?: string;
|
|
44
|
+
/** Insert after this action ID. */
|
|
45
|
+
after?: string;
|
|
46
|
+
}
|
package/package.json
CHANGED
package/src/lib/types/index.ts
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright © 2025-2026 OpenVCS Contributors
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
/** API for manipulating top-level application menus. */
|
|
5
|
+
export interface MenubarManager {
|
|
6
|
+
/** Gets a menu by ID (e.g., 'file', 'repository', 'help'). Returns null if not found. */
|
|
7
|
+
get(menuId: string): MenubarMenu | null;
|
|
8
|
+
/** Gets a menu by ID, creating it if it doesn't exist. */
|
|
9
|
+
getOrCreate(menuId: string, label: string): MenubarMenu;
|
|
10
|
+
/** Creates a new menu at the specified position. */
|
|
11
|
+
create(menuId: string, label: string, options?: { before?: string; after?: string }): MenubarMenu;
|
|
12
|
+
/** Removes a menu entirely. */
|
|
13
|
+
remove(menuId: string): void;
|
|
14
|
+
/** Hides a menu (visibility: hidden). */
|
|
15
|
+
hide(menuId: string): void;
|
|
16
|
+
/** Shows a hidden menu. */
|
|
17
|
+
show(menuId: string): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Handle for manipulating a specific menu. */
|
|
21
|
+
export interface MenubarMenu {
|
|
22
|
+
/** Menu ID. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Adds an item to this menu. */
|
|
25
|
+
addItem(item: MenubarItem): void;
|
|
26
|
+
/** Adds a separator to this menu. */
|
|
27
|
+
addSeparator(beforeAction?: string): void;
|
|
28
|
+
/** Removes an item by action ID. */
|
|
29
|
+
removeItem(actionId: string): void;
|
|
30
|
+
/** Hides an item by action ID. */
|
|
31
|
+
hideItem(actionId: string): void;
|
|
32
|
+
/** Shows a hidden item. */
|
|
33
|
+
showItem(actionId: string): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Descriptor for a menu item. */
|
|
37
|
+
export interface MenubarItem {
|
|
38
|
+
/** Display label. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** Action ID (plugin must register handler separately). */
|
|
41
|
+
action: string;
|
|
42
|
+
/** Optional tooltip. */
|
|
43
|
+
title?: string;
|
|
44
|
+
/** Insert before this action ID. */
|
|
45
|
+
before?: string;
|
|
46
|
+
/** Insert after this action ID. */
|
|
47
|
+
after?: string;
|
|
48
|
+
}
|