Add interface exception information.

Signed-off-by: linhaoran <linhaoran2@huawei.com>
This commit is contained in:
linhaoran 2022-09-06 17:54:01 +08:00
parent 2b52aeb29d
commit dc61113252
14 changed files with 332 additions and 42 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class ArrayList<T> {
/**
* A constructor used to create a ArrayList object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,6 +31,7 @@ declare class ArrayList<T> {
* Appends the specified element to the end of this arraylist.
* @param element to be appended to this arraylist
* @returns the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -39,7 +42,9 @@ declare class ArrayList<T> {
* any subsequent elements to the right (adds one to their index).
* @param index index at which the specified element is to be inserted
* @param element element to be inserted
* @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -48,6 +53,7 @@ declare class ArrayList<T> {
* Check if arraylist contains the specified element
* @param element element to be contained
* @return the boolean type,if arraylist contains the specified element,return true,else return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -57,6 +63,7 @@ declare class ArrayList<T> {
* in this arraylist, or -1 if this arraylist does not contain the element.
* @param element element to be contained
* @return the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -66,7 +73,9 @@ declare class ArrayList<T> {
* delete the element, and move the index of all elements to the right of the element forward by one.
* @param index the index in the arraylist
* @return the T type ,returns undefined if arraylist is empty,If the index is
* out of bounds (greater than or equal to length or less than 0), throw an exception
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed. *
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -77,6 +86,7 @@ declare class ArrayList<T> {
* unchanged. More formally, removes the element with the lowest index
* @param element element to remove
* @return the boolean type ,If there is no such element, return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -86,6 +96,7 @@ declare class ArrayList<T> {
* or -1 if the arraylist does not contain the element.
* @param element element to find
* @return the number type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -94,8 +105,9 @@ declare class ArrayList<T> {
* Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive.
* @param fromIndex The starting position of the index, containing the value at that index position
* @param toIndex the end of the index, excluding the value at that index
* @throws If the fromIndex is out of range (greater than or equal to length or less than 0),
* or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -109,11 +121,13 @@ declare class ArrayList<T> {
* @param arrlist (Optional) The arraylist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList<T>) => T,
thisArg?: Object): void;
thisArg?: Object): void;
/**
* Executes a provided function once for each value in the arraylist object.
* @param callbackfn (required) A function that accepts up to four arguments.The function to
@ -123,6 +137,8 @@ declare class ArrayList<T> {
* @param arrlist (Optional) The arraylist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -137,6 +153,8 @@ declare class ArrayList<T> {
* @param firstValue (Optional) previous element
* @param secondValue (Optional) next elements
* If this parameter is empty, it will default to ASCII sorting
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -145,8 +163,9 @@ declare class ArrayList<T> {
* Returns a view of the portion of this arraylist between the specified fromIndex,inclusize,and toIndex,exclusive
* @param fromIndex The starting position of the index, containing the value at that index position
* @param toIndex the end of the index, excluding the value at that index
* @throws If the fromIndex or toIndex index is out of range (greater than or equal to length or less than 0),
* or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -154,6 +173,7 @@ declare class ArrayList<T> {
/**
* Removes all of the elements from this arraylist.The arraylist will
* be empty after this call returns.length becomes 0
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -161,6 +181,7 @@ declare class ArrayList<T> {
/**
* Returns a shallow copy of this instance. (The elements themselves are not copied.)
* @return this arraylist instance
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -168,6 +189,7 @@ declare class ArrayList<T> {
/**
* returns the capacity of this arraylist
* @return the number type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -175,6 +197,7 @@ declare class ArrayList<T> {
/**
* convert arraylist to array
* @return the Array type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -182,6 +205,7 @@ declare class ArrayList<T> {
/**
* Determine whether arraylist is empty and whether there is an element
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -189,18 +213,22 @@ declare class ArrayList<T> {
/**
* If the newCapacity provided by the user is greater than or equal to length,
* change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
increaseCapacityTo(newCapacity: number): void;
/**
* Limit the capacity to the current length
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
trimToCurrentLength(): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class Deque<T> {
/**
* A constructor used to create a Deque object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -28,6 +30,7 @@ declare class Deque<T> {
/**
* Inserts an element into the deque header.
* @param element to be appended to this deque
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -35,6 +38,7 @@ declare class Deque<T> {
/**
* Inserting an element at the end of a deque
* @param element to be appended to this deque
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -43,6 +47,7 @@ declare class Deque<T> {
* Check if deque contains the specified element
* @param element element to be contained
* @return the boolean type,if deque contains the specified element,return true,else return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -50,6 +55,7 @@ declare class Deque<T> {
/**
* Obtains the header element of a deque.
* @return the T type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -57,7 +63,7 @@ declare class Deque<T> {
/**
* Obtains the end element of a deque.
* @return the T type
* @throws an exception if the queue is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -65,7 +71,7 @@ declare class Deque<T> {
/**
* Obtains the header element of a deque and delete the element.
* @return the T type
* @throws an exception if the deque is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -73,7 +79,7 @@ declare class Deque<T> {
/**
* Obtains the end element of a deque and delete the element.
* @return the T type
* @throws an exception if the deque is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -86,6 +92,8 @@ declare class Deque<T> {
* @param deque (Optional) The deque object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {TypeError} Parameter check failed.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -93,6 +101,7 @@ declare class Deque<T> {
thisArg?: Object): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class HashMap<K, V> {
/**
* A constructor used to create a HashMap object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -28,6 +30,7 @@ declare class HashMap<K, V> {
/**
* Returns whether the Map object contains elements
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -36,6 +39,7 @@ declare class HashMap<K, V> {
* Returns whether a key is contained in this map
* @param key need to determine whether to include the key
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -44,6 +48,7 @@ declare class HashMap<K, V> {
* Returns whether a value is contained in this map
* @param value need to determine whether to include the value
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -52,6 +57,7 @@ declare class HashMap<K, V> {
* Returns a specified element in a Map object, or null if there is no corresponding element
* @param key the index in HashMap
* @return value or null
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -59,6 +65,8 @@ declare class HashMap<K, V> {
/**
* Adds all element groups in one map to another map
* @param map the Map object to add members
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -68,6 +76,8 @@ declare class HashMap<K, V> {
* @param key Added or updated targets
* @param value Added or updated value
* @returns the map object after set
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -76,24 +86,28 @@ declare class HashMap<K, V> {
* Remove a specified element from a Map object
* @param key Target to be deleted
* @return Target mapped value
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
remove(key: K): V;
/**
* Clear all element groups in the map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
clear(): void;
/**
* Returns a new Iterator object that contains the keys contained in this map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
keys(): IterableIterator<K>;
/**
* Returns a new Iterator object that contains the values contained in this map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -103,6 +117,7 @@ declare class HashMap<K, V> {
* @param key Updated targets
* @param newValue Updated the target mapped value
* @returns the boolean type(Is there a target pointed to by the key)
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -110,6 +125,8 @@ declare class HashMap<K, V> {
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -117,12 +134,14 @@ declare class HashMap<K, V> {
thisArg?: Object): void;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[K, V]>;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class HashSet<T> {
/**
* A constructor used to create a HashSet object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -28,6 +30,7 @@ declare class HashSet<T> {
/**
* Returns whether the Set object contains elements
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -36,6 +39,8 @@ declare class HashSet<T> {
* Returns whether the Set object contain s the elements
* @param value need to determine whether to include the element
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -44,6 +49,8 @@ declare class HashSet<T> {
* If the set does not contain the element, the specified element is added
* @param value Added element
* @returns the boolean type(Is there contain this element)
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -52,18 +59,23 @@ declare class HashSet<T> {
* Remove a specified element from a Set object
* @param value Target to be deleted
* @return the boolean type(Is there contain this element)
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
remove(value: T): boolean;
remove(value: T): boolean;
/**
* Clears all element groups in a set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
clear(): void;
/**
* Executes a provided function once for each value in the Set object.
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -71,18 +83,21 @@ declare class HashSet<T> {
thisArg?: Object): void;
/**
* Returns a new Iterator object that contains the values contained in this set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
values(): IterableIterator<T>;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[T, T]>;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class LightWeightMap<K, V> {
/**
* A constructor used to create a LightWeightMap object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,6 +31,8 @@ declare class LightWeightMap<K, V> {
* Returns whether this map has all the object in a specified map
* @param map the Map object to compare
* @return the boolean type
* @throws {TypeError} Parameter check failed.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -37,6 +41,7 @@ declare class LightWeightMap<K, V> {
* Returns whether a key is contained in this map
* @param key need to determine whether to include the key
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -45,6 +50,7 @@ declare class LightWeightMap<K, V> {
* Returns whether a value is contained in this map
* @param value need to determine whether to include the value
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -53,12 +59,15 @@ declare class LightWeightMap<K, V> {
* Ensures that the capacity of an LightWeightMap container is greater than or equal to a apecified value,
* and that the container has all the original objects after capacity expansion
* @param minimumCapacity Minimum capacity to be reserved
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
increaseCapacityTo(minimumCapacity: number): void;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -67,6 +76,7 @@ declare class LightWeightMap<K, V> {
* Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
* @param key the index in LightWeightMap
* @return value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -75,6 +85,7 @@ declare class LightWeightMap<K, V> {
* Obtains the index of the key equal to a specified key in an LightWeightMap container
* @param key Looking for goals
* @return Subscript corresponding to target
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -83,6 +94,7 @@ declare class LightWeightMap<K, V> {
* Obtains the index of the value equal to a specified value in an LightWeightMap container
* @param value Looking for goals
* @return Subscript corresponding to target
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -90,6 +102,7 @@ declare class LightWeightMap<K, V> {
/**
* Returns whether the Map object contains elements
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -98,12 +111,16 @@ declare class LightWeightMap<K, V> {
* Obtains the key at the loaction identified by index in an LightWeightMap container
* @param index Target subscript for search
* @return the key of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getKeyAt(index: number): K;
/**
* Obtains a ES6 iterator that contains all the keys of an LightWeightMap container
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -111,6 +128,8 @@ declare class LightWeightMap<K, V> {
/**
* Adds all element groups in one map to another map
* @param map the Map object to add members
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -120,6 +139,7 @@ declare class LightWeightMap<K, V> {
* @param key Added or updated targets
* @param value Added or updated value
* @returns the map object after set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -128,6 +148,7 @@ declare class LightWeightMap<K, V> {
* Remove the mapping for this key from this map if present
* @param key Target to be deleted
* @return Target mapped value
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -136,6 +157,8 @@ declare class LightWeightMap<K, V> {
* Deletes a key-value pair at the loaction identified by index from an LightWeightMap container
* @param index Target subscript for search
* @return the boolean type(Is there a delete value)
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -143,6 +166,7 @@ declare class LightWeightMap<K, V> {
/**
* Removes all of the mapping from this map
* The map will be empty after this call returns
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -152,6 +176,9 @@ declare class LightWeightMap<K, V> {
* @param index Target subscript for search
* @param value Updated the target mapped value
* @return the boolean type(Is there a value corresponding to the subscript)
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -159,6 +186,8 @@ declare class LightWeightMap<K, V> {
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -166,12 +195,14 @@ declare class LightWeightMap<K, V> {
thisArg?: Object): void;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
[Symbol.iterator](): IterableIterator<[K, V]>;
/**
* Obtains a string that contains all the keys and values in an LightWeightMap container
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -180,12 +211,16 @@ declare class LightWeightMap<K, V> {
* Obtains the value identified by index in an LightWeightMap container
* @param index Target subscript for search
* @return the value of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getValueAt(index: number): V;
/**
* Returns an iterator of the values contained in this map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class LightWeightSet<T> {
/**
* A constructor used to create a LightWeightSet object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,6 +31,7 @@ declare class LightWeightSet<T> {
* If the set does not contain the element, the specified element is added
* @param value Added element
* @returns the boolean type(Is there contain this element)
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -37,6 +40,8 @@ declare class LightWeightSet<T> {
* Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container
* @param set the Set object to provide the added element
* @returns the boolean type(Is there any new data added successfully)
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -45,6 +50,8 @@ declare class LightWeightSet<T> {
* Returns whether this set has all the object in a specified set
* @param set the Set object to compare
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -53,6 +60,7 @@ declare class LightWeightSet<T> {
* Checks whether an LightWeightSet container has a specified key
* @param key need to determine whether to include the key
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -61,6 +69,7 @@ declare class LightWeightSet<T> {
* Checks whether an the objects of an LightWeighSet containeer are of the same type as a specified Object LightWeightSet
* @param obj need to determine whether to include the obj
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -69,6 +78,9 @@ declare class LightWeightSet<T> {
* Ensures that the capacity of an LightWeightSet container is greater than or equal to a apecified value,
* and that the container has all the original objects after capacity expansion
* @param minimumCapacity Minimum capacity to be reserved
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @throws {RangeError} Index out of range.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -77,6 +89,7 @@ declare class LightWeightSet<T> {
* Obtains the index of s key of a specified Object type in an LightWeightSet container
* @param key Looking for goals
* @return Subscript corresponding to target
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -85,6 +98,7 @@ declare class LightWeightSet<T> {
* Deletes an object of a specified Object type from an LightWeightSet container
* @param key Target to be deleted
* @return Target element
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -93,6 +107,8 @@ declare class LightWeightSet<T> {
* Deletes an object at the loaction identified by index from an LightWeightSet container
* @param index Target subscript for search
* @return the boolean type(Is there a delete value)
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -100,6 +116,7 @@ declare class LightWeightSet<T> {
/**
* Removes all of the mapping from this map
* The map will be empty after this call returns
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -107,6 +124,8 @@ declare class LightWeightSet<T> {
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -114,6 +133,7 @@ declare class LightWeightSet<T> {
thisArg?: Object): void;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -126,6 +146,7 @@ declare class LightWeightSet<T> {
toString(): String;
/**
* Obtains an Array that contains all the objects of an LightWeightSet container.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -134,24 +155,29 @@ declare class LightWeightSet<T> {
* Obtains the object at the location identified by index in an LightWeightSet container
* @param index Target subscript for search
* @return the value of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getValueAt(index: number): T;
/**
* Returns a ES6 iterator of the values contained in this Set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
values(): IterableIterator<T>;
/**
* Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[T, T]>;
/**
* Returns whether the set object contains elements
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class LinkedList<T> {
/**
* A constructor used to create a LinkedList object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,6 +31,7 @@ declare class LinkedList<T> {
* Appends the specified element to the end of this linkedlist.
* @param element to be appended to this linkedlist
* @returns the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -37,7 +40,9 @@ declare class LinkedList<T> {
* Inserts the specified element at the specified position in this linkedlist.
* @param index index at which the specified element is to be inserted
* @param element element to be inserted
* @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @throws {RangeError} Index out of range.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -47,6 +52,8 @@ declare class LinkedList<T> {
* or returns undefined if this linkedlist is empty
* @param index specified position
* @return the T type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -54,6 +61,7 @@ declare class LinkedList<T> {
/**
* Inserts the specified element at the beginning of this LinkedList.
* @param element the element to add
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -61,7 +69,8 @@ declare class LinkedList<T> {
/**
* Retrieves and removes the head (first element) of this linkedlist.
* @return the head of this list
* @throws NoSuchElementException if this linkedlist is empty
* @throws {ContainerBindError} Method not support bind.
* @throws {ContainerIsEmptyError} Container is Empty.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -69,16 +78,17 @@ declare class LinkedList<T> {
/**
* Removes and returns the last element from this linkedlist.
* @return the head of this list
* @throws NoSuchElementException if this linkedlist is empty
* @throws {ContainerBindError} Method not support bind.
* @throws {ContainerIsEmptyError} Container is Empty.
* @since 8
* @syscap SystemCapability.Utils.Lang
*
*/
removeLast(): T;
/**
* Check if linkedlist contains the specified element
* @param element element to be contained
* @return the boolean type,if linkedList contains the specified element,return true,else return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -88,6 +98,7 @@ declare class LinkedList<T> {
* in this linkedlist, or -1 if this linkedlist does not contain the element.
* @param element element to be contained
* @return the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -97,6 +108,9 @@ declare class LinkedList<T> {
* @param index the index in the linkedlist
* @return the T type ,returns undefined if linkedlist is empty,If the index is
* out of bounds (greater than or equal to length or less than 0), throw an exception
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @throws {RangeError} Index out of range.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -107,6 +121,7 @@ declare class LinkedList<T> {
* unchanged. More formally, removes the element with the lowest index
* @param element element to remove
* @return the boolean type ,If there is no such element, return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -117,6 +132,8 @@ declare class LinkedList<T> {
* unchanged. More formally, removes the element with the lowest index
* @param element element to remove
* @return the boolean type ,If there is no such element, return false
* @throws {ContainerBindError} Method not support bind.
* @throws {ContainerIsEmptyError} Container is Empty.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -127,6 +144,8 @@ declare class LinkedList<T> {
* unchanged. More formally, removes the element with the lowest index
* @param element element to remove
* @return the boolean type ,If there is no such element, return false
* @throws {ContainerBindError} Method not support bind.
* @throws {ContainerIsEmptyError} Container is Empty.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -136,6 +155,7 @@ declare class LinkedList<T> {
* or -1 if the linkedlist does not contain the element.
* @param element element to find
* @return the number type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -144,6 +164,7 @@ declare class LinkedList<T> {
* Returns the first element (the item at index 0) of this linkedlist.
* or returns undefined if linkedlist is empty
* @return the T type ,returns undefined if linkedList is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -152,6 +173,7 @@ declare class LinkedList<T> {
* Returns the Last element (the item at index length-1) of this linkedlist.
* or returns undefined if linkedlist is empty
* @return the T type ,returns undefined if linkedList is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -161,6 +183,9 @@ declare class LinkedList<T> {
* @param element replaced element
* @param index index to find
* @return the T type ,returns undefined if linkedList is empty
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -174,6 +199,8 @@ declare class LinkedList<T> {
* @param LinkedList (Optional) The linkedlist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -182,6 +209,7 @@ declare class LinkedList<T> {
/**
* Removes all of the elements from this linkedlist.The linkedlist will
* be empty after this call returns.length becomes 0
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -189,6 +217,7 @@ declare class LinkedList<T> {
/**
* Returns a shallow copy of this instance. (The elements themselves are not copied.)
* @return this linkedlist instance
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -196,12 +225,14 @@ declare class LinkedList<T> {
/**
* convert linkedlist to array
* @return the Array type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
convertToArray(): Array<T>;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class List<T> {
/**
* A constructor used to create a List object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,6 +31,7 @@ declare class List<T> {
* Appends the specified element to the end of this list.
* @param element to be appended to this list
* @returns the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -37,7 +40,9 @@ declare class List<T> {
* Inserts the specified element at the specified position in this list.
* @param index index at which the specified element is to be inserted
* @param element element to be inserted
* @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -47,6 +52,8 @@ declare class List<T> {
* or returns undefined if this list is empty
* @param index specified position
* @return the T type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -55,6 +62,7 @@ declare class List<T> {
* Check if list contains the specified element
* @param element element to be contained
* @return the boolean type,if list contains the specified element,return true,else return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -64,6 +72,7 @@ declare class List<T> {
* in this list, or -1 if this list does not contain the element.
* @param element element to be contained
* @return the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -73,6 +82,9 @@ declare class List<T> {
* @param index the index in the list
* @return the T type ,returns undefined if list is empty,If the index is
* out of bounds (greater than or equal to length or less than 0), throw an exception
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -83,6 +95,7 @@ declare class List<T> {
* unchanged. More formally, removes the element with the lowest index
* @param element element to remove
* @return the boolean type ,If there is no such element, return false
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -92,6 +105,7 @@ declare class List<T> {
* or -1 if the list does not contain the element.
* @param element element to find
* @return the number type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -100,6 +114,7 @@ declare class List<T> {
* Returns the first element (the item at index 0) of this list.
* or returns undefined if list is empty
* @return the T type ,returns undefined if list is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -108,6 +123,7 @@ declare class List<T> {
* Returns the Last element (the item at index length-1) of this list.
* or returns undefined if list is empty
* @return the T type ,returns undefined if list is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -117,6 +133,9 @@ declare class List<T> {
* @param element replaced element
* @param index index to find
* @return the T type
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -126,6 +145,7 @@ declare class List<T> {
* return true, otherwise return false.
* @param obj Compare objects
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -139,6 +159,8 @@ declare class List<T> {
* @param List (Optional) The list object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -152,6 +174,8 @@ declare class List<T> {
* minus firstValue, it returns an list sorted in descending order;
* @param firstValue (Optional) previous element
* @param secondValue (Optional) next elements
* @throws {TypeError} Parameter check failed.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -159,6 +183,7 @@ declare class List<T> {
/**
* Removes all of the elements from this list.The list will
* be empty after this call returns.length becomes 0
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -167,8 +192,9 @@ declare class List<T> {
* Returns a view of the portion of this list between the specified fromIndex,inclusize,and toIndex,exclusive
* @param fromIndex The starting position of the index, containing the value at that index position
* @param toIndex the end of the index, excluding the value at that index
* @throws If the fromIndex or toIndex index is out of range (greater than or equal to length or less than 0),
* or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -182,14 +208,17 @@ declare class List<T> {
* @param list (Optional) The list object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
replaceAllElements(callbackfn: (value: T, index?: number, list?: List<T>) => T,
thisArg?: Object): void;
thisArg?: Object): void;
/**
* convert list to array
* @return the Array type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -197,12 +226,14 @@ declare class List<T> {
/**
* Determine whether list is empty and whether there is an element
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
isEmpty(): boolean;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class PlainArray<T> {
/**
* A constructor used to create a PlainArray object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -29,19 +31,22 @@ declare class PlainArray<T> {
* Appends a key-value pair to PlainArray
* @param key Added the key of key-value
* @param value Added the value of key-value
* @throws Throws this exception if input is invaild
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
add(key: number, value: T): void;
/**
* Clears the current PlainArray object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
clear(): void;
/**
* Obtains a clone of the current PlainArray object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -50,6 +55,8 @@ declare class PlainArray<T> {
* Checks whether the current PlainArray object contains the specified key
* @param key need to determine whether to include the key
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -58,6 +65,8 @@ declare class PlainArray<T> {
* Queries the value associated with the specified key
* @param key Looking for goals
* @return the value of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -66,21 +75,25 @@ declare class PlainArray<T> {
* Queries the index for a specified key
* @param key Looking for goals
* @return Subscript corresponding to target
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getIndexOfKey(key: number): number;
/**
* Queries the index for a specified value
* @param value Looking for goals
* @return Subscript corresponding to target
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
* Queries the index for a specified value
* @param value Looking for goals
* @return Subscript corresponding to target
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getIndexOfValue(value: T): number;
/**
* Checks whether the current PlainArray object is empty
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -89,6 +102,8 @@ declare class PlainArray<T> {
* Queries the key at a specified index
* @param index Target subscript for search
* @return the key of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -97,6 +112,8 @@ declare class PlainArray<T> {
* Remove the key-value pair based on a specified key if it exists and return the value
* @param key Target to be deleted
* @return Target mapped value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -105,6 +122,8 @@ declare class PlainArray<T> {
* Remove the key-value pair at a specified index if it exists and return the value
* @param index Target subscript for search
* @return the T type
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -114,6 +133,9 @@ declare class PlainArray<T> {
* @param index remove start index
* @param size Expected deletion quantity
* @return Actual deleted quantity
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -122,12 +144,16 @@ declare class PlainArray<T> {
* Update value on specified index
* @param index Target subscript for search
* @param value Updated the target mapped value
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
setValueAt(index: number, value: T): void;
/**
* Obtains the string representation of the PlainArray object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -136,12 +162,17 @@ declare class PlainArray<T> {
* Queries the value at a specified index
* @param index Target subscript for search
* @return the value of key-value pairs
* @throws {ContainerBindError} Method not support bind.
* @throws {RangeError} Index out of range.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getValueAt(index: number): T;
/**
* Executes a provided function once for each value in the PlainArray object.
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -149,6 +180,7 @@ declare class PlainArray<T> {
thisArg?: Object): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class Queue<T> {
/**
* A constructor used to create a Queue object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -30,6 +32,7 @@ declare class Queue<T> {
* so immediately without violating capacity restrictions.
* @param element to be appended to this queue
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -37,7 +40,7 @@ declare class Queue<T> {
/**
* Obtains the header element of a queue.
* @return the T type
* @throws an exception if the queue is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -45,7 +48,7 @@ declare class Queue<T> {
/**
* Retrieves and removes the head of this queue
* @return the T type
* @throws an exception if the queue is empty
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -59,6 +62,8 @@ declare class Queue<T> {
* @param Queue (Optional) The queue object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -66,6 +71,7 @@ declare class Queue<T> {
thisArg?: Object): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class Stack<T> {
/**
* A constructor used to create a Stack object.
* @throws {NewTargetIsNullError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -28,6 +30,7 @@ declare class Stack<T> {
/**
* Tests if this stack is empty
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -36,6 +39,7 @@ declare class Stack<T> {
* Looks at the object at the top of this stack without removing it from the stack
* Return undfined if this stack is empty
* @return the top value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -44,6 +48,7 @@ declare class Stack<T> {
* 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 Stack top value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -52,6 +57,7 @@ declare class Stack<T> {
* Pushes an item onto the top of this stack
* @param item to be appended to this Stack
* @returns the T type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -60,6 +66,7 @@ declare class Stack<T> {
* Returns the 1-based position where an object is on this stack
* @param element Target to be deleted
* @returns the T type,If there is no such element, return -1
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -73,6 +80,8 @@ declare class Stack<T> {
* @param stack (Optional) The Stack object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -80,6 +89,7 @@ declare class Stack<T> {
thisArg?: Object): void;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,12 +12,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class TreeMap<K, V> {
/**
* A constructor used to create a TreeMap object.
* @param comparator (Optional) User-defined comparison functions
* @param firstValue (Optional) previous element
* @param secondValue (Optional) next element
* @throws {NewTargetIsNullError} Parameter check failed.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -31,6 +35,7 @@ declare class TreeMap<K, V> {
/**
* Returns whether the Map object contains elements
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -39,6 +44,7 @@ declare class TreeMap<K, V> {
* Returns whether a key is contained in this map
* @param key need to determine whether to include the key
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -47,6 +53,7 @@ declare class TreeMap<K, V> {
* Returns whether a value is contained in this map
* @param value need to determine whether to include the value
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -55,6 +62,7 @@ declare class TreeMap<K, V> {
* Returns a specified element in a Map object, or null if there is no corresponding element
* @param key the index in TreeMap
* @return value or null
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -63,6 +71,7 @@ declare class TreeMap<K, V> {
* Obtains the first sorted key in the treemap.
* Or returns undefined if tree map is empty
* @return value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -71,6 +80,7 @@ declare class TreeMap<K, V> {
* Obtains the last sorted key in the treemap.
* Or returns undefined if tree map is empty
* @return value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -78,6 +88,8 @@ declare class TreeMap<K, V> {
/**
* Adds all element groups in one map to another map
* @param map the Map object to add members
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -87,6 +99,8 @@ declare class TreeMap<K, V> {
* @param key Added or updated targets
* @param value Added or updated value
* @returns the map object after set
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -94,6 +108,7 @@ declare class TreeMap<K, V> {
/**
* Remove a specified element from a Map object
* @param key Target to be deleted
* @throws {ContainerBindError} Method not support bind.
* @return Target mapped value
* @since 8
* @syscap SystemCapability.Utils.Lang
@ -101,6 +116,7 @@ declare class TreeMap<K, V> {
remove(key: K): V;
/**
* Clear all element groups in the map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -109,6 +125,7 @@ declare class TreeMap<K, V> {
* Returns the greatest element smaller than or equal to the specified key
* if the key does not exist, undefied is returned
* @param key Objective of comparison
* @throws {ContainerBindError} Method not support bind.
* @return key or undefined
* @since 8
* @syscap SystemCapability.Utils.Lang
@ -119,18 +136,21 @@ declare class TreeMap<K, V> {
* if the key does not exist, undefied is returned
* @param key Objective of comparison
* @return key or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
getHigherKey(key: K): K;
/**
* Returns a new Iterator object that contains the keys contained in this map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
keys(): IterableIterator<K>;
/**
* Returns a new Iterator object that contains the values contained in this map
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -140,6 +160,7 @@ declare class TreeMap<K, V> {
* @param key Updated targets
* @param value Updated the target mapped value
* @returns the boolean type(Is there a target pointed to by the key)
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -147,6 +168,8 @@ declare class TreeMap<K, V> {
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -154,12 +177,14 @@ declare class TreeMap<K, V> {
thisArg?: Object): void;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[K, V]>;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,12 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare class TreeSet<T> {
/**
* A constructor used to create a TreeSet object.
* @param comparator (Optional) User-defined comparison functions
* @param firstValue (Optional) previous element
* @param secondValue (Optional) next element
* @throws {NewTargetIsNullError} Parameter check failed.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -31,6 +34,7 @@ declare class TreeSet<T> {
/**
* Returns whether the Set object contains elements
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -39,6 +43,7 @@ declare class TreeSet<T> {
* Returns whether the Set object contain s the elements
* @param value need to determine whether to include the element
* @return the boolean type
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -47,6 +52,8 @@ declare class TreeSet<T> {
* If the set does not contain the element, the specified element is added
* @param value Added element
* @returns the boolean type(Is there contain this element)
* @throws {TypeError} Parameter check failed.
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -55,12 +62,14 @@ declare class TreeSet<T> {
* Remove a specified element from a Set object
* @param value Target to be deleted
* @return the boolean type(Is there contain this element)
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
remove(value: T): boolean;
/**
* Clears all element groups in a set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -68,6 +77,7 @@ declare class TreeSet<T> {
/**
* Gets the first elements in a set
* @return value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -75,6 +85,7 @@ declare class TreeSet<T> {
/**
* Gets the last elements in a set
* @return value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -84,6 +95,8 @@ declare class TreeSet<T> {
* if the key does not exist, undefied is returned
* @param key Objective of comparison
* @return key or undefined
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -93,6 +106,8 @@ declare class TreeSet<T> {
* if the key does not exist, undefied is returned
* @param key Objective of comparison
* @return key or undefined
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -100,6 +115,7 @@ declare class TreeSet<T> {
/**
* Return and delete the first element, returns undefined if tree set is empty
* @return first value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -107,12 +123,15 @@ declare class TreeSet<T> {
/**
* Return and delete the last element, returns undefined if tree set is empty
* @return last value or undefined
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
popLast(): T;
/**
* Executes a provided function once for each value in the Set object.
* @throws {ContainerBindError} Method not support bind.
* @throws {TypeError} Parameter check failed.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@ -120,18 +139,21 @@ declare class TreeSet<T> {
thisArg?: Object): void;
/**
* Returns a new Iterator object that contains the values contained in this set
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
values(): IterableIterator<T>;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[T, T]>;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
* @throws {ContainerBindError} Method not support bind.
* @since 8
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @deprecated since 9
declare class Vector<T> {
/**
* A constructor used to create a Vector object.