import type { FC } from "react";
import type { BasicSelectTreeProps } from "../Basic";

export interface DictionarySelectTreeItem {
  dictValue: string;
  dictLabel: string;
  children: DictionarySelectTreeItem[];
  [key: string]: any;
}

/**
 * 组件属性
 */
export interface DictionarySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
  /** appKey，默认 DICTIONARY_APP_KEY_ENUM.DEFAULT（0bb989ecada5470c87635018ece9f327） */
  appKey?: string;
  /** 要获取的字典 */
  dictValue: string;
  /** 树形数据 label 字段，默认 dictLabel */
  nameKey?: string;
  /** 树形数据 value 字段，默认 dictValue */
  idKey?: string;
  /** 获取父级节点 */
  onGetNodePaths?: (nodes: DictionarySelectTreeItem[]) => void;
  /** 获取数据 */
  onGetData?: (data: DictionarySelectTreeItem[], processedData: DictionarySelectTreeItem[]) => void;
}

/**
 * 数据字典下拉树组件
 */
declare const DictionarySelectTree: FC<DictionarySelectTreeProps>;

export default DictionarySelectTree;
