index.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import * as React from 'react';
  2. import type { ColumnsType, ColumnType, Direction, FixedType, GetRowKey, Key, RenderExpandIcon, TriggerEventHandler } from '../../interface';
  3. export declare function convertChildrenToColumns<RecordType>(children: React.ReactNode): ColumnsType<RecordType>;
  4. /**
  5. * Parse `columns` & `children` into `columns`.
  6. */
  7. declare function useColumns<RecordType>({ prefixCls, columns, children, expandable, expandedKeys, columnTitle, getRowKey, onTriggerExpand, expandIcon, rowExpandable, expandIconColumnIndex, expandedRowOffset, direction, expandRowByClick, columnWidth, fixed, scrollWidth, clientWidth, }: {
  8. prefixCls?: string;
  9. columns?: ColumnsType<RecordType>;
  10. children?: React.ReactNode;
  11. expandable: boolean;
  12. expandedKeys: Set<Key>;
  13. columnTitle?: React.ReactNode;
  14. getRowKey: GetRowKey<RecordType>;
  15. onTriggerExpand: TriggerEventHandler<RecordType>;
  16. expandIcon?: RenderExpandIcon<RecordType>;
  17. rowExpandable?: (record: RecordType) => boolean;
  18. expandIconColumnIndex?: number;
  19. direction?: Direction;
  20. expandRowByClick?: boolean;
  21. columnWidth?: number | string;
  22. clientWidth: number;
  23. fixed?: FixedType;
  24. scrollWidth?: number;
  25. expandedRowOffset?: number;
  26. }, transformColumns: (columns: ColumnsType<RecordType>) => ColumnsType<RecordType>): [
  27. columns: ColumnsType<RecordType>,
  28. flattenColumns: readonly ColumnType<RecordType>[],
  29. realScrollWidth: undefined | number,
  30. hasGapFixed: boolean
  31. ];
  32. export default useColumns;