diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 3e359e6bc79d..29f360d5ee50 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -5,16 +5,42 @@ import Group from './Group'; import Search from './Search'; import TextArea from './TextArea'; import Password from './Password'; -import { Omit } from '../_util/type'; +import { Omit, LiteralUnion } from '../_util/type'; import ClearableLabeledInput, { hasPrefixSuffix } from './ClearableLabeledInput'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import SizeContext, { SizeType } from '../config-provider/SizeContext'; import warning from '../_util/warning'; export interface InputProps - extends Omit, 'size' | 'prefix'> { + extends Omit, 'size' | 'prefix' | 'type'> { prefixCls?: string; size?: SizeType; + // ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#%3Cinput%3E_types + type?: LiteralUnion< + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week', + string + >; onPressEnter?: React.KeyboardEventHandler; addonBefore?: React.ReactNode; addonAfter?: React.ReactNode;