@cowwoc/requirements
Version:
A fluent API for enforcing design contracts with automatic message generation.
33 lines (32 loc) • 1.23 kB
text/typescript
import { AbstractDiffWriter, type ColoredDiff } from "../../internal.mjs";
/**
* Base implementation for all color diff writers.
*/
declare abstract class AbstractColorWriter extends AbstractDiffWriter implements ColoredDiff {
/**
* A padding character used to align values vertically.
*/
static readonly DIFF_PADDING = "/";
/**
* Maps from a line number in the actual value to the decoration at the end of the line.
*/
private lineToActualDecoration;
/**
* Maps from a line number in the expected value to the decoration at the end of the line.
*/
private lineToExpectedDecoration;
protected constructor();
addActualLine(number: number): void;
addExpectedLine(number: number): void;
writeEqual(text: string): void;
writeDeleted(text: string): void;
writeInserted(text: string): void;
protected beforeFlush(): void;
getDiffLines(): string[];
protected abstract afterFlush(): void;
abstract decorateDeletedText(text: string): string;
abstract decorateEqualText(text: string): string;
abstract decorateInsertedText(text: string): string;
abstract decoratePadding(text: string): string;
}
export { AbstractColorWriter };