JSRuntime Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Abstract base class for a JavaScript runtime.
public ref class JSRuntime abstract : Microsoft::JSInterop::IJSRuntimepublic abstract class JSRuntime : IDisposable, Microsoft.JSInterop.IJSRuntimepublic abstract class JSRuntime : Microsoft.JSInterop.IJSRuntimetype JSRuntime = class
    interface IJSRuntime
    interface IDisposabletype JSRuntime = class
    interface IJSRuntimePublic MustInherit Class JSRuntime
Implements IDisposable, IJSRuntimePublic MustInherit Class JSRuntime
Implements IJSRuntime- Inheritance
- 
				JSRuntime
- Derived
- Implements
Constructors
| JSRuntime() | Initializes a new instance of JSRuntime. | 
Properties
| DefaultAsyncTimeout | Gets or sets the default timeout for asynchronous JavaScript calls. | 
| JsonSerializerOptions | Gets the JsonSerializerOptions used to serialize and deserialize interop payloads. | 
Methods
| BeginInvokeJS(Int64, String, String, JSCallResultType, Int64) | Begins an asynchronous function invocation with the call type FunctionCall. For more configuration options, use the overload Microsoft.JSInterop.JSRuntime.BeginInvokeJS(Microsoft.JSInterop.Infrastructure.JSInvocationInfo@). | 
| BeginInvokeJS(Int64, String, String) | Begins an asynchronous function invocation. | 
| BeginInvokeJS(JSInvocationInfo) | Begins an asynchronous function invocation. | 
| Dispose() | Dispose the JSRuntime. | 
| EndInvokeDotNet(DotNetInvocationInfo, DotNetInvocationResult) | Completes an async JS interop call from JavaScript to .NET | 
| GetValueAsync<TValue>(String, CancellationToken) | Reads the value of the specified JavaScript property asynchronously. | 
| GetValueAsync<TValue>(String) | Reads the value of the specified JavaScript property asynchronously. | 
| InvokeAsync<TValue>(String, CancellationToken, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| InvokeAsync<TValue>(String, Object[]) | Invokes the specified JavaScript function asynchronously. JSRuntime will apply timeouts to this operation based on the value configured in DefaultAsyncTimeout. To dispatch a call with a different, or no timeout, consider using InvokeAsync<TValue>(String, CancellationToken, Object[]). | 
| InvokeConstructorAsync(String, CancellationToken, Object[]) | Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the  | 
| InvokeConstructorAsync(String, Object[]) | Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the  | 
| ReadJSDataAsStreamAsync(IJSStreamReference, Int64, CancellationToken) | Provides a Stream for the data reference represented by  | 
| ReceiveByteArray(Int32, Byte[]) | Accepts the byte array data being transferred from JS to DotNet. | 
| SendByteArray(Int32, Byte[]) | Transfers a byte array from .NET to JS. | 
| SetValueAsync<TValue>(String, TValue, CancellationToken) | Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. | 
| SetValueAsync<TValue>(String, TValue) | Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. | 
| TransmitStreamAsync(Int64, DotNetStreamReference) | Transmits the stream data from .NET to JS. Subclasses should override this method and provide an implementation that transports the data to JS and calls DotNet.jsCallDispatcher.supplyDotNetStream. | 
Extension Methods
| GetValueAsync<TValue>(IJSRuntime, String, TimeSpan) | Reads the value of the specified JavaScript property asynchronously. | 
| InvokeAsync<TValue>(IJSRuntime, String, Object[]) | Invokes the specified JavaScript function asynchronously. JSRuntime will apply timeouts to this operation based on the value configured in DefaultAsyncTimeout. To dispatch a call with a different timeout, or no timeout, consider using InvokeAsync<TValue>(String, CancellationToken, Object[]). | 
| InvokeAsync<TValue>(IJSRuntime, String, CancellationToken, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| InvokeAsync<TValue>(IJSRuntime, String, TimeSpan, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| InvokeConstructorAsync(IJSRuntime, String, Object[]) | Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the  | 
| InvokeConstructorAsync(IJSRuntime, String, CancellationToken, Object[]) | Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the  | 
| InvokeConstructorAsync(IJSRuntime, String, TimeSpan, Object[]) | Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the  | 
| InvokeVoidAsync(IJSRuntime, String, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| InvokeVoidAsync(IJSRuntime, String, CancellationToken, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| InvokeVoidAsync(IJSRuntime, String, TimeSpan, Object[]) | Invokes the specified JavaScript function asynchronously. | 
| SetValueAsync<TValue>(IJSRuntime, String, TValue, TimeSpan) | Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. |