From 3a49585095c1f46cf8aa87ce1c927e9b545010e5 Mon Sep 17 00:00:00 2001 From: Orange_66 Date: Tue, 9 Sep 2025 19:12:27 +0800 Subject: [PATCH] Add a callback function to parse xml attributes Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICX5S6 Signed-off-by: Orange_66 --- api/@ohos.xml.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/api/@ohos.xml.d.ts b/api/@ohos.xml.d.ts index c570cba5a5..33a5aa34d7 100644 --- a/api/@ohos.xml.d.ts +++ b/api/@ohos.xml.d.ts @@ -44,6 +44,20 @@ * @arkts 1.1&1.2 */ declare namespace xml { + /** + * The type of Deque forEach callback function. + * + * @typedef { function } AttributeWithTagCb + * @param { string } tagName - The name of tag + * @param { string } key - The name of attribute + * @param { value } string - The value of attribute + * @returns { boolean } This callback does not return a value + * @syscap SystemCapability.Utils.Lang + * @atomicservice + * @since arkts {'1.1':'20', '1.2':'20'} + * @arkts 1.1&1.2 + */ + type AttributeWithTagCb = (tagName: string, key: string, value: string) => boolean /** * The XmlDynamicSerializer interface is used to dynamically generate an xml file. * @@ -1392,6 +1406,18 @@ declare namespace xml { * @arkts 1.1&1.2 */ tokenValueCallbackFunction?: (eventType: EventType, value: ParseInfo) => boolean; + + /** + * Token value callback function. + * + * @type { ?AttributeWithTagCb } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since arkts {'1.1':'20', '1.2':'20'} + * @arkts 1.1&1.2 + */ + attributeWithTagCallbackFunction?: AttributeWithTagCb; } /** -- Gitee