import { DefineComponent } from 'vue';
import { Nullable } from '../ts-helpers';

/**
 * InputTextArea component props
 */
export interface InputTextAreaProps {
  /**
   * String modelValue of the input.
   */
  modelValue?: Nullable<string>;
  /**
   * Sets the initial value of the field.
   * This will only available with option 'useValidator'.
   *
   * In usecase like edit form, you need to display the previous inputted value.
   */
  value?: string;
  /**
   * The maximun character length allowed.
   *
   * @default 30 - for inputTextArea;
   * @default unlimited - for textarea;
   */
  maxLength?: number;
  /**
   * The input label. Tell the user what input is this.
   */
  label?: string;
  /**
   * Wether the input should be validated with vee-validator or not.
   * If you use this component within form input, you need to set this props as true.
   */
  useValidator?: boolean;
  /**
   * This prop is required if you use this component in a form input.
   * Specify the unique field name, match with your needs for API request.
   *
   * @default 'textAreaInput'
   */
  fieldName?: string;
  /**
   * Wether this input field is required or not.
   */
  mandatory?: boolean;
  /**
   * Invalid input state.
   */
  invalid?: boolean;
  /**
   * Set custom validator message.
   * Will be show if invalid="true"
   */
  validatorMessage?: string;
  /**
   * Classes for validator message in input field.
   */
  validatorMessageClass?: string;
  /**
   * Specify the input placeholder.
   *
   * @default 'Enter {label}' or 'Enter {type}'
   */
  placeholder?: string;
  /**
   * Disabled the input.
   */
  disabled?: boolean;
  /**
   * Show information to user about the field.
   */
  fieldInfo?: string;
  /**
   * Specify classes for input.
   */
  inputClass?: string;
  /**
   * Specify classes for input container.
   */
  inputContainerClass?: string;
  /**
   * Specify classes for label.
   */
  labelClass?: string;
}

/**
 * InputTextArea component emits
 */
export type InputTextAreaEmits = {
  'input': [payload?: Nullable<string>];
  'update:modelValue': [payload?: Nullable<string>];
};

/**
 * **TSVue - InputTextArea**
 *
 * _Handle input text with form validation._
 *
 * --- ---
 * ![TSVue](https://ik.imagekit.io/kurniadev/TS-HEAD-BLACK.png)
 *
 * @group form
 */
declare const InputTextArea: DefineComponent<
  InputTextAreaProps,
  InputTextAreaEmits
>;

export default InputTextArea;
