/** * Self-contained HTML rendering for `detectLeaksInXCTest` and * `detectLeaksInXCUITest`. * * The rendered file embeds inline CSS (no external assets) so it renders the * same way in: * * - GitHub's file preview after upload-artifact + download * - PR-comment bots that link to the artifact URL * - A local `open report.html` from a CI failure investigation * * The template lives at `src/templates/leak-report.html` and is substituted * with three placeholders: `{{TITLE}}`, `{{VERSION}}`, `{{TIMESTAMP}}`, * `{{BODY}}`. The body fragment is generated per-call and represents the * per-test sections (totals, new-cycles table, embedded steps log). * * Inputs are intentionally narrowed to the result shapes the two detect * tools share, so the renderer can be called from either tool without * conditional branches. */ export interface LeakReportSection { /** Short label that goes at the top of the section (e.g. test identifier). */ title: string; /** True when the section passed all checks (green verdict pill). */ passed: boolean; /** Free-text reason rendered next to the pill when `passed` is false. */ failureReason?: string; /** Absolute path to the baseline `.memgraph` (rendered as a `` line). */ baselineMemgraph?: string; /** Absolute path to the after `.memgraph`. */ afterMemgraph?: string; totals: { baselineLeaks: number; afterLeaks: number; leakDelta: number; }; newCycles: Array<{ rootClass: string; chainLength: number; allowlisted: boolean; }>; /** Step-by-step log, rendered inside a collapsed `
` block. */ steps?: string[]; } export interface RenderLeakReportInput { title: string; /** Optional context line (e.g. scheme, destination) rendered under the H1. */ subtitle?: string; sections: LeakReportSection[]; } export declare function renderLeakReportHtml(input: RenderLeakReportInput): string; /** * Render and persist the HTML report. Returns the absolute path it was * written to. The caller is responsible for choosing the path (so the same * helper drives both the XCTest and XCUITest tools without each tool having * to know about path conventions). */ export declare function writeLeakReportHtml(outputPath: string, input: RenderLeakReportInput): string; export declare function _resetTemplateCacheForTests(): void; export declare function _templatePathForTests(): string; export declare const LEAK_REPORT_TEMPLATE_PATH: string; export type { LeakReportSection as LeakReportSectionType };