Files
clipforge-game-clipper/.pnpm-store/v11/files/f0/0f8521a20eef6b8359f118220efecd1da36d018c0e147e0854a103b96978f4516bcb28a0fac119c9c6e64e349a976c3ad60ebfd9c5e9851f9b399ee5a1b047
T

31 lines
1.3 KiB
Plaintext
Raw Normal View History

2026-09-09 10:21:29 +02:00
import { MenuItemBase } from './base';
/** Options for creating a new menu item. */
export interface MenuItemOptions {
/** Specify an id to use for the new menu item. */
id?: string;
/** The text of the new menu item. */
text: string;
/** Whether the new menu item is enabled or not. */
enabled?: boolean;
/** Specify an accelerator for the new menu item. */
accelerator?: string;
/** Specify a handler to be called when this menu item is activated. */
action?: (id: string) => void;
}
/** A menu item inside a {@linkcode Menu} or {@linkcode Submenu} and contains only text. */
export declare class MenuItem extends MenuItemBase {
/** @ignore */
protected constructor(rid: number, id: string);
/** Create a new menu item. */
static new(opts: MenuItemOptions): Promise<MenuItem>;
/** Returns the text of this menu item. */
text(): Promise<string>;
/** Sets the text for this menu item. */
setText(text: string): Promise<void>;
/** Returns whether this menu item is enabled or not. */
isEnabled(): Promise<boolean>;
/** Sets whether this menu item is enabled or not. */
setEnabled(enabled: boolean): Promise<void>;
/** Sets the accelerator for this menu item. */
setAccelerator(accelerator: string | null): Promise<void>;
}