Types
NOTE
The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.
CustomBuilderWithId18+
type CustomBuilderWithId = (id: number) => void
Defines a type that can be used for component attributes and method parameters to customize the UI description and generate custom components with a specific component ID.
Atomic service API: This API can be used in atomic services since API version 18.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| id | number | Yes | Component ID. |
ClickEventListenerCallback12+
type ClickEventListenerCallback = (event: ClickEvent, node?: FrameNode) => void
Defines the callback type for listening for click events in UIObserver.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| event | ClickEvent | Yes | Information about the click event that triggers the callback. |
| node | FrameNode | No | Component bound to the click event. |
PanListenerCallback19+
type PanListenerCallback = (event: GestureEvent, current: GestureRecognizer, node?: FrameNode) => void
Defines a callback for pan gesture events.
Atomic service API: This API can be used in atomic services since API version 19.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| event | GestureEvent | Yes | Information about the gesture event that triggers the callback. |
| current | GestureRecognizer | Yes | Information about the gesture recognizer that detects the event. |
| node | FrameNode | No | Component bound to the gesture event. |
GestureEventListenerCallback12+
type GestureEventListenerCallback = (event: GestureEvent, node?: FrameNode) => void
Defines the callback type for gesture event listeners in UIObserver.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| event | GestureEvent | Yes | Information about the gesture event that triggers the callback. |
| node | FrameNode | No | Component bound to the gesture event. |
NodeIdentity20+
type NodeIdentity = string|number
Defines the component ID.
Atomic service API: This API can be used in atomic services since API version 20.
System capability: SystemCapability.ArkUI.ArkUI.Full
| Type | Description |
|---|---|
| string | ID of the target component, set using the universal attributes id. |
| number | System-assigned unique node ID, obtainable via getUniqueId. |
NodeRenderStateChangeCallback20+
type NodeRenderStateChangeCallback = (state: NodeRenderState, node?: FrameNode) => void
Defines the callback type for listening for the rendering state of a specific node in UIObserver.
Atomic service API: This API can be used in atomic services since API version 20.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| state | NodeRenderState | Yes | Information about the gesture event that triggers the callback. |
| node | FrameNode | No | Component bound to the gesture event that triggers the listener; returns null if the component has been released. |
GestureListenerCallback20+
type GestureListenerCallback = (info: GestureTriggerInfo) => void
Defines the callback type for listening for specific gesture trigger information in UIObserver.
Atomic service API: This API can be used in atomic services since API version 20.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| info | GestureTriggerInfo | Yes | Details of the gesture triggered by the interaction. |
PointerStyle12+
type PointerStyle = pointer.PointerStyle
Defines the pointer style.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.MultimodalInput.Input.Pointer
| Type | Description |
|---|---|
| pointer.PointerStyle | Pointer style. |
Context12+
type Context = common.Context
Defines the context of the current ability.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Ability.AbilityRuntime.Core
Model restriction: This API can be used only in the stage model.
| Type | Description |
|---|---|
| common.Context | Context object associated with the current ability. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller
openharmony 鸿蒙 errorcode-canvas
openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent
openharmony 鸿蒙 errorcode-bindSheet
openharmony 鸿蒙 js-apis-arkui-uiExtension-sys
openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo
openharmony 鸿蒙 capi-arkui-rendernodeutils
openharmony 鸿蒙 js-apis-arkui-node
openharmony 鸿蒙 capi-native-node-h
openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem