arkui_sys/native_node_napi/
native_node_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)]
6use crate::drawable_descriptor::ArkUI_DrawableDescriptor;
7use crate::native_type::*;
8use ohos_sys_opaque_types::{napi_env, napi_value};
9
10extern "C" {
11    /// Obtains a <b>FrameNode</b> object on the ArkTS side and maps it to an <b>ArkUI_NodeHandle</b> object on the
12    /// native side.
13    ///
14    /// # Arguments
15    ///
16    /// * `env` - Indicates the NAPI environment pointer.
17    ///
18    /// * `frameNode` - Indicates the <b>FrameNode</b> object created on the ArkTS side.
19    ///
20    /// * `handle` - Indicates the pointer to the <b>ArkUI_NodeHandle</b> object.
21    ///
22    /// # Returns
23    ///
24    /// * Returns the error code.
25    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
26    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
27    ///
28    /// Available since API-level: 12
29    #[cfg(feature = "api-12")]
30    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
31    pub fn OH_ArkUI_GetNodeHandleFromNapiValue(
32        env: napi_env,
33        frameNode: napi_value,
34        handle: *mut ArkUI_NodeHandle,
35    ) -> i32;
36    /// Obtains a <b>UIContext</b> object on the ArkTS side and maps it to an <b>ArkUI_ContextHandle</b> object on the
37    /// native side.
38    ///
39    /// # Arguments
40    ///
41    /// * `env` - ndicates the NAPI environment pointer.
42    ///
43    /// * `value` - Indicates the <b>UIContext</b> object created on the ArkTS side.
44    ///
45    /// * `context` - Indicates the pointer to the <b>ArkUI_ContextHandle</b> object.
46    ///
47    /// # Returns
48    ///
49    /// * Returns the error code.
50    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
51    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
52    ///
53    /// Available since API-level: 12
54    #[cfg(feature = "api-12")]
55    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
56    pub fn OH_ArkUI_GetContextFromNapiValue(
57        env: napi_env,
58        value: napi_value,
59        context: *mut ArkUI_ContextHandle,
60    ) -> i32;
61    /// Obtains a <b>NodeContent</b> object on the ArkTS side and maps it to an <b>ArkUI_NodeContentHandle</b>
62    /// object on the native side.
63    ///
64    /// # Arguments
65    ///
66    /// * `env` - ndicates the NAPI environment pointer.
67    ///
68    /// * `value` - Indicates the <b>NodeContent</b> object created on the ArkTS side.
69    ///
70    /// * `content` - Indicates the pointer to the <b>ArkUI_NodeContentHandle</b> object.
71    ///
72    /// # Returns
73    ///
74    /// * Returns the error code.
75    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
76    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
77    ///
78    /// Available since API-level: 12
79    #[cfg(feature = "api-12")]
80    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
81    pub fn OH_ArkUI_GetNodeContentFromNapiValue(
82        env: napi_env,
83        value: napi_value,
84        content: *mut ArkUI_NodeContentHandle,
85    ) -> i32;
86    /// Obtains a <b>DrawableDescriptor</b> object on the ArkTS side and maps it to an
87    /// <b>ArkUI_DrawableDescriptro</b> object on the native side.
88    ///
89    /// # Arguments
90    ///
91    /// * `env` - Indicates the NAPI environment pointer.
92    ///
93    /// * `value` - Indicates the <b>DrawableDescriptor</b> object created on the ArkTS side.
94    ///
95    /// * `drawableDescriptor` - Indicates the pointer to the <b>ArkUI_DrawableDescriptro</b> object.
96    ///
97    /// # Returns
98    ///
99    /// * Returns the error code.
100    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
101    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
102    ///
103    /// Available since API-level: 12
104    #[cfg(feature = "api-12")]
105    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
106    pub fn OH_ArkUI_GetDrawableDescriptorFromNapiValue(
107        env: napi_env,
108        value: napi_value,
109        drawableDescriptor: *mut *mut ArkUI_DrawableDescriptor,
110    ) -> i32;
111    /// Obtains a <b>Resource</b> object on the ArkTS side and maps it to an
112    /// <b>ArkUI_DrawableDescriptro</b> object on the native side.
113    ///
114    /// # Arguments
115    ///
116    /// * `env` - Indicates the NAPI environment pointer.
117    ///
118    /// * `value` - Indicates the <b>Resource</b> object created on the ArkTS side.
119    ///
120    /// * `drawableDescriptor` - Indicates the pointer to the <b>ArkUI_DrawableDescriptro</b> object.
121    ///
122    /// # Returns
123    ///
124    /// * Returns the error code.
125    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
126    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
127    ///
128    /// Available since API-level: 12
129    #[cfg(feature = "api-12")]
130    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
131    pub fn OH_ArkUI_GetDrawableDescriptorFromResourceNapiValue(
132        env: napi_env,
133        value: napi_value,
134        drawableDescriptor: *mut *mut ArkUI_DrawableDescriptor,
135    ) -> i32;
136    /// Obtain the ID of the Navigation component where the node is located.
137    ///
138    /// # Arguments
139    ///
140    /// * `node` - The node.
141    ///
142    /// * `buffer` - The buffer to which NavigationID writes to the memory,
143    /// memory space needs to be allocated by the developer.
144    ///
145    /// * `bufferSize` - The buffer size
146    ///
147    /// * `writeLength` - Indicates the string length actually written to the buffer
148    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
149    /// Indicates the minimum buffer size that can accommodate the target
150    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
151    ///
152    /// # Returns
153    ///
154    /// * The error code.
155    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
156    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
157    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
158    /// this may be because the node is not in Navigation.
159    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
160    ///
161    /// Available since API-level: 12
162    #[cfg(feature = "api-12")]
163    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
164    pub fn OH_ArkUI_GetNavigationId(
165        node: ArkUI_NodeHandle,
166        buffer: *mut ::core::ffi::c_char,
167        bufferSize: i32,
168        writeLength: *mut i32,
169    ) -> ArkUiResult;
170    /// Obtain the name of the NavDestination component where the node is located.
171    ///
172    /// # Arguments
173    ///
174    /// * `node` - The node.
175    ///
176    /// * `buffer` - The buffer to which NavDestination name writes to the memory,
177    /// memory space needs to be allocated by the developer.
178    ///
179    /// * `bufferSize` - The buffer size
180    ///
181    /// * `writeLength` - Indicates the string length actually written to the buffer
182    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
183    /// Indicates the minimum buffer size that can accommodate the target
184    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
185    ///
186    /// # Returns
187    ///
188    /// * The error code.
189    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
190    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
191    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
192    /// this may be because the node is not in Navigation.
193    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
194    ///
195    /// Available since API-level: 12
196    #[cfg(feature = "api-12")]
197    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
198    pub fn OH_ArkUI_GetNavDestinationName(
199        node: ArkUI_NodeHandle,
200        buffer: *mut ::core::ffi::c_char,
201        bufferSize: i32,
202        writeLength: *mut i32,
203    ) -> ArkUiResult;
204    /// Based on the given index value, obtain the length of the Navigation stack where the node is located.
205    ///
206    /// # Arguments
207    ///
208    /// * `node` - The node.
209    ///
210    /// * `length` - The length of the stack. After the operation succeeds, the result is written back to this parameter.
211    ///
212    /// # Returns
213    ///
214    /// * The error code.
215    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
216    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or length is null.
217    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
218    /// this may be because the node is not in Navigation.
219    ///
220    /// Available since API-level: 12
221    #[cfg(feature = "api-12")]
222    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
223    pub fn OH_ArkUI_GetNavStackLength(node: ArkUI_NodeHandle, length: *mut i32) -> ArkUiResult;
224    /// Based on the given index value, obtain the page name of the corresponding position
225    /// in the navigation stack where the node is located.
226    /// Index values are counted from 0, with 0 being the bottom of the stack.
227    ///
228    /// # Arguments
229    ///
230    /// * `node` - The node.
231    ///
232    /// * `index` - The index of the NavDestination in the stack is queried.
233    ///
234    /// * `buffer` - The buffer to which NavDestination index writes to the memory,
235    /// memory space needs to be allocated by the developer.
236    ///
237    /// * `bufferSize` - The buffer size
238    ///
239    /// * `writeLength` - Indicates the string length actually written to the buffer
240    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
241    /// Indicates the minimum buffer size that can accommodate the target
242    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
243    ///
244    /// # Returns
245    ///
246    /// * The error code.
247    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
248    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
249    /// [`ARKUI_ERROR_CODE_NODE_INDEX_INVALID`] if index is an invalid value.
250    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
251    /// this may be because the node is not in Navigation.
252    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
253    ///
254    /// Available since API-level: 12
255    #[cfg(feature = "api-12")]
256    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
257    pub fn OH_ArkUI_GetNavDestinationNameByIndex(
258        node: ArkUI_NodeHandle,
259        index: i32,
260        buffer: *mut ::core::ffi::c_char,
261        bufferSize: i32,
262        writeLength: *mut i32,
263    ) -> ArkUiResult;
264    /// Obtain the ID of the NavDestination component where the node is located.
265    ///
266    /// # Arguments
267    ///
268    /// * `node` - The node.
269    ///
270    /// * `buffer` - The buffer to which NavDestination ID writes to the memory,
271    /// memory space needs to be allocated by the developer.
272    ///
273    /// * `bufferSize` - The buffer size
274    ///
275    /// * `writeLength` - Indicates the string length actually written to the buffer
276    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
277    /// Indicates the minimum buffer size that can accommodate the target
278    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
279    ///
280    /// # Returns
281    ///
282    /// * The error code.
283    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
284    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
285    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
286    /// this may be because the node is not in Navigation.
287    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
288    ///
289    /// Available since API-level: 12
290    #[cfg(feature = "api-12")]
291    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
292    pub fn OH_ArkUI_GetNavDestinationId(
293        node: ArkUI_NodeHandle,
294        buffer: *mut ::core::ffi::c_char,
295        bufferSize: i32,
296        writeLength: *mut i32,
297    ) -> ArkUiResult;
298    /// Obtain the state of the NavDestination component where the node is located.
299    ///
300    /// # Arguments
301    ///
302    /// * `node` - The node.
303    ///
304    /// * `state` - The state value of NavDestination is written back into this parameter.
305    ///
306    /// # Returns
307    ///
308    /// * The error code.
309    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
310    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or state is null.
311    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
312    /// this may be because the node is not in Navigation.
313    ///
314    /// Available since API-level: 12
315    #[cfg(feature = "api-12")]
316    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
317    pub fn OH_ArkUI_GetNavDestinationState(
318        node: ArkUI_NodeHandle,
319        state: *mut ArkUI_NavDestinationState,
320    ) -> ArkUiResult;
321    /// Obtain the index of the NavDestination component on the Navigation stack where the node is located.
322    ///
323    /// # Arguments
324    ///
325    /// * `node` - The node.
326    ///
327    /// * `index` - Index value, counted from 0.
328    ///
329    /// # Returns
330    ///
331    /// * The error code.
332    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
333    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or index is null.
334    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
335    /// this may be because the node is not in Navigation.
336    ///
337    /// Available since API-level: 12
338    #[cfg(feature = "api-12")]
339    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
340    pub fn OH_ArkUI_GetNavDestinationIndex(node: ArkUI_NodeHandle, index: *mut i32) -> ArkUiResult;
341    /// Obtain the parameters of the NavDestination component where the node is located.
342    ///
343    /// # Arguments
344    ///
345    /// * `node` - The node.
346    ///
347    /// # Returns
348    ///
349    /// * The parameters.
350    /// If a null pointer is returned, it may be because the node is empty or the parameters does not exist.
351    ///
352    /// Available since API-level: 12
353    #[cfg(feature = "api-12")]
354    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
355    pub fn OH_ArkUI_GetNavDestinationParam(node: ArkUI_NodeHandle) -> napi_value;
356    /// Obtain the index of the page where the node resides in the Router page stack.
357    ///
358    /// # Arguments
359    ///
360    /// * `node` - The node.
361    ///
362    /// * `index` - Index value, counted from 1.
363    ///
364    /// # Returns
365    ///
366    /// * The error code.
367    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
368    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or index is null.
369    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
370    /// this may be because the node is not in RouterPage.
371    ///
372    /// Available since API-level: 12
373    #[cfg(feature = "api-12")]
374    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
375    pub fn OH_ArkUI_GetRouterPageIndex(node: ArkUI_NodeHandle, index: *mut i32) -> ArkUiResult;
376    /// Obtain the name of the page where the node is located.
377    ///
378    /// # Arguments
379    ///
380    /// * `node` - The node.
381    ///
382    /// * `buffer` - The buffer to which page name writes to the memory,
383    /// memory space needs to be allocated by the developer.
384    ///
385    /// * `bufferSize` - The buffer size
386    ///
387    /// * `writeLength` - Indicates the string length actually written to the buffer
388    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
389    /// Indicates the minimum buffer size that can accommodate the target
390    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
391    ///
392    /// # Returns
393    ///
394    /// * The error code.
395    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
396    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
397    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
398    /// this may be because the node is not in RouterPage.
399    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
400    ///
401    /// Available since API-level: 12
402    #[cfg(feature = "api-12")]
403    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
404    pub fn OH_ArkUI_GetRouterPageName(
405        node: ArkUI_NodeHandle,
406        buffer: *mut ::core::ffi::c_char,
407        bufferSize: i32,
408        writeLength: *mut i32,
409    ) -> ArkUiResult;
410    /// Obtain the path of the page where the node is located.
411    ///
412    /// # Arguments
413    ///
414    /// * `node` - The node.
415    ///
416    /// * `buffer` - The buffer to which page path writes to the memory,
417    /// memory space needs to be allocated by the developer.
418    ///
419    /// * `bufferSize` - The buffer size
420    ///
421    /// * `writeLength` - Indicates the string length actually written to the buffer
422    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
423    /// Indicates the minimum buffer size that can accommodate the target
424    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
425    ///
426    /// # Returns
427    ///
428    /// * The error code.
429    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
430    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
431    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
432    /// this may be because the node is not in RouterPage.
433    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
434    ///
435    /// Available since API-level: 12
436    #[cfg(feature = "api-12")]
437    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
438    pub fn OH_ArkUI_GetRouterPagePath(
439        node: ArkUI_NodeHandle,
440        buffer: *mut ::core::ffi::c_char,
441        bufferSize: i32,
442        writeLength: *mut i32,
443    ) -> ArkUiResult;
444    /// Obtain the state of the page where the node is located.
445    ///
446    /// # Arguments
447    ///
448    /// * `node` - The node.
449    ///
450    /// * `state` - The state value of the page is written back to this parameter.
451    ///
452    /// # Returns
453    ///
454    /// * The error code.
455    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
456    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or state is null.
457    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
458    /// this may be because the node is not in RouterPage.
459    ///
460    /// Available since API-level: 12
461    #[cfg(feature = "api-12")]
462    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
463    pub fn OH_ArkUI_GetRouterPageState(
464        node: ArkUI_NodeHandle,
465        state: *mut ArkUI_RouterPageState,
466    ) -> ArkUiResult;
467    /// Obtain the ID of the page where the node is located.
468    ///
469    /// # Arguments
470    ///
471    /// * `node` - The node.
472    ///
473    /// * `buffer` - The buffer to which page ID writes to the memory,
474    /// memory space needs to be allocated by the developer.
475    ///
476    /// * `bufferSize` - The buffer size
477    ///
478    /// * `writeLength` - Indicates the string length actually written to the buffer
479    /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
480    /// Indicates the minimum buffer size that can accommodate the target
481    /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
482    ///
483    /// # Returns
484    ///
485    /// * The error code.
486    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
487    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
488    /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
489    /// this may be because the node is not in RouterPage.
490    /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
491    ///
492    /// Available since API-level: 12
493    #[cfg(feature = "api-12")]
494    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
495    pub fn OH_ArkUI_GetRouterPageId(
496        node: ArkUI_NodeHandle,
497        buffer: *mut ::core::ffi::c_char,
498        bufferSize: i32,
499        writeLength: *mut i32,
500    ) -> ArkUiResult;
501    /// Register a callback to be executed when rendering in the next frame. Cannot be called on
502    /// the non-UI thread. Checking for non-UI thread calls will abort.
503    ///
504    /// # Arguments
505    ///
506    /// * `uiContext` - ArkUI_ContextHandle.
507    ///
508    /// * `userData` - Indicates the custom data to be saved.
509    ///
510    /// * `callback` - Custom callback function.
511    ///
512    /// * `nanoTimestamp` - Timestamp of frame signal.
513    ///
514    /// * `frameCount` - Frame count.
515    ///
516    /// # Returns
517    ///
518    /// * Returns the result code.
519    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
520    /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
521    /// Returns [`ARKUI_ERROR_CODE_UI_CONTEXT_INVALID`] if the uiContext is invalid.
522    /// Returns [`ARKUI_ERROR_CODE_CALLBACK_INVALID`] if the callback function is invalid.
523    ///
524    /// Available since API-level: 18
525    #[cfg(feature = "api-18")]
526    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
527    pub fn OH_ArkUI_PostFrameCallback(
528        uiContext: ArkUI_ContextHandle,
529        userData: *mut ::core::ffi::c_void,
530        callback: ::core::option::Option<
531            unsafe extern "C" fn(
532                nanoTimestamp: u64,
533                frameCount: u32,
534                userData: *mut ::core::ffi::c_void,
535            ),
536        >,
537    ) -> i32;
538    /// Initialize the ArkTS method for the specified env environment. Cannot be called on
539    /// the non-UI thread. Checking for non-UI thread calls will abort.
540    ///
541    /// # Arguments
542    ///
543    /// * `env` - napi environment pointer.
544    ///
545    /// # Returns
546    ///
547    /// * The error code.
548    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
549    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if env is null or failed to set the whitelist.
550    /// [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
551    ///
552    /// Available since API-level: 20
553    #[cfg(feature = "api-20")]
554    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
555    pub fn OH_ArkUI_InitModuleForArkTSEnv(env: napi_env) -> ArkUiResult;
556    /// Notify the specified env environment is invalid. Cannot be called on
557    /// the non-UI thread. Checking for non-UI thread calls will abort.
558    ///
559    /// # Arguments
560    ///
561    /// * `env` - napi environment pointer.
562    ///
563    /// Available since API-level: 20
564    #[cfg(feature = "api-20")]
565    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
566    pub fn OH_ArkUI_NotifyArkTSEnvDestroy(env: napi_env);
567    /// Register a callback to be executed at the end of the next idle frame.
568    /// If there is no next frame, will request one automatically.
569    ///
570    /// # Arguments
571    ///
572    /// * `uiContext` - ArkUI_ContextHandle.
573    ///
574    /// * `userData` - Indicates the custom data to be saved.
575    ///
576    /// * `callback` - Custom callback function.
577    ///
578    /// * `nanoTimeLeft` - Time remaining until the end of the current frame.
579    ///
580    /// * `frameCount` - Frame count.
581    ///
582    /// # Returns
583    ///
584    /// * Returns the result code.
585    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
586    /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
587    /// Returns [`ARKUI_ERROR_CODE_UI_CONTEXT_INVALID`] if the uiContext is invalid.
588    /// Returns [`ARKUI_ERROR_CODE_CALLBACK_INVALID`] if the callback function is invalid.
589    ///
590    /// Available since API-level: 20
591    #[cfg(feature = "api-20")]
592    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
593    pub fn OH_ArkUI_PostIdleCallback(
594        uiContext: ArkUI_ContextHandle,
595        userData: *mut ::core::ffi::c_void,
596        callback: ::core::option::Option<
597            unsafe extern "C" fn(
598                nanoTimeLeft: u64,
599                frameCount: u32,
600                userData: *mut ::core::ffi::c_void,
601            ),
602        >,
603    ) -> i32;
604}