///
///
declare module "@run-z/optionz/colors.js" {
import type { ColorSupport } from "chalk";
import type { ZOption } from "@run-z/optionz";
/**
* Chalk color options configuration.
*
* @typeParam TOption A type of color option.
*/
export interface ChalkZColorConfig {
/**
* Forces terminal colors support.
*
* Assigns `chalk.level` by default.
*
* @param mode - Color support mode (off, basic, 256, or 16m/TrueColor).
* @param option - Color support option.
*
* @returns Either nothing if color support enabled synchronously, or a promise-like instance resolved when color
* support enabled asynchronously.
*/
forceColors?(mode: ColorSupport, option: TOption): void | PromiseLike;
}
}
declare module "@run-z/optionz/colors.js" {
import type { ChalkInstance } from "chalk";
/**
* Terminal color theme relying on [chalk](https://www.npmjs.com/package/chalk).
*
* This theme is used {@link ZColors.useByDefault by default}.
*/
export class ChalkZColors implements ZColors {
/**
* Chalk instance to use.
*/
chalk(): ChalkInstance;
usage(text: string): string;
param(name: string): string;
sign(sign: string): string;
optional(text: string): string;
bullet(sign?: string): string;
}
}
declare module "@run-z/optionz/colors.js" {
/**
* Terminal color theme to use for text formatting.
*/
export interface ZColors {
/**
* Formats option usage text.
*
* @param text - Original usage text.
*
* @returns Formatted usage text.
*/
usage(text: string): string;
/**
* Formats option parameter placeholder.
*
* @param name - Parameter name.
*
* @returns Formatted placeholder.
*/
param(name: string): string;
/**
* Formats a sign to use as part of grammar definition.
*
* @param sign - A sign to format.
*
* @returns Formatted sign.
*/
sign(sign: string): string;
/**
* Formats optional part of grammar definition.
*
* @param text - Optional grammar text.
*
* @returns Formatted optional grammar.
*/
optional(text: string): string;
/**
* Formats a list bullet.
*
* @param sign - Override bullet symbol to use.
*
* @returns Formatted bullet.
*/
bullet(sign?: string): string;
}
export const ZColors: {
/**
* Assigns terminal color theme to use {@link clz by default}.
*
* @param colors - New default terminal color theme to use.
*/
useByDefault(colors: ZColors): void;
};
/**
* Terminal color theme that delegates to {@link ZColors.useByDefault default one}.
*/
export const clz: ZColors;
}
declare module "@run-z/optionz/colors.js" {
import type { ZOption } from "@run-z/optionz";
import type { SupportedZOptions } from "@run-z/optionz";
/**
* Accepts `--color`, `--no-color`, and `--no-colors` options.
*
* Then [chalk] would be able to interpret them .
*
* [chalk]: https://www.npmjs.com/package/chalk
*
* @param config - Chalk color support configuration.
*
* @returns Supported set of color options.
*/
export function chalkZColorOptions(config?: ChalkZColorConfig): SupportedZOptions;
}
//# sourceMappingURL=optionz.colors.d.ts.map