diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index e09c64cf804db29c28705850dbad6746e6347619..e18d3b81524ce8e694d61dec5c2ad7e31f234553 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -231,14 +231,14 @@ declare class Deque { /** * Obtains the header element of a deque. * - * @returns { T | undefined } the first element of the deque if it exists, otherwise returns undefined. + * @returns { T } the first element of the deque. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getFirst(): T | undefined; + getFirst(): T; /** * Obtains the end element of a deque. @@ -272,14 +272,14 @@ declare class Deque { /** * Obtains the end element of a deque. * - * @returns { T | undefined } the last element of the deque if it exists, otherwise returns undefined. + * @returns { T } the last element of the deque if it exists, otherwise returns undefined. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getLast(): T | undefined; + getLast(): T; /** * Obtains the header element of a deque and delete the element. @@ -313,14 +313,14 @@ declare class Deque { /** * Obtains the header element of a deque and delete the element. * - * @returns { T | undefined } the deleted element of the deque if it exists, otherwise returns undefined. + * @returns { T } the deleted element of the deque if it exists, otherwise returns undefined. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - popFirst(): T | undefined; + popFirst(): T; /** * Obtains the end element of a deque and delete the element. @@ -354,14 +354,14 @@ declare class Deque { /** * Obtains the end element of a deque and delete the element. * - * @returns { T | undefined } the deleted element of the deque if it exists, otherwise returns undefined. + * @returns { T } the deleted element of the deque if it exists, otherwise returns undefined. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - popLast(): T | undefined; + popLast(): T; /** * Executes a provided function once for each value in the deque object. diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index 992800277850d44dce5020f2c1a8a514326f34bc..c74e0d85712413cfda71f0113483d0148febd628 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -235,14 +235,14 @@ declare class LinkedList { * Obtains an element at the specified position in this container. * * @param { int } index - specified position - * @returns { T | undefined} the element at the specified index, or undefined if the index is out of range. + * @returns { T } the element at the specified index, or undefined if the index is out of range. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - get(index: int): T | undefined; + get(index: int): T; /** * Inserts the specified element at the beginning of this LinkedList. @@ -683,14 +683,14 @@ declare class LinkedList { /** * Obtains the first element in this container. * - * @returns { T | undefined } the T type, returns undefined if linkedList is empty + * @returns { T } the T type, returns undefined if linkedList is empty * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getFirst(): T | undefined; + getFirst(): T; /** * Returns the Last element (the item at index length-1) of this linkedlist. @@ -726,14 +726,14 @@ declare class LinkedList { /** * Obtains the last element in this container. * - * @returns { T | undefined } the T type, returns undefined if linkedList is empty + * @returns { T } the T type, returns undefined if linkedList is empty * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getLast(): T | undefined; + getLast(): T; /** * Replaces the element at the specified position in this Vector with the specified element @@ -790,7 +790,7 @@ declare class LinkedList { * * @param { int } index - Position index of the target element. * @param { T } element - Element to be used for replacement. - * @returns { T | undefined } the T type ,returns undefined if linkedList is empty + * @returns { T } the T type * @throws { BusinessError } 10200001 - The value of index is out of range. * 1.Mandatory parameters are left unspecified; * 2.Incorrect parameter types; @@ -801,7 +801,7 @@ declare class LinkedList { * @since 20 * @arkts 1.2 */ - set(index: int, element: T): T | undefined; + set(index: int, element: T): T; /** * Replaces each element of this linkedlist with the result of applying the operator to that element. diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index 7b4aaa6a2e4f86c08bc94be2263b76a47be8b4a5..5d4d25075c206d97832c2e133e26976ce275312d 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -592,7 +592,7 @@ declare class List { * * @param { int } index - Position index of the target element. * @param { T } element - Element to be used for replacement. - * @returns { T | undefined } the T type, returns undefined if linkedList is empty + * @returns { T } the T type * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= ${length - 1}. * Received value is: ${index} * @syscap SystemCapability.Utils.Lang @@ -601,7 +601,7 @@ declare class List { * @since 20 * @arkts 1.2 */ - set(index: int, element: T): T | undefined; + set(index: int, element: T): T; /** * Compares the specified object with this list for equality.if the object are the same as this list * return true, otherwise return false. diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 2dc7eedf00c1d69b7e760fa6f11436db8cbd9a8c..8f1366a0a55591cec87bf3c116c04e387ec7285e 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -173,14 +173,14 @@ declare class Stack { * Looks at the object at the top of this stack without removing it from the stack * Return undefined if this stack is empty * - * @returns { T | undefined } the top value, or undefined if container is empty + * @returns { T } the top value * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - peek(): T | undefined; + peek(): T; /** * Removes the object at the top of this stack and returns that object as the value of this function @@ -218,14 +218,14 @@ declare class Stack { * Removes the object at the top of this stack and returns that object as the value of this function * an exception if the stack is empty * - * @returns { T | undefined } Stack top value, or undefined if container is empty + * @returns { T } Stack top value * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - pop(): T | undefined; + pop(): T; /** * Pushes an item onto the top of this stack diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 68a1d106d329e89642f8a54e01bc3bd3e0bd4b33..413c6542daa3efc57089029dcb54eb91ea293f7c 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -349,27 +349,27 @@ declare class TreeMap { * Obtains the first sorted key in the treemap. * Or returns undefined if tree map is empty * - * @returns { K | undefined } the key of the first element if exists, undefined otherwise + * @returns { K } the key of the first element * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getFirstKey(): K | undefined; + getFirstKey(): K; /** * Obtains the last sorted key in the treemap. * Or returns undefined if tree map is empty * - * @returns { K | undefined } the key of the last element if exists, undefined otherwise + * @returns { K } the key of the last element * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - getLastKey(): K | undefined; + getLastKey(): K; /** * Adds all element groups in one map to another map diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index 9a61949bd4dd0d190e49748dbf9d25fa4fe6964e..8d8eb2b72ca9eb64ebe28ae89205d3589b70854e 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -565,26 +565,26 @@ declare class TreeSet { /** * Return and delete the first element, returns undefined if tree set is empty * - * @returns { T | undefined} the value of the first element in the TreeSet if exists, undefined otherwise + * @returns { T } the value of the first element in the TreeSet * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - popFirst(): T | undefined; + popFirst(): T; /** * Return and delete the last element, returns undefined if tree set is empty * - * @returns { T | undefined } the value of the last element in the TreeSet if exists, undefined otherwise + * @returns { T } the value of the last element in the TreeSet * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - popLast(): T | undefined; + popLast(): T; /** * Executes a provided function once for each value in the Set object.