import * as LitHtml from '../../lit-html/lit-html.js';
import { type TreeNodeId, type TreeNode } from './TreeOutlineUtils.js';
export interface TreeOutlineData {
defaultRenderer: (node: TreeNode, state: {
isExpanded: boolean;
}) => LitHtml.TemplateResult;
/**
* Note: it is important that all the TreeNode objects are unique. They are
* used internally to the TreeOutline as keys to track state (such as if a
* node is expanded or not), and providing the same object multiple times will
* cause issues in the TreeOutline.
*/
tree: readonly TreeNode[];
filter?: (node: TreeNodeDataType) => FilterOption;
compact?: boolean;
}
export declare function defaultRenderer(node: TreeNode): LitHtml.TemplateResult;
export declare class ItemSelectedEvent extends Event {
static readonly eventName = "itemselected";
data: {
node: TreeNode;
};
constructor(node: TreeNode);
}
export declare class ItemMouseOverEvent extends Event {
static readonly eventName = "itemmouseover";
data: {
node: TreeNode;
};
constructor(node: TreeNode);
}
export declare class ItemMouseOutEvent extends Event {
static readonly eventName = "itemmouseout";
data: {
node: TreeNode;
};
constructor(node: TreeNode);
}
/**
*
* The tree can be filtered by providing a custom filter function.
* The filter is applied on every node when constructing the tree
* and proceeds as follows:
* - If the filter return SHOW for a node, the node is included in the tree.
* - If the filter returns FLATTEN, the node is ignored but its subtree is included.
*/
export declare const enum FilterOption {
SHOW = "SHOW",
FLATTEN = "FLATTEN"
}
export declare class TreeOutline extends HTMLElement {
#private;
static readonly litTagName: import("../../lit-html/static.js").Static;
static get observedAttributes(): string[];
attributeChangedCallback(name: 'nowrap' | 'toplevelbordercolor', oldValue: string | null, newValue: string | null): void;
connectedCallback(): void;
get data(): TreeOutlineData;
set data(data: TreeOutlineData);
/**
* Recursively expands the tree from the root nodes, to a max depth. The max
* depth is 0 indexed - so a maxDepth of 2 (default) will expand 3 levels: 0,
* 1 and 2.
*/
expandRecursively(maxDepth?: number): Promise;
/**
* Collapses all nodes in the tree.
*/
collapseAllNodes(): Promise;
/**
* Takes a TreeNode, expands the outline to reveal it, and focuses it.
*/
expandToAndSelectTreeNode(targetTreeNode: TreeNode): Promise;
/**
* Takes a TreeNode ID, expands the outline to reveal it, and focuses it.
*/
expandToAndSelectTreeNodeId(targetTreeNodeId: TreeNodeId): Promise;
/**
* Takes a list of TreeNode IDs and expands the corresponding nodes.
*/
expandNodeIds(nodeIds: TreeNodeId[]): Promise;
/**
* Takes a TreeNode ID and focuses the corresponding node.
*/
focusNodeId(nodeId: TreeNodeId): Promise;
collapseChildrenOfNode(domNode: HTMLLIElement): Promise;
}
declare global {
interface HTMLElementTagNameMap {
'devtools-tree-outline': TreeOutline;
}
}