/** * @fileoverview Shared display-lookup helpers for fitness check packs. * * Each check pack contributes its own slug -> [icon, displayName] map; these * helpers do the lookup against that map with a sensible fallback. Previously * each pack carried a byte-identical copy of this lookup logic โ€” surfaced by * the graph tool's duplicated-function-body rule. */ import type { Check } from '../framework/check-types.js'; import type { CheckDisplayEntry } from '../plugins/types.js'; /** * Fold a pack's `slug -> [icon, displayName]` map ONTO its checks (ยง5.3 fold): * each check whose slug has an entry gets `icon`/`displayName` set on its * `config`, so display travels WITH the check and there is no separate * per-process display sidecar/singleton. Checks with no entry pass through * unchanged (consumers fall back to a default icon + kebab-to-title-case). * * `check.config` is pure metadata โ€” the check's `run`/`getScope`/`getMatcher` * closures capture the original author config, not `check.config` โ€” so adding * display to `check.config` is execution-safe. */ export declare function applyCheckDisplay(checks: readonly Check[], displayMap: Readonly>): Check[]; /** * Get the icon for a check by slug. Falls back to the magnifying-glass emoji * when the slug isn't present in the supplied display map. */ export declare function getCheckIcon(displayMap: Readonly>, checkSlug: string): string; /** * Get the display name for a check by slug. Falls back to kebab-to-title-case * conversion of the slug itself when no entry exists in the display map. */ export declare function getCheckDisplayName(displayMap: Readonly>, checkSlug: string): string; /** * Display helpers bound to a single check pack's display map. */ export interface DisplayHelpers { /** Get the icon for a check by slug. Falls back to the magnifying-glass emoji. */ getCheckIcon: (checkSlug: string) => string; /** Get the display name for a check by slug. Falls back to kebab-to-title-case. */ getCheckDisplayName: (checkSlug: string) => string; } /** * Binds the shared display-lookup logic to a per-pack `CHECK_DISPLAY` map, * returning slug-only `getCheckIcon` / `getCheckDisplayName` closures. * * Each check pack owns its own display data but the binding wrapper was * previously byte-identical across packs (flagged by the graph tool's * duplicated-function-body rule); this factory keeps the data/logic split * intact while erasing the wrapper twin. */ export declare function makeDisplayHelpers(displayMap: Readonly>): DisplayHelpers; //# sourceMappingURL=display.d.ts.map