import { type Argv, type Arguments } from 'yargs'; /** * Resolves the set of log files to read. With explicit service names each * `/.log` is returned (missing ones reported to the warn sink); * with none, every `*.log` in the runtime directory is returned, sorted. * * @param {string} varHome - runtime working directory * @param {string[]} [services] - explicit service names * @param {(msg: string) => void} [warn] - sink for warnings (missing logs) * @return {string[]} - absolute log file paths */ export declare function resolveLogFiles(varHome: string, services?: string[], warn?: (msg: string) => void): string[]; /** * Deletes collected log files in the runtime working directory. With an * explicit list of service names, only `.log` for those services is * removed; with none, every `*.log` is removed. * * @param {string} varHome - runtime working directory * @param {string[]} [services] - service names to scope the clean to * @return {number} - number of files removed */ export declare function cleanLogs(varHome: string, services?: string[]): number; /** * Prefixes a block of text with a coloured `[service]` label on every line, * mirroring the behaviour of tools like `multitail`. When there is a single * source the text is returned unchanged. * * @param {string} label - service name to prefix (already de-suffixed) * @param {string} text - the raw text block * @param {number} index - source index (drives the colour cycle) * @param {boolean} prefix - whether to apply the prefix at all * @return {string} */ export declare function labelText(label: string, text: string, index: number, prefix: boolean): string; /** * Reads and optionally follows a set of log files, writing their (labelled) * contents to the output sink. With `follow: false` it dumps current contents * and resolves immediately - the mode used by tests and one-shot reads. With * `follow: true` it additionally streams appended data until the process is * interrupted. * * @param {string[]} files - log file paths * @param {object} opts - behaviour flags * @param {boolean} opts.follow - keep streaming appended data * @param {boolean} opts.prefix - prefix each line with the service name * @param {(chunk: string) => void} [opts.out] - output sink (default: stdout) * @return {Promise} - resolves when done (never, while following) */ export declare function tailFiles(files: string[], opts: { follow: boolean; prefix: boolean; out?: (chunk: string) => void; signal?: AbortSignal; }): Promise; export declare const command: string, describe: string, builder: (yargs: Argv) => Argv<{ services: string[] | undefined; } & { c: boolean; } & { f: boolean; } & { prefix: boolean; } & { P: boolean; }>, handler: (argv: Arguments) => Promise;