function walkUsage(
  targetPath,
  { onNode = noop, onLeaf = noop, onLink = noop }
) {
  /** @type {ReferenceLinkage[]} */
  let children
  try {
    children = tracePathToUsages(targetPath)
  } catch (err) {
    if (RefOutOfScopeError.isRefOutOfScopeError(err)) {
      onLeaf(targetPath)
      return
    }
    throw err
  }
  children.forEach((refLink) => {
    onNode(refLink)
    onLink(targetPath, refLink)
    walkUsage(refLink.path, { onNode, onLeaf })
  })
}
@param {import('@babel/traverse').NodePath<import('@babel/types').Node>} targetPath
@param {*} param1
@returns