From 386c3ac166ae377a103f2b9b60c5ff8e419f9e52 Mon Sep 17 00:00:00 2001 From: zhangziye Date: Wed, 23 Apr 2025 15:44:34 +0800 Subject: [PATCH] [cherry-pick]Uri Url fix query and iterator Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICDC9U Signed-off-by: zhangziye --- api/@ohos.url.d.ets | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/api/@ohos.url.d.ets b/api/@ohos.url.d.ets index 5a76196ba4..bf58e75744 100644 --- a/api/@ohos.url.d.ets +++ b/api/@ohos.url.d.ets @@ -97,13 +97,13 @@ declare namespace url { * Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. * - * @returns { EntryIterator } Returns an iterator over all values. + * @returns { IterableIterator<[string, string]> } Returns an iterator over all values. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 */ - entries(): EntryIterator; + entries(): IterableIterator<[string, string]>; /** * Callback functions are used to traverse key-value pairs on the URLParams instance object. @@ -170,30 +170,30 @@ declare namespace url { /** * Returns an iterator allowing to go through all keys contained in this object. * - * @returns { KeyValueIterator } Returns an ES6 Iterator over the names of each name-value pair. + * @returns { IterableIterator } Returns an ES6 Iterator over the names of each name-value pair. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 */ - keys(): KeyValueIterator; + keys(): IterableIterator; /** * Returns an iterator allowing to go through all values contained in this object. * - * @returns { KeyValueIterator } Returns an ES6 Iterator over the values of each name-value pair. + * @returns { IterableIterator } Returns an ES6 Iterator over the values of each name-value pair. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 */ - values(): KeyValueIterator; + values(): IterableIterator; /** * Returns an iterator allowing to go through all key/value * pairs contained in this object. * - * @returns { EntryIterator } Returns an ES6 iterator. + * @returns { IterableIterator<[string, string]> } Returns an ES6 iterator. * Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. * @syscap SystemCapability.Utils.Lang @@ -201,7 +201,7 @@ declare namespace url { * @atomicservice * @since 20 */ - $_iterator(): EntryIterator; + $_iterator(): IterableIterator<[string, string]>; /** * Returns a query string suitable for use in a URL. @@ -516,15 +516,5 @@ declare namespace url { */ set username(username: string); } - - class EntryIterator implements Iterator> { - next(): IteratorResult>; - $_iterator(): EntryIterator; - } - - class KeyValueIterator implements Iterator { - next(): IteratorResult; - $_iterator(): KeyValueIterator; - } } export default url; -- Gitee