import type { Helper } from "../helper-registry.js";
/**
* Returns all of the items in an array after the specified index. Opposite of before.
* Useful for slicing test result arrays to show only later results in CTRF reports.
*
* @example
* {{after test.results 1}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} n - Starting index (number of items to exclude).
* @returns {unknown[]} Array excluding n items from the start.
*/
export declare const afterHelper: Helper;
/**
* Cast the given value to an array.
* Useful for normalizing test data fields to arrays for consistent rendering in test reports.
*
* @example
* {{arrayify test.status}}
*
*
*
* @param {unknown} value - The value to cast.
* @returns {unknown[]} The value as an array.
*/
export declare const arrayifyHelper: Helper;
/**
* Return all of the items in the collection before the specified count. Opposite of after.
* Useful for showing only the first N test results or errors in a summary table.
*
* @example
* {{before test.results 2}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} n - Number of items to include from the start.
* @returns {unknown[]} Array excluding items after the given number.
*/
export declare const beforeHelper: Helper;
/**
* Iterates over each item in an array and exposes the current item and index to the block.
* Useful for rendering test steps or log entries with their index in CTRF reports.
*
* @example
* {{#eachIndex test.results}}
* {{item}} is {{index}}
* {{/eachIndex}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for each item with index.
*/
export declare const eachIndexHelper: Helper;
/**
* Block helper that filters the given array and renders the block for values that evaluate to true, otherwise the inverse block is returned.
* Useful for displaying only passing or failing tests in a filtered test report section.
*
* @example
* {{#filter test.results "passed"}}AAA{{else}}BBB{{/filter}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} value - The value to filter by.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for filtered items.
*/
export declare const filterHelper: Helper;
/**
* Returns the first item, or first n items of an array.
* Useful for showing the first test, or a summary of the first N failures in a report.
*
* @example
* {{first test.results 2}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} n - Number of items to return from the start.
* @returns {unknown|unknown[]} The first item or first n items.
*/
export declare const firstHelper: Helper;
/**
* Iterates over each item in an array and exposes the current item as context to the inner block.
* Useful for rendering each test case, log entry, or assertion in a test report.
*
* @example
* {{#forEach test.results}}
* {{this}}
* {{/forEach}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for each item.
*/
export declare const forEachHelper: Helper;
/**
* Block helper that renders the block if an array has the given value. Optionally specify an inverse block to render when the array does not have the value.
* Useful for conditionally rendering sections if a test status or tag is present in the results.
*
* @example
* {{#inArray test.results "passed"}}foo{{else}}bar{{/inArray}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} value - The value to check for.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block if value is present, else inverse.
*/
export declare const inArrayHelper: Helper;
/**
* Returns true if value is an ES5 array.
* Useful for checking if a test field is an array before iterating in a template.
*
* @example
* {{isArray test.results}}
*
*
*
* @param {unknown} value - The value to test.
* @returns {boolean} True if value is an array.
*/
export declare const isArrayHelper: Helper;
/**
* Returns the item from array at index idx.
*
* @example
* {{itemAt test.results 1}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} idx - The index to retrieve.
* @returns {unknown} The item at the given index.
*/
export declare const itemAtHelper: Helper;
/**
* Join all elements of array into a string, optionally using a given separator.
*
* @example
* {{join test.results}}
*
*
*
* {{join test.results "-"}}
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} separator - The separator to use. Defaults to ','.
* @returns {string} The joined string.
*/
export declare const joinHelper: Helper;
/**
* Returns true if the length of the given value is equal to the given length. Can be used as a block or inline helper.
*
* @example
* {{equalsLength test.results 2}}
*
*
*
* @param {unknown} value - The value to test (array or string).
* @param {unknown} length - The length to compare to.
* @returns {boolean} True if lengths are equal.
*/
export declare const equalsLengthHelper: Helper;
/**
* Returns the last item, or last n items in an array or string. Opposite of first.
*
* @example
* {{last test.results}}
*
*
*
* {{last test.results 2}}
*
*
* @param {unknown} value - The array or string from test data.
* @param {unknown} n - Number of items to return from the end.
* @returns {unknown|unknown[]} The last item or last n items.
*/
export declare const lastHelper: Helper;
/**
* Returns a slice of an array from the specified start index to the end index.
* Useful for pagination, limiting displayed items, or working with specific ranges of test results.
*
* @example
* {{#slice test.results 1 4}}
*
{{this.name}}
* {{/slice}}
*
*
*
* @param {unknown} array - The array to be sliced.
* @param {unknown} start - The start index for the slice.
* @param {unknown} end - The end index for the slice (exclusive).
* @param {object} options - Handlebars options object, including the block to render.
* @returns {string} A concatenated string of all rendered items within the slice.
*/
export declare const sliceHelper: Helper;
/**
* Returns the length of the given string or array.
*
* @example
* {{length test.results}}
*
*
*
* @param {unknown} value - The value to measure (array, object, or string).
* @returns {number} The length of the value.
*/
export declare const lengthHelper: Helper;
/**
* Alias for equalsLength.
*/
export declare const lengthEqualHelper: Helper;
/**
* Returns a new array, created by calling function on each element of the given array.
*
* @example
* {{map test.results double}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} fn - The function to call on each element.
* @returns {unknown[]} The mapped array.
*/
export declare const mapHelper: Helper;
/**
* Map over the given object or array of objects and create an array of values from the given prop. Dot-notation may be used (as a string) to get nested properties.
*
* @example
* {{pluck test.results "name"}}
*
*
*
* @param {unknown} collection - The array or object from test data.
* @param {unknown} prop - The property to pluck (dot notation allowed).
* @returns {unknown[]} The plucked values.
*/
export declare const pluckHelper: Helper;
/**
* Reverse the elements in an array, or the characters in a string.
*
* @example
* {{reverse test.results}}
*
*
*
* @param {unknown} value - The array or string from test data.
* @returns {unknown} The reversed array or string.
*/
export declare const reverseHelper: Helper;
/**
* Block helper that returns the block if the callback returns true for some value in the given array.
*
* @example
* {{#some test.results isString}}
* Render me if the array has a string.
* {{else}}
* Render me if it doesn't.
* {{/some}}
*
* @param {unknown} array - The array from test data.
* @param {unknown} iter - The iteratee function.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block if some item passes the iteratee.
*/
export declare const someHelper: Helper;
/**
* Sort the given array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.
*
* @example
* {{sort test.results}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} keyOrFn - The key to sort by, or a sorting function.
* @returns {unknown[]} The sorted array.
*/
export declare const sortHelper: Helper;
/**
* Sort an array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.
*
* @example
* {{sortBy test.results "score"}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} props - The property or properties to sort by.
* @returns {unknown[]} The sorted array.
*/
export declare const sortByHelper: Helper;
/**
* Use the items in the array after the specified index as context inside a block. Opposite of withBefore.
*
* @example
* {{#withAfter test.results 2}}
* {{this}}
* {{/withAfter}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} idx - The index after which to use items.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for items after idx.
*/
export declare const withAfterHelper: Helper;
/**
* Use the items in the array before the specified index as context inside a block. Opposite of withAfter.
*
* @example
* {{#withBefore test.results 2}}
* {{this}}
* {{/withBefore}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} idx - The index before which to use items.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for items before idx.
*/
export declare const withBeforeHelper: Helper;
/**
* Use the first item in a collection inside a handlebars block expression. Opposite of withLast.
*
* @example
* {{#withFirst test.results}}
* {{this}}
* {{/withFirst}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for the first item.
*/
export declare const withFirstHelper: Helper;
/**
* Block helper that groups array elements by given group size.
*
* @example
* {{#withGroup test.results 2}}
* {{#each this}}
* {{.}}
* {{/each}}
*
* {{/withGroup}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} size - The desired length of each group.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for each group.
*/
export declare const withGroupHelper: Helper;
/**
* Use the last item or n items in an array as context inside a block. Opposite of withFirst.
*
* @example
* {{#withLast test.results}}
* {{this}}
* {{/withLast}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for the last item.
*/
export declare const withLastHelper: Helper;
/**
* Block helper that sorts a collection and exposes the sorted collection as context inside the block.
*
* @example
* {{#withSort test.results "score"}}{{this}}{{/withSort}}
*
*
*
* @param {unknown} array - The array from test data.
* @param {unknown} prop - The property to sort by.
* @param {unknown} options - Handlebars options object.
* @returns {string} Rendered block for sorted items.
*/
export declare const withSortHelper: Helper;
/**
* Block helper that returns an array with all duplicate values removed. Best used along with an each helper.
*
* @example
* {{#each (unique test.results)}}{{.}}{{/each}}
*
*
*
* @param {unknown} array - The array from test data.
* @returns {unknown[]} Array with duplicates removed.
*/
export declare const uniqueHelper: Helper;
export declare const arrayHelpers: Helper[];