Replace all instances of JSDoc generic Function with detailed @callback definition (type-only changes).

This commit is contained in:
David Anson 2023-09-04 21:41:16 -07:00
parent 8bb97dadfe
commit 07f403173c
6 changed files with 199 additions and 38 deletions

View file

@ -203,12 +203,24 @@ function micromarkParse(
);
}
/**
* @callback AllowedPredicate
* @param {Token} token Micromark token.
* @returns {boolean} True iff allowed.
*/
/**
* @callback TransformPredicate
* @param {Token} token Micromark token.
* @returns {Token[]} Child tokens.
*/
/**
* Filter a list of Micromark tokens by predicate.
*
* @param {Token[]} tokens Micromark tokens.
* @param {Function} allowed Allowed token predicate.
* @param {Function} [transformChildren] Transform children predicate.
* @param {AllowedPredicate} allowed Allowed token predicate.
* @param {TransformPredicate} [transformChildren] Transform predicate.
* @returns {Token[]} Filtered tokens.
*/
function filterByPredicate(tokens, allowed, transformChildren) {