chore(all): delete useless Omit define (#31661)

This commit is contained in:
Zuobin Wang 2021-08-04 20:07:28 +08:00 committed by GitHub
parent 485bca241a
commit 7f16838631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 5 additions and 14 deletions

View File

@ -1,4 +1,3 @@
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
export const tuple = <T extends string[]>(...args: T) => args;

View File

@ -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 {

View File

@ -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';

View File

@ -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[]) {

View File

@ -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;

View File

@ -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<E extends HTMLInputElement | HTMLTextAreaElement
| React.ChangeEvent<E>
| React.MouseEvent<HTMLElement, MouseEvent>
| React.CompositionEvent<HTMLElement>,
onChange:
| undefined
| ((event: React.ChangeEvent<E>) => void),
onChange: undefined | ((event: React.ChangeEvent<E>) => void),
targetValue?: string,
) {
if (!onChange) {

View File

@ -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;

View File

@ -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';

View File

@ -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);

View File

@ -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<PickerTimeProps<Dayjs>, 'picker'> {}

View File

@ -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<PickerTimeProps<Dayjs>, 'picker'> {}