/**
 * Duration Parsing and Formatting
 *
 * Handles conversion between duration strings (e.g., '5m', '500ms', '24h')
 * and millisecond values.
 */
import type { Duration, DurationString } from './types.js';
/**
 * Duration unit multipliers (to milliseconds)
 */
export declare const DURATION_UNITS: Record<string, number>;
/**
 * Checks if a value is a valid duration string
 */
export declare function isDurationString(value: unknown): value is DurationString;
/**
 * Parses a duration string to milliseconds
 *
 * @param value - Duration string (e.g., '5m', '500ms', '24h', '30d')
 * @returns Duration in milliseconds
 * @throws ValidationError if format is invalid
 *
 * @example
 * parseDuration('500ms') // 500
 * parseDuration('5s')    // 5000
 * parseDuration('5m')    // 300000
 * parseDuration('24h')   // 86400000
 * parseDuration('30d')   // 2592000000
 */
export declare function parseDuration(value: string): Duration;
/**
 * Parses a duration value that may be string or number
 *
 * @param value - Duration string or number (milliseconds)
 * @returns Duration in milliseconds
 */
export declare function parseDurationValue(value: string | number): Duration;
/**
 * Safely parses a duration, returning undefined on failure
 */
export declare function tryParseDuration(value: unknown): Duration | undefined;
/**
 * Formats a duration in milliseconds to a human-readable string
 * Uses the largest appropriate unit
 *
 * @param ms - Duration in milliseconds
 * @returns Formatted duration string
 *
 * @example
 * formatDuration(500)       // '500ms'
 * formatDuration(5000)      // '5s'
 * formatDuration(300000)    // '5m'
 * formatDuration(86400000)  // '24h'
 * formatDuration(2592000000) // '30d'
 */
export declare function formatDuration(ms: Duration): string;
/**
 * Formats a duration with appropriate precision for display
 * May produce decimal values for better readability
 *
 * @param ms - Duration in milliseconds
 * @returns Human-readable duration string
 */
export declare function formatDurationHuman(ms: Duration): string;
/**
 * Validates a duration is within an allowed range
 *
 * @param value - Duration in milliseconds
 * @param min - Minimum allowed value
 * @param max - Maximum allowed value
 * @param field - Field name for error messages
 * @returns The validated duration
 */
export declare function validateDurationRange(value: Duration, min: Duration, max: Duration, field: string): Duration;
//# sourceMappingURL=duration.d.ts.map