Because of limitations of JS platform, we need to replace all blocking invocations by non blocking invocations with callback.
It seems it is harder than I thought. It was easier to fix it in client code.
Better solution will be switch library to Kotlin Coroutines.
Because of limitations of JS platform, we need to replace all blocking invocations by non blocking invocations with callback.