import type { DiffRegion } from '@variance-authority/core/attribute'; import { type DiffPolicy } from '@variance-authority/raster'; import { type ChangeLabels } from './change-draw.js'; export { CHANGE_COLOURS, changeLayout, type ChangeLabels } from './change-draw.js'; /** * The change at its own size: what a reviewer reads in place of two pages. * * A full-page capture is 1280 pixels wide and tens of thousands tall. Shown * whole in a pull request comment it is scaled to the column, a sentence of it * is a grey line, and a reviewer cannot read what changed without downloading * both pages and finding the spot by eye. The regions of a comparison already * say where to look, so the picture is cut there: each of the largest regions, * with the rows around it, at one image pixel per screen pixel. * * Each cut is a split diff, the way a code review shows text: before on the * left, after on the right, and the rows that show the same content level with * each other, read through the row alignment. An inserted row stands opposite * stripes on the before side and a removed one opposite stripes on the after * side, so everything under an insertion sits beside itself and reads as * unchanged. What changed is washed on both sides, red on before and green on * after, with an edge just outside it, over the pages' own pixels. Rows that * only moved are not marked on the panels: the gutter beside them carries an * arrow the way they went, and a gap that only got taller is neither marked * nor cut out while anything else changed. * * Every window is as wide as the widest and framed on a canvas, under a label * per column, so the sheet reads as one picture with its sources named. */ export interface ChangeImages { /** The whole difference: the after image dimmed with the changed pixels in red. */ readonly diff: Buffer; /** * The cuts, before beside after, one under another and all one width, under * a label per column. Absent when there was no region to cut. */ readonly change?: Buffer; } /** * The difference image and the cuts of it, from one alignment. * * `regions` are the comparison's, on its canvas: the after image's when the * rows aligned, the box that holds both when they did not. The difference is * computed here on the same rule, so the two agree on where every pixel is. */ export declare function changeImages(before: Buffer, after: Buffer, regions: readonly DiffRegion[], policy?: DiffPolicy, /** What the sheet says about itself: the subject, and where each side came from. */ labels?: ChangeLabels): ChangeImages; //# sourceMappingURL=change.d.ts.map