diff --git a/components/table/Column.ts b/components/table/Column.ts index 0d0761f282..05269ff8a9 100644 --- a/components/table/Column.ts +++ b/components/table/Column.ts @@ -1,8 +1,7 @@ import type { AnyObject } from '../_util/type'; import type { ColumnType } from './interface'; -export interface ColumnProps - extends ColumnType { +export interface ColumnProps extends ColumnType { children?: null; } diff --git a/components/table/ColumnGroup.ts b/components/table/ColumnGroup.ts index 3c98159395..021f8eb6cc 100644 --- a/components/table/ColumnGroup.ts +++ b/components/table/ColumnGroup.ts @@ -4,7 +4,7 @@ import type { AnyObject } from '../_util/type'; import type { ColumnProps } from './Column'; import type { ColumnType } from './interface'; -export interface ColumnGroupProps +export interface ColumnGroupProps extends Omit, 'children'> { children: | React.ReactElement> diff --git a/components/table/ExpandIcon.tsx b/components/table/ExpandIcon.tsx index 604db8b424..034f0547ce 100644 --- a/components/table/ExpandIcon.tsx +++ b/components/table/ExpandIcon.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import type { AnyObject } from '../_util/type'; import type { TableLocale } from './interface'; -interface DefaultExpandIconProps { +interface DefaultExpandIconProps { prefixCls: string; record: RecordType; expanded: boolean; diff --git a/components/table/InternalTable.tsx b/components/table/InternalTable.tsx index abd18aee5d..bb1155c97d 100644 --- a/components/table/InternalTable.tsx +++ b/components/table/InternalTable.tsx @@ -59,7 +59,7 @@ export type { ColumnsType, TablePaginationConfig }; const EMPTY_LIST: AnyObject[] = []; -interface ChangeEventInfo { +interface ChangeEventInfo { pagination: { current?: number; pageSize?: number; @@ -113,8 +113,7 @@ export interface TableProps } /** Same as `TableProps` but we need record parent render times */ -export interface InternalTableProps - extends TableProps { +export interface InternalTableProps extends TableProps { _renderTimes: number; } diff --git a/components/table/demo/edit-cell.tsx b/components/table/demo/edit-cell.tsx index ba080df70d..b676540144 100644 --- a/components/table/demo/edit-cell.tsx +++ b/components/table/demo/edit-cell.tsx @@ -1,5 +1,5 @@ import React, { useContext, useEffect, useRef, useState } from 'react'; -import type { GetRef, InputRef } from 'antd'; +import type { GetRef, InputRef, TableProps } from 'antd'; import { Button, Form, Input, Popconfirm, Table } from 'antd'; type FormInstance = GetRef>; @@ -96,8 +96,6 @@ const EditableCell: React.FC> = ({ return {childNode}; }; -type EditableTableProps = Parameters[0]; - interface DataType { key: React.Key; name: string; @@ -105,7 +103,7 @@ interface DataType { address: string; } -type ColumnTypes = Exclude; +type ColumnTypes = Exclude; const App: React.FC = () => { const [dataSource, setDataSource] = useState([ diff --git a/components/table/hooks/useFilter/FilterDropdown.tsx b/components/table/hooks/useFilter/FilterDropdown.tsx index ee1c582d08..a4720c8558 100644 --- a/components/table/hooks/useFilter/FilterDropdown.tsx +++ b/components/table/hooks/useFilter/FilterDropdown.tsx @@ -120,7 +120,7 @@ function renderFilterItems({ export type TreeColumnFilterItem = ColumnFilterItem & FilterTreeDataNode; -export interface FilterDropdownProps { +export interface FilterDropdownProps { tablePrefixCls: string; prefixCls: string; dropdownPrefixCls: string; diff --git a/components/table/hooks/useFilter/FilterSearch.tsx b/components/table/hooks/useFilter/FilterSearch.tsx index e94aaa23c4..8ce9e4ae92 100644 --- a/components/table/hooks/useFilter/FilterSearch.tsx +++ b/components/table/hooks/useFilter/FilterSearch.tsx @@ -5,7 +5,7 @@ import type { AnyObject } from '../../../_util/type'; import Input from '../../../input'; import type { FilterSearchType, TableLocale } from '../../interface'; -interface FilterSearchProps { +interface FilterSearchProps { value: string; onChange: (e: React.ChangeEvent) => void; filterSearch: FilterSearchType; diff --git a/components/table/hooks/useFilter/index.tsx b/components/table/hooks/useFilter/index.tsx index 6ef2e298ee..656745700c 100644 --- a/components/table/hooks/useFilter/index.tsx +++ b/components/table/hooks/useFilter/index.tsx @@ -17,7 +17,7 @@ import type { import { getColumnKey, getColumnPos, renderColumnTitle } from '../../util'; import FilterDropdown, { flattenKeys } from './FilterDropdown'; -export interface FilterState { +export interface FilterState { column: ColumnType; key: Key; filteredKeys?: FilterKey; @@ -203,7 +203,7 @@ export const getFilterData = ( return filterDatas; }; -export interface FilterConfig { +export interface FilterConfig { prefixCls: string; dropdownPrefixCls: string; mergedColumns: ColumnsType; diff --git a/components/table/hooks/useLazyKVMap.ts b/components/table/hooks/useLazyKVMap.ts index d9512861ef..4023a491ed 100644 --- a/components/table/hooks/useLazyKVMap.ts +++ b/components/table/hooks/useLazyKVMap.ts @@ -3,7 +3,7 @@ import * as React from 'react'; import type { AnyObject } from '../../_util/type'; import type { GetRowKey, Key } from '../interface'; -interface MapCache { +interface MapCache { data?: readonly RecordType[]; childrenColumnName?: string; kvMap?: Map; diff --git a/components/table/hooks/useSelection.tsx b/components/table/hooks/useSelection.tsx index fdedc35865..181217ba2d 100644 --- a/components/table/hooks/useSelection.tsx +++ b/components/table/hooks/useSelection.tsx @@ -40,7 +40,7 @@ export const SELECTION_NONE = 'SELECT_NONE' as const; const EMPTY_LIST: React.Key[] = []; -interface UseSelectionConfig { +interface UseSelectionConfig { prefixCls: string; pageData: RecordType[]; data: RecordType[]; diff --git a/components/table/hooks/useSorter.tsx b/components/table/hooks/useSorter.tsx index f33380768d..0a33d0b036 100644 --- a/components/table/hooks/useSorter.tsx +++ b/components/table/hooks/useSorter.tsx @@ -53,7 +53,7 @@ const nextSortDirection = (sortDirections: SortOrder[], current: SortOrder | nul return sortDirections[sortDirections.indexOf(current) + 1]; }; -export interface SortState { +export interface SortState { column: ColumnType; key: Key; sortOrder: SortOrder | null; @@ -370,7 +370,7 @@ export const getSortData = ( }); }; -interface SorterConfig { +interface SorterConfig { prefixCls: string; mergedColumns: ColumnsType; onSorterChange: ( diff --git a/components/table/interface.ts b/components/table/interface.ts index e687eb184c..1f3d7aff26 100644 --- a/components/table/interface.ts +++ b/components/table/interface.ts @@ -16,11 +16,11 @@ import type { TooltipProps } from '../tooltip'; import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; import type { InternalTableProps, TableProps } from './InternalTable'; -export type RefTable = ( +export type RefTable = ( props: React.PropsWithChildren> & React.RefAttributes, ) => React.ReactElement; -export type RefInternalTable = ( +export type RefInternalTable = ( props: React.PropsWithChildren> & React.RefAttributes, ) => React.ReactElement; diff --git a/components/transfer/demo/component-token.tsx b/components/transfer/demo/component-token.tsx index dbff9f5bc6..4c6489dc3b 100644 --- a/components/transfer/demo/component-token.tsx +++ b/components/transfer/demo/component-token.tsx @@ -3,7 +3,7 @@ import { ConfigProvider, Space, Switch, Table, Tag, Transfer } from 'antd'; import type { GetProp, TableColumnsType, TableProps, TransferProps } from 'antd'; import difference from 'lodash/difference'; -type TableRowSelection = TableProps['rowSelection']; +type TableRowSelection = TableProps['rowSelection']; type TransferItem = GetProp[number];