This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
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.
ContainsJSImportAttribute andJSExportAttribute, which can be used to interop with JavaScript when running in the browser or other WASM architectures.
| Name | Description |
|---|---|
| JSException | Represents an exception initiated from the JavaScript interop code. |
| JSExportAttribute | Indicates that a source generator should export the attributed method to JavaScript and create thunks necessary to marshal its arguments and any return value or thrown exception. |
| JSHost | Represents the JavaScript host environment where the .NET runtime is currently operating. |
| JSImportAttribute | Indicates that the JSImport source generator should create a managed wrapper to invoke a specific imported JavaScript function and marshal its arguments, return values, and exceptions. |
| JSMarshalAsAttribute<T> | Specifies the JavaScript type associated with a managed argument or return value.The JSImport generator will use this information to marshal data between the JavaScript and managed environments. |
| JSObject | Represents a reference to an object in the JavaScript host environment and enables interaction with it as a proxy. |
| JSType | Used as the generic argument forJSMarshalAsAttribute<T> to express the expected JavaScript type, which should be the source or result of argument marshalling. |
| JSType.Any | Dynamically selects the most appropriate JavaScript or managed type for each argument value at run time. |
| JSType.Array<T> | Marshals as a copy of the JavaScriptArray orTypedArray type. |
| JSType.BigInt | Marshal as JavaScriptBigInt type. |
| JSType.Boolean | Marshal as JavaScriptBoolean type. |
| JSType.Date | Marshal as JavaScriptDate type. |
| JSType.Discard | Suppresses marshalling of the JavaScript function's return value and discards it. |
| JSType.Error | Marshals as the JavaScriptError type. |
| JSType.Function | Marshals as the JavaScriptFunction type. |
| JSType.Function<T> | Marshals as the JavaScriptFunction type. |
| JSType.Function<T1,T2> | Marshals as the JavaScriptFunction type. |
| JSType.Function<T1,T2,T3> | Marshals as the JavaScriptFunction type. |
| JSType.Function<T1,T2,T3,T4> | Marshals as the JavaScriptFunction type. |
| JSType.MemoryView | Marshals a managed Span or ArraySegment as a JavaScript wrapper object that provides access to the managed memory. |
| JSType.Number | Marshal as JavaScriptNumber type. |
| JSType.Object | Marshal as JavaScriptObject type. |
| JSType.Promise<T> | Marshal as JavaScriptPromise type. |
| JSType.String | Marshal as JavaScriptString type. |
| JSType.Void | Asserts that a JavaScript function should have no return value. |
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?