@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
16 lines (15 loc) • 768 B
TypeScript
import { PropTypes } from '@zag-js/vue';
import { ComputedRef, MaybeRef } from 'vue';
import { EmitFn, Optional } from '../../types';
import { TreeCollection, TreeNode } from '../collection';
import { RootEmits } from './tree-view.types';
import * as treeView from '@zag-js/tree-view';
export interface UseTreeViewProps<T extends TreeNode> extends Optional<Omit<treeView.Props, 'dir' | 'getRootNode' | 'collection'>, 'id'> {
/**
* The collection of tree nodes
*/
collection: TreeCollection<T>;
}
export interface UseTreeViewReturn<T extends TreeNode> extends ComputedRef<treeView.Api<PropTypes, T>> {
}
export declare const useTreeView: <T extends TreeNode>(props: MaybeRef<UseTreeViewProps<T>>, emit?: EmitFn<RootEmits<T>>) => UseTreeViewReturn<T>;