UNPKG

spread-diff-patch

Version:
45 lines (42 loc) 1.53 kB
/** * Represents a Formatter class. * @template T - The type parameter for the Formatter class. */ declare class Formatter<T> { patch: (actual: string | null, expected: string | null) => string; /** * Creates an instance of Formatter. * @param {Function} patcher - The patcher function used to generate the patched string. */ constructor(patcher?: (actual: string | null, expected: string | null) => string); /** * Formats the diff array of arrays. * @param diffAOA - The diff array of arrays to be formatted. * @returns The formatted string. */ format(diffAOA: DiffAOA<T>): string; } /** * Represents the differences between two arrays of arrays (AOA) with a customizable format. * @template T - The type of data in the arrays of arrays. */ declare class DiffAOA<T> extends Array<Array<T | Array<T | null>>> { #private; /** * Formats the differences using the provided formatter. * @param formatter - The formatter object responsible for generating the formatted string. * @returns The formatted string representing the differences. */ format(formatter: Formatter<T>): string; /** * Gets the count of differences in the array of arrays. * @returns The number of differences. */ get diffCount(): number; /** * Sets the count of differences in the array of arrays. * @param value - The number of differences to set. */ set diffCount(value: number); } export { DiffAOA as D, Formatter as F };