/** * @grove-dev/ui — formatting helpers (V1, dependency-free). * * Mirrors `open-apps/src/lib/format.ts` so the openapps-derived * component library and any other consumer (Astro, Svelte, Next.js) * can share the same string shaping. * * Keep these functions pure so they can run in both SSR and * 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 a number with thousands separators. 1234 → "1,234". Returns * "—" for non-finite / nullish input. Mirrors openapps `formatNumber`. */ export declare function formatNumber(n: number | null | undefined): string; /** * 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; /** * 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=format.d.ts.map