toggle menu
Kotlin Wrappers API Reference
js
switch theme
search in API
kotlin-js
/
js.promise
/
Promise
Promise
js
open
external
class
Promise
<
out
T
>
(
executor
:
(
resolve
:
PromiseResolve
<
T
>
)
->
Unit
)
:
PromiseLike
<
T
>
(
source
)
Inheritors
DisposablePromise
Members
Members & Extensions
Constructors
Promise
Link copied to clipboard
js
constructor
(
executor
:
(
resolve
:
PromiseResolve
<
T
>
,
reject
:
PromiseReject
)
->
Unit
)
constructor
(
executor
:
(
resolve
:
PromiseResolve
<
T
>
)
->
Unit
)
Types
Companion
Link copied to clipboard
js
object
Companion
Functions
as
Deferred
Link copied to clipboard
js
inline
fun
<
T
>
Promise
<
T
>
.
asDeferred
(
)
:
Deferred
<
T
>
await
Link copied to clipboard
js
open
inline suspend override
fun
await
(
)
:
T
catch
Link copied to clipboard
js
inline
fun
<
T
>
Promise
<
T
>
.
catch
(
noinline
onRejected
:
(
JsError
)
->
T
)
:
Promise
<
T
>
finally
Link copied to clipboard
js
fun
finally
(
onFinally
:
(
)
->
Unit
)
:
Promise
<
T
>
flat
Catch
Link copied to clipboard
js
inline
fun
<
T
>
Promise
<
T
>
.
flatCatch
(
noinline
onRejected
:
(
JsError
)
->
PromiseResult
<
T
>
)
:
Promise
<
T
>
flat
Then
Link copied to clipboard
js
override
fun
<
R
>
flatThen
(
onFulfilled
:
(
T
)
->
PromiseResult
<
R
>
)
:
Promise
<
R
>
override
fun
<
R
>
flatThen
(
onFulfilled
:
(
T
)
->
PromiseResult
<
R
>
,
onRejected
:
(
JsError
)
->
PromiseResult
<
R
>
)
:
Promise
<
R
>
then
Link copied to clipboard
js
override
fun
<
R
>
then
(
onFulfilled
:
(
T
)
->
R
)
:
Promise
<
R
>
override
fun
<
R
>
then
(
onFulfilled
:
(
T
)
->
R
,
onRejected
:
(
JsError
)
->
R
)
:
Promise
<
R
>
then
To
Link copied to clipboard
js
open
inline
fun
thenTo
(
continuation
:
Continuation
<
T
>
)
to
Promise
Link copied to clipboard
js
inline
fun
<
T
>
PromiseResult
<
T
>
.
toPromise
(
)
:
Promise
<
T
>
to
Result
Link copied to clipboard
js
suspend
fun
<
T
>
PromiseLike
<
T
>
.
toResult
(
)
:
Result
<
T
>