openharmony 鸿蒙 arkts-apis-uicontext-t

2026-08-25 浏览 (1)

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

NameTypeMandatoryDescription
idnumberYesComponent 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

NameTypeMandatoryDescription
eventClickEventYesInformation about the click event that triggers the callback.
nodeFrameNodeNoComponent 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

NameTypeMandatoryDescription
eventGestureEventYesInformation about the gesture event that triggers the callback.
currentGestureRecognizerYesInformation about the gesture recognizer that detects the event.
nodeFrameNodeNoComponent 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

NameTypeMandatoryDescription
eventGestureEventYesInformation about the gesture event that triggers the callback.
nodeFrameNodeNoComponent 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

TypeDescription
stringID of the target component, set using the universal attributes id.
numberSystem-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

NameTypeMandatoryDescription
stateNodeRenderStateYesInformation about the gesture event that triggers the callback.
nodeFrameNodeNoComponent 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

NameTypeMandatoryDescription
infoGestureTriggerInfoYesDetails 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

TypeDescription
pointer.PointerStylePointer 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.

TypeDescription
common.ContextContext 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

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/B8iQg7GS