import type { Helper } from "../helper-registry.js"; /** * Format a number to its equivalent in bytes. If a string is passed, * its length will be formatted and returned. * Useful for displaying test file sizes, memory usage, or data transfer amounts in test reports. * * @example * {{bytes test.stats.totalFileSize}} * * * * {{bytes test.name}} * * * * {{bytes test.stats.coverageSize}} * * * * **Use with CTRF templates**: Perfect for displaying test artifact sizes, log file sizes, or memory consumption metrics in test reports. * * @param {unknown} number - The number or string from test data to format as bytes. * @returns {string} The formatted byte string for use in test reports. */ export declare const bytesHelper: Helper; /** * Add commas to numbers for improved readability. * Useful for formatting large numbers like test counts, execution times, or file sizes in test reports. * * @example * {{addCommas test.stats.totalTests}} * * * * {{addCommas test.duration}} * * * * {{addCommas test.stats.assertions}} * * * * **Use with CTRF templates**: Essential for making large test metrics readable, such as total test counts, assertion counts, or execution times in milliseconds. * * @param {unknown} num - The number from test data to format with commas. * @returns {string} The comma-formatted number string for use in test reports. */ export declare const addCommasHelper: Helper; /** * Convert a string or number to a formatted phone number. * Useful for formatting contact information in test reports or user data validation tests. * * @example * {{phoneNumber test.user.phone}} * * * * {{phoneNumber "5551234567"}} * * * {{phoneNumber test.contactInfo.emergencyPhone}} * * * **Use with CTRF templates**: Useful when testing applications with user registration, contact forms, or when displaying formatted test data that includes phone numbers. * * @param {unknown} num - The phone number from test data to format, e.g., `8005551212`. * @returns {string} Formatted phone number: `(800) 555-1212` for use in test reports. */ export declare const phoneNumberHelper: Helper; /** * Abbreviate numbers to the given number of precision. This is for * general numbers, not size in bytes. * Useful for displaying large test metrics like execution counts or performance numbers in test reports. * * @example * {{abbreviateNumber test.stats.totalAssertions "2"}} * * * * {{abbreviateNumber test.performance.opsPerSecond "1"}} * * * * {{abbreviateNumber test.stats.memoryUsage "3"}} * * * * **Use with CTRF templates**: Perfect for dashboard displays showing abbreviated test metrics, performance indicators, or large statistical values without overwhelming the report layout. * * @param {unknown} number - The number from test data to abbreviate. * @param {unknown} precision - The number of decimal places to show. * @returns {string} The abbreviated number string for use in test reports. */ export declare const abbreviateNumberHelper: Helper; /** * Returns a string representing the given number in exponential notation. * Useful for displaying very large or very small test metrics and scientific notation in test reports. * * @example * {{toExponential test.stats.totalExecutions}} * * * * {{toExponential test.performance.nanoseconds "2"}} * * * * {{toExponential test.stats.bigNumber "4"}} * * * **Use with CTRF templates**: Ideal for scientific test data, performance benchmarks with extreme values, or when displaying test results that involve very large or very small numbers. * * @param {unknown} number - The number from test data to convert to exponential notation. * @param {unknown} fractionDigits - Optional. The number of digits after the decimal point. * @returns {string} The exponential notation string for use in test reports. */ export declare const toExponentialHelper: Helper; /** * Formats the given number using fixed-point notation. * Useful for displaying consistent decimal precision in test metrics, percentages, and measurements in test reports. * * @example * {{toFixed test.coverage.percentage "2"}} * * * * {{toFixed test.performance.avgResponseTime "3"}} * * * * {{toFixed test.stats.successRate "1"}} * * * * **Use with CTRF templates**: Essential for displaying consistent formatting of percentages, timing data, success rates, and any decimal values in test reports. * * @param {unknown} number - The number from test data to format with fixed-point notation. * @param {unknown} digits - Optional. The number of digits after the decimal point (0-20). * @returns {string} The fixed-point formatted string for use in test reports. */ export declare const toFixedHelper: Helper; /** * Returns a string representing the Number object to the specified precision. * Useful for displaying test metrics with consistent significant digits and scientific precision in test reports. * * @example * {{toPrecision test.performance.throughput "3"}} * * * * {{toPrecision test.stats.memoryUsage "5"}} * * * * {{toPrecision test.timing.duration "2"}} * * * * **Use with CTRF templates**: Perfect for displaying performance metrics, scientific test data, or any values where you need consistent significant digit precision across different scales. * * @param {unknown} number - The number from test data to format with specified precision. * @param {unknown} precision - Optional. The number of significant digits (1-100). * @returns {string} The precision-formatted string for use in test reports. */ export declare const toPrecisionHelper: Helper; /** * Converts a decimal rate (0-1) to a percentage with fixed decimal places. * This is specifically for rates from the CTRF insights that are calculated as decimals. * Useful for displaying test success rates, failure rates, flaky rates, and coverage percentages in test reports. * * @example * {{toPercent test.stats.successRate 2}} * * * * {{toPercent test.coverage.failRate 1}} * * * * {{toPercent test.performance.flakyRate 3}} * * * * **Use with CTRF templates**: Essential for displaying test rates, success/failure percentages, coverage metrics, and any decimal values that represent ratios as readable percentages in test reports. * * @param {unknown} rate - The numeric rate as a decimal (0-1) from test data. * @param {unknown} fractionDigits - Optional. The number of decimal places (0-20). Defaults to 2. * @returns {string} The formatted percentage string for use in test reports. */ export declare const toPercentHelper: Helper; export declare const numberHelpers: Helper[];