import { List, Map, Record } from 'immutable' export type ValidatorErrorsSingle = List> export type ValidatorErrorsValue = Map export interface ValidatorErrors { errCount: number errors: ValidatorErrorsValue childErrors: Map errorsToJS: () => { [key: string]: { [key: string]: any }[] } getErrors: () => ValidatorErrorsValue addError: (type: string, context?: Map) => ValidatorErrorsType addErrors: (errors: ValidatorErrorsType) => ValidatorErrorsType addChildErrors: (errors: ValidatorErrorsType) => ValidatorErrorsType addErrorsToChild: (errors: ValidatorErrorsType) => ValidatorErrorsType hasError: (type?: string) => boolean getError: (type: string) => ValidatorErrorsSingle } export type ValidatorErrorsType = Record & ValidatorErrors export const ValidatorErrors: ValidatorErrorsType export function createValidatorErrors(): ValidatorErrorsType export type onErrorHandler = (errors: ValidatorErrorsType | undefined) => void export type onErrors = (cb: onErrorHandler) => void