ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript.JavaScript
JavaScriptExtensions Class
JavaScriptExtensions Methods
ToPromise Method
ToPromise(Task) Method
ToPromise<T>(Task<T>) Method
ToPromise(ValueTask) Method
ToPromise<T>(ValueTask<T>) Method
ToPromise(Task, ScriptEngine) Method
ToPromise<T>(Task<T>, ScriptEngine) Method
ToPromise(ValueTask, ScriptEngine) Method
ToPromise<T>(ValueTask<T>, ScriptEngine) Method

# JavaScriptExtensionsToPromise Method

Overload List

| Name | Description
--- | --- | ---
| ToPromise(Task) | Converts a Task instance to a promise for use with script code currently running on the calling thread.
| ToPromise(ValueTask) | Converts a ValueTask instance to a promise for use with script code currently running on the calling thread.
| ToPromise(Task, ScriptEngine) | Converts a Task instance to a promise for use with script code running in the specified script engine.
| ToPromise(ValueTask, ScriptEngine) | Converts a ValueTask instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(TaskT) | Converts a TaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(ValueTaskT) | Converts a ValueTaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(TaskT, ScriptEngine) | Converts a TaskTResult instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(ValueTaskT, ScriptEngine) | Converts a ValueTaskTResult instance to a promise for use with script code running in the specified script engine.

Top
See Also

#### Reference

JavaScriptExtensions Class
Microsoft.ClearScript.JavaScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft