@log-rush/log-formatter
Version:
Parse/Format/Style colored logs
39 lines (38 loc) • 1.59 kB
TypeScript
import { SGREffect } from './types';
export interface ReadOnlySGRAstNode {
readonly effect: SGREffect;
readonly content: string;
readonly nextNode: SGRAstNode | undefined;
readonly previousNode: SGRAstNode | undefined;
}
export interface WriteableSGRAstNode extends ReadOnlySGRAstNode {
setEffect<K extends keyof SGREffect>(key: K, value: SGREffect[K]): SGRAstNode;
setEffects(effects: Partial<SGREffect>): SGRAstNode;
setContent(value: string): SGRAstNode;
appendContent(value: string): SGRAstNode;
insertBefore(node: SGRAstNode): SGRAstNode;
removeBefore(): SGRAstNode | undefined;
insertAfter(node: SGRAstNode): SGRAstNode;
removeAfter(): SGRAstNode | undefined;
clone(): SGRAstNode;
}
export declare class SGRAstNode implements WriteableSGRAstNode {
readonly effect: SGREffect;
content: string;
nextNode: SGRAstNode | undefined;
previousNode: SGRAstNode | undefined;
constructor(effect: SGREffect, content: string, next?: SGRAstNode, previous?: SGRAstNode);
setEffect<K extends keyof SGREffect>(key: K, value: SGREffect[K]): SGRAstNode;
setEffects(effects: Partial<SGREffect>): SGRAstNode;
setContent(value: string): SGRAstNode;
appendContent(value: string): SGRAstNode;
insertBefore(node: SGRAstNode): SGRAstNode;
insertAfter(node: SGRAstNode): SGRAstNode;
removeBefore(): SGRAstNode | undefined;
removeAfter(): SGRAstNode | undefined;
clone(): SGRAstNode;
static New(): SGRAstNode;
New(): SGRAstNode;
static Default(): SGRAstNode;
Default(): SGRAstNode;
}