How to avoid this surprising Map behavior with external JS classes

Map is a particular Kotlin interface which is not mapped to any specific JavaScript type. You can’t cast a map-like JS object to kotlin.Map.

I can see couple of options:

  1. Use external type with Alternative to @nativeGetter
  2. Convert native object to HashMap How to access native JS object as a Map<String, Any>?