import type { TreeSelectProps } from "antd/es/tree-select";
import type { FC } from "react";

/**
 * 组件属性
 */
export interface BasicSelectTreeProps extends Omit<TreeSelectProps, "fieldNames"> {
  /** 树形数据 label 字段，默认 name */
  nameKey?: string;
  /** 树形数据 value 字段，默认 id */
  idKey?: string;
  /** 树形数据 children 字段，默认 children */
  childrenKey?: string;
  /** @deprecated 已弃用，请使用 getNodePathsIsIncludeOneself */
  onGetNodePathsIsIncludeOneself?: boolean;
  /** 决定 onGetNodePaths 是否包含自身节点，默认 true */
  getNodePathsIsIncludeOneself?: boolean;
  /** 获取父级节点 */
  onGetNodePaths?: (nodes: Record<string, any>[]) => void;
  /** 占位符 */
  placeholder?: string;
  /** 控制只能选择到第几级 */
  level?: number;
  /** 获取 label */
  onGetLabel?: (label: string | string[]) => void;
  /** 获取数据 */
  onGetData?: (data: Record<string, any>[], processedData: Record<string, any>[]) => void;
  /** 是否只允许选择最后一级，默认 false */
  onlyLastLevel?: boolean;
}

/**
 * 基础下拉树组件
 */
declare const BasicSelectTree: FC<BasicSelectTreeProps>;

export default BasicSelectTree;
