import Collection, { type CollectionChangeEvent } from "@arcgis/core/core/Collection"; import { Menu } from "@vertigis/arcgis-extensions/menus/Menu"; import type { MenuItemProperties } from "@vertigis/arcgis-extensions/menus/MenuItem"; import type { InitializableBaseEvents } from "@vertigis/arcgis-extensions/support/InitializableBase"; import type { AnalyticsContext } from "@vertigis/viewer-spec/analytics/AnalyticsContext"; import type { MenuModelProperties as GvfMenuModelProperties } from "@vertigis/viewer-spec/app-config/common/MenuModelProperties"; import type { AuthenticationService } from "../authentication/AuthenticationService"; import type { MessageBus } from "../messaging"; import type { ComponentModel, ComponentModelProperties, PropertyDefs } from "../models"; import type { InjectionContainer } from "../services/InjectionContainer"; import type { UIService } from "../ui"; import type { MenuItemModel, MenuItemModelProperties } from "./MenuItemModel"; /** * Serializable properties for MenuModel. */ export interface MenuModelProperties extends Omit, ComponentModelProperties { /** * The list of menu items. */ items?: (MenuItemModel | MenuItemProperties)[]; } /** * @inheritdoc */ interface MenuModelEvents extends InitializableBaseEvents { /** * Called when a child is activated. */ "child-activated": string | undefined; } /** * MenuModel provides a general purpose, loosely coupled model for defining * menus that can be accessed by any module. */ export declare class MenuModel = MenuItemModel> extends Menu implements ComponentModel { /** * @deprecated Do not directly reference this property. Use EventNames and * EventTypes helpers from @arcgis/core/Evented. */ readonly "@eventTypes": MenuModelEvents; /** * @inheritdoc */ icon: string | undefined; /** * @inheritdoc */ isLandmark: boolean | undefined; injectionContainer: InjectionContainer; /** * Filters that determine whether the MenuModel is visible to a given * end-user. If both visibleTo and hiddenFrom are undefined/empty, the * component will be visible to all users. Visibility filters will only be * acknowledged on MenuModels coupled with layout components. */ readonly visibleTo: Collection; /** * Filters that determine whether the MenuModel is hidden from a given * end-user. If both visibleTo and hiddenFrom are undefined/empty, the * component will be visible to all users. Visibility filters will only be * acknowledged on MenuModels coupled with layout components. */ readonly hiddenFrom: Collection; /** * This will only be defined when created by the app container. Any * component that creates its own instance of a MenuModel will need to set * this property explicitly. */ private _uiService; private _changeHandle; private _messages; private _authService; private readonly _initializeHandles; private readonly _componentIsInitialized; get messages(): MessageBus; set messages(value: MessageBus); get authService(): AuthenticationService; set authService(value: AuthenticationService); get uiService(): UIService; set uiService(value: UIService); private get _componentIds(); /** * Returns whether or not the Menu Item will be visible to the user. * Visibility filters will only be acknowledged on MenuModels that are * coupled with layout components. */ get isVisibleToUser(): boolean; /** * Traverses the entire Menu tree and executes a given function with each * {@link MenuItemModel}, and returns if/when the function returns a defined * value. * * @param modelHandler A function that gets executed with every encountered * {@link MenuItemModel}. The return of a defined value stops the traversal * and returns that value. */ walkDownTree(modelHandler: (item: TMenuItem) => U): U | undefined; /** * Creates a clone of the menu and all of its items. */ clone(): this; /** * Gets information that can be useful for reporting actions this component * performs to VertiGIS Studio Analytics. */ getAnalyticsContext(): AnalyticsContext; /** * @inheritdoc */ protected _onInitialize(): Promise; protected _onDestroy(): Promise; /** * When the collection changes, we'll need to decide how to handle the * elements. Removals and clears remove from the executable list, Additions * need only re execute canExecuteChanged to decide whether to display or * not. * * @param event Indicate the type of change made to the menu items. */ protected _handleMenuItemsChanged(event: CollectionChangeEvent): Promise; protected _getSerializableProperties(): PropertyDefs; private _childComponentIds; } export {};