Version: 1.3
LanguageEnglish
  • C#

OpenHarmonyJSAPI

class in UnityEngine

/

Implemented in:UnityEngine.OpenHarmonyJSModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

APIs that enable user to call OpenHarmony JavaScript from Unity scripting (C#).

Static Methods

AcquireCallbackGCHandleForbid a C# function to be released during GC.
CallFunctionCall a specified JavaScript function.
CreateArrayBufferCreate a JavaScript Arraybuffer.
CreateArrayWithLengthCreate a JavaScript array with length.
CreateBooleanCreate a JavaScript boolean variable.
CreateBooleanArrayCreate a JavaScript boolean array.
CreateDoubleCreate a JavaScript Number variable.
CreateDoubleArrayCreate a JavaScript Number array.
CreateFunctionCreate a napi function.
CreateIntCreate a JavaScript Number variable.
CreateInt64Create a JavaScript BigInt varibale.
CreateInt64ArrayCreate a JavaScript BigInt array.
CreateIntArrayCreate a JavaScript Number array.
CreateNapiReferenceCreate a napi reference for napi value.
CreateObjectCreate a JavaScript object.
CreateStringUTF8Create a JavaScript string with UTF8 encoding.
CreateUIntCreate a JavaScript Number variable.
CreateUInt64Create a JavaScript BigUInt varibale.
DeleteNapiReferenceDelete a napi reference.
GetArrayBufferLengthGet the length of a byte array from a JavaScript array buffer.
GetArrayElementGet element with specified index from a JavaScript array.
GetArrayLengthGet length of a JavaScript array.
GetExportedNapiValueGet registered napi value.
GetNamedPropertyGet named property from a JavaScript object.
GetNapiValueByNapiRefGet napi value from napi reference.
GetTypedArrayInfoGet typedarray info form a JavaScript object.
GetValueBooleanGet JavaScript boolean value.
GetValueDoubleGet JavaScript double value.
GetValueFromArrayBufferGet the value of a byte array from a JavaScript array buffer.
GetValueIntGet JavaScript int value.
GetValueInt64Get JavaScript int64 value.
GetValueStringUTF8Get JavaScript string value with UTF8 encoding.
GetValueUIntGet JavaScript uint value.
GetValueUInt64Get JavaScript uint64 value.
IsArrayCheck if the Object passed in is an array.
IsArrayBufferCheck if the Object passed in is an array buffer.
IsTypedArrayCheck if the Object passed in is an typedarray.
ReleaseCallbackGCHandleRelease a GC handle.
SetArrayElementSet value with specified index of a JavaScript array.
SetNamedPropertySet a named property of a JavaScript object.
SetValueToArrayBufferSet the value of a byte array into a JavaScript array buffer.
ToBooleanArrayConvert a C# boolean array to JavaScript side.
ToDoubleArrayConvert a C# double array to JavaScript side.
ToInt64ArrayConvert a C# int64 array to JavaScript side.
ToIntArrayConvert a C# int array to JavaScript side.
ToObjectArrayConvert a C# OpenHarmonyJSObject array to JavaScript side.
ToStringArrayConvert a C# string array to JavaScript side.
TypeOfExtract type of a JavaScript object.