awesome-logging
Advanced tools
Comparing version 0.2.1 to 0.2.2
export declare abstract class AwesomeLoggerBase { | ||
static isInitialized: boolean; | ||
private _lastLine; | ||
scrollAmount: number; | ||
protected _hasChanges: boolean; | ||
@@ -15,4 +14,3 @@ private _clean; | ||
protected restrictedChanged(text: string): void; | ||
render(): string; | ||
clean(): void; | ||
} |
@@ -1,4 +0,1 @@ | ||
import { AwesomeLoggerType, LoggerConfig, LoggerReturnType } from './logger-type'; | ||
export declare class LoggerCreator { | ||
static create<T extends AwesomeLoggerType>(type: T, config?: LoggerConfig<T>): LoggerReturnType<T>; | ||
} | ||
export {}; |
@@ -1,19 +0,1 @@ | ||
import { AwesomeLoggerBase } from './logger-base'; | ||
import { AwesomePromptBase } from '../prompt/prompt-base'; | ||
export declare class LoggerManager { | ||
private static _instance; | ||
private readonly _readStream?; | ||
private _currentKeyListener?; | ||
private _activeLogger?; | ||
private _cangeDetection; | ||
constructor(); | ||
changeKeyListener(listener?: (val: string) => any): void; | ||
static getInstance(): LoggerManager; | ||
loggerChanged(calledFrom: AwesomeLoggerBase): void; | ||
logRestricted(text: string): void; | ||
log(logger: AwesomeLoggerBase): void; | ||
prompt(prompt: AwesomePromptBase<any>): void; | ||
interrupt(text: string): void; | ||
runWithoutChangeDetection(run: () => void): void; | ||
clearLogger(): void; | ||
} | ||
export {}; |
@@ -1,6 +0,1 @@ | ||
export declare class StringRenderer { | ||
static lastString: string; | ||
private static lastTerminalHeight; | ||
static renderString(val: string, interruptLog: boolean, ignoreLastLine: boolean, newLog: boolean): void; | ||
private static getLineStringToPrint; | ||
} | ||
export {}; |
@@ -11,2 +11,3 @@ "use strict"; | ||
const terminal_size_1 = require("../utils/terminal-size"); | ||
// @internal | ||
class StringRenderer { | ||
@@ -13,0 +14,0 @@ static renderString(val, interruptLog, ignoreLastLine, newLog) { |
@@ -1,5 +0,1 @@ | ||
export declare class StringTrimmer { | ||
static ensureConsoleFit(val: string, limitRowCount: boolean, scollAmount: number): string; | ||
static ensureRowsCount(rowsTrimmed: string[], scrollAmount: number): string[]; | ||
private static ensureRowsLength; | ||
} | ||
export {}; |
@@ -10,2 +10,3 @@ "use strict"; | ||
const terminal_size_1 = require("../utils/terminal-size"); | ||
// @internal | ||
class StringTrimmer { | ||
@@ -12,0 +13,0 @@ static ensureConsoleFit(val, limitRowCount, scollAmount) { |
@@ -1,18 +0,1 @@ | ||
export declare const CONTROL_PREFIX: string; | ||
export declare const MOVE_LEFT: () => boolean; | ||
export declare const MOVE_UP: (i?: number) => {}; | ||
export declare const MOVE_DOWN: (i?: number) => {}; | ||
export declare const INSERT_LINE: () => boolean; | ||
export declare const INSERT_NEW_LINE: () => boolean; | ||
export declare const DELETE_LINE: () => boolean; | ||
export declare const CLEAR_LINE: () => boolean; | ||
export declare const HIDE_CURSOR: () => void; | ||
export declare const SHOW_CURSOR: () => void; | ||
export declare const START_BLINK_CURSOR: () => boolean; | ||
export declare const STOP_BLINK_CURSOR: () => boolean; | ||
export declare const SAVE_CURSOR: () => boolean; | ||
export declare const RESTORE_CURSOR: () => boolean; | ||
export declare const KEY_ARROW_UP: string; | ||
export declare const KEY_ARROW_DOWN: string; | ||
export declare const KEY_ARROW_RIGHT: string; | ||
export declare const KEY_ARROW_LEFT: string; | ||
export {}; |
@@ -9,19 +9,28 @@ "use strict"; | ||
restore_cursor_1.default(); | ||
// @internal | ||
exports.CONTROL_PREFIX = '\u001b['; | ||
let cursorVisible = true; | ||
let debug = false; | ||
// @internal | ||
const MOVE_LEFT = () => process.stdout.write(`${exports.CONTROL_PREFIX}1000D`); | ||
exports.MOVE_LEFT = MOVE_LEFT; | ||
// @internal | ||
const MOVE_UP = (i = 1) => (i > 0 ? process.stdout.write(`${exports.CONTROL_PREFIX}${i}A`) : {}); | ||
exports.MOVE_UP = MOVE_UP; | ||
// @internal | ||
const MOVE_DOWN = (i = 1) => (i > 0 ? process.stdout.write(`${exports.CONTROL_PREFIX}${i}B`) : {}); | ||
exports.MOVE_DOWN = MOVE_DOWN; | ||
// @internal | ||
const INSERT_LINE = () => process.stdout.write('\n'); | ||
exports.INSERT_LINE = INSERT_LINE; | ||
// @internal | ||
const INSERT_NEW_LINE = () => process.stdout.write(`${exports.CONTROL_PREFIX}1L`); | ||
exports.INSERT_NEW_LINE = INSERT_NEW_LINE; | ||
// @internal | ||
const DELETE_LINE = () => process.stdout.write(`${exports.CONTROL_PREFIX}1M`); | ||
exports.DELETE_LINE = DELETE_LINE; | ||
// @internal | ||
const CLEAR_LINE = () => process.stdout.write(`${exports.CONTROL_PREFIX}0K`); | ||
exports.CLEAR_LINE = CLEAR_LINE; | ||
// @internal | ||
const HIDE_CURSOR = () => { | ||
@@ -37,2 +46,3 @@ if (debug) { | ||
exports.HIDE_CURSOR = HIDE_CURSOR; | ||
// @internal | ||
const SHOW_CURSOR = () => { | ||
@@ -45,14 +55,22 @@ if (!cursorVisible) { | ||
exports.SHOW_CURSOR = SHOW_CURSOR; | ||
// @internal | ||
const START_BLINK_CURSOR = () => process.stdout.write(`${exports.CONTROL_PREFIX}?12h`); | ||
exports.START_BLINK_CURSOR = START_BLINK_CURSOR; | ||
// @internal | ||
const STOP_BLINK_CURSOR = () => process.stdout.write(`${exports.CONTROL_PREFIX}?12l`); | ||
exports.STOP_BLINK_CURSOR = STOP_BLINK_CURSOR; | ||
// @internal | ||
const SAVE_CURSOR = () => process.stdout.write(`${exports.CONTROL_PREFIX}s`); | ||
exports.SAVE_CURSOR = SAVE_CURSOR; | ||
// @internal | ||
const RESTORE_CURSOR = () => process.stdout.write(`${exports.CONTROL_PREFIX}u`); | ||
exports.RESTORE_CURSOR = RESTORE_CURSOR; | ||
// @internal | ||
exports.KEY_ARROW_UP = `${exports.CONTROL_PREFIX}A`; | ||
// @internal | ||
exports.KEY_ARROW_DOWN = `${exports.CONTROL_PREFIX}B`; | ||
// @internal | ||
exports.KEY_ARROW_RIGHT = `${exports.CONTROL_PREFIX}C`; | ||
// @internal | ||
exports.KEY_ARROW_LEFT = `${exports.CONTROL_PREFIX}D`; | ||
//# sourceMappingURL=ansi-utils.js.map |
@@ -1,3 +0,1 @@ | ||
export declare const ConsoleLog: { | ||
log: (val?: string) => void; | ||
}; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConsoleLog = void 0; | ||
// @internal | ||
exports.ConsoleLog = { log: () => { } }; | ||
//# sourceMappingURL=console-log.js.map |
export declare type AwesomeLoggerColor = 'WHITE' | 'BLACK' | 'RED' | 'GREEN' | 'YELLOW' | 'BLUE' | 'MAGENTA' | 'CYAN' | 'GRAY'; | ||
export declare const colorizeFg: (color?: AwesomeLoggerColor | undefined) => (val: string) => string; | ||
export declare const colorize: (color?: AwesomeLoggerColor | undefined, bgColor?: AwesomeLoggerColor | undefined) => (val: string) => string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.colorize = exports.colorizeFg = void 0; | ||
exports.colorize = void 0; | ||
const chalk_1 = __importDefault(require("chalk")); | ||
@@ -57,7 +57,6 @@ const colorizeBg = (bgColor) => { | ||
}; | ||
exports.colorizeFg = colorizeFg; | ||
const colorize = (color, bgColor) => { | ||
return (str) => exports.colorizeFg(color)(colorizeBg(bgColor)(str)); | ||
return (str) => colorizeFg(color)(colorizeBg(bgColor)(str)); | ||
}; | ||
exports.colorize = colorize; | ||
//# sourceMappingURL=logger-color.js.map |
@@ -1,5 +0,1 @@ | ||
export declare class TerminalSize { | ||
private static get terminalSize(); | ||
static get terminalHeight(): number; | ||
static get terminalWidth(): number; | ||
} | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TerminalSize = void 0; | ||
// @internal | ||
class TerminalSize { | ||
@@ -5,0 +6,0 @@ static get terminalSize() { |
{ | ||
"name": "awesome-logging", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Advanced logging messages, interactive prompts, loading animations and more in TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
128178
1851