///
///
declare module "@run-z/optionz/help.js" {
import type { ZOptionMeta } from "@run-z/optionz";
import type { ZOption } from "@run-z/optionz";
/**
* Configuration for {@link helpZOptionReader help option reader}.
*
* @typeParam TOption A type of help option.
*/
export interface ZHelpConfig {
/**
* Help display mode.
*
* One of:
*
* - `brief` to display only brief help info.
* - `full` to display detailed help info.
*
* @default `detailed`
*/
readonly mode?: 'brief' | 'detailed' | undefined;
/**
* Compares two options meta.
*
* By default sorts options by their {@link @run-z/optionz!ZOptionMeta.Help#group group} first, and then - by their
* keys.
*
* @param key1 - First option key.
* @param meta1 - First option meta.
* @param key2 - Second option key.
* @param meta2 - Second option meta.
*
* @returns Positive number if first option should be listed after the second one, negative number if first option
* should be listed before the second one, or zero to list them in original order.
*/
compare?(key1: string, meta1: ZOptionMeta.Combined, key2: string, meta2: ZOptionMeta.Combined): number;
/**
* Displays help information.
*
* By default prints help information formatted by {@link ZHelpFormatter help formatter} to console.
*
* @param options - A list of options meta to display.
* @param option - Help option representation.
*
* @returns Either nothing if help displayed synchronously, or a promise-like instance resolved when help displayed
* asynchronously.
*/
display?(options: ZOptionMeta.List, option: TOption): void | PromiseLike;
}
}
declare module "@run-z/optionz/help.js" {
import type { ZOptionMeta } from "@run-z/optionz";
/**
* Options help printer used {@link ZHelpConfig.display by default}.
*/
export class ZHelpFormatter {
/**
* Detects usage column width.
*
* @param options - A list of options meta to format.
*/
usageWidth(options: ZOptionMeta.List): number;
/**
* Paddings for usage column.
*
* @return top, right, bottom, and left paddings.
*/
usagePadding(): readonly [
top: number,
right: number,
bottom: number,
left: number
];
/**
* Paddings for text column.
*
* @return top, right, bottom, and left paddings.
*/
textPadding(): readonly [
top: number,
right: number,
bottom: number,
left: number
];
/**
* Formats options help information.
*
* @param options - A list of options meta to display.
*
* @returns A promise resolved to formatted help text.
*/
help(options: ZOptionMeta.List): Promise;
}
}
declare module "@run-z/optionz/help.js" {
import type { ZOption } from "@run-z/optionz";
import type { ZOptionReader } from "@run-z/optionz";
/**
* Creates option reader able to build and print help info.
*
* @typeParam TOption A type of help option.
* @param config - Help configuration.
*
* @returns New option reader.
*/
export function helpZOptionReader(config?: ZHelpConfig): ZOptionReader.Fn;
}
//# sourceMappingURL=optionz.help.d.ts.map