Skip to content

JSValue structure

C#
public struct JSValue : IJSValue<JSValue>

Public Members

namedescription
JSValue()Creates an empty instance of JSValue, which implicitly converts to Undefined when used in any scope.
JSValue(…)Creates a new instance of JSValue from a handle in the current scope. (2 constructors)
static False { get; }
static Global { get; }
static Null { get; }
static True { get; }
static Undefined { get; }
static CreateArray()
static CreateArray(…)
static CreateArrayBuffer(…)(2 methods)
static CreateBigInt(…)(4 methods)
static CreateDataView(…)
static CreateDate(…)
static CreateError(…)
static CreateExternal(…)
static CreateExternalArrayBuffer<T>(…)
static CreateFunction(…)(2 methods)
static CreateNumber(…)(4 methods)
static CreateObject()
static CreatePromise(…)
static CreateRangeError(…)
static CreateStringUtf16(…)(2 methods)
static CreateStringUtf8(…)
static CreateSymbol(…)
static CreateSyntaxError(…)
static CreateTypedArray(…)
static CreateTypeError(…)
static DefineClass(…)(2 methods)
static GetBoolean(…)
static RunScript(…)
static SymbolFor(…)
Handle { get; }Gets the value handle, or throws an exception if the value scope is disposed or access from the current thread is invalid.
Item { get; set; }(3 indexers)
Items { get; }
Properties { get; }
Scope { get; }
AddFinalizer(…)(2 methods)
AddGCHandleFinalizer(…)
As<T>()Tries to create a T struct from this JSValue. It returns null if the T struct cannot be created.
AsUnchecked<T>()Creates a T struct from this JSValue without checking the enclosed handle type. It must be used only when the handle type is known to be correct.
Call()
Call(…)(7 methods)
CallAsConstructor()
CallAsConstructor(…)(6 methods)
CallMethod(…)(7 methods)
CastTo<T>()Creates a T struct from this JSValue. It throws InvalidCastException in case of failure.
CheckObjectTypeTag(…)
CoerceToBoolean()
CoerceToNumber()
CoerceToObject()
CoerceToString()
DefineProperties(…)(2 methods)
DeleteElement(…)
DeleteProperty(…)
DetachArrayBuffer()
Equals(…)Compares two JS values using JS "strict" equality.
override Equals(…)
Freeze()
GetAllPropertyNames(…)
GetArrayBufferInfo()
GetArrayLength()
GetBigIntWordCount()
GetBigIntWords(…)(2 methods)
GetDataViewInfo(…)
GetDateValue()
GetElement(…)
override GetHashCode()
GetProperty(…)
GetPropertyNames()
GetPrototype()
GetTypedArrayBuffer(…)
GetTypedArrayData<T>()
GetTypedArrayLength(…)
GetValueBool()
GetValueDouble()
GetValueExternal()Gets the object that is represented as an external value. (Throws if the JS value is not an external value.)
GetValueExternalOrPrimitive()Gets the .NET external value or primitive object value (string, boolean, or double) for a JS value, or null if the JS value is not convertible to one of those types.
GetValueInt32()
GetValueInt64()
GetValueStringUtf16()
GetValueStringUtf16(…)
GetValueStringUtf16AsCharArray()
GetValueStringUtf8()
GetValueStringUtf8(…)
GetValueUInt32()
HasElement(…)
HasOwnProperty(…)
HasProperty(…)
InstanceOf(…)
Is<T>()Checks if the T struct can be created from this JSValue.
IsArray()
IsArrayBuffer()
IsBigInt()
IsBoolean()
IsDataView()
IsDate()
IsDetachedArrayBuffer()
IsError()
IsExternal()
IsFunction()
IsNull()
IsNullOrUndefined()
IsNumber()
IsObject()
IsPromise()
IsString()
IsSymbol()
IsTypedArray()
IsUndefined()
RemoveWrap(…)Detaches an object from this JSValue.
Seal()
SetElement(…)
SetObjectTypeTag(…)
SetProperty(…)
ToBigInteger()
ToInt64BigInt(…)
ToUInt64BigInt(…)
TryGetValueExternal()Gets the object that is represented as an external value, or null if the JS value is not an external value.
TryUnwrap()Attempts to get the object that was previously attached to this JSValue.
TypeOf()
Unwrap(…)Gets the object that was previously attached to this JSValue. (Throws an exception if unwrapping failed.)
Wrap(…)Attaches an object to this JSValue. (2 methods)
static GetVersion()
operator ==Compares two JS values using JS "strict" equality.
explicit operator(25 operators)
implicit operator(27 operators)
operator !=Compares two JS values using JS "strict" equality.
delegate From<T>Delegate that provides a conversion from some type to a JS value.
delegate To<T>Delegate that provides a conversion from a JS value to some type.

See Also

Released under the MIT license