src/language-js/print/misc.js/printTypeAnnotation
function printTypeAnnotation(path, options, print) {
  const node = path.getValue();
  if (!node.typeAnnotation) {
    return "";
  }

  const parentNode = path.getParentNode();

  // Workaround for https://github.com/babel/babel/issues/14498
  if (parentNode.type === "ArrayPattern" && options.parser === "babel-ts") {
    return [" as ", print("typeAnnotation")];
  }

  const isFunctionDeclarationIdentifier =
    parentNode.type === "DeclareFunction" && parentNode.id === node;

  if (isFlowAnnotationComment(options.originalText, node.typeAnnotation)) {
    return [" /*: ", print("typeAnnotation"), " */"];
  }

  return [isFunctionDeclarationIdentifier ? "" : ": ", print("typeAnnotation")];
}