//#region src/docReview/reviewReport.d.ts /** * The kind of change detected for a block when reviewing a translation against * its base document. * * - `review`: the base block changed and its translation must be updated. * - `insert_new`: the base block has no translation yet and must be added. * - `delete`: the target block no longer exists in the base and should be removed. */ export type ReviewBlockAction = 'review' | 'insert_new' | 'delete'; /** A 1-based, inclusive line range within a document. */ export type LineRange = { start: number; end: number; }; /** * A single block that diverges between the base document and its translation. * * This is the unit an external translator (AI client, human, or agent) needs to * act on: it carries the base content to translate, the existing translation to * update, and where each lives so the change can be located in the file. */ export type ReviewReportBlock = { /** What should happen to this block. */ action: ReviewBlockAction; /** Line range of the block in the base document (omitted for pure deletions). */ baseLineRange?: LineRange; /** Line range of the block in the target document (omitted for new insertions). */ targetLineRange?: LineRange; /** Raw markdown of the base block (omitted for pure deletions). */ baseContent?: string; /** Existing translation of the block (omitted for new insertions). */ targetContent?: string; }; export type ReviewReportSummary = { /** Number of blocks reused as-is (unchanged translation). */ reuse: number; /** Number of blocks whose translation must be updated. */ review: number; /** Number of blocks missing a translation. */ insertNew: number; /** Number of stale target blocks to delete. */ delete: number; }; export type ReviewReport = { /** Only the blocks that diverge (review, insert_new, delete). */ blocks: ReviewReportBlock[]; /** Counts per action over the whole document, including reused blocks. */ summary: ReviewReportSummary; }; export type BuildReviewReportInput = { /** The base (source) document, used as the translation reference. */ baseText: string; /** The existing target (translated) document, possibly empty. */ targetText: string; /** * 1-based line numbers that changed in the base document. * * When omitted the whole document is compared, and only inserted and deleted * blocks are reported (no aligned block is flagged for review since there is * no way to know which ones changed). An empty array means nothing changed, * and no block at all is reported. */ changedLines?: number[]; }; /** * Compare a base markdown document with its translation and report only the * blocks that need attention, with their line ranges and content. * * Reusable across the CLI (`doc review --log`), the backend (comparing two * translation contents stored in database), and agents that generate the * missing translations. * * @param input - The base/target texts and optional changed lines. * @returns The divergent blocks and a per-action summary. */ export declare const buildReviewReport: ({ baseText, targetText, changedLines }: BuildReviewReportInput) => ReviewReport; /** * Render a {@link ReviewReport} as a human and agent readable log. * * Each divergent block is printed with its action, the base/target line ranges, * the base content to translate, and the existing translation to update. * * @param report - The report to format. * @param options - Optional labels for the base and target locales. * @returns A multi-line string describing every block that needs attention. */ export declare const formatReviewReport: (report: ReviewReport, options?: { baseLabel?: string; targetLabel?: string; }) => string; //#endregion //# sourceMappingURL=reviewReport.d.ts.map