@log-rush/log-formatter
Version:
Parse/Format/Style colored logs
17 lines (16 loc) • 601 B
TypeScript
import { WriteableSGRAstNode } from '../parsing/ast';
import { TextAttribute } from './attributeArray';
export declare enum LogFormat {
ColoredHtml = 0,
RawText = 1,
AttributesArray = 2
}
export declare type FormattingType = {
[LogFormat.ColoredHtml]: string;
[LogFormat.RawText]: string;
[LogFormat.AttributesArray]: TextAttribute[];
};
export declare class LogFormatBuilder {
static format<F extends LogFormat>(rawLog: string, formatting: F): FormattingType[F];
static formatRaw<F extends LogFormat>(astHead: WriteableSGRAstNode, formatting: F): FormattingType[F];
}