@mui/x-tree-view
Version:
The community edition of the MUI X Tree View components.
28 lines • 1.46 kB
TypeScript
import { TreeViewItemId } from "../../../models/index.js";
import { TreeViewItemMeta } from "../../models/index.js";
import type { SimpleTreeViewStore } from "../../SimpleTreeViewStore/index.js";
export declare class TreeViewJSXItemsPlugin {
private store;
constructor(store: SimpleTreeViewStore<any>);
/**
* Insert a new item in the state from a Tree Item component.
* @param {TreeViewItemMeta} item The meta-information of the item to insert.
* @returns {() => void} A function to remove the item from the state.
*/
insertJSXItem: (item: TreeViewItemMeta) => () => void;
/**
* Updates the `labelMap` to register the first character of the given item's label.
* This map is used to navigate the tree using type-ahead search.
* @param {TreeViewItemId} itemId The id of the item to map the label of.
* @param {string} label The item's label.
* @returns {() => void} A function to remove the item from the `labelMap`.
*/
mapLabelFromJSX: (itemId: TreeViewItemId, label: string) => () => void;
/**
* Store the ids of a given item's children in the state.
* Those ids must be passed in the order they should be rendered.
* @param {TreeViewItemId | null} parentId The id of the item to store the children of.
* @param {TreeViewItemId[]} orderedChildrenIds The ids of the item's children.
*/
setJSXItemsOrderedChildrenIds: (parentId: TreeViewItemId | null, orderedChildrenIds: TreeViewItemId[]) => void;
}