@oclif/multi-stage-output
Version:
Terminal output for oclif commands with multiple stages
93 lines (92 loc) • 2.89 kB
TypeScript
import { type SpinnerName } from 'cli-spinners';
import { IconProps } from './components/icon.js';
export type Design = {
icons?: {
/**
* Icon to display for a completed stage. Defaults to green '✔'
*/
completed?: IconProps;
/**
* Icon to display for the current stage in CI environments. Defaults to '▶'
*
* Non-CI environments will display the spinner instead.
*/
current?: IconProps;
/**
* Icon to display for a failed stage. Defaults to red '✘'
*/
failed?: IconProps;
/**
* Icon to display for a pending stage. Defaults to dim '◼'
*/
pending?: IconProps;
/**
* Icon to display for a skipped stage. Defaults to dim '◯'
*/
skipped?: IconProps;
/**
* Icon to display for stage specific information. Defaults to '▸'
*/
info?: IconProps;
/**
* Icon to display for a aborted stage. Defaults to red '◼'
*/
aborted?: IconProps;
/**
* Icon to display for a paused stage. Defaults to magenta '●'
*/
paused?: IconProps;
/**
* Icon to display for an async stage. Defaults to magenta '▶'
*/
async?: IconProps;
/**
* Icon to display for a warning. Defaults to yellow '⚠'
*/
warning?: IconProps;
};
title?: {
/**
* Character to use as a divider for the title. Defaults to '─'
*/
dividerChar?: string;
/**
* Color of the divider. Defaults to 'dim'
*/
dividerColor?: string;
/**
* Padding to add above and below the title. Defaults to 1
*/
padding?: number;
/**
* Color of the title
*/
textColor?: string;
/**
* Padding to add to the left and right of the title. Defaults to 1
*/
textPadding?: number;
/**
* Width of the title. Defaults to 50
*
* The `full` value will use the terminal width minus the title padding.
*/
width?: number | 'full';
};
spinners?: {
/**
* Spinner to display for dynamic info blocks. Defaults to 'line' on Windows and 'dots11' on other platforms
*/
info?: SpinnerName;
/**
* Spinner to display for stages. Defaults to 'line' on Windows and 'dots2' on other platforms
*/
stage?: SpinnerName;
};
};
type RecursiveRequired<T> = Required<{
[P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];
}>;
export type RequiredDesign = RecursiveRequired<Design>;
export declare function constructDesignParams(design?: Design): RequiredDesign;
export {};