/** * Shared formatting helpers used across components. * * Keep these dependency-free so they can be imported by both server- * rendered Astro components and any future client-side scripts. */ /** * Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79". * Used for hero/header star counts and other large-num displays. */ export declare function compact(n: number): string; /** * Format a star count compactly. Returns null when input is not a * finite number, so callers can render "—" without an extra guard. */ export declare function formatStars(n: number | null | undefined): string | null; /** * Format an ISO date as a human "Xd ago" / "Xmo ago" / "Xy ago" string. * Returns "—" for missing or invalid input, and "today" for future * dates (which can happen with bad upstream timestamps). */ export declare function formatRelative(iso: string | null | undefined): string; /** * Trim text to `max` characters on a **word boundary**, appending an * ellipsis when anything was dropped. * * Card descriptions are also `line-clamp`ed, but a CSS clamp cuts at * the character the box runs out of room on — which is how a grid ends * up reading "…and multi-", "…and retrieval", "…an". Trimming first * means the clamp has nothing left to cut mid-word on a normal card. */ export declare function truncateWords(text: string, max?: number): string; /** * Pick the singular or plural noun for a count. The plural form is * explicit — never derived with a naive `+"s"` — so blueprint labels * with irregular plurals ("entity"/"entities") render correctly. */ export declare function pluralize(count: number, singular: string, plural: string): string; /** * Format a count with its noun: `formatCount(1, {singular: "project", * plural: "projects"})` → "1 project". The noun pair typically comes * from the blueprint labels, so every surface (grids, collection * cards, browse results) counts with the same vocabulary. */ export declare function formatCount(count: number, noun: { singular: string; plural: string; }): string; /** * Format an ISO date as a localized short date (e.g. "Jan 5, 2026"). * Returns the original string for unparseable input, or "—" when * no value is provided. */ export declare function formatDate(iso: string | null | undefined): string; //# sourceMappingURL=directory-format.d.ts.map