dukat
dukat copied to clipboard
Extending non-external type and extending final type
this code
export interface ReactNodeArray extends Array<string> {}
is translated
external interface ReactNodeArray : Array<String>
Which is pretty straightforward however non-valid in Koltin/JS since we get
[shabunc@shagen demo (master)]$ kotlinc-js minimal.module_demo.kt -output out.js
minimal.module_demo.kt:18:20: error: external type extends non-external type
external interface ReactNodeArray : Array<String>
^
minimal.module_demo.kt:18:37: error: this type is final, so it cannot be inherited from
external interface ReactNodeArray : Array<String>
Real-life scenario: prop-types
Are there any work arounds to this issue?
I am trying to use the shopify api but they are putting the cursors for next and prev as non enumerated props onto the page results, my thoughts were to extend array as in your example.
Can repro by using the JS MSAL library, getting
External type extends non-external type
due to
external open class ClientAuthError(errorCode: String, errorMessage: String = definedExternally) : AuthError
// AuthError:
typealias AuthError = Error
The Error there is from the Kotlin stdlib