function handleExport(node) {
      if (node.type === 'ExportNamedDeclaration') {
        // ```tsx
        // export function a() {}
        // export class A {}
        // export var a = 1
        // ```
        if (node.declaration) {
          const visitors = createVisitors()
          // Walk the top-level scope.
          walk(node, {
            enter(node) {
              visitors.enter(node)

              if (
                node.type === 'ArrowFunctionExpression' ||
                node.type === 'FunctionDeclaration' ||
                node.type === 'FunctionExpression'
              ) {
                this.skip()
                visitors.exit(node)
              }
            },
            leave: visitors.exit
          })
          exportedValues.push(...visitors.scopes[0].defined)
        }

        // ```tsx
        // export {a, b as c}
        // export {a, b as c} from 'd'
        // ```
        for (child of node.specifiers) {
          if (child.exported.type === 'Identifier') {
            exportedValues.push(child.exported.name)
            /* c8 ignore next 5 -- to do: <https://github.com/mdx-js/mdx/issues/2536> */
          } else {
            // Must be string.
            assert(typeof child.exported.value === 'string')
            exportedValues.push(child.exported.value)
          }
        }
      }

      handleEsm(node)
    }
@param {ExportAllDeclaration | ExportNamedDeclaration} node
  Export node.
@returns {undefined}
  Nothing.