/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/treeItem` component represents an item in a tree structure. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-tree-item/documentation | Lightning Tree Item Documentation} */ declare module "lightning/treeItem" { import { LightningElement } from "lwc"; /** * EndIcon interface as defined in the implementation. */ interface EndIcon { alternativeText?: string; iconName: string; size?: "xx-small" | "x-small" | "small" | "medium" | "large"; src?: string; variant?: "inverse" | "success" | "warning" | "error"; } /** * TreeNode interface key-value pairs that can be passed in items array. */ interface TreeNode { name?: string; label?: string; metatext?: string; endIcon?: string; href?: string; disabled?: boolean; expanded?: boolean; items?: TreeNode[]; } /** * Represents an item in a tree structure. */ export default class LightningTreeItem extends LightningElement { /** * Whether this item is the root of the tree. */ isRoot: boolean; /** * The label for the tree item. */ label: string; /** * Additional text to display for the tree item. */ metatext?: string; /** * Reference to the node data. */ nodeRef?: TreeNode; /** * Whether the tree item is expanded. */ isExpanded?: boolean; /** * Whether the tree item is disabled. */ isDisabled: boolean; /** * The name of the node. */ nodename?: string; /** * The key of the node. */ nodeKey?: string; /** * Whether the tree item is a leaf node. */ isLeaf?: boolean; /** * Whether the tree item is selected. */ selected?: boolean; /** * The icon to display at the end of the tree item. */ endIcon?: EndIcon; /** * The child items of this tree item. */ childItems: TreeNode[]; /** * The index of the focused child, or null if none. */ focusedChild: number | null; /** * The href for the tree item link. */ href?: string; } }