UNPKG

tav-ui

Version:
68 lines (67 loc) 2.15 kB
import type { ExtractPropTypes } from 'vue'; import type { AntTreeNodeCheckedEvent as CheckEventOrigin, TreeDataItem } from 'ant-design-vue/es/tree/Tree'; export declare const treeProps: {}; export declare type TreeProps = ExtractPropTypes<typeof treeProps>; export declare type Recordable<T = any> = Record<string, T>; export declare type Record<K extends keyof any, T> = { [P in K]: T; }; export interface TreeActionItem { render: (record: Recordable) => any; show?: boolean | ((record: Recordable) => boolean); } export interface TreeItem extends TreeDataItem { icon?: any; } export interface FieldNames { children?: string; title?: string; key?: string; id?: string; pid?: string; } export declare type Keys = (string | number)[]; export declare type CheckKeys = (string | number)[] | { checked: (string | number)[]; halfChecked: (string | number)[]; }; export interface TreeActionType { checkAll: (checkAll: boolean) => void; expandAll: (expandAll: boolean) => void; setExpandedKeys: (keys: Keys) => void; getExpandedKeys: () => Keys; setSelectedKeys: (keys: Keys) => void; getSelectedKeys: () => Keys; setCheckedKeys: (keys: CheckKeys) => void; getCheckedKeys: () => CheckKeys; filterByLevel: (level: number) => void; insertNodeByKey: (opt: InsertNodeParams) => void; insertNodesByKey: (opt: InsertNodeParams) => void; deleteNodeByKey: (key: string) => void; updateNodeByKey: (key: string, node: TreeDataItem) => void; setSearchValue: (value: string) => void; getSearchValue: () => string; } export interface InsertNodeParams { parentKey: string | null; node: TreeDataItem; list?: TreeDataItem[]; push?: 'push' | 'unshift'; } export interface ContextMenuOptions { icon?: string; styles?: any; items?: ContextMenuItem[]; } export interface ContextMenuItem { label: string; icon?: string; disabled?: boolean; handler?: Fn; divider?: boolean; children?: ContextMenuItem[]; } export interface Fn<T = any, R = T> { (...arg: T[]): R; } export declare type CheckEvent = CheckEventOrigin;