Available on crate feature
napi only.Structs§
- napi_
async_ cleanup_ hook_ handle__ - napi_
async_ context__ - napi_
async_ work__ - napi_
callback_ info__ - napi_
callback_ scope__ - napi_
deferred__ - napi_
escapable_ handle_ scope__ - napi_
event_ mode api-12 - Indicates the running mode of the native event loop in an asynchronous native thread.
- napi_
extended_ error_ info - napi_
handle_ scope__ - napi_
key_ collection_ mode - napi_
key_ conversion - napi_
key_ filter - napi_
module - napi_
node_ version - napi_
property_ attributes - napi_
property_ descriptor - napi_
qos_ t - napi_
ref__ - napi_
status - napi_
task_ priority api-12 - Indicates the priority of a task dispatched from native thread to ArkTS thread.
- napi_
threadsafe_ function__ - napi_
threadsafe_ function_ call_ mode - napi_
threadsafe_ function_ release_ mode - napi_
type_ tag - napi_
typedarray_ type - napi_
valuetype - uv_
loop_ s
Constants§
Functions§
- napi_
acquire_ ⚠threadsafe_ function - Acquires a thread-safe function.
- napi_
add_ ⚠async_ cleanup_ hook api-11 - Registers an asynchronous clean-up hook for releasing resources when the environment exits.
- napi_
add_ ⚠env_ cleanup_ hook api-11 - Registers a clean-up hook for releasing resources when the environment exits.
- napi_
add_ ⚠finalizer api-11 - Adds a ‘napi_finalize’ callback, which will be called when the ArkTS object is garbage-collected.
- napi_
adjust_ ⚠external_ memory - napi_
async_ ⚠destroy api-11 - Destroys the previously created asynchronous context. The capabilities related to ‘async_hook’ are not supported currently.
- napi_
async_ ⚠init api-11 - Creates an asynchronous context. The capabilities related to ‘async_hook’ are not supported currently.
- napi_
call_ ⚠function - napi_
call_ ⚠threadsafe_ function - Calls a thread-safe function.
- napi_
call_ ⚠threadsafe_ function_ with_ priority api-12 - Dispatch a task with specified priority from a native thread to an ArkTS thread, the task will execute the given thread safe function.
- napi_
cancel_ ⚠async_ work - napi_
check_ ⚠object_ type_ tag - napi_
close_ ⚠callback_ scope api-11 - Closes the callback scope. The capabilities related to ‘async_hook’ are not supported currently.
- napi_
close_ ⚠escapable_ handle_ scope - Closes the escapable handle scope passed in.
- napi_
close_ ⚠handle_ scope - Closes the scope passed in. After the scope is closed, all references declared in it are closed.
- napi_
coerce_ ⚠to_ bool - napi_
coerce_ ⚠to_ native_ binding_ object api-11 - This API sets native properties to a object and converts this ArkTS object to native binding object.
- napi_
coerce_ ⚠to_ number - napi_
coerce_ ⚠to_ object - napi_
coerce_ ⚠to_ string - napi_
create_ ⚠ark_ runtime api-12 - Create the ark runtime.
- napi_
create_ ⚠array - napi_
create_ ⚠array_ with_ length - napi_
create_ ⚠arraybuffer - napi_
create_ ⚠async_ work - napi_
create_ ⚠bigint_ int64 - Creates a ArkTS BigInt from C int64 data.
- napi_
create_ ⚠bigint_ uint64 - Creates a ArkTS BigInt from C int64 data.
- napi_
create_ ⚠bigint_ words - Creates a single ArkTS BigInt from a C uint64 array.
- napi_
create_ ⚠buffer - Creates an ArkTS ArrayBuffer object of the specified size.
- napi_
create_ ⚠buffer_ copy - Creates an ArkTS ArrayBuffer object of the specified size and initializes it with the given data.
- napi_
create_ ⚠dataview - napi_
create_ ⚠date - Creates an ArkTS ‘Date’ object from C double data
- napi_
create_ ⚠double - napi_
create_ ⚠error - Creates a ArkTS Error with text information.
- napi_
create_ ⚠external - napi_
create_ ⚠external_ arraybuffer - napi_
create_ ⚠external_ buffer - Creates an ArkTS ArrayBuffer object of the specified size and initializes it with the given data.
- napi_
create_ ⚠function - napi_
create_ ⚠int32 - napi_
create_ ⚠int64 - napi_
create_ ⚠object - napi_
create_ ⚠object_ with_ named_ properties api-11 - Create ArkTS Object with initial properties given by keys and values, note that property key must be String, and must can not convert to element_index, also all keys must not duplicate.
- napi_
create_ ⚠object_ with_ properties api-11 - Create ArkTS Object with initial properties given by descriptors, note that property key must be String, and must can not convert to element_index, also all keys must not duplicate.
- napi_
create_ ⚠promise - Creates a deferred object and an ArkTS promise.
- napi_
create_ ⚠range_ error - Creates a ArkTS RangeError with text information.
- napi_
create_ ⚠reference - Creates a reference for an object to extend its lifespan. The caller needs to manage the reference lifespan.
- napi_
create_ ⚠sendable_ array api-12 - Create a sendable array.
- napi_
create_ ⚠sendable_ array_ with_ length api-12 - Create a sendable array with length.
- napi_
create_ ⚠sendable_ arraybuffer api-12 - Create a sendable arraybuffer.
- napi_
create_ ⚠sendable_ object_ with_ properties api-12 - Defines a sendable object.
- napi_
create_ ⚠sendable_ typedarray api-12 - Create a sendable typedarray.
- napi_
create_ ⚠string_ latin1 - napi_
create_ ⚠string_ utf8 - napi_
create_ ⚠string_ utf16 - napi_
create_ ⚠symbol - napi_
create_ ⚠threadsafe_ function - Creates a thread-safe function.
- napi_
create_ ⚠type_ error - Creates a ArkTS TypeError with text information.
- napi_
create_ ⚠typedarray - napi_
create_ ⚠uint32 - napi_
define_ ⚠class - Defines an ArkTS class, including constructor function and properties.
- napi_
define_ ⚠properties - napi_
define_ ⚠sendable_ class api-12 - Defines a sendable class.
- napi_
delete_ ⚠async_ work - napi_
delete_ ⚠element - napi_
delete_ ⚠property - napi_
delete_ ⚠reference - Deletes the reference passed in.
- napi_
delete_ ⚠serialization_ data api-12 - Delete serialization data.
- napi_
deserialize ⚠api-12 - Restore serialization data to a ArkTS object.
- napi_
destroy_ ⚠ark_ runtime api-12 - Destroy the ark runtime.
- napi_
detach_ ⚠arraybuffer - Detaches the underlying data from an ‘ArrayBuffer’ object. After the data is detached, you can operate the data in C/C++.
- napi_
escape_ ⚠handle - Promotes the handle to the input ArkTS object so that it is valid for the lifespan of its outer scope.
- napi_
fatal_ ⚠error - Raises a fatal error to terminate the process immediately.
- napi_
fatal_ ⚠exception api-12 - Throws UncaughtException to ArkTS.
- napi_
get_ ⚠all_ property_ names - Obtains the names of all properties of an ArkTS object.
- napi_
get_ ⚠and_ clear_ last_ exception - Obtains and clears the latest exception.
- napi_
get_ ⚠array_ length - napi_
get_ ⚠arraybuffer_ info - napi_
get_ ⚠boolean - napi_
get_ ⚠buffer_ info - Obtains the underlying data of ‘ArrayBuffer’ and its length.
- napi_
get_ ⚠cb_ info - napi_
get_ ⚠dataview_ info - napi_
get_ ⚠date_ value - Obtains the C equivalent of the given ArkTS ‘Date’ object.
- napi_
get_ ⚠element - napi_
get_ ⚠global - napi_
get_ ⚠instance_ data api-11 - Retrieves the data that was previously associated with the currently running environment.
- napi_
get_ ⚠last_ error_ info - Obtains the napi_extended_error_info struct, which contains the latest error information.
- napi_
get_ ⚠named_ property - napi_
get_ ⚠new_ target - napi_
get_ ⚠node_ version - napi_
get_ ⚠null - napi_
get_ ⚠property - napi_
get_ ⚠property_ names - napi_
get_ ⚠prototype - napi_
get_ ⚠reference_ value - Obtains the ArkTS Object associated with the reference.
- napi_
get_ ⚠threadsafe_ function_ context - Obtains the context of a thread-safe function.
- napi_
get_ ⚠typedarray_ info - napi_
get_ ⚠undefined - napi_
get_ ⚠uv_ event_ loop - Obtains the current libuv loop instance.
- napi_
get_ ⚠value_ bigint_ int64 - Obtains a signed 64-bit integer from an ArkTS BigInt object.
- napi_
get_ ⚠value_ bigint_ uint64 - Obtains an unsigned 64-bit integer from an ArkTS BigInt object.
- napi_
get_ ⚠value_ bigint_ words - Obtains the underlying 64-bit unsigned (uint64) byte data from an ArkTS BigInt object.
- napi_
get_ ⚠value_ bool - napi_
get_ ⚠value_ double - napi_
get_ ⚠value_ external - napi_
get_ ⚠value_ int32 - napi_
get_ ⚠value_ int64 - napi_
get_ ⚠value_ string_ latin1 - napi_
get_ ⚠value_ string_ utf8 - napi_
get_ ⚠value_ string_ utf16 - napi_
get_ ⚠value_ uint32 - napi_
get_ ⚠version - napi_
has_ ⚠element - napi_
has_ ⚠named_ property - napi_
has_ ⚠own_ property - Check if the given ArkTS Object has the named own property or not.
- napi_
has_ ⚠property - napi_
instanceof ⚠ - napi_
is_ ⚠array - napi_
is_ ⚠arraybuffer - napi_
is_ ⚠buffer - Checks whether the given ArkTS value is a ‘ArrayBuffer’ object.
- napi_
is_ ⚠dataview - napi_
is_ ⚠date - Checks whether the given ArkTS value is a ‘Date’ object. You can use this API to check the type of the parameter passed from ArkTS.
- napi_
is_ ⚠detached_ arraybuffer - Checks whether the given ‘ArrayBuffer’ has been detached.
- napi_
is_ ⚠error - Checks whether a ‘napi_value’ is an error object.
- napi_
is_ ⚠exception_ pending - Checks whether an exception occurs.
- napi_
is_ ⚠promise - Checks whether the given ‘napi_value’ is a promise object.
- napi_
is_ ⚠sendable api-12 - Queries a napi_value to check if it is sendable.
- napi_
is_ ⚠typedarray - napi_
load_ ⚠module api-11 - Loads an .abc file as a module. This API returns the namespace of the module.
- napi_
load_ ⚠module_ with_ info api-12 - The module is loaded through the NAPI. By default, the default object is exported from the module.
- napi_
make_ ⚠callback api-11 - Allows a ArkTS function to be called in the asynchronous context. The capabilities related to ‘async_hook’ are not supported currently.
- napi_
module_ ⚠register - Registers a native module.
- napi_
new_ ⚠instance - napi_
object_ ⚠freeze - Freezes an ArkTS object. Once an object is frozen, its properties are immutable.
- napi_
object_ ⚠seal - Seals an ArkTS object. Once an object is sealed, its properties cannot be added or deleted, but property values can be modified.
- napi_
open_ ⚠callback_ scope api-11 - Opens a callback scope. The capabilities related to ‘async_hook’ are not supported currently.
- napi_
open_ ⚠escapable_ handle_ scope - Opens an escapable handle scope from which the declared values can be returned to the outer scope.
- napi_
open_ ⚠handle_ scope - Opens a scope.
- napi_
queue_ ⚠async_ work - napi_
queue_ ⚠async_ work_ with_ qos - napi_
ref_ ⚠threadsafe_ function - Indicates that the event loop running on the main thread should not exit until the thread-safe function is destroyed.
- napi_
reference_ ⚠ref - Increments the reference count for the reference passed in and returns the count.
- napi_
reference_ ⚠unref - Decrements the reference count for the reference passed in and returns the count.
- napi_
reject_ ⚠deferred - Rejects a promise by way of the deferred object associated.
- napi_
release_ ⚠threadsafe_ function - Releases a thread-safe function.
- napi_
remove_ ⚠async_ cleanup_ hook api-11 - Unregisters the asynchronous clean-up hook.
- napi_
remove_ ⚠env_ cleanup_ hook api-11 - Unregisters the clean-up hook.
- napi_
remove_ ⚠wrap - napi_
remove_ ⚠wrap_ sendable api-12 - Retrieves a native instance that was previously wrapped in a ArkTS object and removes the wrapping.
- napi_
resolve_ ⚠deferred - Resolves a promise by way of the deferred object associated.
- napi_
run_ ⚠event_ loop api-12 - Run the event loop by the given env and running mode in current thread.
- napi_
run_ ⚠script - napi_
run_ ⚠script_ path - napi_
serialize ⚠api-12 - Serialize a ArkTS object.
- napi_
set_ ⚠element - napi_
set_ ⚠instance_ data api-11 - Associates data with the currently running environment.
- napi_
set_ ⚠named_ property - napi_
set_ ⚠property - napi_
stop_ ⚠event_ loop api-12 - Stop the event loop in current thread.
- napi_
strict_ ⚠equals - napi_
throw ⚠ - Throws a ArkTS error.
- napi_
throw_ ⚠error - Throws a ArkTS Error with text information.
- napi_
throw_ ⚠range_ error - Throws a ArkTS RangeError with text information.
- napi_
throw_ ⚠type_ error - Throws a ArkTS TypeError with text information.
- napi_
type_ ⚠tag_ object - napi_
typeof ⚠ - napi_
unref_ ⚠threadsafe_ function - Indicates that the event loop running on the main thread may exit before the thread-safe function is destroyed.
- napi_
unwrap ⚠ - napi_
unwrap_ ⚠sendable api-12 - Retrieves a native instance that was previously wrapped in a ArkTS object.
- napi_
wrap ⚠ - napi_
wrap_ ⚠enhance api-18 - Wraps a native instance in a ArkTS object.
- napi_
wrap_ ⚠sendable api-12 - Wraps a native instance in a ArkTS object.
- napi_
wrap_ ⚠sendable_ with_ size api-12 - Wraps a native instance in a ArkTS object.
- node_
api_ ⚠get_ module_ file_ name api-11 - Obtains the absolute path of the location, from which the addon is loaded.
Type Aliases§
- char16_
t - napi_
addon_ register_ func - napi_
async_ cleanup_ hook - napi_
async_ cleanup_ hook_ handle - napi_
async_ complete_ callback - napi_
async_ context - napi_
async_ execute_ callback - napi_
async_ work - napi_
callback - napi_
callback_ info - napi_
callback_ scope - napi_
deferred - napi_
env - napi_
escapable_ handle_ scope - napi_
finalize - napi_
handle_ scope - napi_
native_ binding_ attach_ callback api-11 - Native attach callback of napi_coerce_to_native_binding_object that can be used to bind the ArkTS object and the native object.
- napi_
native_ binding_ detach_ callback api-11 - Native detach callback of napi_coerce_to_native_binding_object that can be used to detach the ArkTS object and the native object.
- napi_
ref - napi_
threadsafe_ function - napi_
threadsafe_ function_ call_ js - napi_
value