import Collection from "@arcgis/core/core/Collection"; import type { MenuItemProperties } from "@vertigis/arcgis-extensions/menus/MenuItem"; import { MenuItem } from "@vertigis/arcgis-extensions/menus/MenuItem"; import { Cancellable } from "@vertigis/arcgis-extensions/support/Cancellable"; import type { AnalyticsContext } from "@vertigis/viewer-spec/analytics/AnalyticsContext"; import type { AuthenticationService } from "../authentication/AuthenticationService"; import type { MessageBus } from "../messaging"; import type { ComponentModel, ComponentModelProperties, PropertyDefs } from "../models"; import type { UIService } from "../ui"; import type { MenuModel, MenuModelProperties } from "./MenuModel"; /** * Serializable properties for MenuItemModel. */ export interface MenuItemModelProperties extends MenuItemProperties, ComponentModelProperties { } /** * MenuItemModel provides a general purpose, loosely coupled model for an * individual menu item contained in a menu. */ export declare class MenuItemModel extends MenuItem implements ComponentModel { /** * Context bound to the menu item, which gets used as arguments when then * menu item's execute() function get called. */ context?: unknown; /** * Filters that determine whether the MenuItemModel is visible to a given * end-user. If both visibleTo and hiddenFrom are undefined/empty, the * component will be visible to all users. */ readonly visibleTo: Collection; /** * Filters that determine whether the MenuItemModel is hidden from a given * end-user. If both visibleTo and hiddenFrom are undefined/empty, the * component will be visible to all users. */ readonly hiddenFrom: Collection; private _cancellable; private _messages; private _authService; private _uiService; private _isLandmark; private _isExecuting; constructor(props?: TMenuItemProps); /** * Creates a `MenuItemModel` that represents a divider. */ static createDivider(): MenuItemModel; get menu(): MenuModel; get submenu(): MenuModel; set submenu(value: MenuModel); /** * Returns whether or not the Menu Item will be visible to the user. */ get isVisibleToUser(): boolean; get authService(): AuthenticationService; set authService(value: AuthenticationService); get uiService(): UIService; set uiService(value: UIService); get isLandmark(): boolean | undefined; set isLandmark(value: boolean | undefined); get icon(): string; set icon(value: string); get isDivider(): boolean; get isExecuting(): boolean; get isEnabled(): boolean; set isEnabled(value: boolean); get messages(): MessageBus; set messages(value: MessageBus); /** * Gets information that can be useful for reporting actions this component * performs to VertiGIS Studio Analytics. */ getAnalyticsContext(): AnalyticsContext; /** * Executes the command associated with the {@link MenuItem}. */ execute(): Promise; /** * Cancels execution of the command if it's running. */ cancel(): Cancellable | void; /** * Creates a clone of the item and its submenu. */ clone(): this; /** * Update toggle state if default action is not executable and alternate is * executable. */ updateToggleState(): void; protected _onInitialize(): Promise; /** * @inheritdoc */ protected _onDestroy(): Promise; protected _getSerializableProperties(): PropertyDefs; /** * Initializes all commands associated with any action that's configured on * a menu item. */ private _initializeCommands; }