// @flow
import type { FormFieldError } from '../forms.proptypes';

export type MaskedTextInputOptions = {|
  date?: boolean,
  dateMax?: string,
  dateMin?: string,
  datePattern?: Array<string>,
  delimiter?: string,
  noImmediatePrefix?: boolean,
  numeral?: boolean,
  phone?: boolean,
  phoneRegionCode?: string,
  prefix?: string,
  rawValueTrimPrefix?: boolean,
|};

export type MaskedTextInputProps<ValueType> = {|
  id?: string,
  className?: string,
  type?: 'date' | 'email' | 'number' | 'text' | 'password', // these types for now
  options?: MaskedTextInputOptions,
  placeholder?: ValueType,
  value?: ?ValueType,
  disabled?: boolean,
  error?: FormFieldError,
  focusOnMount?: boolean,
  large?: boolean,
  iconType?: 'lock' | 'error' | 'checkmark',
  iconPosition?: 'left' | 'right',
  onChange: (string, SyntheticInputEvent<HTMLInputElement>) => void,
  onFocus?: (SyntheticFocusEvent<HTMLInputElement>) => void,
  onBlur?: (SyntheticFocusEvent<HTMLInputElement>) => void,
  onRef?: (HTMLInputElement) => void,
  inputMode?: string,
  hideBorder?: boolean,
|};
