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