/** * Legend and summary footer rendering. * * @remarks * `renderLegend` produces a compact glossary mapping icons to labels โ€” e.g. * `โœ… done ๐Ÿšง active โณ pending` โ€” that complements a tree, table, or list. * `renderSummary` produces a one-line aggregate footer such as * `15 Sagas ยท 89 member Epics ยท 1 orphan`. * * Both helpers honor the {@link AnimateContext} gate and emit the empty string * when rendering is disabled. * * @epic T10114 * @task T10128 * @subtask T10146 */ import type { AnimateContext } from '../animate-context.js'; /** One legend entry โ€” icon glyph + plain-text label. */ export interface LegendItem { /** Pre-resolved icon glyph (caller is responsible for ASCII selection). */ readonly icon: string; /** Plain-text label rendered after the icon. */ readonly label: string; } /** Inputs to {@link renderLegend}. */ export interface RenderLegendInput { /** Icon โ†’ label pairs rendered in order. */ readonly items: ReadonlyArray; /** Render gate โ€” primitive returns `''` when `enabled === false`. */ readonly ctx: AnimateContext; /** * When the item count is `<=` this threshold the legend renders as a single * line; above it the legend renders one item per line. Defaults to `8`. */ readonly multiLineThreshold?: number; } /** * Render an icon legend โ€” one-line for small counts, multi-line otherwise. * * @param input - Legend items, render gate, and optional threshold. * @returns The formatted legend string. Empty when `input.ctx.enabled` is `false` * or `input.items` is empty. * * @example * ```ts * renderLegend({ * ctx, * items: [ * { icon: 'โœ…', label: 'done' }, * { icon: '๐Ÿšง', label: 'active' }, * { icon: 'โณ', label: 'pending' }, * ], * }); * // โ†’ 'โœ… done ๐Ÿšง active โณ pending' * ``` */ export declare function renderLegend(input: RenderLegendInput): string; /** One aggregate count cell in {@link renderSummary}. */ export interface SummaryCount { /** Human-readable label (e.g. `'Sagas'`, `'member Epics'`). */ readonly label: string; /** Numeric count rendered before the label. */ readonly n: number; } /** Inputs to {@link renderSummary}. */ export interface RenderSummaryInput { /** Counts rendered left-to-right, separated by middle dots. */ readonly counts: ReadonlyArray; /** Render gate โ€” primitive returns `''` when `enabled === false`. */ readonly ctx: AnimateContext; } /** * Render a one-line aggregate summary footer. * * @param input - Counts to render and the gate context. * @returns The formatted summary string. Empty when `input.ctx.enabled` is `false` * or `input.counts` is empty. * * @example * ```ts * renderSummary({ * ctx, * counts: [ * { label: 'Sagas', n: 15 }, * { label: 'member Epics', n: 89 }, * { label: 'orphan', n: 1 }, * ], * }); * // โ†’ '15 Sagas ยท 89 member Epics ยท 1 orphan' * ``` */ export declare function renderSummary(input: RenderSummaryInput): string; //# sourceMappingURL=legend.d.ts.map