ohos_sys/napi/
napi_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6pub use ohos_sys_opaque_types::{napi_env, napi_value};
7
8pub const NAPI_VERSION: u32 = 8;
9pub const NAPI_VERSION_EXPERIMENTAL: u32 = 2147483647;
10pub const NAPI_AUTO_LENGTH: i32 = -1;
11pub const NAPI_MODULE_VERSION: u32 = 1;
12impl napi_qos_t {
13    pub const napi_qos_background: napi_qos_t = napi_qos_t(0);
14}
15impl napi_qos_t {
16    pub const napi_qos_utility: napi_qos_t = napi_qos_t(1);
17}
18impl napi_qos_t {
19    pub const napi_qos_default: napi_qos_t = napi_qos_t(2);
20}
21impl napi_qos_t {
22    pub const napi_qos_user_initiated: napi_qos_t = napi_qos_t(3);
23}
24#[repr(transparent)]
25#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26pub struct napi_qos_t(pub ::core::ffi::c_uint);
27#[cfg(feature = "api-12")]
28#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
29impl napi_event_mode {
30    /// In this mode, the current asynchronous thread will be blocked and events of native event loop will
31    /// be processed.
32    pub const napi_event_mode_default: napi_event_mode = napi_event_mode(0);
33}
34#[cfg(feature = "api-12")]
35#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
36impl napi_event_mode {
37    /// In this mode, the current asynchronous thread will not be blocked. If there are events in the event loop,
38    /// only one event will be processed and then the event loop will stop. If there are no events in the loop,
39    /// the event loop will stop immediately.
40    pub const napi_event_mode_nowait: napi_event_mode = napi_event_mode(1);
41}
42#[repr(transparent)]
43/// Indicates the running mode of the native event loop in an asynchronous native thread.
44///
45///
46/// Available since API-level: 12
47#[cfg(feature = "api-12")]
48#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
49#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
50pub struct napi_event_mode(pub ::core::ffi::c_uint);
51#[cfg(feature = "api-12")]
52#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
53impl napi_task_priority {
54    /// The immediate priority tasks should be promptly processed whenever feasible.
55    pub const napi_priority_immediate: napi_task_priority = napi_task_priority(0);
56}
57#[cfg(feature = "api-12")]
58#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
59impl napi_task_priority {
60    /// The high priority tasks, as sorted by their handle time, should be prioritized over tasks with low priority.
61    pub const napi_priority_high: napi_task_priority = napi_task_priority(1);
62}
63#[cfg(feature = "api-12")]
64#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
65impl napi_task_priority {
66    /// The low priority tasks, as sorted by their handle time, should be processed before idle priority tasks.
67    pub const napi_priority_low: napi_task_priority = napi_task_priority(2);
68}
69#[cfg(feature = "api-12")]
70#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
71impl napi_task_priority {
72    /// The idle priority tasks should be processed immediately only if there are no other priority tasks.
73    pub const napi_priority_idle: napi_task_priority = napi_task_priority(3);
74}
75#[repr(transparent)]
76/// Indicates the priority of a task dispatched from native thread to ArkTS thread.
77///
78///
79/// Available since API-level: 12
80#[cfg(feature = "api-12")]
81#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
82#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
83pub struct napi_task_priority(pub ::core::ffi::c_uint);
84pub type char16_t = u16;
85#[repr(C)]
86pub struct napi_ref__ {
87    _unused: [u8; 0],
88}
89pub type napi_ref = *mut napi_ref__;
90#[repr(C)]
91pub struct napi_handle_scope__ {
92    _unused: [u8; 0],
93}
94pub type napi_handle_scope = *mut napi_handle_scope__;
95#[repr(C)]
96pub struct napi_escapable_handle_scope__ {
97    _unused: [u8; 0],
98}
99pub type napi_escapable_handle_scope = *mut napi_escapable_handle_scope__;
100#[repr(C)]
101pub struct napi_callback_info__ {
102    _unused: [u8; 0],
103}
104pub type napi_callback_info = *mut napi_callback_info__;
105#[repr(C)]
106pub struct napi_deferred__ {
107    _unused: [u8; 0],
108}
109pub type napi_deferred = *mut napi_deferred__;
110impl napi_property_attributes {
111    pub const napi_default: napi_property_attributes = napi_property_attributes(0);
112}
113impl napi_property_attributes {
114    pub const napi_writable: napi_property_attributes = napi_property_attributes(1);
115}
116impl napi_property_attributes {
117    pub const napi_enumerable: napi_property_attributes = napi_property_attributes(2);
118}
119impl napi_property_attributes {
120    pub const napi_configurable: napi_property_attributes = napi_property_attributes(4);
121}
122impl napi_property_attributes {
123    pub const napi_static: napi_property_attributes = napi_property_attributes(1024);
124}
125impl napi_property_attributes {
126    pub const napi_default_method: napi_property_attributes = napi_property_attributes(5);
127}
128impl napi_property_attributes {
129    pub const napi_default_jsproperty: napi_property_attributes = napi_property_attributes(7);
130}
131#[repr(transparent)]
132#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
133pub struct napi_property_attributes(pub ::core::ffi::c_uint);
134impl napi_valuetype {
135    pub const napi_undefined: napi_valuetype = napi_valuetype(0);
136}
137impl napi_valuetype {
138    pub const napi_null: napi_valuetype = napi_valuetype(1);
139}
140impl napi_valuetype {
141    pub const napi_boolean: napi_valuetype = napi_valuetype(2);
142}
143impl napi_valuetype {
144    pub const napi_number: napi_valuetype = napi_valuetype(3);
145}
146impl napi_valuetype {
147    pub const napi_string: napi_valuetype = napi_valuetype(4);
148}
149impl napi_valuetype {
150    pub const napi_symbol: napi_valuetype = napi_valuetype(5);
151}
152impl napi_valuetype {
153    pub const napi_object: napi_valuetype = napi_valuetype(6);
154}
155impl napi_valuetype {
156    pub const napi_function: napi_valuetype = napi_valuetype(7);
157}
158impl napi_valuetype {
159    pub const napi_external: napi_valuetype = napi_valuetype(8);
160}
161impl napi_valuetype {
162    pub const napi_bigint: napi_valuetype = napi_valuetype(9);
163}
164#[repr(transparent)]
165#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
166pub struct napi_valuetype(pub ::core::ffi::c_uint);
167impl napi_typedarray_type {
168    pub const napi_int8_array: napi_typedarray_type = napi_typedarray_type(0);
169}
170impl napi_typedarray_type {
171    pub const napi_uint8_array: napi_typedarray_type = napi_typedarray_type(1);
172}
173impl napi_typedarray_type {
174    pub const napi_uint8_clamped_array: napi_typedarray_type = napi_typedarray_type(2);
175}
176impl napi_typedarray_type {
177    pub const napi_int16_array: napi_typedarray_type = napi_typedarray_type(3);
178}
179impl napi_typedarray_type {
180    pub const napi_uint16_array: napi_typedarray_type = napi_typedarray_type(4);
181}
182impl napi_typedarray_type {
183    pub const napi_int32_array: napi_typedarray_type = napi_typedarray_type(5);
184}
185impl napi_typedarray_type {
186    pub const napi_uint32_array: napi_typedarray_type = napi_typedarray_type(6);
187}
188impl napi_typedarray_type {
189    pub const napi_float32_array: napi_typedarray_type = napi_typedarray_type(7);
190}
191impl napi_typedarray_type {
192    pub const napi_float64_array: napi_typedarray_type = napi_typedarray_type(8);
193}
194impl napi_typedarray_type {
195    pub const napi_bigint64_array: napi_typedarray_type = napi_typedarray_type(9);
196}
197impl napi_typedarray_type {
198    pub const napi_biguint64_array: napi_typedarray_type = napi_typedarray_type(10);
199}
200#[repr(transparent)]
201#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
202pub struct napi_typedarray_type(pub ::core::ffi::c_uint);
203impl napi_status {
204    pub const napi_ok: napi_status = napi_status(0);
205}
206impl napi_status {
207    pub const napi_invalid_arg: napi_status = napi_status(1);
208}
209impl napi_status {
210    pub const napi_object_expected: napi_status = napi_status(2);
211}
212impl napi_status {
213    pub const napi_string_expected: napi_status = napi_status(3);
214}
215impl napi_status {
216    pub const napi_name_expected: napi_status = napi_status(4);
217}
218impl napi_status {
219    pub const napi_function_expected: napi_status = napi_status(5);
220}
221impl napi_status {
222    pub const napi_number_expected: napi_status = napi_status(6);
223}
224impl napi_status {
225    pub const napi_boolean_expected: napi_status = napi_status(7);
226}
227impl napi_status {
228    pub const napi_array_expected: napi_status = napi_status(8);
229}
230impl napi_status {
231    pub const napi_generic_failure: napi_status = napi_status(9);
232}
233impl napi_status {
234    pub const napi_pending_exception: napi_status = napi_status(10);
235}
236impl napi_status {
237    pub const napi_cancelled: napi_status = napi_status(11);
238}
239impl napi_status {
240    pub const napi_escape_called_twice: napi_status = napi_status(12);
241}
242impl napi_status {
243    pub const napi_handle_scope_mismatch: napi_status = napi_status(13);
244}
245impl napi_status {
246    pub const napi_callback_scope_mismatch: napi_status = napi_status(14);
247}
248impl napi_status {
249    pub const napi_queue_full: napi_status = napi_status(15);
250}
251impl napi_status {
252    pub const napi_closing: napi_status = napi_status(16);
253}
254impl napi_status {
255    pub const napi_bigint_expected: napi_status = napi_status(17);
256}
257impl napi_status {
258    pub const napi_date_expected: napi_status = napi_status(18);
259}
260impl napi_status {
261    pub const napi_arraybuffer_expected: napi_status = napi_status(19);
262}
263impl napi_status {
264    pub const napi_detachable_arraybuffer_expected: napi_status = napi_status(20);
265}
266impl napi_status {
267    pub const napi_would_deadlock: napi_status = napi_status(21);
268}
269impl napi_status {
270    pub const napi_create_ark_runtime_too_many_envs: napi_status = napi_status(22);
271}
272impl napi_status {
273    pub const napi_create_ark_runtime_only_one_env_per_thread: napi_status = napi_status(23);
274}
275impl napi_status {
276    pub const napi_destroy_ark_runtime_env_not_exist: napi_status = napi_status(24);
277}
278#[repr(transparent)]
279#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
280pub struct napi_status(pub ::core::ffi::c_uint);
281pub type napi_callback = ::core::option::Option<
282    unsafe extern "C" fn(env: napi_env, info: napi_callback_info) -> napi_value,
283>;
284pub type napi_finalize = ::core::option::Option<
285    unsafe extern "C" fn(
286        env: napi_env,
287        finalize_data: *mut ::core::ffi::c_void,
288        finalize_hint: *mut ::core::ffi::c_void,
289    ),
290>;
291#[repr(C)]
292pub struct napi_property_descriptor {
293    pub utf8name: *const ::core::ffi::c_char,
294    pub name: napi_value,
295    pub method: napi_callback,
296    pub getter: napi_callback,
297    pub setter: napi_callback,
298    pub value: napi_value,
299    pub attributes: napi_property_attributes,
300    pub data: *mut ::core::ffi::c_void,
301}
302#[repr(C)]
303#[derive(Debug)]
304pub struct napi_extended_error_info {
305    pub error_message: *const ::core::ffi::c_char,
306    pub engine_reserved: *mut ::core::ffi::c_void,
307    pub engine_error_code: u32,
308    pub error_code: napi_status,
309}
310impl napi_key_collection_mode {
311    pub const napi_key_include_prototypes: napi_key_collection_mode = napi_key_collection_mode(0);
312}
313impl napi_key_collection_mode {
314    pub const napi_key_own_only: napi_key_collection_mode = napi_key_collection_mode(1);
315}
316#[repr(transparent)]
317#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
318pub struct napi_key_collection_mode(pub ::core::ffi::c_uint);
319impl napi_key_filter {
320    pub const napi_key_all_properties: napi_key_filter = napi_key_filter(0);
321}
322impl napi_key_filter {
323    pub const napi_key_writable: napi_key_filter = napi_key_filter(1);
324}
325impl napi_key_filter {
326    pub const napi_key_enumerable: napi_key_filter = napi_key_filter(2);
327}
328impl napi_key_filter {
329    pub const napi_key_configurable: napi_key_filter = napi_key_filter(4);
330}
331impl napi_key_filter {
332    pub const napi_key_skip_strings: napi_key_filter = napi_key_filter(8);
333}
334impl napi_key_filter {
335    pub const napi_key_skip_symbols: napi_key_filter = napi_key_filter(16);
336}
337#[repr(transparent)]
338#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
339pub struct napi_key_filter(pub ::core::ffi::c_uint);
340impl napi_key_conversion {
341    pub const napi_key_keep_numbers: napi_key_conversion = napi_key_conversion(0);
342}
343impl napi_key_conversion {
344    pub const napi_key_numbers_to_strings: napi_key_conversion = napi_key_conversion(1);
345}
346#[repr(transparent)]
347#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
348pub struct napi_key_conversion(pub ::core::ffi::c_uint);
349#[repr(C)]
350#[derive(Debug, Copy, Clone)]
351pub struct napi_type_tag {
352    pub lower: u64,
353    pub upper: u64,
354}
355#[repr(C)]
356pub struct napi_callback_scope__ {
357    _unused: [u8; 0],
358}
359pub type napi_callback_scope = *mut napi_callback_scope__;
360#[repr(C)]
361pub struct napi_async_context__ {
362    _unused: [u8; 0],
363}
364pub type napi_async_context = *mut napi_async_context__;
365#[repr(C)]
366pub struct napi_async_work__ {
367    _unused: [u8; 0],
368}
369pub type napi_async_work = *mut napi_async_work__;
370#[repr(C)]
371pub struct napi_threadsafe_function__ {
372    _unused: [u8; 0],
373}
374pub type napi_threadsafe_function = *mut napi_threadsafe_function__;
375impl napi_threadsafe_function_release_mode {
376    pub const napi_tsfn_release: napi_threadsafe_function_release_mode =
377        napi_threadsafe_function_release_mode(0);
378}
379impl napi_threadsafe_function_release_mode {
380    pub const napi_tsfn_abort: napi_threadsafe_function_release_mode =
381        napi_threadsafe_function_release_mode(1);
382}
383#[repr(transparent)]
384#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
385pub struct napi_threadsafe_function_release_mode(pub ::core::ffi::c_uint);
386impl napi_threadsafe_function_call_mode {
387    pub const napi_tsfn_nonblocking: napi_threadsafe_function_call_mode =
388        napi_threadsafe_function_call_mode(0);
389}
390impl napi_threadsafe_function_call_mode {
391    pub const napi_tsfn_blocking: napi_threadsafe_function_call_mode =
392        napi_threadsafe_function_call_mode(1);
393}
394#[repr(transparent)]
395#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
396pub struct napi_threadsafe_function_call_mode(pub ::core::ffi::c_uint);
397pub type napi_async_execute_callback =
398    ::core::option::Option<unsafe extern "C" fn(env: napi_env, data: *mut ::core::ffi::c_void)>;
399pub type napi_async_complete_callback = ::core::option::Option<
400    unsafe extern "C" fn(env: napi_env, status: napi_status, data: *mut ::core::ffi::c_void),
401>;
402pub type napi_threadsafe_function_call_js = ::core::option::Option<
403    unsafe extern "C" fn(
404        env: napi_env,
405        js_callback: napi_value,
406        context: *mut ::core::ffi::c_void,
407        data: *mut ::core::ffi::c_void,
408    ),
409>;
410#[repr(C)]
411#[derive(Debug)]
412pub struct napi_node_version {
413    pub major: u32,
414    pub minor: u32,
415    pub patch: u32,
416    pub release: *const ::core::ffi::c_char,
417}
418#[repr(C)]
419pub struct napi_async_cleanup_hook_handle__ {
420    _unused: [u8; 0],
421}
422pub type napi_async_cleanup_hook_handle = *mut napi_async_cleanup_hook_handle__;
423pub type napi_async_cleanup_hook = ::core::option::Option<
424    unsafe extern "C" fn(handle: napi_async_cleanup_hook_handle, data: *mut ::core::ffi::c_void),
425>;
426#[repr(C)]
427pub struct uv_loop_s {
428    _unused: [u8; 0],
429}
430pub type napi_addon_register_func =
431    ::core::option::Option<unsafe extern "C" fn(env: napi_env, exports: napi_value) -> napi_value>;
432#[repr(C)]
433#[derive(Debug)]
434pub struct napi_module {
435    pub nm_version: ::core::ffi::c_int,
436    pub nm_flags: ::core::ffi::c_uint,
437    pub nm_filename: *const ::core::ffi::c_char,
438    pub nm_register_func: napi_addon_register_func,
439    pub nm_modname: *const ::core::ffi::c_char,
440    pub nm_priv: *mut ::core::ffi::c_void,
441    pub reserved: [*mut ::core::ffi::c_void; 4usize],
442}
443/// Native detach callback of napi_coerce_to_native_binding_object that can be used to
444/// detach the js object and the native object.
445///
446///
447/// Available since API-level: 11
448#[cfg(feature = "api-11")]
449#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
450pub type napi_native_binding_detach_callback = ::core::option::Option<
451    unsafe extern "C" fn(
452        env: napi_env,
453        native_object: *mut ::core::ffi::c_void,
454        hint: *mut ::core::ffi::c_void,
455    ) -> *mut ::core::ffi::c_void,
456>;
457/// Native attach callback of napi_coerce_to_native_binding_object that can be used to
458/// bind the js object and the native object.
459///
460///
461/// Available since API-level: 11
462#[cfg(feature = "api-11")]
463#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
464pub type napi_native_binding_attach_callback = ::core::option::Option<
465    unsafe extern "C" fn(
466        env: napi_env,
467        native_object: *mut ::core::ffi::c_void,
468        hint: *mut ::core::ffi::c_void,
469    ) -> napi_value,
470>;
471extern "C" {
472    pub fn napi_get_last_error_info(
473        env: napi_env,
474        result: *mut *const napi_extended_error_info,
475    ) -> napi_status;
476    pub fn napi_get_undefined(env: napi_env, result: *mut napi_value) -> napi_status;
477    pub fn napi_get_null(env: napi_env, result: *mut napi_value) -> napi_status;
478    pub fn napi_get_global(env: napi_env, result: *mut napi_value) -> napi_status;
479    pub fn napi_get_boolean(env: napi_env, value: bool, result: *mut napi_value) -> napi_status;
480    pub fn napi_create_object(env: napi_env, result: *mut napi_value) -> napi_status;
481    pub fn napi_create_array(env: napi_env, result: *mut napi_value) -> napi_status;
482    pub fn napi_create_array_with_length(
483        env: napi_env,
484        length: usize,
485        result: *mut napi_value,
486    ) -> napi_status;
487    pub fn napi_create_double(env: napi_env, value: f64, result: *mut napi_value) -> napi_status;
488    pub fn napi_create_int32(env: napi_env, value: i32, result: *mut napi_value) -> napi_status;
489    pub fn napi_create_uint32(env: napi_env, value: u32, result: *mut napi_value) -> napi_status;
490    pub fn napi_create_int64(env: napi_env, value: i64, result: *mut napi_value) -> napi_status;
491    pub fn napi_create_string_latin1(
492        env: napi_env,
493        str_: *const ::core::ffi::c_char,
494        length: usize,
495        result: *mut napi_value,
496    ) -> napi_status;
497    pub fn napi_create_string_utf8(
498        env: napi_env,
499        str_: *const ::core::ffi::c_char,
500        length: usize,
501        result: *mut napi_value,
502    ) -> napi_status;
503    pub fn napi_create_string_utf16(
504        env: napi_env,
505        str_: *const char16_t,
506        length: usize,
507        result: *mut napi_value,
508    ) -> napi_status;
509    pub fn napi_create_symbol(
510        env: napi_env,
511        description: napi_value,
512        result: *mut napi_value,
513    ) -> napi_status;
514    pub fn napi_create_function(
515        env: napi_env,
516        utf8name: *const ::core::ffi::c_char,
517        length: usize,
518        cb: napi_callback,
519        data: *mut ::core::ffi::c_void,
520        result: *mut napi_value,
521    ) -> napi_status;
522    pub fn napi_create_error(
523        env: napi_env,
524        code: napi_value,
525        msg: napi_value,
526        result: *mut napi_value,
527    ) -> napi_status;
528    pub fn napi_create_type_error(
529        env: napi_env,
530        code: napi_value,
531        msg: napi_value,
532        result: *mut napi_value,
533    ) -> napi_status;
534    pub fn napi_create_range_error(
535        env: napi_env,
536        code: napi_value,
537        msg: napi_value,
538        result: *mut napi_value,
539    ) -> napi_status;
540    pub fn napi_typeof(
541        env: napi_env,
542        value: napi_value,
543        result: *mut napi_valuetype,
544    ) -> napi_status;
545    pub fn napi_get_value_double(env: napi_env, value: napi_value, result: *mut f64)
546        -> napi_status;
547    pub fn napi_get_value_int32(env: napi_env, value: napi_value, result: *mut i32) -> napi_status;
548    pub fn napi_get_value_uint32(env: napi_env, value: napi_value, result: *mut u32)
549        -> napi_status;
550    pub fn napi_get_value_int64(env: napi_env, value: napi_value, result: *mut i64) -> napi_status;
551    pub fn napi_get_value_bool(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
552    pub fn napi_get_value_string_latin1(
553        env: napi_env,
554        value: napi_value,
555        buf: *mut ::core::ffi::c_char,
556        bufsize: usize,
557        result: *mut usize,
558    ) -> napi_status;
559    pub fn napi_get_value_string_utf8(
560        env: napi_env,
561        value: napi_value,
562        buf: *mut ::core::ffi::c_char,
563        bufsize: usize,
564        result: *mut usize,
565    ) -> napi_status;
566    pub fn napi_get_value_string_utf16(
567        env: napi_env,
568        value: napi_value,
569        buf: *mut char16_t,
570        bufsize: usize,
571        result: *mut usize,
572    ) -> napi_status;
573    pub fn napi_coerce_to_bool(
574        env: napi_env,
575        value: napi_value,
576        result: *mut napi_value,
577    ) -> napi_status;
578    pub fn napi_coerce_to_number(
579        env: napi_env,
580        value: napi_value,
581        result: *mut napi_value,
582    ) -> napi_status;
583    pub fn napi_coerce_to_object(
584        env: napi_env,
585        value: napi_value,
586        result: *mut napi_value,
587    ) -> napi_status;
588    pub fn napi_coerce_to_string(
589        env: napi_env,
590        value: napi_value,
591        result: *mut napi_value,
592    ) -> napi_status;
593    pub fn napi_get_prototype(
594        env: napi_env,
595        object: napi_value,
596        result: *mut napi_value,
597    ) -> napi_status;
598    pub fn napi_get_property_names(
599        env: napi_env,
600        object: napi_value,
601        result: *mut napi_value,
602    ) -> napi_status;
603    pub fn napi_set_property(
604        env: napi_env,
605        object: napi_value,
606        key: napi_value,
607        value: napi_value,
608    ) -> napi_status;
609    pub fn napi_has_property(
610        env: napi_env,
611        object: napi_value,
612        key: napi_value,
613        result: *mut bool,
614    ) -> napi_status;
615    pub fn napi_get_property(
616        env: napi_env,
617        object: napi_value,
618        key: napi_value,
619        result: *mut napi_value,
620    ) -> napi_status;
621    pub fn napi_delete_property(
622        env: napi_env,
623        object: napi_value,
624        key: napi_value,
625        result: *mut bool,
626    ) -> napi_status;
627    pub fn napi_has_own_property(
628        env: napi_env,
629        object: napi_value,
630        key: napi_value,
631        result: *mut bool,
632    ) -> napi_status;
633    pub fn napi_set_named_property(
634        env: napi_env,
635        object: napi_value,
636        utf8name: *const ::core::ffi::c_char,
637        value: napi_value,
638    ) -> napi_status;
639    pub fn napi_has_named_property(
640        env: napi_env,
641        object: napi_value,
642        utf8name: *const ::core::ffi::c_char,
643        result: *mut bool,
644    ) -> napi_status;
645    pub fn napi_get_named_property(
646        env: napi_env,
647        object: napi_value,
648        utf8name: *const ::core::ffi::c_char,
649        result: *mut napi_value,
650    ) -> napi_status;
651    pub fn napi_set_element(
652        env: napi_env,
653        object: napi_value,
654        index: u32,
655        value: napi_value,
656    ) -> napi_status;
657    pub fn napi_has_element(
658        env: napi_env,
659        object: napi_value,
660        index: u32,
661        result: *mut bool,
662    ) -> napi_status;
663    pub fn napi_get_element(
664        env: napi_env,
665        object: napi_value,
666        index: u32,
667        result: *mut napi_value,
668    ) -> napi_status;
669    pub fn napi_delete_element(
670        env: napi_env,
671        object: napi_value,
672        index: u32,
673        result: *mut bool,
674    ) -> napi_status;
675    pub fn napi_define_properties(
676        env: napi_env,
677        object: napi_value,
678        property_count: usize,
679        properties: *const napi_property_descriptor,
680    ) -> napi_status;
681    pub fn napi_is_array(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
682    pub fn napi_get_array_length(env: napi_env, value: napi_value, result: *mut u32)
683        -> napi_status;
684    pub fn napi_strict_equals(
685        env: napi_env,
686        lhs: napi_value,
687        rhs: napi_value,
688        result: *mut bool,
689    ) -> napi_status;
690    pub fn napi_call_function(
691        env: napi_env,
692        recv: napi_value,
693        func: napi_value,
694        argc: usize,
695        argv: *const napi_value,
696        result: *mut napi_value,
697    ) -> napi_status;
698    pub fn napi_new_instance(
699        env: napi_env,
700        constructor: napi_value,
701        argc: usize,
702        argv: *const napi_value,
703        result: *mut napi_value,
704    ) -> napi_status;
705    pub fn napi_instanceof(
706        env: napi_env,
707        object: napi_value,
708        constructor: napi_value,
709        result: *mut bool,
710    ) -> napi_status;
711    pub fn napi_get_cb_info(
712        env: napi_env,
713        cbinfo: napi_callback_info,
714        argc: *mut usize,
715        argv: *mut napi_value,
716        this_arg: *mut napi_value,
717        data: *mut *mut ::core::ffi::c_void,
718    ) -> napi_status;
719    pub fn napi_get_new_target(
720        env: napi_env,
721        cbinfo: napi_callback_info,
722        result: *mut napi_value,
723    ) -> napi_status;
724    pub fn napi_define_class(
725        env: napi_env,
726        utf8name: *const ::core::ffi::c_char,
727        length: usize,
728        constructor: napi_callback,
729        data: *mut ::core::ffi::c_void,
730        property_count: usize,
731        properties: *const napi_property_descriptor,
732        result: *mut napi_value,
733    ) -> napi_status;
734    pub fn napi_wrap(
735        env: napi_env,
736        js_object: napi_value,
737        native_object: *mut ::core::ffi::c_void,
738        finalize_cb: napi_finalize,
739        finalize_hint: *mut ::core::ffi::c_void,
740        result: *mut napi_ref,
741    ) -> napi_status;
742    pub fn napi_unwrap(
743        env: napi_env,
744        js_object: napi_value,
745        result: *mut *mut ::core::ffi::c_void,
746    ) -> napi_status;
747    pub fn napi_remove_wrap(
748        env: napi_env,
749        js_object: napi_value,
750        result: *mut *mut ::core::ffi::c_void,
751    ) -> napi_status;
752    pub fn napi_create_external(
753        env: napi_env,
754        data: *mut ::core::ffi::c_void,
755        finalize_cb: napi_finalize,
756        finalize_hint: *mut ::core::ffi::c_void,
757        result: *mut napi_value,
758    ) -> napi_status;
759    pub fn napi_get_value_external(
760        env: napi_env,
761        value: napi_value,
762        result: *mut *mut ::core::ffi::c_void,
763    ) -> napi_status;
764    pub fn napi_create_reference(
765        env: napi_env,
766        value: napi_value,
767        initial_refcount: u32,
768        result: *mut napi_ref,
769    ) -> napi_status;
770    pub fn napi_delete_reference(env: napi_env, ref_: napi_ref) -> napi_status;
771    pub fn napi_reference_ref(env: napi_env, ref_: napi_ref, result: *mut u32) -> napi_status;
772    pub fn napi_reference_unref(env: napi_env, ref_: napi_ref, result: *mut u32) -> napi_status;
773    pub fn napi_get_reference_value(
774        env: napi_env,
775        ref_: napi_ref,
776        result: *mut napi_value,
777    ) -> napi_status;
778    pub fn napi_open_handle_scope(env: napi_env, result: *mut napi_handle_scope) -> napi_status;
779    pub fn napi_close_handle_scope(env: napi_env, scope: napi_handle_scope) -> napi_status;
780    pub fn napi_open_escapable_handle_scope(
781        env: napi_env,
782        result: *mut napi_escapable_handle_scope,
783    ) -> napi_status;
784    pub fn napi_close_escapable_handle_scope(
785        env: napi_env,
786        scope: napi_escapable_handle_scope,
787    ) -> napi_status;
788    pub fn napi_escape_handle(
789        env: napi_env,
790        scope: napi_escapable_handle_scope,
791        escapee: napi_value,
792        result: *mut napi_value,
793    ) -> napi_status;
794    pub fn napi_throw(env: napi_env, error: napi_value) -> napi_status;
795    pub fn napi_throw_error(
796        env: napi_env,
797        code: *const ::core::ffi::c_char,
798        msg: *const ::core::ffi::c_char,
799    ) -> napi_status;
800    pub fn napi_throw_type_error(
801        env: napi_env,
802        code: *const ::core::ffi::c_char,
803        msg: *const ::core::ffi::c_char,
804    ) -> napi_status;
805    pub fn napi_throw_range_error(
806        env: napi_env,
807        code: *const ::core::ffi::c_char,
808        msg: *const ::core::ffi::c_char,
809    ) -> napi_status;
810    pub fn napi_is_error(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
811    pub fn napi_is_exception_pending(env: napi_env, result: *mut bool) -> napi_status;
812    pub fn napi_get_and_clear_last_exception(env: napi_env, result: *mut napi_value)
813        -> napi_status;
814    pub fn napi_is_arraybuffer(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
815    pub fn napi_create_arraybuffer(
816        env: napi_env,
817        byte_length: usize,
818        data: *mut *mut ::core::ffi::c_void,
819        result: *mut napi_value,
820    ) -> napi_status;
821    pub fn napi_create_external_arraybuffer(
822        env: napi_env,
823        external_data: *mut ::core::ffi::c_void,
824        byte_length: usize,
825        finalize_cb: napi_finalize,
826        finalize_hint: *mut ::core::ffi::c_void,
827        result: *mut napi_value,
828    ) -> napi_status;
829    pub fn napi_get_arraybuffer_info(
830        env: napi_env,
831        arraybuffer: napi_value,
832        data: *mut *mut ::core::ffi::c_void,
833        byte_length: *mut usize,
834    ) -> napi_status;
835    pub fn napi_is_typedarray(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
836    pub fn napi_create_typedarray(
837        env: napi_env,
838        type_: napi_typedarray_type,
839        length: usize,
840        arraybuffer: napi_value,
841        byte_offset: usize,
842        result: *mut napi_value,
843    ) -> napi_status;
844    pub fn napi_get_typedarray_info(
845        env: napi_env,
846        typedarray: napi_value,
847        type_: *mut napi_typedarray_type,
848        length: *mut usize,
849        data: *mut *mut ::core::ffi::c_void,
850        arraybuffer: *mut napi_value,
851        byte_offset: *mut usize,
852    ) -> napi_status;
853    pub fn napi_create_dataview(
854        env: napi_env,
855        length: usize,
856        arraybuffer: napi_value,
857        byte_offset: usize,
858        result: *mut napi_value,
859    ) -> napi_status;
860    pub fn napi_is_dataview(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
861    pub fn napi_get_dataview_info(
862        env: napi_env,
863        dataview: napi_value,
864        bytelength: *mut usize,
865        data: *mut *mut ::core::ffi::c_void,
866        arraybuffer: *mut napi_value,
867        byte_offset: *mut usize,
868    ) -> napi_status;
869    pub fn napi_get_version(env: napi_env, result: *mut u32) -> napi_status;
870    pub fn napi_create_promise(
871        env: napi_env,
872        deferred: *mut napi_deferred,
873        promise: *mut napi_value,
874    ) -> napi_status;
875    pub fn napi_resolve_deferred(
876        env: napi_env,
877        deferred: napi_deferred,
878        resolution: napi_value,
879    ) -> napi_status;
880    pub fn napi_reject_deferred(
881        env: napi_env,
882        deferred: napi_deferred,
883        rejection: napi_value,
884    ) -> napi_status;
885    pub fn napi_is_promise(env: napi_env, value: napi_value, is_promise: *mut bool) -> napi_status;
886    pub fn napi_run_script(
887        env: napi_env,
888        script: napi_value,
889        result: *mut napi_value,
890    ) -> napi_status;
891    pub fn napi_adjust_external_memory(
892        env: napi_env,
893        change_in_bytes: i64,
894        adjusted_value: *mut i64,
895    ) -> napi_status;
896    pub fn napi_create_date(env: napi_env, time: f64, result: *mut napi_value) -> napi_status;
897    pub fn napi_is_date(env: napi_env, value: napi_value, is_date: *mut bool) -> napi_status;
898    pub fn napi_get_date_value(env: napi_env, value: napi_value, result: *mut f64) -> napi_status;
899    /// Adds a 'napi_finalize' callback, which will be called when the ArkTS object is garbage-collected.
900    ///
901    /// # Arguments
902    ///
903    /// * `env` - Current running virtual machine context.
904    ///
905    /// * `js_object` - The ArkTS object value.
906    ///
907    /// * `native_object` - Native object to bind with the ArkTS object.
908    ///
909    /// * `finalize_cb` - Native callback that can be used to free the native object when the ArkTS object is
910    /// garbage-collected.
911    ///
912    /// * `finalize_hint` - Optional contextual hint that is passed to the finalize callback.
913    ///
914    /// * `result` - Optional reference of the ArkTS object.
915    ///
916    ///
917    /// # Returns
918    ///
919    /// * Return the function execution status.
920    ///
921    /// Available since API-level: 11
922    #[cfg(feature = "api-11")]
923    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
924    pub fn napi_add_finalizer(
925        env: napi_env,
926        js_object: napi_value,
927        native_object: *mut ::core::ffi::c_void,
928        finalize_cb: napi_finalize,
929        finalize_hint: *mut ::core::ffi::c_void,
930        result: *mut napi_ref,
931    ) -> napi_status;
932    pub fn napi_create_bigint_int64(
933        env: napi_env,
934        value: i64,
935        result: *mut napi_value,
936    ) -> napi_status;
937    pub fn napi_create_bigint_uint64(
938        env: napi_env,
939        value: u64,
940        result: *mut napi_value,
941    ) -> napi_status;
942    pub fn napi_create_bigint_words(
943        env: napi_env,
944        sign_bit: ::core::ffi::c_int,
945        word_count: usize,
946        words: *const u64,
947        result: *mut napi_value,
948    ) -> napi_status;
949    pub fn napi_get_value_bigint_int64(
950        env: napi_env,
951        value: napi_value,
952        result: *mut i64,
953        lossless: *mut bool,
954    ) -> napi_status;
955    pub fn napi_get_value_bigint_uint64(
956        env: napi_env,
957        value: napi_value,
958        result: *mut u64,
959        lossless: *mut bool,
960    ) -> napi_status;
961    pub fn napi_get_value_bigint_words(
962        env: napi_env,
963        value: napi_value,
964        sign_bit: *mut ::core::ffi::c_int,
965        word_count: *mut usize,
966        words: *mut u64,
967    ) -> napi_status;
968    pub fn napi_get_all_property_names(
969        env: napi_env,
970        object: napi_value,
971        key_mode: napi_key_collection_mode,
972        key_filter: napi_key_filter,
973        key_conversion: napi_key_conversion,
974        result: *mut napi_value,
975    ) -> napi_status;
976    /// Associates data with the currently running environment.
977    ///
978    /// # Arguments
979    ///
980    /// * `env` - Current running virtual machine context.
981    ///
982    /// * `data` - Data item to bind with the 'env'.
983    ///
984    /// * `finalize_cb` - Optional native callback that will be triggered when 'env' is destroyed or this interface
985    /// repeatedly calls.
986    ///
987    /// * `finalize_hint` - Optional contextual hint that is passed to the finalize callback.
988    ///
989    ///
990    /// # Returns
991    ///
992    /// * Returns the function execution status.
993    ///
994    /// Available since API-level: 11
995    #[cfg(feature = "api-11")]
996    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
997    pub fn napi_set_instance_data(
998        env: napi_env,
999        data: *mut ::core::ffi::c_void,
1000        finalize_cb: napi_finalize,
1001        finalize_hint: *mut ::core::ffi::c_void,
1002    ) -> napi_status;
1003    /// Retrieves the data that was previously associated with the currently running environment.
1004    ///
1005    /// # Arguments
1006    ///
1007    /// * `env` - Current running virtual machine context.
1008    ///
1009    /// * `data` - Data item is bound with the 'env'.
1010    ///
1011    ///
1012    /// # Returns
1013    ///
1014    /// * Returns the function execution status.
1015    ///
1016    /// Available since API-level: 11
1017    #[cfg(feature = "api-11")]
1018    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1019    pub fn napi_get_instance_data(
1020        env: napi_env,
1021        data: *mut *mut ::core::ffi::c_void,
1022    ) -> napi_status;
1023    pub fn napi_detach_arraybuffer(env: napi_env, arraybuffer: napi_value) -> napi_status;
1024    pub fn napi_is_detached_arraybuffer(
1025        env: napi_env,
1026        value: napi_value,
1027        result: *mut bool,
1028    ) -> napi_status;
1029    pub fn napi_type_tag_object(
1030        env: napi_env,
1031        value: napi_value,
1032        type_tag: *const napi_type_tag,
1033    ) -> napi_status;
1034    pub fn napi_check_object_type_tag(
1035        env: napi_env,
1036        value: napi_value,
1037        type_tag: *const napi_type_tag,
1038        result: *mut bool,
1039    ) -> napi_status;
1040    pub fn napi_object_freeze(env: napi_env, object: napi_value) -> napi_status;
1041    pub fn napi_object_seal(env: napi_env, object: napi_value) -> napi_status;
1042    pub fn napi_module_register(mod_: *mut napi_module);
1043    pub fn napi_fatal_error(
1044        location: *const ::core::ffi::c_char,
1045        location_len: usize,
1046        message: *const ::core::ffi::c_char,
1047        message_len: usize,
1048    ) -> !;
1049    /// Creates an asynchronous context. The capabilities related to 'async_hook' are not supported currently.
1050    ///
1051    /// # Arguments
1052    ///
1053    /// * `env` - Current running virtual machine context.
1054    ///
1055    /// * `async_resource` - Object associated with the async work that will be passed to possible 'async_hook'.
1056    ///
1057    /// * `async_resource_name` - Identifier for the kind of resource that is being provided for diagnostic information
1058    /// exposed by the async_hooks API.
1059    ///
1060    /// * `result` - The initialized async context.
1061    ///
1062    ///
1063    /// # Returns
1064    ///
1065    /// * Returns the function execution status.
1066    ///
1067    /// Available since API-level: 11
1068    #[cfg(feature = "api-11")]
1069    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1070    pub fn napi_async_init(
1071        env: napi_env,
1072        async_resource: napi_value,
1073        async_resource_name: napi_value,
1074        result: *mut napi_async_context,
1075    ) -> napi_status;
1076    /// Destroys the previously created asynchronous context. The capabilities related to 'async_hook' are not
1077    /// supported currently.
1078    ///
1079    /// # Arguments
1080    ///
1081    /// * `env` - Current running virtual machine context.
1082    ///
1083    /// * `async_context` - The async context to be destroyed.
1084    ///
1085    ///
1086    /// # Returns
1087    ///
1088    /// * Returns the function execution status.
1089    ///
1090    /// Available since API-level: 11
1091    #[cfg(feature = "api-11")]
1092    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1093    pub fn napi_async_destroy(env: napi_env, async_context: napi_async_context) -> napi_status;
1094    /// Allows a JS function to be called in the asynchronous context. The capabilities related to **async_hook** are
1095    /// not supported currently.
1096    /// # Arguments
1097    ///
1098    /// * `env` - Current running virtual machine context.
1099    ///
1100    /// * `async_context` - The context environment for the async operation.
1101    ///
1102    /// * `recv` - The 'this' pointer of the function.
1103    ///
1104    /// * `func` - ArkTS function to be called.
1105    ///
1106    /// * `argc` - Size of the argument array which is passed to 'func'.
1107    ///
1108    /// * `argv` - Argument array.
1109    ///
1110    /// * `result` - Result returned by the ArkTS function.
1111    ///
1112    ///
1113    /// # Returns
1114    ///
1115    /// * Returns the function execution status.
1116    ///
1117    /// Available since API-level: 11
1118    #[cfg(feature = "api-11")]
1119    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1120    pub fn napi_make_callback(
1121        env: napi_env,
1122        async_context: napi_async_context,
1123        recv: napi_value,
1124        func: napi_value,
1125        argc: usize,
1126        argv: *const napi_value,
1127        result: *mut napi_value,
1128    ) -> napi_status;
1129    /// Creates a ArkTS buffer of the specified size.
1130    /// # Arguments
1131    ///
1132    /// * `env` - Current running virtual machine context.
1133    ///
1134    /// * `length` - The size of the buffer to be created.
1135    ///
1136    /// * `data` - Raw pointer of the ArkTS buffer.
1137    ///
1138    /// * `result` - Result returned by the ArkTS function.
1139    ///
1140    ///
1141    /// # Returns
1142    ///
1143    /// * Returns the function execution status.
1144    ///
1145    /// Available since API-level: 10
1146    pub fn napi_create_buffer(
1147        env: napi_env,
1148        length: usize,
1149        data: *mut *mut ::core::ffi::c_void,
1150        result: *mut napi_value,
1151    ) -> napi_status;
1152    pub fn napi_create_external_buffer(
1153        env: napi_env,
1154        length: usize,
1155        data: *mut ::core::ffi::c_void,
1156        finalize_cb: napi_finalize,
1157        finalize_hint: *mut ::core::ffi::c_void,
1158        result: *mut napi_value,
1159    ) -> napi_status;
1160    pub fn napi_create_buffer_copy(
1161        env: napi_env,
1162        length: usize,
1163        data: *const ::core::ffi::c_void,
1164        result_data: *mut *mut ::core::ffi::c_void,
1165        result: *mut napi_value,
1166    ) -> napi_status;
1167    pub fn napi_is_buffer(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
1168    pub fn napi_get_buffer_info(
1169        env: napi_env,
1170        value: napi_value,
1171        data: *mut *mut ::core::ffi::c_void,
1172        length: *mut usize,
1173    ) -> napi_status;
1174    pub fn napi_create_async_work(
1175        env: napi_env,
1176        async_resource: napi_value,
1177        async_resource_name: napi_value,
1178        execute: napi_async_execute_callback,
1179        complete: napi_async_complete_callback,
1180        data: *mut ::core::ffi::c_void,
1181        result: *mut napi_async_work,
1182    ) -> napi_status;
1183    pub fn napi_delete_async_work(env: napi_env, work: napi_async_work) -> napi_status;
1184    pub fn napi_queue_async_work(env: napi_env, work: napi_async_work) -> napi_status;
1185    pub fn napi_cancel_async_work(env: napi_env, work: napi_async_work) -> napi_status;
1186    pub fn napi_get_node_version(
1187        env: napi_env,
1188        version: *mut *const napi_node_version,
1189    ) -> napi_status;
1190    pub fn napi_get_uv_event_loop(env: napi_env, loop_: *mut *mut uv_loop_s) -> napi_status;
1191    /// Throws UncaughtException to ArkTS.
1192    /// # Arguments
1193    ///
1194    /// * `env` - Current running virtual machine context.
1195    ///
1196    /// * `err` - Error object which is passed to 'UncaughtException'.
1197    ///
1198    ///
1199    /// # Returns
1200    ///
1201    /// * Returns the function execution status.
1202    ///
1203    /// Available since API-level: 12
1204    #[cfg(feature = "api-12")]
1205    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1206    pub fn napi_fatal_exception(env: napi_env, err: napi_value) -> napi_status;
1207    /// Registers a clean-up hook for releasing resources when the environment exits.
1208    ///
1209    /// # Arguments
1210    ///
1211    /// * `env` - Current running virtual machine context.
1212    ///
1213    /// * `fun` - Function pointer which will be triggered when environment is destroy.
1214    ///
1215    /// * `arg` - The argument is passed to the function pointer 'fun'.
1216    ///
1217    ///
1218    /// # Returns
1219    ///
1220    /// * Returns the function execution status.
1221    ///
1222    /// Available since API-level: 11
1223    #[cfg(feature = "api-11")]
1224    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1225    pub fn napi_add_env_cleanup_hook(
1226        env: napi_env,
1227        fun: ::core::option::Option<unsafe extern "C" fn(arg: *mut ::core::ffi::c_void)>,
1228        arg: *mut ::core::ffi::c_void,
1229    ) -> napi_status;
1230    /// Unregisters the clean-up hook.
1231    ///
1232    /// # Arguments
1233    ///
1234    /// * `env` - Current running virtual machine context.
1235    ///
1236    /// * `fun` - Function pointer which will be triggered when environment is destroy.
1237    ///
1238    /// * `arg` - The argument is passed to the function pointer 'fun'.
1239    ///
1240    ///
1241    /// # Returns
1242    ///
1243    /// * Returns the function execution status.
1244    ///
1245    /// Available since API-level: 11
1246    #[cfg(feature = "api-11")]
1247    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1248    pub fn napi_remove_env_cleanup_hook(
1249        env: napi_env,
1250        fun: ::core::option::Option<unsafe extern "C" fn(arg: *mut ::core::ffi::c_void)>,
1251        arg: *mut ::core::ffi::c_void,
1252    ) -> napi_status;
1253    /// Opens a callback scope. The capabilities related to 'async_hook' are not supported currently.
1254    /// # Arguments
1255    ///
1256    /// * `env` - Current running virtual machine context.
1257    ///
1258    /// * `resource_object` - The resource object to be passed to possible 'async_hook'.
1259    ///
1260    /// * `context` - The context environment for the async operation.
1261    ///
1262    /// * `result` - The generated callback scope.
1263    ///
1264    ///
1265    /// # Returns
1266    ///
1267    /// * Returns the function execution status.
1268    ///
1269    /// Available since API-level: 11
1270    #[cfg(feature = "api-11")]
1271    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1272    pub fn napi_open_callback_scope(
1273        env: napi_env,
1274        resource_object: napi_value,
1275        context: napi_async_context,
1276        result: *mut napi_callback_scope,
1277    ) -> napi_status;
1278    /// Closes the callback scope. The capabilities related to 'async_hook' are not supported currently.
1279    ///
1280    /// # Arguments
1281    ///
1282    /// * `env` - Current running virtual machine context.
1283    ///
1284    /// * `scope` - The callback scope to be closed.
1285    ///
1286    ///
1287    /// # Returns
1288    ///
1289    /// * Returns the function execution status.
1290    ///
1291    /// Available since API-level: 11
1292    #[cfg(feature = "api-11")]
1293    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1294    pub fn napi_close_callback_scope(env: napi_env, scope: napi_callback_scope) -> napi_status;
1295    pub fn napi_create_threadsafe_function(
1296        env: napi_env,
1297        func: napi_value,
1298        async_resource: napi_value,
1299        async_resource_name: napi_value,
1300        max_queue_size: usize,
1301        initial_thread_count: usize,
1302        thread_finalize_data: *mut ::core::ffi::c_void,
1303        thread_finalize_cb: napi_finalize,
1304        context: *mut ::core::ffi::c_void,
1305        call_js_cb: napi_threadsafe_function_call_js,
1306        result: *mut napi_threadsafe_function,
1307    ) -> napi_status;
1308    pub fn napi_get_threadsafe_function_context(
1309        func: napi_threadsafe_function,
1310        result: *mut *mut ::core::ffi::c_void,
1311    ) -> napi_status;
1312    pub fn napi_call_threadsafe_function(
1313        func: napi_threadsafe_function,
1314        data: *mut ::core::ffi::c_void,
1315        is_blocking: napi_threadsafe_function_call_mode,
1316    ) -> napi_status;
1317    pub fn napi_acquire_threadsafe_function(func: napi_threadsafe_function) -> napi_status;
1318    pub fn napi_release_threadsafe_function(
1319        func: napi_threadsafe_function,
1320        mode: napi_threadsafe_function_release_mode,
1321    ) -> napi_status;
1322    pub fn napi_unref_threadsafe_function(
1323        env: napi_env,
1324        func: napi_threadsafe_function,
1325    ) -> napi_status;
1326    pub fn napi_ref_threadsafe_function(
1327        env: napi_env,
1328        func: napi_threadsafe_function,
1329    ) -> napi_status;
1330    /// Registers an asynchronous clean-up hook for releasing resources when the environment exits.
1331    ///
1332    /// # Arguments
1333    ///
1334    /// * `env` - Current running virtual machine context.
1335    ///
1336    /// * `hook` - The function pointer to call at environment teardown.
1337    ///
1338    /// * `arg` - The pointer to pass to `hook` when it gets called.
1339    ///
1340    /// * `remove_handle` - Optional handle that refers to the asynchronous cleanup.
1341    ///
1342    ///
1343    /// # Returns
1344    ///
1345    /// * Returns the function execution status.
1346    ///
1347    /// Available since API-level: 11
1348    #[cfg(feature = "api-11")]
1349    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1350    pub fn napi_add_async_cleanup_hook(
1351        env: napi_env,
1352        hook: napi_async_cleanup_hook,
1353        arg: *mut ::core::ffi::c_void,
1354        remove_handle: *mut napi_async_cleanup_hook_handle,
1355    ) -> napi_status;
1356    /// Unregisters the asynchronous clean-up hook.
1357    ///
1358    /// # Arguments
1359    ///
1360    /// * `remove_handle` - Optional handle that refers to the asynchronous cleanup.
1361    ///
1362    ///
1363    /// # Returns
1364    ///
1365    /// * Returns the function execution status.
1366    ///
1367    /// Available since API-level: 11
1368    #[cfg(feature = "api-11")]
1369    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1370    pub fn napi_remove_async_cleanup_hook(
1371        remove_handle: napi_async_cleanup_hook_handle,
1372    ) -> napi_status;
1373    /// Obtains the absolute path of the location, from which the addon is loaded.
1374    ///
1375    /// # Arguments
1376    ///
1377    /// * `env` - Current running virtual machine context.
1378    ///
1379    /// * `result` - The absolute path of the location of the loaded addon.
1380    ///
1381    ///
1382    /// # Returns
1383    ///
1384    /// * Returns the function execution status.
1385    ///
1386    /// Available since API-level: 11
1387    #[cfg(feature = "api-11")]
1388    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1389    pub fn node_api_get_module_file_name(
1390        env: napi_env,
1391        result: *mut *const ::core::ffi::c_char,
1392    ) -> napi_status;
1393    pub fn napi_run_script_path(
1394        env: napi_env,
1395        path: *const ::core::ffi::c_char,
1396        result: *mut napi_value,
1397    ) -> napi_status;
1398    pub fn napi_queue_async_work_with_qos(
1399        env: napi_env,
1400        work: napi_async_work,
1401        qos: napi_qos_t,
1402    ) -> napi_status;
1403    /// Loads an .abc file as a module. This API returns the namespace of the module.
1404    /// # Arguments
1405    ///
1406    /// * `env` - Current running virtual machine context.
1407    ///
1408    /// * `path` - Path of the .abc file or name of the module to load.
1409    ///
1410    /// * `result` - Result of the module object.
1411    ///
1412    ///
1413    /// # Returns
1414    ///
1415    /// * Returns the function execution status.
1416    ///
1417    /// Available since API-level: 11
1418    #[cfg(feature = "api-11")]
1419    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1420    pub fn napi_load_module(
1421        env: napi_env,
1422        path: *const ::core::ffi::c_char,
1423        result: *mut napi_value,
1424    ) -> napi_status;
1425    /// Create JSObject with initial properties given by descriptors, note that property key must be String, and
1426    /// must can not convert to element_index, also all keys must not duplicate.
1427    ///
1428    /// # Arguments
1429    ///
1430    /// * `env` - Current running virtual machine context.
1431    ///
1432    /// * `result` - The created ArkTS object.
1433    ///
1434    /// * `property_count` - Number of the property descriptors.
1435    ///
1436    /// * `properties` - Array of property descriptors which are expected to be applied to the ArkTS object.
1437    ///
1438    ///
1439    /// # Returns
1440    ///
1441    /// * Returns the function execution status.
1442    ///
1443    /// Available since API-level: 11
1444    #[cfg(feature = "api-11")]
1445    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1446    pub fn napi_create_object_with_properties(
1447        env: napi_env,
1448        result: *mut napi_value,
1449        property_count: usize,
1450        properties: *const napi_property_descriptor,
1451    ) -> napi_status;
1452    /// Create JSObject with initial properties given by keys and values, note that property key must be String, and
1453    /// must can not convert to element_index, also all keys must not duplicate.
1454    ///
1455    /// # Arguments
1456    ///
1457    /// * `env` - Current running virtual machine context.
1458    ///
1459    /// * `result` - The absolute path of the location of the loaded addon.
1460    ///
1461    /// * `property_count` - Number of the propertied which needs to be applied on the ArkTS object.
1462    ///
1463    /// * `keys` - Array of the keys of the properties.
1464    ///
1465    /// * `values` - Array of the values of the properties.
1466    ///
1467    ///
1468    /// # Returns
1469    ///
1470    /// * Returns the function execution status.
1471    ///
1472    /// Available since API-level: 11
1473    #[cfg(feature = "api-11")]
1474    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1475    pub fn napi_create_object_with_named_properties(
1476        env: napi_env,
1477        result: *mut napi_value,
1478        property_count: usize,
1479        keys: *mut *const ::core::ffi::c_char,
1480        values: *const napi_value,
1481    ) -> napi_status;
1482    /// This API sets native properties to a object and converts this js object to native binding object.
1483    ///
1484    /// # Arguments
1485    ///
1486    /// * `env` - Current running virtual machine context.
1487    ///
1488    /// * `js_object` - The JavaScript value to coerce.
1489    ///
1490    /// * `detach_cb` - Native callback that can be used to detach the js object and the native object.
1491    ///
1492    /// * `attach_cb` - Native callback that can be used to bind the js object and the native object.
1493    ///
1494    /// * `native_object` - User-provided native instance to pass to thr detach callback and attach callback.
1495    ///
1496    /// * `hint` - Optional hint to pass to the detach callback and attach callback.
1497    ///
1498    ///
1499    /// # Returns
1500    ///
1501    /// * Return the function execution status.
1502    ///
1503    /// Available since API-level: 11
1504    #[cfg(feature = "api-11")]
1505    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1506    pub fn napi_coerce_to_native_binding_object(
1507        env: napi_env,
1508        js_object: napi_value,
1509        detach_cb: napi_native_binding_detach_callback,
1510        attach_cb: napi_native_binding_attach_callback,
1511        native_object: *mut ::core::ffi::c_void,
1512        hint: *mut ::core::ffi::c_void,
1513    ) -> napi_status;
1514    /// The module is loaded through the NAPI. By default, the default object is exported from the module.
1515    ///
1516    /// # Arguments
1517    ///
1518    /// * `env` - Current running virtual machine context.
1519    ///
1520    /// * `path` - Path name of the module to be loaded, like
1521    /// * `module_info` - Path names of bundle and module, like com.example.application/entry.
1522    ///
1523    /// * `result` - Result of loading a module, which is an exported object of the module.
1524    ///
1525    ///
1526    /// # Returns
1527    ///
1528    /// * Returns the function execution status.
1529    ///
1530    /// Available since API-level: 12
1531    #[cfg(feature = "api-12")]
1532    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1533    pub fn napi_load_module_with_info(
1534        env: napi_env,
1535        path: *const ::core::ffi::c_char,
1536        module_info: *const ::core::ffi::c_char,
1537        result: *mut napi_value,
1538    ) -> napi_status;
1539    /// Create the ark runtime.
1540    ///
1541    /// # Arguments
1542    ///
1543    /// * `env` - Indicates the ark runtime environment.
1544    ///
1545    ///
1546    /// # Returns
1547    ///
1548    /// * Return the function execution status.
1549    ///
1550    /// Available since API-level: 12
1551    #[cfg(feature = "api-12")]
1552    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1553    pub fn napi_create_ark_runtime(env: *mut napi_env) -> napi_status;
1554    /// Destroy the ark runtime.
1555    ///
1556    /// # Arguments
1557    ///
1558    /// * `env` - Indicates the ark runtime environment.
1559    ///
1560    ///
1561    /// # Returns
1562    ///
1563    /// * Return the function execution status.
1564    ///
1565    /// Available since API-level: 12
1566    #[cfg(feature = "api-12")]
1567    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1568    pub fn napi_destroy_ark_runtime(env: *mut napi_env) -> napi_status;
1569    /// Defines a sendable class.
1570    ///
1571    /// # Arguments
1572    ///
1573    /// * `env` - The environment that the API is invoked under.
1574    ///
1575    /// * `utf8name` - Name of the ArkTS constructor function.
1576    ///
1577    /// * `length` - The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated.
1578    ///
1579    /// * `constructor` - Callback function that handles constructing instances of the class.
1580    ///
1581    /// * `data` - Optional data to be passed to the constructor callback as the data property of the callback info.
1582    ///
1583    /// * `property_count` - Number of items in the properties array argument.
1584    ///
1585    /// * `properties` - Array of property descriptors describing static and instance data properties, accessors, and
1586    /// methods on the class. See napi_property_descriptor.
1587    ///
1588    /// * `parent` - A napi_value representing the Superclass.
1589    ///
1590    /// * `result` - A napi_value representing the constructor function for the class.
1591    ///
1592    ///
1593    /// # Returns
1594    ///
1595    /// * Return the function execution status.
1596    ///
1597    /// Available since API-level: 12
1598    #[cfg(feature = "api-12")]
1599    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1600    pub fn napi_define_sendable_class(
1601        env: napi_env,
1602        utf8name: *const ::core::ffi::c_char,
1603        length: usize,
1604        constructor: napi_callback,
1605        data: *mut ::core::ffi::c_void,
1606        property_count: usize,
1607        properties: *const napi_property_descriptor,
1608        parent: napi_value,
1609        result: *mut napi_value,
1610    ) -> napi_status;
1611    /// Queries a napi_value to check if it is sendable.
1612    ///
1613    /// # Arguments
1614    ///
1615    /// * `env` - The environment that the API is invoked under.
1616    ///
1617    /// * `value` - The napi_value to be checked.
1618    ///
1619    /// * `result` - Boolean value that is set to true if napi_value is sendable, false otherwise.
1620    ///
1621    ///
1622    /// # Returns
1623    ///
1624    /// * Return the function execution status.
1625    ///
1626    /// Available since API-level: 12
1627    #[cfg(feature = "api-12")]
1628    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1629    pub fn napi_is_sendable(env: napi_env, value: napi_value, result: *mut bool) -> napi_status;
1630    /// Defines a sendable object.
1631    ///
1632    /// # Arguments
1633    ///
1634    /// * `env` - The environment that the API is invoked under.
1635    ///
1636    /// * `property_count` - The count of object properties.
1637    ///
1638    /// * `properties` - Object properties.
1639    ///
1640    /// * `result` - The created sendable object.
1641    ///
1642    ///
1643    /// # Returns
1644    ///
1645    /// * Return the function execution status.
1646    ///
1647    /// Available since API-level: 12
1648    #[cfg(feature = "api-12")]
1649    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1650    pub fn napi_create_sendable_object_with_properties(
1651        env: napi_env,
1652        property_count: usize,
1653        properties: *const napi_property_descriptor,
1654        result: *mut napi_value,
1655    ) -> napi_status;
1656    /// Wraps a native instance in a ArkTS object.
1657    ///
1658    /// # Arguments
1659    ///
1660    /// * `env` - The environment that the API is invoked under.
1661    ///
1662    /// * `js_object` - The ArkTS object that will be the wrapper for the native object.
1663    ///
1664    /// * `native_object` - The native instance that will be wrapped in the ArkTS object.
1665    ///
1666    /// * `finalize_cb` - Optional native callback that can be used to free the native instance when the ArkTS object
1667    /// has been garbage-collected.
1668    ///
1669    /// * `finalize_hint` - Optional contextual hint that is passed to the finalize callback.
1670    ///
1671    ///
1672    /// # Returns
1673    ///
1674    /// * Return the function execution status.
1675    ///
1676    /// Available since API-level: 12
1677    #[cfg(feature = "api-12")]
1678    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1679    pub fn napi_wrap_sendable(
1680        env: napi_env,
1681        js_object: napi_value,
1682        native_object: *mut ::core::ffi::c_void,
1683        finalize_cb: napi_finalize,
1684        finalize_hint: *mut ::core::ffi::c_void,
1685    ) -> napi_status;
1686    /// Wraps a native instance in a ArkTS object.
1687    ///
1688    /// # Arguments
1689    ///
1690    /// * `env` - The environment that the API is invoked under.
1691    ///
1692    /// * `js_object` - The ArkTS object that will be the wrapper for the native object.
1693    ///
1694    /// * `native_object` - The native instance that will be wrapped in the ArkTS object.
1695    ///
1696    /// * `finalize_cb` - Optional native callback that can be used to free the native instance when the ArkTS object
1697    /// has been garbage-collected.
1698    ///
1699    /// * `finalize_hint` - Optional contextual hint that is passed to the finalize callback.
1700    ///
1701    /// * `native_binding_size` - The size of native binding.
1702    ///
1703    ///
1704    /// # Returns
1705    ///
1706    /// * Return the function execution status.
1707    ///
1708    /// Available since API-level: 12
1709    #[cfg(feature = "api-12")]
1710    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1711    pub fn napi_wrap_sendable_with_size(
1712        env: napi_env,
1713        js_object: napi_value,
1714        native_object: *mut ::core::ffi::c_void,
1715        finalize_cb: napi_finalize,
1716        finalize_hint: *mut ::core::ffi::c_void,
1717        native_binding_size: usize,
1718    ) -> napi_status;
1719    /// Retrieves a native instance that was previously wrapped in a ArkTS object.
1720    ///
1721    /// # Arguments
1722    ///
1723    /// * `env` - The environment that the API is invoked under.
1724    ///
1725    /// * `js_object` - The object associated with the native instance.
1726    ///
1727    /// * `result` - Pointer to the wrapped native instance.
1728    ///
1729    ///
1730    /// # Returns
1731    ///
1732    /// * Return the function execution status.
1733    ///
1734    /// Available since API-level: 12
1735    #[cfg(feature = "api-12")]
1736    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1737    pub fn napi_unwrap_sendable(
1738        env: napi_env,
1739        js_object: napi_value,
1740        result: *mut *mut ::core::ffi::c_void,
1741    ) -> napi_status;
1742    /// Retrieves a native instance that was previously wrapped in a ArkTS object and removes the wrapping.
1743    ///
1744    /// # Arguments
1745    ///
1746    /// * `env` - The environment that the API is invoked under.
1747    ///
1748    /// * `js_object` - The object associated with the native instance.
1749    ///
1750    /// * `result` - Pointer to the wrapped native instance.
1751    ///
1752    ///
1753    /// # Returns
1754    ///
1755    /// * Return the function execution status.
1756    ///
1757    /// Available since API-level: 12
1758    #[cfg(feature = "api-12")]
1759    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1760    pub fn napi_remove_wrap_sendable(
1761        env: napi_env,
1762        js_object: napi_value,
1763        result: *mut *mut ::core::ffi::c_void,
1764    ) -> napi_status;
1765    /// Create a sendable array.
1766    ///
1767    /// # Arguments
1768    ///
1769    /// * `env` - The environment that the API is invoked under.
1770    ///
1771    /// * `result` - A napi_value representing a sendable array.
1772    ///
1773    ///
1774    /// # Returns
1775    ///
1776    /// * Return the function execution status.
1777    ///
1778    /// Available since API-level: 12
1779    #[cfg(feature = "api-12")]
1780    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1781    pub fn napi_create_sendable_array(env: napi_env, result: *mut napi_value) -> napi_status;
1782    /// Create a sendable array with length.
1783    ///
1784    /// # Arguments
1785    ///
1786    /// * `env` - The environment that the API is invoked under.
1787    ///
1788    /// * `length` - The initial length of the sendable array.
1789    ///
1790    /// * `result` - A napi_value representing a sendable array.
1791    ///
1792    ///
1793    /// # Returns
1794    ///
1795    /// * Return the function execution status.
1796    ///
1797    /// Available since API-level: 12
1798    #[cfg(feature = "api-12")]
1799    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1800    pub fn napi_create_sendable_array_with_length(
1801        env: napi_env,
1802        length: usize,
1803        result: *mut napi_value,
1804    ) -> napi_status;
1805    /// Create a sendable arraybuffer.
1806    ///
1807    /// # Arguments
1808    ///
1809    /// * `env` - The environment that the API is invoked under.
1810    ///
1811    /// * `byte_length` - The length in bytes of the sendable arraybuffer to create.
1812    ///
1813    /// * `data` - Pointer to the underlying byte buffer of the sendable arraybuffer.
1814    ///
1815    /// * `result` - A napi_value representing a sendable arraybuffer.
1816    ///
1817    ///
1818    /// # Returns
1819    ///
1820    /// * Return the function execution status.
1821    ///
1822    /// Available since API-level: 12
1823    #[cfg(feature = "api-12")]
1824    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1825    pub fn napi_create_sendable_arraybuffer(
1826        env: napi_env,
1827        byte_length: usize,
1828        data: *mut *mut ::core::ffi::c_void,
1829        result: *mut napi_value,
1830    ) -> napi_status;
1831    /// Create a sendable typedarray.
1832    ///
1833    /// # Arguments
1834    ///
1835    /// * `env` - The environment that the API is invoked under.
1836    ///
1837    /// * `type` - Scalar datatype of the elements within the sendable typedarray.
1838    ///
1839    /// * `length` - Number of elements in the typedarray.
1840    ///
1841    /// * `arraybuffer` - Sendable arraybuffer underlying the sendable typedarray.
1842    ///
1843    /// * `byte_offset` - The byte offset within the sendable arraybuffer from which to start projecting the
1844    /// sendable typedarray.
1845    ///
1846    /// * `result` - A napi_value representing a sendable typedarray.
1847    ///
1848    ///
1849    /// # Returns
1850    ///
1851    /// * Return the function execution status.
1852    ///
1853    /// Available since API-level: 12
1854    #[cfg(feature = "api-12")]
1855    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1856    pub fn napi_create_sendable_typedarray(
1857        env: napi_env,
1858        type_: napi_typedarray_type,
1859        length: usize,
1860        arraybuffer: napi_value,
1861        byte_offset: usize,
1862        result: *mut napi_value,
1863    ) -> napi_status;
1864    /// Run the event loop by the given env and running mode in current thread.
1865    ///
1866    /// Support to run the native event loop in an asynchronous native thread with the specified running mode.
1867    ///
1868    /// # Arguments
1869    ///
1870    /// * `env` - Current running virtual machine context.
1871    ///
1872    /// * `mode` - Indicates the running mode of the native event loop.
1873    ///
1874    ///
1875    /// # Returns
1876    ///
1877    /// * Return the function execution status.
1878    ///
1879    /// Available since API-level: 12
1880    #[cfg(feature = "api-12")]
1881    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1882    pub fn napi_run_event_loop(env: napi_env, mode: napi_event_mode) -> napi_status;
1883    /// Stop the event loop in current thread.
1884    ///
1885    /// Support to stop the running event loop in current native thread.
1886    ///
1887    /// # Arguments
1888    ///
1889    /// * `env` - Current running virtual machine context.
1890    ///
1891    ///
1892    /// # Returns
1893    ///
1894    /// * Return the function execution status.
1895    ///
1896    /// Available since API-level: 12
1897    #[cfg(feature = "api-12")]
1898    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1899    pub fn napi_stop_event_loop(env: napi_env) -> napi_status;
1900    /// Serialize a JS object.
1901    ///
1902    /// # Arguments
1903    ///
1904    /// * `env` - Current running virtual machine context.
1905    ///
1906    /// * `object` - The JavaScript value to serialize.
1907    ///
1908    /// * `transfer_list` - List of data to transfer in transfer mode.
1909    ///
1910    /// * `clone_list` - List of Sendable data to transfer in clone mode.
1911    ///
1912    /// * `result` - Serialization result of the JS object.
1913    ///
1914    ///
1915    /// # Returns
1916    ///
1917    /// * Returns the function execution status.
1918    ///
1919    /// Available since API-level: 12
1920    #[cfg(feature = "api-12")]
1921    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1922    pub fn napi_serialize(
1923        env: napi_env,
1924        object: napi_value,
1925        transfer_list: napi_value,
1926        clone_list: napi_value,
1927        result: *mut *mut ::core::ffi::c_void,
1928    ) -> napi_status;
1929    /// Restore serialization data to a ArkTS object.
1930    ///
1931    /// # Arguments
1932    ///
1933    /// * `env` - Current running virtual machine context.
1934    ///
1935    /// * `buffer` - Data to deserialize.
1936    ///
1937    /// * `object` - ArkTS object obtained by deserialization.
1938    ///
1939    ///
1940    /// # Returns
1941    ///
1942    /// * Returns the function execution status.
1943    ///
1944    /// Available since API-level: 12
1945    #[cfg(feature = "api-12")]
1946    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1947    pub fn napi_deserialize(
1948        env: napi_env,
1949        buffer: *mut ::core::ffi::c_void,
1950        object: *mut napi_value,
1951    ) -> napi_status;
1952    /// Delete serialization data.
1953    ///
1954    /// # Arguments
1955    ///
1956    /// * `env` - Current running virtual machine context.
1957    ///
1958    /// * `buffer` - Data to delete.
1959    ///
1960    ///
1961    /// # Returns
1962    ///
1963    /// * Returns the function execution status.
1964    ///
1965    /// Available since API-level: 12
1966    #[cfg(feature = "api-12")]
1967    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1968    pub fn napi_delete_serialization_data(
1969        env: napi_env,
1970        buffer: *mut ::core::ffi::c_void,
1971    ) -> napi_status;
1972    /// Dispatch a task with specified priority from a native thread to an ArkTS thread, the task will execute
1973    /// the given thread safe function.
1974    ///
1975    /// # Arguments
1976    ///
1977    /// * `func` - Indicates the thread safe function.
1978    ///
1979    /// * `data` - Indicates the data anticipated to be transferred to the ArkTS thread.
1980    ///
1981    /// * `priority` - Indicates the priority of the task dispatched.
1982    ///
1983    /// * `isTail` - Indicates the way of the task dispatched into the native event queue. When "isTail" is true,
1984    /// the task will be dispatched to the tail of the native event queue. Conversely, when "isTail" is false, the
1985    /// tasks will be dispatched to the head of the native event queue.
1986    ///
1987    ///
1988    /// # Returns
1989    ///
1990    /// * Return the function execution status.
1991    ///
1992    /// Available since API-level: 12
1993    #[cfg(feature = "api-12")]
1994    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1995    pub fn napi_call_threadsafe_function_with_priority(
1996        func: napi_threadsafe_function,
1997        data: *mut ::core::ffi::c_void,
1998        priority: napi_task_priority,
1999        isTail: bool,
2000    ) -> napi_status;
2001}