UNPKG

a2r

Version:
46 lines (45 loc) 1.22 kB
import { ProcessInfo, OnValidation } from '../../model/watcher'; /** * Will handle files changes and validate them before */ declare class RuntimeValidator { constructor(fileValidator: (filePath: string) => Promise<boolean> | boolean, onValidation: OnValidation, sourcePath: string, targetPath: string); /** * Function to validate files */ private validator; /** * Function to be executed if there are no failing files after all files are processed */ private onValidation; /** * Indicates whether the validator is processing a file or not */ private processing; /** * Pending files to process */ private filesToProcess; /** * Files that didn't pass validation */ failingFiles: Map<string, boolean>; /** * Source path */ sourcePath: string; /** * Target path */ targetPath: string; /** * Processes pending files (from `filesToProcess`) */ private processQueue; /** * Add file to pending files queue * @param processInfo Process info from watcher event */ addFileToQueue(processInfo: ProcessInfo): Promise<void>; } export default RuntimeValidator;