header
uses tcmts.cli.style.dim, which uses node:util
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import { cutSignature } from "#codebase/tcmts/cli/main"; import { Placement } from "#codebase/tcmts/cli/placement"; import { bold, dim } from "#codebase/tcmts/cli/style"; import { shortHash } from "#codebase/tcmts/core/hash"; export function header(cb: Codebase, hash: string): string { const rec = cb.store.getDef(hash)!; const names = cb.store.pathsOf(hash); const line = `${dim("//")} ${bold(names.join(", ") || "(unnamed)")} ${dim(shortHash(hash))} ${dim(cutSignature(rec.kind === "type" ? rec.signature : ": " + cb.store.shownSignature(rec)))}`; if (rec.kind === "type") return line; const placement = new Placement(cb); return `${line} ${dim(`// ${placement.describe(hash)}`)}`; }
uses
- tcmts.cli.codebase.Codebase
- tcmts.cli.main.cutSignature
- tcmts.cli.placement.Placement
- tcmts.cli.style.bold
- tcmts.cli.style.dim
- tcmts.core.hash.shortHash