IJSValue<TSelf> interface
A base interface for a struct that represents a JavaScript value type or a built-in object type. It provides functionality for converting between the struct and JSValue.
C#
public interface IJSValue<TSelf> : IEquatable<JSValue>
where TSelf : struct, IJSValue| parameter | description |
|---|---|
| TSelf | The derived struct type. |
Members
| name | description |
|---|---|
| As<T>() | Tries to create a T struct from this instance. It returns null if the T struct cannot be created. |
| AsUnchecked<T>() | Creates a T struct from this instance without checking the enclosed handle type. It must be used only when the handle type is known to be correct. |
| CastTo<T>() | Creates a T struct from this instance. It throws InvalidCastException in case of failure. |
| Is<T>() | Checks if the T struct can be created from this instance`. |
| static CanCreateFrom(…) | Checks if the derived struct TSelf can be created from a JSValue. |
| static CreateUnchecked(…) | Creates a new instance of the derived struct TSelf from a JSValue without checking the enclosed handle type. |
See Also
- struct JSValue
- namespace Microsoft.JavaScript.NodeApi
- IJSValue.cs