Desired Solution
I am looking for the most efficient way to do type checking on a SourceFile's modified AST.
Undesired Solution
I do not want to serialize/emit the modified SourceFile's AST to text and then parse the text back into a new SourceFile.
I am aware of the BuilderProgram that can be used to incrementally build a Program [1]. However, I have not seen any way of updating a SourceFile other than working with text range changes. It seems to be very resource-consuming since I already have the actual modified AST ready.
Compiler API docs
https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API