From 2e63f7f11829ee66414e938b5b1b403dba239d68 Mon Sep 17 00:00:00 2001
From: Caoruihong
Date: Fri, 12 Sep 2025 00:13:16 +0800
Subject: [PATCH] feat: transform for static arkts
Signed-off-by: Caoruihong
Change-Id: I3864a368f6ecd5af04b3bf6fd5381890dbc19c5c
---
api/@ohos.arkui.inspector.static.d.ets | 39 ++++-------
api/arkui/component/common.static.d.ets | 66 ++++---------------
.../uiExtensionComponent.static.d.ets | 28 +++-----
3 files changed, 33 insertions(+), 100 deletions(-)
diff --git a/api/@ohos.arkui.inspector.static.d.ets b/api/@ohos.arkui.inspector.static.d.ets
index 6065f1b7e4..b204087c5a 100644
--- a/api/@ohos.arkui.inspector.static.d.ets
+++ b/api/@ohos.arkui.inspector.static.d.ets
@@ -40,71 +40,56 @@ declare namespace inspector {
/**
* Registers a callback with the corresponding query condition by using the handle.
* This callback is triggered when the component layout complete.
- * @param { 'layout' } type - type of the listened event.
* @param { Callback } callback - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- onLayout(type: 'layout', callback: Callback): void;
+ onLayout(callback: Callback): void;
/**
* Deregisters a callback with the corresponding query condition by using the handle.
* This callback is not triggered when the component layout complete.
- * @param { 'layout' } type - type of the listened event.
* @param { Callback } [callback] - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- offLayout(type: 'layout', callback?: Callback): void;
+ offLayout(callback?: Callback): void;
/**
* Registers a callback with the corresponding query condition by using the handle.
* This callback is triggered when the component draw complete.
- * @param { 'draw' } type - type of the listened event.
* @param { Callback } callback - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- onDraw(type: 'draw', callback: Callback): void;
+ onDraw(callback: Callback): void;
/**
* Deregisters a callback with the corresponding query condition by using the handle.
* This callback is not triggered when the component draw complete.
- * @param { 'draw' } type - type of the listened event.
* @param { Callback } [callback] - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- offDraw(type: 'draw', callback?: Callback): void;
+ offDraw(callback?: Callback): void;
/**
* Registers a callback with the corresponding query condition by using the handle.
* This callback is triggered when the child of component draw complete.
- * @param { 'drawChildren' } type - type of the listened event.
* @param { Callback } callback - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- onDrawChildren(type: 'drawChildren', callback: Callback): void;
+ onDrawChildren(callback: Callback): void;
/**
* Deregisters a callback with the corresponding query condition by using the handle.
* This callback is not triggered when the child of component draw complete.
- * @param { 'drawChildren' } type - type of the listened event.
* @param { Callback } [callback] - callback of the listened event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- offDrawChildren(type: 'drawChildren', callback?: Callback): void;
-
- /**
- * @since 20 static
- */
- overload on { onLayout, onDraw, onDrawChildren }
- /**
- * @since 20 static
- */
- overload off { offLayout, offDraw, offDrawChildren }
+ offDrawChildren(callback?: Callback): void;
}
/**
diff --git a/api/arkui/component/common.static.d.ets b/api/arkui/component/common.static.d.ets
index 728aa03469..63c5e74192 100644
--- a/api/arkui/component/common.static.d.ets
+++ b/api/arkui/component/common.static.d.ets
@@ -10782,18 +10782,8 @@ export declare interface CommonMethod {
* NOTE
*
Whether to enable accessibility grouping. When accessibility grouping is enabled,
*
the component and all its children are treated as a single selectable unit, and the accessibility
- *
service will no longer focus on the individual child components.
+ *
service will no longer focus on the individual child components.
*
- * @param { boolean | undefined } value - set group with accessibility, default value is false.
- * @returns { this }
- * @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
- */
- default accessibilityGroupWithValue(value: boolean | undefined): this;
- /**
- * Sets whether to enable accessibility grouping.
- *
- * NOTE
*
If accessibility grouping is enabled and the component does not contain a universal text attribute
*
or an accessibility text attribute, the system will concatenate the universal text attributes of
*
its child components to form a merged text for the component. If a child component lacks a universal
@@ -10805,27 +10795,12 @@ export declare interface CommonMethod {
*
If a child component lacks both, it will be ignored.
*
* @param { boolean | undefined } isGroup - set group with accessibility, default value is false.
- * @param { AccessibilityOptions | undefined } config - accessibilityOptions for accessibility, default value is false.
- * @returns { this }
- * @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
- */
- default accessibilityGroupWithConfig(isGroup: boolean | undefined, config: AccessibilityOptions | undefined): this;
- /**
- * @since 20 static
- */
- overload accessibilityGroup { accessibilityGroupWithValue, accessibilityGroupWithConfig };
- /**
- * Sets the accessibility text.
- * When a component does not contain a text attribute, you can use this API to set an accessibility
- * text attribute, so that accessibility services can announce the specified content for the component.
- *
- * @param { string | undefined } value - set accessibility text, default value is "".
+ * @param { ?AccessibilityOptions } [accessibilityOptions] - options for accessibility, default value is false.
* @returns { this }
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- default accessibilityTextOfStringType(value: string | undefined): this;
+ default accessibilityGroup(isGroup: boolean | undefined, accessibilityOptions?: AccessibilityOptions): this;
/**
* Sets accessibility next focus id
* @param { string | undefined } nextId - set component next accessibility focus id
@@ -10861,21 +10836,19 @@ export declare interface CommonMethod {
/**
* Sets the accessibility text.
* NOTE
- * If a component has both text content and accessibility text, only the accessibility text is announced.
+ *
When a component does not contain a text attribute, you can use this API to set an accessibility
+ *
text attribute, so that accessibility services can announce the specified content for the component.
+ *
If a component has both text content and accessibility text, only the accessibility text is announced.
*
If a component is grouped for accessibility purposes but lacks both text content and accessibility
*
text, the screen reader will concatenate text from its child components (depth-first traversal).
*
To prioritize accessibility text concatenation, set accessibilityPreferred in accessibilityGroup.
*
- * @param { Resource } text - set accessibility text
+ * @param { Resource | string | undefined } text - set accessibility text, default value is "".
* @returns { this }
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
+ * @since 22 static
*/
- default accessibilityTextOfResourceType(text: Resource): this;
- /**
- * @since 20 static
- */
- overload accessibilityText { accessibilityTextOfStringType, accessibilityTextOfResourceType };
+ default accessibilityText(text: Resource | string | undefined): this;
/**
* Sets accessibility role,role indicates the custom type of the component
* @param { AccessibilityRoleType | undefined } role - set accessibility component type
@@ -10901,15 +10874,6 @@ export declare interface CommonMethod {
* @since 20 static
*/
default accessibilityTextHint(value: string | undefined): this;
- /**
- * Sets accessibilityDescription
- *
- * @param { string | undefined } value - set description of accessibility, default value is "".
- * @returns { this }
- * @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
- */
- default accessibilityDescriptionOfStringType(value: string | undefined): this;
/**
* Sets accessibilityDescription
*
@@ -10922,16 +10886,12 @@ export declare interface CommonMethod {
*
cannot be learned from component attributes and accessibility text. If a component contains
*
both text information and the accessibility description, the text is read first and then the
*
accessibility description, when the component is selected.
- * @param { Resource } description - set description of accessibility
+ * @param { Resource | string | undefined } description - set description of accessibility, default value is "".
* @returns { this }
* @syscap SystemCapability.ArkUI.ArkUI.Full
- * @since 20 static
- */
- default accessibilityDescriptionOfResourceType(description: Resource): this;
- /**
- * @since 20 static
+ * @since 22 static
*/
- overload accessibilityDescription { accessibilityDescriptionOfStringType, accessibilityDescriptionOfResourceType };
+ default accessibilityDescription(description: Resource | string | undefined): this;
/**
* Sets the accessibility level.
* This property determines whether the component can be recognized by accessibility services.
diff --git a/api/arkui/component/uiExtensionComponent.static.d.ets b/api/arkui/component/uiExtensionComponent.static.d.ets
index ad5798f539..27f55230f0 100644
--- a/api/arkui/component/uiExtensionComponent.static.d.ets
+++ b/api/arkui/component/uiExtensionComponent.static.d.ets
@@ -193,58 +193,46 @@ export declare interface UIExtensionProxy {
* Register the listener that watches for async data receiver callback being registered by UIExtensionAbility.
* AnonyMous Object Rectification
*
- * @param { 'asyncReceiverRegister' } type - Indicates the type of event.
* @param { Callback } callback - Callback of the listened event.
* @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
- * @since 20 static
+ * @since 22 static
*/
- onAsyncReceiverRegister(type: 'asyncReceiverRegister', callback: Callback): void;
+ onAsyncReceiverRegister(callback: Callback): void;
/**
* Register the listener that watches for sync data receiver callback being registered by UIExtensionAbility.
* AnonyMous Object Rectification
*
- * @param { 'syncReceiverRegister' } type - Indicates the type of event.
* @param { Callback } callback - Callback of the listened event.
* @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
- * @since 20 static
+ * @since 22 static
*/
- onSyncReceiverRegister(type: 'syncReceiverRegister', callback: Callback): void;
+ onSyncReceiverRegister(callback: Callback): void;
/**
* Deregisters the listener that watches for async data receiver callback being registered by UIExtensionAbility.
* AnonyMous Object Rectification
*
- * @param { 'asyncReceiverRegister' } type - Type of the listened event.
* @param { Callback } [callback] - Callback of the listened event.
* @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
- * @since 20 static
+ * @since 22 static
*/
- offAsyncReceiverRegister(type: 'asyncReceiverRegister', callback?: Callback): void;
+ offAsyncReceiverRegister(callback?: Callback): void;
/**
* Deregisters the listener that watches for sync data receiver callback being registered by UIExtensionAbility.
* AnonyMous Object Rectification
*
- * @param { 'syncReceiverRegister' } type - Type of the listened event.
* @param { Callback } [callback] - Callback of the listened event.
* @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
- * @since 20 static
- */
- offSyncReceiverRegister(type: 'syncReceiverRegister', callback?: Callback): void;
- /**
- * @since 20 static
- */
- overload on { onAsyncReceiverRegister, onSyncReceiverRegister }
- /**
- * @since 20 static
+ * @since 22 static
*/
- overload off { offAsyncReceiverRegister, offSyncReceiverRegister }
+ offSyncReceiverRegister(callback?: Callback): void;
}
/**
--
Gitee