diff --git a/components/_util/type.ts b/components/_util/type.ts index 783a44b6af..a42c2b8fb9 100644 --- a/components/_util/type.ts +++ b/components/_util/type.ts @@ -1,4 +1,3 @@ -export type Omit = Pick>; // https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead export const tuple = (...args: T) => args; diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index c91f0f5bb1..bcf0051f16 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -6,7 +6,6 @@ import BreadcrumbSeparator from './BreadcrumbSeparator'; import Menu from '../menu'; import { ConfigContext } from '../config-provider'; import devWarning from '../_util/devWarning'; -import { Omit } from '../_util/type'; import { cloneElement } from '../_util/reactNode'; export interface Route { diff --git a/components/button/button.tsx b/components/button/button.tsx index 2aa8a5fe1d..c2769ab171 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -6,7 +6,7 @@ import omit from 'rc-util/lib/omit'; import Group from './button-group'; import { ConfigContext } from '../config-provider'; import Wave from '../_util/wave'; -import { Omit, tuple } from '../_util/type'; +import { tuple } from '../_util/type'; import devWarning from '../_util/devWarning'; import SizeContext, { SizeType } from '../config-provider/SizeContext'; import LoadingIcon from './LoadingIcon'; diff --git a/components/card/index.tsx b/components/card/index.tsx index fe87caa33b..361ea4e9c0 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -7,7 +7,6 @@ import Tabs, { TabsProps } from '../tabs'; import Row from '../row'; import Col from '../col'; import { ConfigContext } from '../config-provider'; -import { Omit } from '../_util/type'; import SizeContext from '../config-provider/SizeContext'; function getAction(actions: React.ReactNode[]) { diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index 5d77e7b6bf..8df2b76e4e 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -5,7 +5,6 @@ import UpOutlined from '@ant-design/icons/UpOutlined'; import DownOutlined from '@ant-design/icons/DownOutlined'; import { ConfigContext } from '../config-provider'; -import { Omit } from '../_util/type'; import SizeContext, { SizeType } from '../config-provider/SizeContext'; type ValueType = string | number; diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 1ea61e9b9f..58a0a2a47e 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -5,7 +5,7 @@ import Group from './Group'; import Search from './Search'; import TextArea from './TextArea'; import Password from './Password'; -import { Omit, LiteralUnion } from '../_util/type'; +import { LiteralUnion } from '../_util/type'; import ClearableLabeledInput, { hasPrefixSuffix } from './ClearableLabeledInput'; import { ConfigConsumer, ConfigConsumerProps, DirectionType } from '../config-provider'; import SizeContext, { SizeType } from '../config-provider/SizeContext'; @@ -67,9 +67,7 @@ export function resolveOnChange | React.MouseEvent | React.CompositionEvent, - onChange: - | undefined - | ((event: React.ChangeEvent) => void), + onChange: undefined | ((event: React.ChangeEvent) => void), targetValue?: string, ) { if (!onChange) { diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index 8daeb8c4f0..8c6ae2379f 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -3,7 +3,6 @@ import * as React from 'react'; import DatePicker from '../date-picker'; import { PickerTimeProps, RangePickerTimeProps } from '../date-picker/generatePicker'; import devWarning from '../_util/devWarning'; -import { Omit } from '../_util/type'; const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker; diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index ca435c7876..1aebb762f4 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import { ElementOf, Omit, tuple } from '../_util/type'; +import { ElementOf, tuple } from '../_util/type'; import Pagination from '../pagination'; import { TransferListProps, RenderedItem } from './list'; import ListItem from './ListItem'; diff --git a/components/typography/Title.tsx b/components/typography/Title.tsx index 12d7708ad6..9ba9cd5643 100644 --- a/components/typography/Title.tsx +++ b/components/typography/Title.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import devWarning from '../_util/devWarning'; import Base, { BlockProps } from './Base'; -import { tupleNum, Omit } from '../_util/type'; +import { tupleNum } from '../_util/type'; const TITLE_ELE_LIST = tupleNum(1, 2, 3, 4, 5); diff --git a/docs/react/replace-moment.en-US.md b/docs/react/replace-moment.en-US.md index 6e10e356e7..d2c74324cc 100644 --- a/docs/react/replace-moment.en-US.md +++ b/docs/react/replace-moment.en-US.md @@ -39,7 +39,6 @@ import { Dayjs } from 'dayjs'; import * as React from 'react'; import DatePicker from './DatePicker'; import { PickerTimeProps } from 'antd/es/date-picker/generatePicker'; -import { Omit } from 'antd/es/_util/type'; export interface TimePickerProps extends Omit, 'picker'> {} diff --git a/docs/react/replace-moment.zh-CN.md b/docs/react/replace-moment.zh-CN.md index d9ac9c0d38..103f38c8f7 100644 --- a/docs/react/replace-moment.zh-CN.md +++ b/docs/react/replace-moment.zh-CN.md @@ -39,7 +39,6 @@ import { Dayjs } from 'dayjs'; import * as React from 'react'; import DatePicker from './DatePicker'; import { PickerTimeProps } from 'antd/es/date-picker/generatePicker'; -import { Omit } from 'antd/es/_util/type'; export interface TimePickerProps extends Omit, 'picker'> {}