/** * File size validation and conversion utility * Converts human-readable file size strings to bytes */ export interface FileSizeValidationResult { isValid: boolean; bytes: number; error?: string; } /** * Validates and converts a file size string to bytes * * @param sizeInput - Size string (e.g., "10MB", "1.5G", "512", "500KB") * @returns Validation result with bytes value or error * * @example * validateFileSize("10MB") // { isValid: true, bytes: 10485760 } * validateFileSize("1.5G") // { isValid: true, bytes: 1610612736 } * validateFileSize("invalid") // { isValid: false, bytes: 0, error: "Invalid format" } */ export declare function validateFileSize(sizeInput: string): FileSizeValidationResult; /** * Converts bytes to human-readable format * * @param bytes - Number of bytes * @param decimals - Number of decimal places (default: 1) * @returns Formatted string (e.g., "10.5 MB", "1.2 GB") */ export declare function formatBytes(bytes: number, decimals?: number): string; /** * Convenience function that throws an error if validation fails * * @param sizeInput - Size string to validate * @returns Number of bytes * @throws Error if validation fails */ export declare function parseFileSize(sizeInput: string): number;