import OutputLine from './common/OutputLine'; import { ObjectType } from './types/types'; export default class Parsers { hgVersion: string; constructor(hgVersion: string); /** * Parse command output as raw text content. * repo.branches (err, out) -> console.log Parsers.text(out) */ static text: (out: OutputLine[]) => string; /** * Parse command output as json content. This is useful when JSON template * is passed as an option to the command (i.e. `-Tjson`). * repo.branches {"--template":"json"}, (err, out) -> * branches = Parsers.json out * branches.forEach (b) -> * console.log "#{b.branch} #{b.active}" */ static json: (out: OutputLine[]) => any; /** * Parse version from `version` command. Returns a string version number. */ static version: (out: OutputLine[]) => string; /** * Parse `tags` command text response. Returns an object with tag names as * object keys. Key value is a 2 element array of revision number and revision * hash. * tags = {"":["":""]} */ tags: (out: OutputLine[]) => ObjectType; /** * Parse `status` command text response. Returns an object with file names as * object keys. Key value is the status id. * status = {"":""} */ status: (out: OutputLine[]) => ObjectType; }