From 28b17324d84beb87633d1d1d3a850b0ee674dbf1 Mon Sep 17 00:00:00 2001 From: chengyuli Date: Wed, 20 Aug 2025 10:48:35 +0800 Subject: [PATCH] https://gitee.com/openharmony/interface_sdk-js/issues/ICTYCZ Signed-off-by: chengyuli Change-Id: I37f5d7585552f4054181b2b089a5bf0fa0840b36 --- api/@ohos.util.ArrayList.d.ts | 12 ++++++------ api/@ohos.util.Deque.d.ts | 6 +++--- api/@ohos.util.HashMap.d.ts | 8 ++++---- api/@ohos.util.HashSet.d.ts | 8 ++++---- api/@ohos.util.LightWeightMap.d.ts | 8 ++++---- api/@ohos.util.LightWeightSet.d.ts | 8 ++++---- api/@ohos.util.LinkedList.d.ts | 6 +++--- api/@ohos.util.List.d.ts | 12 ++++++------ api/@ohos.util.PlainArray.d.ts | 6 +++--- api/@ohos.util.Queue.d.ts | 6 +++--- api/@ohos.util.Stack.d.ts | 6 +++--- api/@ohos.util.TreeMap.d.ts | 8 ++++---- api/@ohos.util.TreeSet.d.ts | 8 ++++---- 13 files changed, 51 insertions(+), 51 deletions(-) diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index 2224bc38ec..48fa14f030 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -955,29 +955,29 @@ export type ArrayListComparatorFn = (firstValue: T, secondValue: T) => double * * @typedef { function } ArrayListForEachCb * @param { T } value - The current element being processed - * @param { int } index - The index of the current element - * @param { ArrayList } arrlist - The ArrayList instance being traversed + * @param { int } [index] - The index of the current element + * @param { ArrayList } [arrlist] - The ArrayList instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type ArrayListForEachCb = (value: T, index: int, arrlist: ArrayList) => void; +export type ArrayListForEachCb = (value: T, index?: int, arrlist?: ArrayList) => void; /** * The type of ArrayList callback function. * * @typedef { function } ArrayListReplaceCb * @param { T } value - The current element being processed - * @param { int } index - The index of the current element - * @param { ArrayList } arrlist - The ArrayList instance being traversed + * @param { int } [index] - The index of the current element + * @param { ArrayList } [arrlist] - The ArrayList instance being traversed * @returns { T } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type ArrayListReplaceCb = (value: T, index: int, arrlist: ArrayList) => T; +export type ArrayListReplaceCb = (value: T, index?: int, arrlist?: ArrayList) => T; export default ArrayList; diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index e09c64cf80..0ebde4c423 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -490,14 +490,14 @@ declare class Deque { * * @typedef { function } DequeForEachCb * @param { T } value - The current element being processed - * @param { int } index - The index of the current element - * @param { Deque } deque - The Deque instance being traversed + * @param { int } [index] - The index of the current element + * @param { Deque } [deque] - The Deque instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type DequeForEachCb = (value: T, index: int, deque: Deque) => void; +export type DequeForEachCb = (value: T, index?: int, deque?: Deque) => void; export default Deque; diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index 60bd6a50ba..c7ad1906f3 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -625,15 +625,15 @@ declare class HashMap { * The type of HashMap callback function. * * @typedef { function } HashMapCbFn - * @param { V } value - The value of the current entry - * @param { K } key - The key of the current entry - * @param { HashMap } map - The HashMap instance being traversed + * @param { V } [value] - The value of the current entry + * @param { K } [key] - The key of the current entry + * @param { HashMap } [map] - The HashMap instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ - export type HashMapCbFn = (value: V, key: K, map: HashMap) => void; + export type HashMapCbFn = (value?: V, key?: K, map?: HashMap) => void; export default HashMap; diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index c4746e0d9b..ca0e377881 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -459,15 +459,15 @@ declare class HashSet { * The type of HashSet callback function. * * @typedef { function } HashSetCbFn - * @param { T } value - The current element being processed - * @param { T } key - [Deprecated] HashSet does not use key-value pairs, this parameter exists only for API compatibility - * @param { HashSet } set - The HashSet instance being traversed + * @param { T } [value] - The current element being processed + * @param { T } [key] - [Deprecated] HashSet does not use key-value pairs, this parameter exists only for API compatibility + * @param { HashSet } [set] - The HashSet instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type HashSetCbFn = (value: T, key: T, set: HashSet) => void; +export type HashSetCbFn = (value?: T, key?: T, set?: HashSet) => void; export default HashSet; diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index 4bbac94397..ee7f19875d 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -977,15 +977,15 @@ declare class LightWeightMap { * The type of LightWeightMap callback function. * * @typedef { function } LightWeightMapCbFn - * @param { V } value - The value of the current entry - * @param { K } key - The key of the current entry - * @param { LightWeightMap } map - The LightWeightMap instance being traversed + * @param { V } [value] - The value of the current entry + * @param { K } [key] - The key of the current entry + * @param { LightWeightMap } [map] - The LightWeightMap instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ - export type LightWeightMapCbFn = (value: V, key: K, map: LightWeightMap) => void; + export type LightWeightMapCbFn = (value?: V, key?: K, map?: LightWeightMap) => void; export default LightWeightMap; diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index 6e63cf0f9a..f4d132a499 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -778,15 +778,15 @@ declare class LightWeightSet { * The type of LightWeightSet callback function. * * @typedef { function } LightWeightSetForEachCb - * @param { T } value - The value of current element - * @param { T } key - The key of current element(same as value) - * @param { LightWeightSet } set - The LightWeightSet instance being traversed + * @param { T } [value] - The value of current element + * @param { T } [key] - The key of current element(same as value) + * @param { LightWeightSet } [set] - The LightWeightSet instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type LightWeightSetForEachCb = (value: T, key: T, set: LightWeightSet) => void +export type LightWeightSetForEachCb = (value?: T, key?: T, set?: LightWeightSet) => void export default LightWeightSet; diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index 9928002778..ea9c1c7e24 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -1004,14 +1004,14 @@ declare class LinkedList { * * @typedef { function } LinkedListForEachCb * @param { T } value - The value of current element - * @param { int } index - The index of current element - * @param { LinkedList } linkedList - The LinkedList instance being traversed + * @param { int } [index] - The index of current element + * @param { LinkedList } [linkedList] - The LinkedList instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type LinkedListForEachCb = (value: T, index: int, linkedList: LinkedList) => void +export type LinkedListForEachCb = (value: T, index?: int, linkedList?: LinkedList) => void export default LinkedList; diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index 2b6ff26735..6293c6ab7c 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -1020,29 +1020,29 @@ export type ListComparatorFn = (firstValue: T, secondValue: T) => double; * * @typedef { function } ListForEachCb * @param { T } value - The value of current element - * @param { int } index - The index of current element - * @param { List } list - The List instance being traversed + * @param { int } [index] - The index of current element + * @param { List } [list] - The List instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type ListForEachCb = (value: T, index: int, list: List) => void +export type ListForEachCb = (value: T, index?: int, list?: List) => void /** * The type of List callback function. * * @typedef { function } LinkedListForEachCb * @param { T } value - The old value of current element - * @param { int } index - The index of current element - * @param { List } list - The List instance being traversed + * @param { int } [index] - The index of current element + * @param { List } [list] - The List instance being traversed * @returns { T } - The new value of current element * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type ListReplaceCb = (value: T, index: int, list: List) => T +export type ListReplaceCb = (value: T, index?: int, list?: List) => T export default List; diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index a4b5e2ede7..0616c3dd93 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -830,14 +830,14 @@ declare class PlainArray { * * @typedef { function } PlainArrayForEachCb * @param { T } value - The value of current element - * @param { int } key - The key of current element - * @param { PlainArray } PlainArray - The PlainArray instance being traversed + * @param { int } [key] - The key of current element + * @param { PlainArray } [PlainArray] - The PlainArray instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type PlainArrayForEachCb = (value: T, key: int, PlainArray: PlainArray) => void +export type PlainArrayForEachCb = (value: T, key?: int, PlainArray?: PlainArray) => void export default PlainArray; diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index 37ec882239..c3ab28f14c 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -341,14 +341,14 @@ declare class Queue { * * @typedef { function } QueueForEachCb * @param { T } value - The value of current element - * @param { int } index - The key of current element - * @param { Queue } queue - The Queue instance being traversed + * @param { int } [index] - The key of current element + * @param { Queue } [queue] - The Queue instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type QueueForEachCb = (value: T, index: int, queue: Queue) => void +export type QueueForEachCb = (value: T, index?: int, queue?: Queue) => void export default Queue; diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 2dc7eedf00..9254aafa3f 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -404,14 +404,14 @@ declare class Stack { * * @typedef { function } StackForEachCb * @param { T } value - The value of current element - * @param { int } index - The key of current element - * @param { Stack } stack - The Stack instance being traversed + * @param { int } [index] - The key of current element + * @param { Stack } [stack] - The Stack instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type StackForEachCb = (value: T, index: int, stack: Stack) => void +export type StackForEachCb = (value: T, index?: int, stack?: Stack) => void export default Stack; diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 68a1d106d3..07c44d003a 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -862,16 +862,16 @@ declare class TreeMap { * The type of TreeMap callback function. * * @typedef { function } TreeMapForEachCb - * @param { V } value - The value of current element - * @param { K } key - The key of current element - * @param { TreeMap } map - The TreeMap instance being traversed + * @param { V } [value] - The value of current element + * @param { K } [key] - The key of current element + * @param { TreeMap } [map] - The TreeMap instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type TreeMapForEachCb = (value: V, key: K, map: TreeMap) => void +export type TreeMapForEachCb = (value?: V, key?: K, map?: TreeMap) => void /** * The type of TreeMap comparator. diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index 9a61949bd4..921f3daad6 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -756,16 +756,16 @@ declare class TreeSet { * The type of TreeSet callback function. * * @typedef { function } TreeSetForEachCb - * @param { T } value - The value of current element - * @param { T } key - The key of current element(same as value) - * @param { TreeSet } set - The TreeSet instance being traversed + * @param { T } [value] - The value of current element + * @param { T } [key] - The key of current element(same as value) + * @param { TreeSet } [set] - The TreeSet instance being traversed * @returns { void } This callback does not return a value * @syscap SystemCapability.Utils.Lang * @atomicservice * @since 20 * @arkts 1.2 */ -export type TreeSetForEachCb = (value: T, key: T, set: TreeSet) => void +export type TreeSetForEachCb = (value?: T, key?: T, set?: TreeSet) => void /** * The type of TreeSet comparator. -- Gitee