/** * Text formatting utilities for display and context estimation */ import type { Message, Model } from '../types/index.js'; /** * Estimate token count from text using character-based approximation * Rule: ~4 characters per token (conservative estimate) */ export declare function estimateTokens(text: string): number; /** * Estimate total tokens in a conversation */ export declare function estimateConversationTokens(messages: Message[]): number; /** * Calculate context usage percentage for a model */ export declare function calculateContextUsage(messages: Message[], model: Model): number; /** * Format context usage as percentage string */ export declare function formatContextUsage(usage: number): string; /** * Format model name for display * Example: "anthropic/claude-3-opus" -> "Claude 3 Opus" */ export declare function formatModelName(modelId: string): string; /** * Format timestamp for display * Example: "2025-11-08T10:00:00Z" -> "10:00 AM" */ export declare function formatTimestamp(timestamp: string | number): string; /** * Format date and time for display * Example: "2025-11-08T10:00:00Z" -> "Nov 8, 10:00 AM" */ export declare function formatDateTime(isoTimestamp: string): string; /** * Format duration in milliseconds to human-readable string */ export declare function formatDuration(milliseconds: number): string; /** * Truncate text to a maximum length with ellipsis */ export declare function truncate(text: string, maxLength: number): string; /** * Format price from string to human-readable format * Example: "0.000015" -> "$0.000015" */ export declare function formatPrice(priceString: string): string; /** * Format token count with thousands separator * Example: 150000 -> "150,000" */ export declare function formatTokenCount(tokens: number): string; /** * Pluralize a word based on count */ export declare function pluralize(word: string, count: number): string; /** * Format message count * Example: 5 -> "5 messages", 1 -> "1 message" */ export declare function formatMessageCount(count: number): string; /** * Word wrap text to a maximum line width */ export declare function wordWrap(text: string, maxWidth: number): string; /** * Strip ANSI color codes from text */ export declare function stripAnsi(text: string): string; /** * Get display width of text (accounting for multi-byte characters) */ export declare function getDisplayWidth(text: string): number; //# sourceMappingURL=formatting.d.ts.map