import type { Helper } from "../helper-registry.js"; /** * Append the specified `suffix` to the given string. * * @example * {{append test.name " [FLAKY]"}} * * * * {{append test.suite.name "."}}{{append test.name ".log"}} * * * @param {unknown} str - The base string from test data. * @param {unknown} suffix - The suffix to append (e.g., status, file extension, identifier). * @returns {string} The concatenated string for use in test reports. */ export declare const appendHelper: Helper; /** * Convert the given string to camelCase format. * Useful for creating consistent property names, test identifiers, or file naming conventions in test reports. * * @example * {{camelcase "User Login Test"}} * * * * {{camelcase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to camelCase. * @returns {string} The camelCased string for use in test reports and identifiers. */ export declare const camelCaseHelper: Helper; /** * Capitalize the first word in a sentence. * Useful for formatting test names, suite descriptions, and error messages in test reports. * * @example * {{capitalize test.name}} * * * * {{capitalize test.suite.name}} * * * * @param {unknown} str - The string from test data to capitalize. * @returns {string} The string with the first character capitalized for use in test reports. */ export declare const capitalizeHelper: Helper; /** * Capitalize all words in a string. * Useful for formatting test suite titles, section headers, and display names in test reports. * * @example * {{capitalizeAll test.suite.name}} * * * * {{capitalizeAll "api endpoint validation"}} * * * @param {unknown} str - The string from test data to capitalize all words. * @returns {string} The string with all words capitalized for use in test reports. */ export declare const capitalizeAllHelper: Helper; /** * Center a string using non-breaking spaces. * Useful for formatting test report headers, status indicators, and table columns. * * @example * {{center test.status "20"}} * * * * {{center "Test Results" "30"}} * * * @param {unknown} str - The string from test data to center. * @param {unknown} spaces - The total width for centering. * @returns {string} The centered string for use in test reports. */ export declare const centerHelper: Helper; /** * Remove both extraneous whitespace and non-word characters from the beginning and end of a string. * Useful for cleaning test names, error messages, and file paths in test reports. * * @example * {{chop " __Test Name__ "}} * * * {{chop "---API-Test---"}} * * * {{chop test.name}} * * * @param {unknown} str - The string from test data to clean. * @returns {string} The cleaned string for use in test reports. */ export declare const chopHelper: Helper; /** * Convert characters to dash-case (kebab-case). * Useful for creating URL-friendly test identifiers, file names, and CSS classes in test reports. * * @example * {{dashcase "User Login Test"}} * * * {{dashcase test.suite.name}} * * * {{dashcase "Database_Connection Test"}} * * * @param {unknown} str - The string from test data to convert to dash-case. * @returns {string} The dash-cased string for use in test reports and identifiers. */ export declare const dashCaseHelper: Helper; /** * Convert characters to dot.case format. * Useful for creating property paths, configuration keys, and structured identifiers in test reports. * * @example * {{dotcase "User Login Test"}} * * * {{dotcase test.suite.name}} * * * {{dotcase "Database_Connection-Test"}} * * * @param {unknown} str - The string from test data to convert to dot.case. * @returns {string} The dot.cased string for use in test reports and identifiers. */ export declare const dotCaseHelper: Helper; /** * Convert all characters to lowercase. * Useful for normalizing test names, tags, and identifiers in test reports. * * @example * {{downcase test.status}} * * * {{downcase "API ENDPOINT TEST"}} * * * {{downcase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to lowercase. * @returns {string} The lowercased string for use in test reports. */ export declare const downCaseHelper: Helper; /** * Truncate a string to the specified length and append an ellipsis (…). * Useful for creating summary views and limiting long test names or messages in test reports. * * @example * {{ellipsis test.name "20"}} * * * * {{ellipsis test.message "50"}} * * * @param {unknown} str - The string from test data to truncate. * @param {unknown} length - The maximum length before truncation. * @returns {string} The truncated string with ellipsis for use in test reports. */ export declare const ellipsisHelper: Helper; /** * Replace spaces in a string with hyphens. * Useful for creating URL-friendly identifiers and file names in test reports. * * @example * {{hyphenate test.name}} * * * {{hyphenate test.suite.name}} * * * @param {unknown} str - The string from test data to hyphenate. * @returns {string} The hyphenated string for use in test reports. */ export declare const hyphenateHelper: Helper; /** * Return true if the value is a string. * Useful for conditional logic and validation in test report templates. * * @example * {{#if (isString test.name)}} * Test: {{test.name}} * {{/if}} * * {{isString test.status}} * * * @param {unknown} value - The value from test data to check. * @returns {boolean} True if the value is a string for use in test reports. */ export declare const isStringHelper: Helper; /** * Convert all characters to lowercase. * Useful for normalizing test names, tags, and identifiers in test reports. * * @example * {{lowercase test.status}} * * * {{lowercase "API ENDPOINT TEST"}} * * * {{lowercase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to lowercase. * @returns {string} The lowercased string for use in test reports. */ export declare const lowerCaseHelper: Helper; /** * Count the number of occurrences of a substring within a string. * Useful for analyzing test patterns, counting failures, or frequency analysis in test reports. * * @example * {{occurrences test.name "API"}} * * * {{occurrences test.message "error"}} * * * @param {unknown} str - The string from test data to search in. * @param {unknown} substring - The substring to count occurrences of. * @returns {number} The number of occurrences for use in test reports. */ export declare const occurrencesHelper: Helper; /** * Convert string to PascalCase format. * Useful for creating class names, component names, and identifiers in test reports. * * @example * {{pascalcase "user login test"}} * * * {{pascalcase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to PascalCase. * @returns {string} The PascalCased string for use in test reports. */ export declare const pascalCaseHelper: Helper; /** * Convert string to path/case format using forward slashes. * Useful for creating file paths, URL paths, and hierarchical identifiers in test reports. * * @example * {{pathcase "User Login Test"}} * * * {{pathcase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to path/case. * @returns {string} The path/cased string for use in test reports. */ export declare const pathCaseHelper: Helper; /** * Replace spaces in the given string with pluses. * Useful for creating URL-safe query parameters and encoded test identifiers in test reports. * * @example * {{plusify test.name}} * * * {{plusify "API Endpoint Test"}} * * * @param {unknown} str - The string from test data to convert spaces to pluses. * @returns {string} The string with spaces replaced by plus signs for use in test reports. */ export declare const plusifyHelper: Helper; /** * Prepend the given string with the specified prefix. * Useful for adding status indicators, test categories, or formatting in test reports. * * @example * {{prepend test.name "✓ "}} * * * * {{prepend test.status "Status: "}} * * * @param {unknown} str - The base string from test data. * @param {unknown} prefix - The prefix to prepend (e.g., status, category, icon). * @returns {string} The prefixed string for use in test reports. */ export declare const prependHelper: Helper; /** * Render a block without processing Handlebars templates inside the block. * Useful for displaying raw template code or examples in test documentation. * * @example * {{{{#raw}}}} * {{test.name}} - {{test.status}} * {{{{/raw}}}} * * * @param {Object} options - Handlebars options object. * @returns {string} The raw content without template processing. */ export declare const rawHelper: Helper; /** * Remove all occurrences of substring from the given string. * Useful for cleaning test names, removing unwanted characters, or filtering content in test reports. * * @example * {{remove test.name "_test"}} * * * {{remove "User_Login_Test_Suite" "_"}} * * * @param {unknown} str - The string from test data to process. * @param {unknown} substring - The substring to remove from the string. * @returns {string} The string with all occurrences removed for use in test reports. */ export declare const removeHelper: Helper; /** * Remove the first occurrence of substring from the given string. * Useful for cleaning test prefixes or removing specific patterns in test reports. * * @example * {{removeFirst test.name "test_"}} * * * {{removeFirst "API_Test_API_Suite" "API_"}} * * * @param {unknown} str - The string from test data to process. * @param {unknown} substring - The substring to remove (first occurrence only). * @returns {string} The string with first occurrence removed for use in test reports. */ export declare const removeFirstHelper: Helper; /** * Replace all occurrences of substring a with substring b. * Useful for normalizing test data, fixing formatting, or transforming content in test reports. * * @example * {{replace test.name "_" " "}} * * * {{replace test.status "PASSED" "✓ PASSED"}} * * * @param {unknown} str - The string from test data to process. * @param {unknown} a - The substring to find and replace. * @param {unknown} b - The replacement substring. * @returns {string} The string with all replacements made for use in test reports. */ export declare const replaceHelper: Helper; /** * Replace the first occurrence of substring a with substring b. * Useful for targeted replacements and formatting in test reports. * * @example * {{replaceFirst test.name "Test" "Suite"}} * * * {{replaceFirst test.message "Error:" "⚠️ Error:"}} * * * @param {unknown} str - The string from test data to process. * @param {unknown} a - The substring to find and replace (first occurrence only). * @param {unknown} b - The replacement substring. * @returns {string} The string with first replacement made for use in test reports. */ export declare const replaceFirstHelper: Helper; /** * Reverse a string. * Useful for creating reversed views, debugging, or special formatting in test reports. * * @example * {{reverse test.name}} * * * {{reverse "API"}} * * * @param {unknown} str - The string from test data to reverse. * @returns {string} The reversed string for use in test reports. */ export declare const reverseHelper: Helper; /** * Sentence case the given string - capitalize first letter of each sentence. * Useful for formatting test descriptions and error messages in test reports. * * @example * {{sentence "hello world. goodbye world."}} * * * {{sentence test.message}} * * * @param {unknown} str - The string from test data to convert to sentence case. * @returns {string} The sentence-cased string for use in test reports. */ export declare const sentenceHelper: Helper; /** * Convert string to snake_case format. * Useful for creating database-friendly identifiers and consistent naming in test reports. * * @example * {{snakecase "User Login Test"}} * * * {{snakecase test.suite.name}} * * * @param {unknown} str - The string from test data to convert to snake_case. * @returns {string} The snake_cased string for use in test reports. */ export declare const snakeCaseHelper: Helper; /** * Split string by the given character. * Useful for parsing test data, tags, or creating arrays from delimited strings in test reports. * * @example * {{split test.tags ","}} * * * {{split test.name " "}} * * * @param {unknown} str - The string from test data to split. * @param {unknown} separator - The character or string to split by. * @returns {string[]} The array of split strings for use in test reports. */ export declare const splitHelper: Helper; /** * Splits the given text into an array of lines, omitting any empty lines. * Useful for processing multiline strings and iterating over each line in test reports. * Perfect for handling stack traces, error messages, or console output. * * @example * {{#each (splitLines test.error.stack)}} *
{{this}}
* {{/each}} * * {{splitLines "Line one\n\nLine two\nLine three"}} * * * @param {unknown} str - The input string containing one or more lines. * @returns {string[]} An array of non-empty lines. * Use to process multiline test output, stack traces, or error messages. */ export declare const splitLinesHelper: Helper; /** * Extracts a section of a string and returns a new string based on start and end indices. * Useful for extracting portions of test IDs, commit hashes, or truncating strings to specific positions. * * @example * {{sliceString "d9a40a70dd26e3b309e9d106adaca2417d4ffb1e" 0 7}} * * * {{sliceString test.commitHash 0 8}} * * * {{sliceString test.name 5}} * * * @param {unknown} str - The input string to slice. * @param {unknown} start - The index of the first character to include in the returned substring. * @param {unknown} end - Optional. The index of the first character to exclude from the returned substring. * @returns {string} A new string containing the extracted section. * Use to extract specific portions of strings like IDs, hashes, or file paths. */ export declare const sliceStringHelper: Helper; /** * Test whether a string begins with the given prefix. * Useful for conditional logic and filtering in test report templates. * * @example * {{#if (startsWith test.name "API")}} * 🌐 {{test.name}} * {{else}} * {{test.name}} * {{/if}} * * {{startsWith test.suite.name "Integration"}} * * * @param {unknown} str - The string from test data to check. * @param {unknown} prefix - The prefix to test for. * @returns {boolean} True if string starts with prefix for use in test reports. */ export declare const startsWithHelper: Helper; /** * Title case the given string - capitalize the first letter of each word. * Useful for formatting test suite names, section headers, and display titles in test reports. * * @example * {{titleize "this is title case"}} * * * {{titleize test.suite.name}} * * * @param {unknown} str - The string from test data to convert to title case. * @returns {string} The title-cased string for use in test reports. */ export declare const titleizeHelper: Helper; /** * Remove extraneous whitespace from the beginning and end of a string. * Useful for cleaning test data and normalizing input in test reports. * * @example * {{trim " User Login Test "}} * * * {{trim test.name}} * * * @param {unknown} str - The string from test data to trim. * @returns {string} The trimmed string for use in test reports. */ export declare const trimHelper: Helper; /** * Remove extraneous whitespace from the beginning of a string. * Useful for cleaning left-aligned content and formatting in test reports. * * @example * {{trimLeft " User Login Test "}} * * * {{trimLeft test.name}} * * * @param {unknown} str - The string from test data to left-trim. * @returns {string} The left-trimmed string for use in test reports. */ export declare const trimLeftHelper: Helper; /** * Remove extraneous whitespace from the end of a string. * Useful for cleaning right-aligned content and formatting in test reports. * * @example * {{trimRight " User Login Test "}} * * * {{trimRight test.name}} * * * @param {unknown} str - The string from test data to right-trim. * @returns {string} The right-trimmed string for use in test reports. */ export declare const trimRightHelper: Helper; /** * Truncate a string to the specified length. * Useful for creating consistent layouts and limiting content length in test reports. * * @example * {{truncate test.name "15"}} * * * {{truncate test.message "50" "..."}} * * * @param {unknown} str - The string from test data to truncate. * @param {unknown} limit - The maximum length as a string. * @param {unknown} suffix - Optional suffix when truncated (defaults to "…"). * @returns {string} The truncated string for use in test reports. */ export declare const truncateHelper: Helper; /** * Truncate a string to have the specified number of words. * Useful for creating word-limited summaries and previews in test reports. * * @example * {{truncateWords test.name "3"}} * * * {{truncateWords test.message "5" " [...]"}} * * * @param {unknown} str - The string from test data to truncate. * @param {unknown} limit - The maximum number of words as a string. * @param {unknown} suffix - Optional suffix when truncated (defaults to "..."). * @returns {string} The word-truncated string for use in test reports. */ export declare const truncateWordsHelper: Helper; /** * Uppercase all characters in the given string. Alias for uppercase. * Useful for creating emphasis, headers, and status indicators in test reports. * * @example * {{upcase test.status}} * * * {{upcase "api test"}} * * * @param {unknown} str - The string from test data to convert to uppercase. * @returns {string} The uppercased string for use in test reports. */ export declare const upcaseHelper: Helper; /** * Uppercase all characters in the given string. * Useful for creating emphasis, headers, and status indicators in test reports. * * @example * {{uppercase test.status}} * * * {{uppercase "api endpoint test"}} * * * @param {unknown} str - The string from test data to convert to uppercase. * @returns {string} The uppercased string for use in test reports. */ export declare const uppercaseHelper: Helper; /** * Escapes special Markdown characters in the given string. * This is useful to ensure that characters like `*`, `_`, `(`, `)`, etc. * don't inadvertently format the output as Markdown in test reports or documentation. * * @example * {{escapeMarkdown "Hello *world*"}} * * * {{escapeMarkdown test.name}} * * * * @param {unknown} str - The input string containing potential Markdown characters. * @returns {string} The string with Markdown characters escaped. * Use to safely display test names, file paths, or error messages in Markdown. */ export declare const escapeMarkdownHelper: Helper; /** * Strips ANSI escape codes from the given message. * * @example * {{stripAnsi "Hello \u001b[31mRed\u001b[0m"}} * Returns: "Hello Red" * * @param {unknown} message - The string potentially containing ANSI escape codes. * @returns {string} The string with all ANSI escape codes removed. */ export declare const stripAnsiHelper: Helper; /** * Strips ANSI escape codes from a given string. * * @param message - The string from which ANSI escape codes will be removed. * @returns The string with ANSI escape codes removed. * @throws {TypeError} If the input is not a string. */ export declare function stripAnsi(message: string): string; /** * Returns a regular expression for matching ANSI escape codes. * * @param options - An optional object specifying whether to match only the first occurrence. * @param options.onlyFirst - If true, matches only the first occurrence of an ANSI code. * @returns A regular expression for matching ANSI escape codes. */ export declare function ansiRegex({ onlyFirst }?: { onlyFirst?: boolean | undefined; }): RegExp; /** * Converts ANSI escape codes in the given message to HTML. * This is useful for displaying colorized console output in a browser. * * @example * {{ansiToHtml "Hello \u001b[31mRed\u001b[0m"}} * Returns: "Hello Red" * * @param {unknown} message - The ANSI-colored string. * @returns {string} An HTML-formatted string reflecting the original ANSI colors. */ export declare const ansiToHtmlHelper: Helper; export declare const stringHelpers: Helper[];