import { ClassValue } from 'clsx'; /** * Combines class names using clsx and merges Tailwind classes intelligently. * This is the standard utility for conditional and merged class names. * * @param inputs - Class values to combine (strings, objects, arrays) * @returns Merged class string with Tailwind conflicts resolved * * @example * cn('px-4 py-2', isActive && 'bg-blue-500', { 'opacity-50': isDisabled }) * // Returns: "px-4 py-2 bg-blue-500" (if isActive is true, isDisabled is false) */ declare function cn(...inputs: ClassValue[]): string; /** * Formatting utilities for display purposes */ /** * Truncates an address or ID for display. * Shows first N characters after optional prefix. * * @param value - The full address or ID string * @param chars - Number of characters to show (default: 5) * @param prefix - Prefix to skip (default: '0x') * @returns Truncated string * * @example * truncateId('0x123456789098765432') // Returns: '12345' * truncateId('0x123456789098765432', 8) // Returns: '12345678' */ declare function truncateId(value: string, chars?: number, prefix?: string): string; /** * Converts an IPFS URI to an HTTP gateway URL. * * @param uri - The IPFS URI (ipfs://... format) * @param gateway - The gateway to use (default: ipfs.io) * @returns HTTP URL for the content * * @example * ipfsToHttp('ipfs://QmHash123') // Returns: 'https://ipfs.io/ipfs/QmHash123' */ declare function ipfsToHttp(uri: string | undefined | null, gateway?: string): string | undefined; /** * Formats a number with compact notation (K, M, B, etc.) * * @param value - The number to format * @param decimals - Maximum decimal places (default: 2) * @returns Formatted string * * @example * formatCompact(1500) // Returns: '1.5K' * formatCompact(2500000) // Returns: '2.5M' */ declare function formatCompact(value: number, decimals?: number): string; /** * Strengthens/normalizes an image URL to ensure it's displayable. * Handles IPFS URIs, raw IPFS hashes, and validates HTTP URLs. * * @param url - The image URL to process * @returns A normalized HTTP(S) URL * * @example * strengthenImageUrl('ipfs://QmHash123') // Returns: 'https://ipfs.io/ipfs/QmHash123' * strengthenImageUrl('QmHash123') // Returns: 'https://ipfs.io/ipfs/QmHash123' * strengthenImageUrl('https://example.com/img.png') // Returns: 'https://example.com/img.png' */ declare function strengthenImageUrl(url?: string): string; /** * Ellipsizes a string by showing characters from start and end with '...' in middle. * * @param str - The string to ellipsize * @param length - Total visible characters (split between start and end) * @returns Ellipsized string or original if shorter than length * * @example * ellipsizeString('0x1234567890abcdef', 8) // Returns: '0x12...cdef' */ declare function ellipsizeString(str: string | undefined | null, length: number): string; /** * Ellipsizes a hex string (0x-prefixed) preserving the prefix. * * @param hex - The hex string to ellipsize (must start with 0x) * @param length - Visible characters in the payload (default: 12) * @returns Ellipsized hex string * @throws Error if hex doesn't start with 0x * * @example * ellipsizeHex('0x1234567890abcdef1234567890abcdef') // Returns: '0x123456...abcdef' */ declare function ellipsizeHex(hex: string, length?: number): string; /** * Truncates a string to a specified length, adding '...' at the end. * * @param str - The string to truncate * @param length - Maximum length before truncation * @returns Truncated string with '...' or original if shorter * * @example * truncateString('Hello World', 5) // Returns: 'Hello...' */ declare function truncateString(str: string | undefined | null, length: number): string; /** * Intelligently shortens a label based on its type (hex, URL, IPFS, DID, etc.) * This is the main utility for displaying atom/entity labels in the UI. * * @param label - The label to shorten * @param length - Maximum length for generic strings (default: 50) * @returns Shortened label appropriate for its type * * @example * shortenLabel('0x1234567890abcdef...') // Returns: '0x1234...cdef' * shortenLabel('https://example.com/page') // Returns: 'example.com/page' * shortenLabel('ipfs://bafkre...') // Returns: 'bafkre...xyz' */ declare function shortenLabel(label: string | null | undefined, length?: number): string; /** * Capitalizes the first letter of a string. * * @param str - The string to capitalize * @returns String with first letter capitalized * * @example * capitalizeFirstLetter('hello') // Returns: 'Hello' */ declare function capitalizeFirstLetter(str: string): string; /** * Capitalizes the first letter of each word in a phrase. * * @param phrase - The phrase to capitalize * @returns Phrase with each word capitalized * * @example * capitalize('hello world') // Returns: 'Hello World' */ declare function capitalize(phrase: string): string; /** * Converts seconds to a compact human-readable format (e.g., "5d", "3h", "10m"). * * @param seconds - Number of seconds * @returns Compact time string * * @example * secondsToHms(3700) // Returns: '1h' * secondsToHms(90) // Returns: '1m' */ declare function secondsToHms(seconds: number): string; /** * Formats a date as a human-readable "time ago" string. * Handles various date input formats including Unix timestamps. * * @param date - Date object, ISO string, or Unix timestamp (10 or 13 digits) * @param ago - Whether to append "ago" suffix (default: true) * @returns Human-readable time difference string * * @example * timeAgo(new Date(Date.now() - 3600000)) // Returns: '1h ago' * timeAgo('1703001600', false) // Returns: '5d' */ declare function timeAgo(date: Date | string, ago?: boolean): string; /** * Converts seconds to a descriptive duration string (e.g., "5 d", "3 h"). * * @param inputVar - Seconds as number or string * @returns Duration string with space before unit * * @example * secondsToDhms(90000) // Returns: '1 d' */ declare function secondsToDhms(inputVar: string | number): string; export { capitalize, capitalizeFirstLetter, cn, ellipsizeHex, ellipsizeString, formatCompact, ipfsToHttp, secondsToDhms, secondsToHms, shortenLabel, strengthenImageUrl, timeAgo, truncateId, truncateString };