/** * Token amounts for owners: "12.4M tokens" out, "20M" / "500k" / "2000万" in. * * specs/2026-10-02-spend-cap.md §Token unit * * @module services/usage/token-format */ /** * Short token count: `950`, `12.4K`, `12.4M`, `1.2B`. * * @param tokens - Token count * @returns Compact text (no unit) * * @example * compactTokens(12_400_000) // '12.4M' */ export declare function compactTokens(tokens: number): string; /** * Token count for owner text. * * @param tokens - Token count * @returns e.g. `12.4M tokens` */ export declare function formatTokens(tokens: number): string; /** * Parse a token amount the owner typed. * * Accepts a plain number, `K`/`M`/`B` suffixes (any case, `mil`/`million` * too), Chinese `万` (10k) / `亿` (100M), commas, and an optional trailing * `tokens` / `token`. * * @param text - Amount text * @returns Whole tokens, or null when it is not a positive amount * * @example * parseTokenAmount('20M') // 20_000_000 * parseTokenAmount('2000万') // 20_000_000 * parseTokenAmount('1.5b tokens') // 1_500_000_000 */ export declare function parseTokenAmount(text: unknown): number | null; /** * Convert a USD setting to tokens with the documented migration rate * ({@link USAGE_CONSTANTS.TOKENS_PER_USD}), rounded to a whole thousand. * * @param usd - Dollars * @returns Tokens */ export declare function usdToTokens(usd: number): number; //# sourceMappingURL=token-format.d.ts.map