import Vue from 'vue'; import { CombinedVueInstance } from 'vue/types/vue'; import { VNode } from 'vue/types/vnode'; export interface TreeValue { /** * The value of the node. */ value: string | number; /** * Status, 'all' means all of children are selected or the node itself is selected. */ status: 'all' | 'partial'; /** * The child nodes. */ children?: TreeValue[]; } export interface TreeOption { /** * The id attribute for HTML element. */ id?: string; /** * The text content for display. */ label: string; /** * The value of the option. */ value?: string | number; /** * The nested child options, if provided in flat mode, the value of the option itself will be ignored. */ children?: TreeOption[]; } /** * @internal * Maps tree options to selected value */ export interface TreeOptionSelectedMap { [p: string]: boolean | TreeOptionSelectedMap; [p: number]: boolean | TreeOptionSelectedMap; } export interface TreeProps { /** * Selected values, use for v-model two-way binding with event `change` */ value: (string | number)[] | TreeValue[]; /** * The options array for selecting */ options: TreeOption[]; /** * Change the behavior of partially selected options to 'unselect all'. */ partialToUnselectAll: boolean; /** * Flat mode, use on-dimensional array for bound value. * Note that the value of none-end nodes in options will be ignore. */ flat: boolean; } export interface TreeEvents { onChange(value: (string | number)[] | TreeValue[]): void; } export interface TreeData { expandedOptions: TreeOption[]; selectedMap: TreeOptionSelectedMap; } export interface TreeMethods { switchExpand(option: TreeOption): void; change(option: TreeOption, valuePath: (string | number)[]): void; renderOption(option: TreeOption, index: number, level: number, indent: boolean, valuePath: (string | number)[]): VNode; } export interface TreeComputed { } export declare type TreeInstance = CombinedVueInstance; declare const _default: import("../../utils/create/component").TsxComponent, {}, {}>; export default _default;