import { default as ValueProcessor } from './value-processor'
import { default as ActionProcessor } from './action-processor'

export { ValueProcessor }
export { ActionProcessor }

export type Element = {
  id?: any
  key?: any // This is the key used to call the API, do not use to identify the field
  index?: number
  value?: any
  selected?: any
  autofill?: any
  fields?: Array<any>
  options?: Array<any>
  triggerIndex?: number
  triggerColumn?: string
  identifier?: string
  type: 'radio' | 'select' | 'input' | 'masters-select' | 'custom-select'
}

export type Action = {
  action: string
  payload: object
}

export interface Processor {
  processElement(element: Element, index: number): Element | Action[] | null
}

export default {
  ValueProcessor,
  ActionProcessor,
}
