import { TypeChecker , Expression , isCallLikeExpression , JSDocTagInfo } from '@tsd/typescript' ; param checker param expression return export const resolveJSDocTags = ( checker , expression ) : Map < string , JSDocTagInfo > | undefined => { const ref = isCallLikeExpression ( expression ) ? checker . getResolvedSignature ( expression ) : checker . getSymbolAtLocation ( expression ) ; if ( ! ref ) { return ; } return new Map < string , JSDocTagInfo > ( ref . getJsDocTags ( ) . map ( tag => [ tag . name , tag ] ) ) ; } ; param checker param expression return export const expressionToString = ( checker , expression ) : string | undefined => { if ( isCallLikeExpression ( expression ) ) { const signature = checker . getResolvedSignature ( expression ) ; if ( ! signature ) { return ; } return checker . signatureToString ( signature ) ; } const symbol = checker . getSymbolAtLocation ( expression ) ; if ( ! symbol ) { return ; } return checker . symbolToString ( symbol , expression ) ; } ;