import { posix as path } from 'path' ; import Project from 'ts-simple-ast' ; import * as typescript from 'typescript' ; param entryFile returns export function createTypescriptProject ( entryFile ) { const typescriptProgram = typescript . createProgram ( [ entryFile ] , { } ) ; const sourceFilePaths = typescriptProgram . getSourceFiles ( ) . filter ( ( sourceFile ) : boolean => { return ! typescriptProgram . isSourceFileFromExternalLibrary ( sourceFile ) && ! sourceFile . isDeclarationFile ; } ) . map ( ( sourceFile ) : string => { return sourceFile . fileName ; } ) ; const typescriptProject = new Project ( ) ; typescriptProject . addExistingSourceFiles ( sourceFilePaths ) ; return typescriptProject ; }