Comparing version 6.0.0-beta.6 to 6.0.0-beta.7
@@ -86,7 +86,7 @@ import { Observable } from 'rxjs'; | ||
declare function cleanseAnsiOutput(chunk: string): string; | ||
declare function cleanseAnsi(chunk: string): string; | ||
declare const color: colorette.Colorette; | ||
declare function indentString(string: string, count: number): string; | ||
declare function indent(string: string, count: number): string; | ||
@@ -108,28 +108,4 @@ declare const FIGURES_MAIN: { | ||
/** | ||
* A basic function to parse minutes and tasks passed given a duration. | ||
* Useful for renderers to show the task time. | ||
* | ||
* @param {number} duration | ||
* @returns {string} | ||
*/ | ||
declare function parseTaskTime(duration: number): string; | ||
declare function splat(message: string, ...splat: any[]): string; | ||
declare function parseTimestamp(): string; | ||
/** Default loglevels for the logger */ | ||
declare enum LogLevels { | ||
STARTED = "STARTED", | ||
COMPLETED = "COMPLETED", | ||
FAILED = "FAILED", | ||
SKIPPED = "SKIPPED", | ||
OUTPUT = "OUTPUT", | ||
TITLE = "TITLE", | ||
ROLLBACK = "ROLLBACK", | ||
RETRY = "RETRY", | ||
PROMPT = "PROMPT" | ||
} | ||
/** | ||
@@ -139,15 +115,15 @@ * A internal logger for using in the verbose renderer mostly. | ||
declare class ListrLogger { | ||
private options?; | ||
private readonly options?; | ||
readonly process: ProcessOutput; | ||
constructor(options?: ListrLoggerOptions); | ||
started(message: string | any[], options?: LogEntityOptions): void; | ||
failed(message: string | any[], options?: LogEntityOptions): void; | ||
skipped(message: string | any[], options?: LogEntityOptions): void; | ||
completed(message: string | any[], options?: LogEntityOptions): void; | ||
output(message: string | any[], options?: LogEntityOptions): void; | ||
title(message: string | any[], options?: LogEntityOptions): void; | ||
retry(message: string | any[], options?: LogEntityOptions): void; | ||
rollback(message: string | any[], options?: LogEntityOptions): void; | ||
prompt(message: string | any[], options?: LogEntityOptions): void; | ||
stdout(message: string | any[], options?: LogEntityOptions): void; | ||
started(message: string | any[], options?: LoggerFieldOptions): void; | ||
failed(message: string | any[], options?: LoggerFieldOptions): void; | ||
skipped(message: string | any[], options?: LoggerFieldOptions): void; | ||
completed(message: string | any[], options?: LoggerFieldOptions): void; | ||
output(message: string | any[], options?: LoggerFieldOptions): void; | ||
title(message: string | any[], options?: LoggerFieldOptions): void; | ||
retry(message: string | any[], options?: LoggerFieldOptions): void; | ||
rollback(message: string | any[], options?: LoggerFieldOptions): void; | ||
prompt(message: string | any[], options?: LoggerFieldOptions): void; | ||
stdout(message: string | any[], options?: LoggerFieldOptions): void; | ||
wrap(message: string, options?: { | ||
@@ -159,5 +135,5 @@ format?: LoggerFormat; | ||
prefix(message: string, ...prefixes: LoggerField[]): string; | ||
fields(message: string, options?: LogEntityOptions<true>): string; | ||
fields(message: string, options?: LoggerFieldOptions<true>): string; | ||
icon<T extends RendererStyleMap<K>, K extends string>(map: T, level: K, icon?: string | false): string; | ||
protected format(level: LogLevels, message: string | any[], options?: LogEntityOptions): string; | ||
protected format(level: LogLevels, message: string | any[], options?: LoggerFieldOptions): string; | ||
protected style(level: LogLevels, message: string): string; | ||
@@ -175,7 +151,19 @@ } | ||
useIcons?: boolean; | ||
entityOptions?: LogEntityOptions<true>; | ||
/** | ||
* Apply fields and templates as presets before and after each message. | ||
*/ | ||
fieldOptions?: LoggerFieldOptions<true>; | ||
/** | ||
* Style map for coloring and icons. | ||
*/ | ||
style?: ListrLoggerOptionStyle; | ||
/** | ||
* Pass custom options to user created logger on different environments. | ||
* | ||
* Not used on the default logger. | ||
*/ | ||
user?: any; | ||
} | ||
type ListrLoggerOptionStyle = RendererStyleMap<LogLevels>; | ||
interface LogEntityOptions<MultipleOnly extends boolean = false> { | ||
type ListrLoggerOptionStyle<T extends string = LogLevels> = RendererStyleMap<T>; | ||
interface LoggerFieldOptions<MultipleOnly extends boolean = false> { | ||
prefix?: MultipleOnly extends false ? LoggerField | LoggerField[] : LoggerField[]; | ||
@@ -193,5 +181,20 @@ suffix?: MultipleOnly extends false ? LoggerField | LoggerField[] : LoggerField[]; | ||
interface LoggerRendererOptions { | ||
logger?: ListrLogger; | ||
logger?: typeof ListrLogger; | ||
loggerOptions?: ListrLoggerOptions; | ||
} | ||
/** Default loglevels for the logger */ | ||
declare enum LogLevels { | ||
STARTED = "STARTED", | ||
COMPLETED = "COMPLETED", | ||
FAILED = "FAILED", | ||
SKIPPED = "SKIPPED", | ||
OUTPUT = "OUTPUT", | ||
TITLE = "TITLE", | ||
ROLLBACK = "ROLLBACK", | ||
RETRY = "RETRY", | ||
PROMPT = "PROMPT" | ||
} | ||
declare const LISTR_LOGGER_STYLE: ListrLoggerOptionStyle; | ||
declare class ProcessOutputBuffer { | ||
@@ -552,3 +555,3 @@ private buffer; | ||
COMPLETED_WITH_FAILED_SUBTASKS = "COMPLETED_WITH_FAILED_SUBTASKS", | ||
COMPLETED_WITH_SISTER_TASKS_FAILED = "COMPLETED_WITH_SISTER_TASKS_FAILED", | ||
COMPLETED_WITH_FAILED_SISTER_TASKS = "COMPLETED_WITH_SISTER_TASKS_FAILED", | ||
RETRY = "RETRY", | ||
@@ -561,2 +564,3 @@ ROLLING_BACK = "ROLLING_BACK", | ||
} | ||
declare const LISTR_DEFAULT_RENDERER_STYLE: ListrLoggerOptionStyle<ListrDefaultRendererLogLevels>; | ||
@@ -573,4 +577,14 @@ type PresetTimer = LoggerFieldFn<[number]>; | ||
} | ||
declare const RENDERER_TIMER: PresetTimer; | ||
/** | ||
* A basic function to parse minutes and tasks passed given a duration. | ||
* Useful for renderers to show the task time. | ||
* | ||
* @param {number} duration | ||
* @returns {string} | ||
*/ | ||
declare function parseTimer(duration: number): string; | ||
type PresetTimestamp = LoggerFieldFn; | ||
@@ -580,4 +594,7 @@ interface RendererPresetTimestamp { | ||
} | ||
declare const RENDERER_TIMESTAMP: PresetTimestamp; | ||
declare function parseTimestamp(): string; | ||
/** Default updating renderer for Listr2 */ | ||
@@ -1216,2 +1233,2 @@ declare class DefaultRenderer implements ListrRenderer { | ||
export { ANSI_ESCAPE, ANSI_ESCAPE_CODES, Concurrency, DefaultRenderer, Figures, Listr, ListrBaseClassOptions, ListrBaseRenderer, ListrContext, ListrDefaultRenderer, ListrDefaultRendererLogLevels, ListrDefaultRendererOptions, ListrDefaultRendererOptionsStyle, ListrDefaultRendererTasks, ListrDefaultRendererValue, ListrEnvironmentVariables, ListrError, ListrErrorTypes, ListrEventType, ListrFallbackRenderer, ListrFallbackRendererValue, ListrGetRendererClassFromValue, ListrGetRendererOptions, ListrGetRendererTaskOptions, ListrGetRendererValueFromClass, ListrLogger, ListrLoggerOptionStyle, ListrLoggerOptions, ListrOptions, ListrPrimaryRendererOptions, ListrRenderer, ListrRendererFactory, ListrRendererOptions, ListrRendererValue, ListrSecondaryRendererOptions, ListrSilentRenderer, ListrSilentRendererValue, ListrSimpleRenderer, ListrSimpleRendererOptions, ListrSimpleRendererTasks, ListrSimpleRendererValue, ListrSubClassOptions, ListrTask, ListrTaskEventType, ListrTaskFn, ListrTaskMessage, Task as ListrTaskObject, ListrTaskPrompt, ListrTaskResult, ListrTaskRetry, ListrTaskState, TaskWrapper as ListrTaskWrapper, ListrTestRenderer, ListrTestRendererOptions, ListrTestRendererTasks, ListrTestRendererValue, ListrVerboseRendererOptions, ListrVerboseRendererTasks, LogEntityOptions, LogLevels, LoggerField, LoggerFieldFn, LoggerFormat, LoggerRendererOptions, Manager, PresetTimer, PresetTimestamp, ProcessOutput, ProcessOutputBuffer, ProcessOutputHook, ProcessOutputRendererOptions, PromptCancelOptions, PromptError, PromptInstance, PromptOptions, PromptOptionsMap, PromptOptionsType, PromptSettings, PromptTypes, RENDERER_TIMER, RENDERER_TIMESTAMP, RendererPresetTimer, RendererPresetTimestamp, RendererStyleMap, SilentRenderer, SimpleRenderer, Spinner, SupportedRenderer, TestRenderer, TestRendererEvent, Unionize, VerboseRenderer, assertFunctionOrSelf, cleanseAnsiOutput, cloneObject, color, createPrompt, figures, generateUUID, getRenderer, getRendererClass, indentString, isObservable, isUnicodeSupported, parseTaskTime, parseTimestamp, splat }; | ||
export { ANSI_ESCAPE, ANSI_ESCAPE_CODES, Concurrency, DefaultRenderer, Figures, LISTR_DEFAULT_RENDERER_STYLE, LISTR_LOGGER_STYLE, Listr, ListrBaseClassOptions, ListrBaseRenderer, ListrContext, ListrDefaultRenderer, ListrDefaultRendererLogLevels, ListrDefaultRendererOptions, ListrDefaultRendererOptionsStyle, ListrDefaultRendererTasks, ListrDefaultRendererValue, ListrEnvironmentVariables, ListrError, ListrErrorTypes, ListrEventType, ListrFallbackRenderer, ListrFallbackRendererValue, ListrGetRendererClassFromValue, ListrGetRendererOptions, ListrGetRendererTaskOptions, ListrGetRendererValueFromClass, ListrLogger, ListrLoggerOptionStyle, ListrLoggerOptions, ListrOptions, ListrPrimaryRendererOptions, ListrRenderer, ListrRendererFactory, ListrRendererOptions, ListrRendererValue, ListrSecondaryRendererOptions, ListrSilentRenderer, ListrSilentRendererValue, ListrSimpleRenderer, ListrSimpleRendererOptions, ListrSimpleRendererTasks, ListrSimpleRendererValue, ListrSubClassOptions, ListrTask, ListrTaskEventType, ListrTaskFn, ListrTaskMessage, Task as ListrTaskObject, ListrTaskPrompt, ListrTaskResult, ListrTaskRetry, ListrTaskState, TaskWrapper as ListrTaskWrapper, ListrTestRenderer, ListrTestRendererOptions, ListrTestRendererTasks, ListrTestRendererValue, ListrVerboseRendererOptions, ListrVerboseRendererTasks, LogLevels, LoggerField, LoggerFieldFn, LoggerFieldOptions, LoggerFormat, LoggerRendererOptions, Manager, PresetTimer, PresetTimestamp, ProcessOutput, ProcessOutputBuffer, ProcessOutputHook, ProcessOutputRendererOptions, PromptCancelOptions, PromptError, PromptInstance, PromptOptions, PromptOptionsMap, PromptOptionsType, PromptSettings, PromptTypes, RENDERER_TIMER, RENDERER_TIMESTAMP, RendererPresetTimer, RendererPresetTimestamp, RendererStyleMap, SilentRenderer, SimpleRenderer, Spinner, SupportedRenderer, TestRenderer, TestRendererEvent, Unionize, VerboseRenderer, assertFunctionOrSelf, cleanseAnsi, cloneObject, color, createPrompt, figures, generateUUID, getRenderer, getRendererClass, indent, isObservable, isUnicodeSupported, parseTimer, parseTimestamp, splat }; |
{ | ||
"name": "listr2", | ||
"version": "6.0.0-beta.6", | ||
"version": "6.0.0-beta.7", | ||
"description": "Terminal task list reborn! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186850
5034