function traverse(node, callbacks) {
	if (callbacks[node.type]) {
		callbacks[node.type](node);
	} else {
		callbacks["*"]();
	}

	const parent = /** @type {ParentNode} */ (node);

	if (typeof parent.children !== "undefined") {
		for (let i = 0; i < parent.children.length; i++) {
			traverse(parent.children[i], callbacks);
		}
	}
}
Performs a depth-first traversal of the Markdown AST.
@param {Node} node A Markdown AST node.
@param {{[key: string]: (node?: Node) => void}} callbacks A map of node types to callbacks.
@returns {void}