JetBrains / kotlin-wrappers

Kotlin wrappers for popular JavaScript libraries
Apache License 2.0
1.33k stars 165 forks source link

`PromiseLike` cannot be extended #2213

Closed lppedd closed 4 months ago

lppedd commented 4 months ago

VS Code types have a Thenable interface which extends PromiseLike

interface Thenable<T> extends PromiseLike<T> { }

However it won't work in Kotlin as PromiseLike has been declared sealed.

https://github.com/JetBrains/kotlin-wrappers/blob/df02b39cff1a4d7ba77344514e9b85cc90be4f26/kotlin-js/src/jsMain/kotlin/js/promise/PromiseLike.kt#L5

Is there a reason for it to be sealed, or can we just open it?

turansky commented 4 months ago

Thenable - just alias of PromiseLike, isn't it?

lppedd commented 4 months ago

@turansky I'd say you're right at this point, however having a separate (real) type could be useful anyway.

turansky commented 4 months ago

however having a separate (real) type could be useful anyway

If you have use cases for PromiseLike - please provide them.