import { SvelteComponentTyped } from "svelte";
/**
* Computes the depth of a tree leaf node relative to
.
* Returns the depth of the node (0-based, where 0 is the root level).
* @example
* ```svelte
* import { computeTreeLeafDepth } from 'carbon-components-svelte/src/TreeView/TreeViewNode.svelte';
* let nodeRef;
* $: depth = computeTreeLeafDepth(nodeRef);
*
* Node at depth {depth}
* ```
*/
export declare function computeTreeLeafDepth(node: HTMLElement | null): number;
/**
* Finds the nearest parent tree node
*/
export declare function findParentTreeNode(node: Node | null | undefined): null | HTMLElement;
export type TreeNode = import('./TreeView.svelte').TreeNode;
export type TreeViewNodeProps = TreeNode, Icon extends import("../utils/icon-component.js").IconComponent = any> = {
/**
* Set to `true` if the node has no children.
* @default false
*/
leaf?: boolean;
/**
* @default ""
*/
id?: Node["id"];
/**
* Specify the node text.
* @default ""
*/
text?: string;
/**
* Set to `true` to disable the node.
* @default false
*/
disabled?: boolean;
/**
* 1-based `aria-level` of this node within the tree.
* @default 1
*/
level?: number;
/**
* 1-based `aria-posinset` of this node among its siblings.
* @default 1
*/
posinset?: number;
/**
* `aria-setsize` — the number of siblings (including this node).
* @default 1
*/
setsize?: number;
/**
* Specify the URL the TreeNode links to.
*/
href?: string | undefined;
/**
* Specify the link target.
*/
target?: string | undefined;
/**
* Specify the icon to render.
*/
icon?: Icon | undefined;
children?: (this: void, ...args: [{
node: Node & {
expanded: false;
leaf: boolean;
selected: boolean;
checked: boolean;
indeterminate: boolean;
}
}]) => void;
};
export default class TreeViewNode = TreeNode, Icon extends import("../utils/icon-component.js").IconComponent = any> extends SvelteComponentTyped<
TreeViewNodeProps,
Record,
{
default: {
node: Node & {
expanded: false;
leaf: boolean;
selected: boolean;
checked: boolean;
indeterminate: boolean;
}
};
}
> {}