Update Google Docs content from Chrome Extension

I want to integrate my Chrome extension with Google Docs, as to make it able to replace text. If I just replace text by working with DOM, it has no effect. This could be helpful in many situations. One such use case is the autocorrect extension. My understanding is that Google Docs code is written in ClosureScript or something like this.

Finding text inside the editor is not too complicated. It is marked with kix classes such as kix-appview-editor and similar.
How could I trigger an update from inside the JavaScript extension script? I don’t want to use Google App Script. I know that what I need is possible, because I found an extension changing text inside GDocs from JavaScript. The extension is called Blaze Text and it has no problem working with Google Docs. Unfortunately, the code is obfuscated so determining how they do this is not easy.

I found a trick that does this for React 15 and later. I am using it to for React.JS compatibility. How could I “force an update” on Google Docs?