import type { InputHTMLAttributes, MouseEventHandler, Ref } from 'react'; import type { FieldBlockProps } from '../field-block'; import type { BaseInputAsInputProps } from '../base-input'; type HTMLInputProps = Pick, 'autoComplete' | 'autoFocus' | 'defaultValue' | 'disabled' | 'id' | 'name' | 'onBlur' | 'onChange' | 'onFocus' | 'onInput' | 'placeholder' | 'readOnly' | 'required' | 'type' | 'value'>; export type InputType = Extract['type'], 'text' | 'password' | 'search' | 'email' | 'tel' | 'number'>; export interface InputProps extends HTMLInputProps, FieldBlockProps { /** Ref элемента input. */ inputRef?: Ref; /** Свойства BaseInputProps. */ baseInputProps?: BaseInputAsInputProps; /** Тип поля. */ type?: InputType; /** Нужно ли выводить кнопку очистки поля. */ clearable?: boolean; /** Сработает при очистке поля. */ onClear?: MouseEventHandler; /** Значение. */ value?: string; /** Значение по умолчанию. */ defaultValue?: string; /** Стили корневого элемента. */ style?: Required['rootProps']['style']; /** CSS-класс корневого элемента. */ className?: Required['rootProps']['className']; } export {};