import { IDataHook } from "model-react"; import { IPrioritizedMenuItem } from "../../menus/menu/_types/IPrioritizedMenuItem"; import { ISubscribable } from "../../utils/subscribables/_types/ISubscribable"; import { IAction } from "../_types/IAction"; import { IActionBinding } from "../_types/IActionBinding"; import { IActionNodeWithTargets } from "../_types/IActionNode"; import { IActionTarget } from "../_types/IActionTarget"; import { IIndexedActionBinding } from "../_types/IIndexedActionBinding"; import { IContextMenuItemData } from "./_types/IContextMenuItemData"; export declare type IOverrideContextItem = { node: IContextItemNode; contextItem: IContextMenuItemData; }; export declare type IContextItemNode = Omit & { contextItems: IContextMenuItemData[]; children: IContextItemNode[]; descendantBindings?: IIndexedActionBinding[]; descendantTargets?: IActionTarget[]; descendantContextItems?: Map; }; /** * Retrieves all the context items for the given targets * @param contextItemData The context item data to collect the final items from * @param sourceItems The items to retrieve the context items from * @param extraBindings Extra bindings that shouldn't contribute to the itemCount, but should be used to show items in the menu * @param hook A hook to subscribe to changes * @returns The context items */ export declare function collectContextMenuItems(contextItemData: IContextMenuItemData[], sourceItems: IActionTarget[], extraBindings?: ISubscribable[]>, hook?: IDataHook): IPrioritizedMenuItem[]; /** * Obtains the prioritized menu item with the selection count as a category * @param prioritizedItem The item to add the count category to * @param count The number of items that have a binding for this item * @param total The total number of items * @returns The item with the category */ export declare function getItemWithCountCategory(prioritizedItem: IPrioritizedMenuItem, count: number, total: number): IPrioritizedMenuItem; /** * Retrieves all descendant (self + recursive children) bindings for a given node, and caches them within the node * @param node The node to retrieve the descendant bindings for * @returns All the descendant bindings */ export declare function getDescendantBindings(node: IContextItemNode): IIndexedActionBinding[]; /** * Retrieves all descendant (self + recursive children) targets for a given node, and caches them within the node * @param node The node to retrieve the descendant targets for * @returns All the descendant targets */ export declare function getDescendantTargets(node: IContextItemNode): IActionTarget[]; /** * Retrieves all descendant (self + recursive children) context items (CI) for a given node in the order of furthest up to furthest down the tree, such that a CI is only included if it covers all descendant items. * It also caches the result within the node * @param node The node to retrieve the descendant context items for * @param targetAction The action that the found context items should be overrides for * @returns All the descendant context items */ export declare function getCommonDescendantContextItems(node: IContextItemNode, targetAction: IAction): IOverrideContextItem[]; //# sourceMappingURL=collectContextMenuItems.d.ts.map