import type { PerformanceSummaryPayload } from '../../native'; import type { PerformanceSummary } from './performance-analysis'; /** * A recommendation built from structured parts so the link text comes from the * link definition (not a substring scanned out of the assembled report). A part * is either literal text or a {@link RecLink}; the renderers below project the * same parts to the terminal string, the payload string, and the popup links. */ type RecPart = string | RecLink; export type Recommendation = RecPart[]; /** * A docs link inside a recommendation: a sentence is the visible text and the whole of * it links to the utm-tagged URL. With OSC 8 the phrase is a hyperlink; without it the * tagged URL is appended as ` → `. The payload string is URL-less — the Rust popup * re-links the phrase from {@link PerformanceSummaryPayload.links}. */ interface RecLink { /** Visible label: the sentence that links. */ visible: string; /** OSC 8 click target / appended URL: the utm-tagged URL. */ href: string; } /** * The recommendation string the napi payload ships and the Rust popup matches against. * Links are URL-less (the popup re-links them from {@link PerformanceSummaryPayload.links}). */ export declare function recommendationToPayloadString(rec: Recommendation): string; /** Below this (ms) overhead is noise, not worth a recommendation. */ export declare const MEANINGFUL_OVERHEAD = 1000; /** * The recommendations the report shows, in display order: every candidate in * {@link RECOMMENDATIONS} whose criteria apply to this run. Shared by the terminal report, * the GitHub-summary Markdown, and the TUI payload. */ export declare function buildRecommendations(s: PerformanceSummary): Recommendation[]; /** The full performance report as a terminal string (the TUI popup renders natively from {@link buildExitSummaryPayload} instead). */ export declare function formatReport(s: PerformanceSummary): string; /** * The performance report as GitHub-flavored Markdown for the Actions job summary * (`$GITHUB_STEP_SUMMARY`). Mirrors {@link formatReport}'s content — the same stats and * recommendations — and, when the run had failures, lists them above the stats. Links * render as Markdown links rather than OSC 8 hyperlinks. * * `command` (the nx command, e.g. `run-many -t build`) is appended to the heading so * stacked reports from multiple nx commands in one job summary stay distinguishable. */ export declare function formatReportMarkdown(s: PerformanceSummary, command: string): string; /** * Build the payload for the TUI's exit-countdown popup, which renders natively in Rust * (the terminal path uses {@link formatReport}). The shape is the generated napi * {@link PerformanceSummaryPayload}, imported not re-declared so the producer and the * Rust struct can't drift. */ export declare function buildExitSummaryPayload(s: PerformanceSummary): PerformanceSummaryPayload; export {};