replaceTypescript replaceTypescript takes the AST and modifies it. For finding nodes in the AST you can specify a node Text and parentNode Kinds.