then

open fun <S> then(onFulfilled: (T) -> S?): Promise<S>(source)
open fun <S> then(onFulfilled: (T) -> S?, onRejected: (Throwable) -> S?): Promise<S>(source)

Since Kotlin

1.1
fun <S : JsAny?> then(onFulfilled: (T) -> S?): Promise<S>(source)
fun <S : JsAny?> then(onFulfilled: (T) -> S?, onRejected: (JsAny) -> S?): Promise<S>(source)

Since Kotlin

1.8