import * as React from "react";
import type { Datum } from "./datumTypes";
/**
 * Format number with specified format string
 *
 * @param value - Number to format
 * @param formatString - D3 format string (e.g., ".2f", ",.0f", ".1%")
 * @returns Formatted string
 *
 * @see https://github.com/d3/d3-format#format for format string options
 */
export declare function formatNumber(value: number, formatString?: string): string;
/**
 * Format date with specified format string
 *
 * @param value - Date to format
 * @param formatString - D3 time format string (e.g., "%Y-%m-%d", "%b %d")
 * @returns Formatted string
 *
 * @see https://github.com/d3/d3-time-format#timeFormat for format string options
 */
export declare function formatDate(value: Date | number | string, formatString?: string): string;
/**
 * Creates a formatting function based on the type
 *
 * @param type - Type of formatting: 'number', 'date', 'percent', or 'currency'
 * @param options - Optional configuration for the formatter
 * @returns Formatting function
 *
 * @example
 * ```ts
 * const fmt = formatAxis('number', { decimals: 2 })
 * fmt(1234.567) // "1,234.57"
 *
 * const dateFmt = formatAxis('date', { format: '%b %Y' })
 * dateFmt(new Date()) // "Jan 2024"
 * ```
 */
export declare function formatAxis(type?: "number" | "date" | "percent" | "currency", options?: {
    decimals?: number;
    format?: string;
    currency?: string;
}): (d: number | string | Date) => string;
/**
 * Creates a tooltip content generator
 *
 * @param fields - Array of field names to display
 * @param formatters - Optional map of field names to formatting functions
 * @param labels - Optional map of field names to display labels
 * @returns React element generator function
 *
 * @example
 * ```ts
 * const tooltip = createTooltip(
 *   ['category', 'value'],
 *   { value: d => formatNumber(d, ',.2f') },
 *   { category: 'Category', value: 'Value' }
 * )
 * ```
 */
export declare function createTooltip(fields: string[], formatters?: Record<string, (v: any) => string>, labels?: Record<string, string>): (d: Datum) => React.JSX.Element;
/**
 * Formats large numbers with K/M/B suffixes
 *
 * @param value - Number to format
 * @param decimals - Number of decimal places
 * @returns Formatted string with suffix
 *
 * @example
 * ```ts
 * formatLargeNumber(1234) // "1.2K"
 * formatLargeNumber(1234567) // "1.2M"
 * formatLargeNumber(1234567890) // "1.2B"
 * ```
 */
export declare function formatLargeNumber(value: number, decimals?: number): string;
/**
 * Smart default tick format for axis labels.
 *
 * Handles the common problems with raw number-to-string conversion:
 * - Floating-point noise (0.30000000000000004 → "0.3")
 * - Excessive precision (62.123456789 → "62.1235")
 * - Large numbers (1500000 → "1.5M")
 * - Strings/non-numbers pass through unchanged
 *
 * Used as the default axis tickFormat when no explicit format is provided.
 */
export declare function smartTickFormat(value: any): string;
type TimeGranularity = "seconds" | "minutes" | "hours" | "days" | "months" | "years";
/**
 * Creates a hierarchical time axis formatter.
 *
 * The first tick is fully qualified (e.g., "Mar 24, 2026 14:33:52").
 * Subsequent ticks show only the significant unit change (e.g., ":53").
 * When a time boundary is crossed (new minute, hour, day, etc.), the
 * label re-qualifies up to that boundary (e.g., "14:34:00").
 *
 * Designed to be passed as `xFormat` on any Semiotic XY chart.
 * Uses the extended `(value, index, allTicks)` signature.
 *
 * @param granularity - Optional explicit granularity. If omitted,
 *   auto-detected from the tick spacing on first call.
 *
 * @example
 * ```tsx
 * import { adaptiveTimeTicks } from "semiotic"
 *
 * // Auto-detect granularity from the data
 * <LineChart data={ts} xFormat={adaptiveTimeTicks()} />
 *
 * // Explicit granularity
 * <LineChart data={ts} xFormat={adaptiveTimeTicks("minutes")} />
 * ```
 */
export declare function adaptiveTimeTicks(granularity?: TimeGranularity): (value: any, index?: number, allTicks?: number[]) => string;
/**
 * Truncates text to specified length with ellipsis
 *
 * @param text - Text to truncate
 * @param maxLength - Maximum length before truncation
 * @returns Truncated text
 */
export declare function truncateText(text: string, maxLength?: number): string;
export {};
