import React from "react";
import { MenuProps } from "antd";

//#region src/components/sort/types.d.ts
/** 单个排序子项（如 A→Z、0→9），由组件的 getSortItems 返回 */
type SortOptionItem = {
  key: string;
  label: string;
};
type SortItemProps = {
  /** 排序类型，与 sortChildrenMap 对应；当 getSortItems 存在时可省略 */type?: "date" | "string" | "number" | "option";
  label?: string;
  name?: string | string[];
  isCustom: boolean;
  columnKey?: string;
  localFilter?: boolean;
  isHidden?: boolean; /** 由组件内置导出：直接返回该列的排序子项，优先于 type */
  getSortItems?: (fieldKey: string) => SortOptionItem[];
};
type SortListProps = {
  list: SortItemProps[];
  onChange?: (val: string, detail: Parameters<Required<MenuProps>["onClick"]>[0]) => void;
  button?: React.ReactNode;
  style?: React.CSSProperties;
  value?: any;
  placement?: "bottom" | "bottomLeft" | "bottomRight" | "top" | "topLeft" | "topRight";
  localPagination?: boolean;
};
//#endregion
export { SortListProps };