import * as ArrayCheck from "../array"; export enum IsArrayOfErrorCode { ELEMENT_FAILED_PREDICATE = "ELEMENT_FAILED_PREDICATE" } export type ElementPredicate = ((element : any) => (undefined|ErrorCodeT))|((element : any) => boolean); /* TODO Replace `any` with proper constraints */ export type IsArrayOfResult> = ( ArrayCheck.ArrayErrorCode | { index? : number|string, argIndex? : number|string, forcedArg? : any, error : IsArrayOfErrorCode } | { index? : number|string, argIndex? : number|string, forcedArg? : any, error : ErrorCodeT } ) //ErrorCodeT should be an enum export function checkArrayOf (mixed : any, elementPredicate : ElementPredicate) : undefined|IsArrayOfResult { return ArrayCheck.checkArrayPredicate(mixed, (arr) => { for (let i=0; i