import type { Menu } from "@vertigis/arcgis-extensions/menus/Menu"; import type { MenuItemModel, MenuModel } from "../menus"; import type { ConfigurableItemUtils } from "./ConfigurableItemUtils"; import type { ModelDesignerSettings } from "./ModelDesignerSettings"; import type * as Settings from "./SettingsSchema"; import type { CommandSettings } from "./commands"; import type { ActionContextType } from "./commands/ActionContextType"; import type { ReportTemplate, WorkflowTemplate } from "./commands/Templates"; export declare const CREATE_MENU_ITEM_TYPE_ID = "create-menu-item"; export declare const MENU_ITEM_TYPE_ID = "menu-item"; export declare const CREATE_SUB_MENU_TYPE_ID = "create-sub-menu"; export declare const SUB_MENU_TYPE_ID = "sub-menu"; export declare const DIVIDER_TYPE_ID: undefined; /** * App Designer settings for a menu. */ export interface MenuDesignerSettings extends ModelDesignerSettings { /** * The menu items in the menu. */ items: Settings.ListItemSettings[]; } /** * App Designer settings for a submenu. */ export interface SubMenuDesignerSettings extends ModelDesignerSettings { /** * Settings for the submenu items. */ submenuItems: Settings.ListItemSettings[]; } /** * App Designer settings for a menu item within a list. */ export interface MenuListItemDesignerSettings extends Pick { } /** * App Designer settings for a menu item. */ export interface MenuItemDesignerSettings extends ModelDesignerSettings { /** * Command settings for the alternate command, if the menu item supports * toggling. */ alternateCommand?: CommandSettings; /** * Description for the alternate command, if the menu item supports * toggling. */ alternateDescription?: string; /** * Icon for the alternate command, if the menu item supports toggling. */ alternateIconId?: string; /** * Title for the alternate command, if the menu item supports toggling. */ alternateTitle?: string; /** * Whether or not the item supports toggling. */ canBeToggled?: boolean; /** * The command settings. */ command?: CommandSettings; /** * Description explaining what the item does, typically displayed in a * tooltip or as secondary menu item text. */ description?: string; /** * List of users who should not be able to see this item. */ hiddenFrom?: string[]; /** * If true, the item will be hidden if its command's canExecute returns * `false`. */ hideOnDisable?: boolean; /** * The item's icon. */ iconId?: string; /** * Settings for sub items if this item is a submenu. */ submenuItems?: Settings.ListItemSettings[]; /** * The report template(s). */ reportTemplate?: ReportTemplate[]; /** * The item's title. */ title: string; /** * A list of users who should be able to see this item (by default, everyone * can). */ visibleTo?: string[]; /** * The workflow template(s). */ workflowTemplate?: WorkflowTemplate[]; } /** * Applies menu settings to a MenuModel. * * @param model The menu to update. * @param items The settings for the menu items. * @param utils The configurable item utils (passed into all App Designer * callbacks). * @param contextType The context type for the menu. */ export declare function applyMenuSettings(model: MenuModel, items: Settings.ListItemSettings[], utils: ConfigurableItemUtils, contextType?: ActionContextType): Promise; /** * Gets the App Designer settings for a menu. * * @param menu The menu to get settings for. * @param utils The configurable item utils (passed into all App Designer * callbacks). */ export declare function getMenuSettings(menu: Menu, utils: ConfigurableItemUtils): Promise; interface MenuListSettingArgs { creationSubsettingsType?: string; id: keyof TSettings; includeSubmenuType?: boolean; /** * Whether the title `Menu Items` should be displayed. */ includeTitle?: boolean; utils: ConfigurableItemUtils; } /** * Get the single schema setting for a menu. */ export declare function getMenuListSetting({ includeSubmenuType, creationSubsettingsType, id, utils, includeTitle, }: MenuListSettingArgs): Promise>; /** * Applies menu item settings to a menu item. * * @param menuItem The menu item to update. * @param settings The settings to apply. * @param utils The configurable item utils (passed into all App Designer * callbacks). * @param contextType The action context type. */ export declare function applyMenuItemSettings(menuItem: MenuItemModel, settings: Partial, utils: ConfigurableItemUtils, contextType?: ActionContextType): Promise; /** * Gets the settings for a menu item. * * @param menuItem The menu item to get. * @param utils The configurable item utils (passed into all App Designer * callbacks). */ export declare function getMenuItemSettings(menuItem: MenuItemModel, utils: ConfigurableItemUtils): Promise; /** * Arguments for getMenuItemSettingsSchema(). */ export interface GetMenuItemSettingsSchemaArgs { /** * The menu item. */ model: MenuItemModel; /** * Configurable item utils. */ utils: ConfigurableItemUtils; /** * The type of context associated with the menu. */ contextType: ActionContextType; /** * Whether to allow editing the description. */ includeDescription?: boolean; /** * Whether to allow editing submenu items. */ includeSubmenu?: boolean; /** * Whether to show toggle-related settings. */ includeToggleSettings?: boolean; /** * Whether to allow editing role-based visibility settings. */ includeVisibilitySettings?: boolean; /** * The set of report templates to show for the reports.run command. */ reportTemplates?: ReportTemplate[]; /** * The set of workflow templates to show for the workflow.run command. */ workflowTemplates?: WorkflowTemplate[]; } /** * Gets the settings schema for a menu item. */ export declare function getMenuItemSettingsSchema({ contextType, includeDescription, includeSubmenu, includeToggleSettings, includeVisibilitySettings, model, utils, reportTemplates, workflowTemplates, }: GetMenuItemSettingsSchemaArgs): Promise>; /** * Gets the settings schema for a new menu item. * * @param settingConfig Additional settings to add to the schema. */ export declare function getNewMenuItemSettingsSchema(settingConfig: Partial>): Promise>; /** * Looks up a menu item within a menu by ID. * * @param menu The menu containing the item. * @param itemId The menu item ID. */ export declare function findMenuItemModelFromMenuModel(menu: MenuModel, itemId: string): MenuItemModel | undefined; interface MenuListItemTypesArgs { creationSubsettingsType?: string; includeSubmenuType?: boolean; utils: ConfigurableItemUtils; } /** * Gets the list item types for a menu. */ export declare function getMenuListItemTypes({ includeSubmenuType, creationSubsettingsType, }: MenuListItemTypesArgs): Settings.ListItemType[]; export {};