import fs from "fs" ; /**
 * each handler has a name for filtering and a match regex for matching which files it should resolve
 * the handler function returns an error message or undefined/null for success
 * the resolver function (optional) can attempt to resolve the failed validation
 */ export interface Handler { name : string ; match : RegExp ; handler : ( file : string , root : string ) => string | undefined ; resolver ? : ( file : string , root : string ) => { resolved : boolean ; message ? : string ; } ; final ? : ( root : string , resolve : boolean ) => { error ? : string ; } | undefined ; } ; export function readFile ( file ) { return fs . readFileSync ( file , { encoding : "utf8" } ) ; } export function writeFile ( file , data ) { fs . writeFileSync ( file , data , { encoding : "utf8" } ) ; }