diff --git a/typings/index.d.ts b/typings/index.d.ts index 5d1667e..6a057b0 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4,96 +4,178 @@ * Author: eidng8 */ -import { G8TreeView as VueTree } from './vue-tree'; +import { Vue } from 'vue-property-decorator'; /** - * A tree view component with stable DOM structure. Stable means its structure - * will not change once rendered. This component uses CSS to toggle sub-tree. - * To improve performance, sub-trees are not rendered until they are first - * expanded. Once expanded, further collapse/expand action won't cause the - * sub-tree to be rendered again. Currently there is an - * [issue](https://github.com/eidng8/vue-tree/issues/24) about performance - * problem of large tree data set. - */ -declare class G8TreeView extends VueTree {} - -/** - * Tree data + * Tree item data */ declare interface G8TreeItem { /** - * Item key, serves as identifier + * Just to allow accessing data via index syntax and arbitrary data to fit in. */ - key: number | string; + [key: string]: unknown; /** - * Item name (its label) + * Item name, serves as label, will be rendered as node label. */ - name: string; + name?: string; /** - * Checkbox state + * Whether current node is checked. */ checked?: boolean; /** - * Intermediate check box state. `true` while some of the children were + * Intermediate check box state. Active while some of the children were * checked, but not all. */ intermediate?: boolean; /** - * Tags attached to the item + * Whether the sub-tree of this node has been rendered. + */ + rendered?: boolean; + + /** + * List of tags. */ tags?: G8TreeItemTag[]; /** - * List of child items + * List of child nodes. */ children?: G8TreeItem[]; } /** - * Item tag data, rendered using `