/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Toolbar
 */
import { IModelApp } from "@itwin/core-frontend";
/** Helper namespace to create toolbar items.
 * @beta
 */
export var ToolbarItemUtilities;
(function (ToolbarItemUtilities) {
    /** Creates an action item. */
    function createActionItem(id, itemPriority, icon, label, execute, overrides) {
        return {
            id,
            itemPriority,
            icon,
            label,
            execute,
            ...overrides,
        };
    }
    ToolbarItemUtilities.createActionItem = createActionItem;
    /** Creates a group item. */
    function createGroupItem(id, itemPriority, icon, label, items, overrides) {
        return {
            id,
            itemPriority,
            icon,
            label,
            items,
            ...overrides,
        };
    }
    ToolbarItemUtilities.createGroupItem = createGroupItem;
    /** Creates a custom item. */
    function createCustomItem(id, itemPriority, icon, label, panelContent, overrides) {
        return {
            id,
            itemPriority,
            icon,
            label,
            panelContent,
            ...overrides,
        };
    }
    ToolbarItemUtilities.createCustomItem = createCustomItem;
    /** Creates an action item from the specified tool type. */
    function createForTool(toolType, overrides) {
        return ToolbarItemUtilities.createActionItem(toolType.toolId, 0, toolType.iconSpec, toolType.flyover, () => {
            void IModelApp.tools.run(toolType.toolId);
        }, {
            description: toolType.description,
            ...overrides,
        });
    }
    ToolbarItemUtilities.createForTool = createForTool;
})(ToolbarItemUtilities || (ToolbarItemUtilities = {}));
//# sourceMappingURL=ToolbarItemUtilities.js.map