interface IArgV { commands: { [key: string]: string; }; booleans: { [key: string]: string; }; definitions: { [key: string]: string; }; } interface IParsedArgV { commands: { [key: string]: number; }; booleans: { [key: string]: boolean; }; definitions: { [key: string]: string; }; } declare class Util { private static instance; private constructor(); static getInstance(): Util; /** * To be used in command line applications to parse the argument vector provided to the cli. * * @param argv process.argv * @param config */ parseArgVector(argv: string[], config: IArgV): IParsedArgV; /** * Update the version property in the file `package.json`. If the `package.json` is in another * directory you may override the location by specifying the second parameter. */ changePackageVersion(version: string, filePath?: string): void; /** * Execute a system command such as `pwd`. When setting the `print` argument to true * the promise will resolve or reject to an empty string and all the output from the command * will be redirected to the current stdout stream. * * NOTE: This function only supports one command at a time. Use `exec` for any combination of * commands. */ execCmd(cmd: string, print?: boolean): Promise; /** * Execute a system command such as `pwd`. Note that some output may be missing since some * programs print to stderr and we are only resolving the output of stdout. */ exec(cmd: string): Promise; /** * Returns a list of all the files that have not yet been committed. */ getModifiedFiles(): Promise; /** * Move files and/or directories recursively. If the `src` parameter ends with `/` then only * the contents of the directory will be moved to the destination. Otherwise the whole `src` * directory will be moved to the destination. */ move(src: string, dest: string): string[]; /** * Read the json contents from a file. Returns null if there is an issue while parsing. */ readJSON(name: string, path?: string): object | null; /** * Write the contents to a file. Returns a boolean indicating if writing was successful. */ writeJSON(contents: any, name: string, path?: string): boolean; /** * Quick and dirty string replacement. The `template` needs to have strings in the form * of `%{}` where `` is one of the keys specified in `properties`. */ replaceStrings(template: string, properties: object): string; } declare const util: Util; export { Util, util, };