import { PluginPass } from '@babel/core' ; import { IntersectionTypeAnnotation , TSIntersectionType , isTSFunctionType , tsIntersectionType , tsParenthesizedType , } from '@babel/types' ; import { convertFlowType } from './flow-type' ; export function convertIntersectionTypeAnnotation ( node , state ) { return tsIntersectionType ( node . types . map ( type => { const tsType = convertFlowType ( type , state ) ; return isTSFunctionType ( tsType ) ? tsParenthesizedType ( tsType ) : tsType ; } ) ) ; }