// Reference Types
///
/** Libraries */
import { Component, FormEvent } from 'react';
import { Moment } from 'moment';
import { List, Map, Set } from 'immutable';
import { Dispatch, Action } from 'redux';
/** Types */
export type InputType =
| 'text'
| 'radio'
| 'checkbox'
| 'number'
| 'email'
| 'password'
| 'hidden'
| 'file';
export type InputTest = 'required' | 'pattern' | 'type' | 'minLength' | 'maxLength' | 'min' | 'max';
export type TestType = string | number | boolean | Function | undefined;
export type DateRangeMoment = {
startDate: Moment;
endDate: Moment;
};
export type PossibleInputValue =
| number
| string
| boolean
| Moment
| DateRangeMap
| undefined
| List
| Set;
export type getInputPath = () => Array;
export type inputChanged = (value: PossibleInputValue, changed?: boolean) => void;
export type inputBlurred = () => void;
export type setValidation = (type: string, test?: TestType) => void;
export type compareAdditionalProps = (props: TProps, nextProps: TProps) => boolean;
export type SetInputAction = FSA;
export type SetValidationAction = FSA;
export type SetInputInteractionAction = FSA;
export type SetAllInputInteractionAction = FSA<
SetAllInputInteractionPayload,
'SET_ALL_INPUT_INTERACTIONS'
>;
export type ClearAllInputsAction = FSA;
export type formState = Map;
export type OnSubmit = (
e: FormEvent,
formData: formState | FormData,
submitGeneratedForm?: T
) => void;
export type InputUnionProps =
| TextInputProps
| TextAreaProps
| SelectInputProps
| SwitchProps
| RadioTabsProps
| DatePickerProps
| DateRangeProps;
export type ReducerFunc<
TState = Map,
TAction =
| ClearAllInputsAction
| SetInputAction
| SetAllInputInteractionAction
| SetInputInteractionAction
| SetValidationAction
> = (state: TState, action: TAction) => TState;
export type BasicReducer = {
SET_INPUT: ReducerFunc