UNPKG

2.25 kBTypeScriptView Raw
1import { Disposable } from '../disposable';
2import { CompoundMenuNode, CompoundMenuNodeMetadata, CompoundMenuNodeRole, MenuNode, SubMenuOptions } from './menu-types';
3/**
4 * Node representing a (sub)menu in the menu tree structure.
5 */
6export declare class CompositeMenuNode implements MenuNode, CompoundMenuNode, CompoundMenuNodeMetadata {
7 readonly id: string;
8 label?: string | undefined;
9 readonly parent?: (MenuNode & CompoundMenuNode) | undefined;
10 protected readonly _children: MenuNode[];
11 iconClass?: string;
12 order?: string;
13 readonly when?: string;
14 readonly _role?: CompoundMenuNodeRole;
15 constructor(id: string, label?: string | undefined, options?: SubMenuOptions, parent?: (MenuNode & CompoundMenuNode) | undefined);
16 get icon(): string | undefined;
17 get children(): ReadonlyArray<MenuNode>;
18 get role(): CompoundMenuNodeRole;
19 /**
20 * Inserts the given node at the position indicated by `sortString`.
21 *
22 * @returns a disposable which, when called, will remove the given node again.
23 */
24 addNode(node: MenuNode): Disposable;
25 /**
26 * Removes the first node with the given id.
27 *
28 * @param id node id.
29 */
30 removeNode(id: string): void;
31 get sortString(): string;
32 get isSubmenu(): boolean;
33 /** @deprecated @since 1.28 use CompoundMenuNode.isNavigationGroup instead */
34 static isNavigationGroup: typeof CompoundMenuNode.isNavigationGroup;
35}
36export declare class CompositeMenuNodeWrapper implements MenuNode, CompoundMenuNodeMetadata {
37 protected readonly wrapped: Readonly<CompositeMenuNode>;
38 readonly parent: MenuNode & CompoundMenuNode;
39 protected readonly options?: SubMenuOptions | undefined;
40 constructor(wrapped: Readonly<CompositeMenuNode>, parent: MenuNode & CompoundMenuNode, options?: SubMenuOptions | undefined);
41 get id(): string;
42 get label(): string | undefined;
43 get sortString(): string;
44 get isSubmenu(): boolean;
45 get role(): CompoundMenuNodeRole;
46 get icon(): string | undefined;
47 get iconClass(): string | undefined;
48 get order(): string | undefined;
49 get when(): string | undefined;
50 get children(): ReadonlyArray<MenuNode>;
51}
52//# sourceMappingURL=composite-menu-node.d.ts.map
\No newline at end of file