// eslint-disable-next-line @typescript-eslint/no-explicit-any export type RowMap = Record; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type RowArray = V[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type Row = RowMap | RowArray; export interface RowValidationResult { row: R | null; isValid: boolean; reason?: string; } export type RowValidatorCallback = (error: Error | null, result?: RowValidationResult) => void; export type RowTransformCallback = (error?: Error | null, row?: R) => void; export type SyncRowTransform = (row: I) => O; export type AsyncRowTransform = (row: I, cb: RowTransformCallback) => void; export type RowTransformFunction = SyncRowTransform | AsyncRowTransform; export const isSyncTransform = ( transform: RowTransformFunction, ): transform is SyncRowTransform => { return transform.length === 1; }; export type RowValidateCallback = (error?: Error | null, isValid?: boolean, reason?: string) => void; export type SyncRowValidate = (row: R) => boolean; export type AsyncRowValidate = (row: R, cb: RowValidateCallback) => void; export type RowValidate = AsyncRowValidate | SyncRowValidate; export const isSyncValidate = (validate: RowValidate): validate is SyncRowValidate => { return validate.length === 1; }; export type HeaderArray = (string | undefined | null)[]; export type HeaderTransformFunction = (headers: HeaderArray) => HeaderArray;