1 Star 0 Fork 3.9K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.util.List.d.ts 34.40 KB
一键复制 编辑 原始数据 按行查看 历史
suchongwei 提交于 2024-08-04 15:27 +08:00 . commonlibrary api doc add @type and @typedef 
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkTS
*/
/**
* List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
* When querying an element, the system traverses the list from the beginning.
*
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
* When querying an element, the system traverses the list from the beginning.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
* When querying an element, the system traverses the list from the beginning.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
declare class List<T> {
/**
* A constructor used to create a List object.
*
* @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* A constructor used to create a List object.
*
* @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* A constructor used to create a List object.
*
* @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
constructor();
/**
* Gets the element number of the List. This is a number one higher than the highest index in the list.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Gets the element number of the List. This is a number one higher than the highest index in the list.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Gets the element number of the List. This is a number one higher than the highest index in the list.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
length: number;
/**
* Appends the specified element to the end of this list.
*
* @param { T } element - element element to be appended to this list
* @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws { BusinessError } 10200011 - The add method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Appends the specified element to the end of this list.
*
* @param { T } element - element element to be appended to this list
* @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws { BusinessError } 10200011 - The add method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Appends the specified element to the end of this list.
*
* @param { T } element - element element to be appended to this list
* @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
* @throws { BusinessError } 10200011 - The add method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
add(element: T): boolean;
/**
* Inserts the specified element at the specified position in this list.
*
* @param { T } element - element element element to be inserted
* @param { number } index - index index index at which the specified element is to be inserted
* @throws { BusinessError } 10200011 - The insert method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Inserts the specified element at the specified position in this list.
*
* @param { T } element - element element element to be inserted
* @param { number } index - index index index at which the specified element is to be inserted
* @throws { BusinessError } 10200011 - The insert method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Inserts the specified element at the specified position in this list.
*
* @param { T } element - element element element to be inserted
* @param { number } index - index index index at which the specified element is to be inserted
* @throws { BusinessError } 10200011 - The insert method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
insert(element: T, index: number): void;
/**
* Returns the element at the specified position in this list,
* or returns undefined if this list is empty
*
* @param { number } index - index index specified position
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the element at the specified position in this list,
* or returns undefined if this list is empty
*
* @param { number } index - index index specified position
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the element at the specified position in this list,
* or returns undefined if this list is empty
*
* @param { number } index - index index specified position
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
get(index: number): T;
/**
* Check if list contains the specified element
*
* @param { T } element - element element element to be contained
* @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
* @throws { BusinessError } 10200011 - The has method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Check if list contains the specified element
*
* @param { T } element - element element element to be contained
* @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
* @throws { BusinessError } 10200011 - The has method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Check if list contains the specified element
*
* @param { T } element - element element element to be contained
* @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
* @throws { BusinessError } 10200011 - The has method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
has(element: T): boolean;
/**
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
*
* @param { T } element - element element element to be contained
* @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
*
* @param { T } element - element element element to be contained
* @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
*
* @param { T } element - element element element to be contained
* @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
* @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getIndexOf(element: T): number;
/**
* Find the corresponding element according to the index.
*
* @param { number } index - index index the index in the list
* @returns { T } 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 { BusinessError } 10200011 - The removeByIndex method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Find the corresponding element according to the index.
*
* @param { number } index - index index the index in the list
* @returns { T } 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 { BusinessError } 10200011 - The removeByIndex method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Find the corresponding element according to the index.
*
* @param { number } index - index index the index in the list
* @returns { T } 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 { BusinessError } 10200011 - The removeByIndex method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
removeByIndex(index: number): T;
/**
* Removes the first occurrence of the specified element from this list,
* if it is present. If the list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
*
* @param { T } element - element element element to remove
* @returns { boolean } the boolean type ,If there is no such element, return false
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Removes the first occurrence of the specified element from this list,
* if it is present. If the list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
*
* @param { T } element - element element element to remove
* @returns { boolean } the boolean type ,If there is no such element, return false
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Removes the first occurrence of the specified element from this list,
* if it is present. If the list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
*
* @param { T } element - element element element to remove
* @returns { boolean } the boolean type ,If there is no such element, return false
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
remove(element: T): boolean;
/**
* Returns in the index of the last occurrence of the specified element in this list ,
* or -1 if the list does not contain the element.
*
* @param { T } element - element element element to find
* @returns { number } the number type
* @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns in the index of the last occurrence of the specified element in this list ,
* or -1 if the list does not contain the element.
*
* @param { T } element - element element element to find
* @returns { number } the number type
* @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns in the index of the last occurrence of the specified element in this list ,
* or -1 if the list does not contain the element.
*
* @param { T } element - element element element to find
* @returns { number } the number type
* @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getLastIndexOf(element: T): number;
/**
* Returns the first element (the item at index 0) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the first element (the item at index 0) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the first element (the item at index 0) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getFirst(): T;
/**
* Returns the Last element (the item at index length-1) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getLast method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the Last element (the item at index length-1) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getLast method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the Last element (the item at index length-1) of this list.
* or returns undefined if list is empty
*
* @returns { T } the T type ,returns undefined if list is empty
* @throws { BusinessError } 10200011 - The getLast method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getLast(): T;
/**
* Replaces the element at the specified position in this List with the specified element
*
* @param { number } index - index index index to find
* @param { T } element - element element replaced element
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Replaces the element at the specified position in this List with the specified element
*
* @param { number } index - index index index to find
* @param { T } element - element element replaced element
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Replaces the element at the specified position in this List with the specified element
*
* @param { number } index - index index index to find
* @param { T } element - element element replaced element
* @returns { T } the T type
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
set(index: number, 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.
*
* @param { Object } obj - obj obj Compare objects
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The equal method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Compares the specified object with this list for equality.if the object are the same as this list
* return true, otherwise return false.
*
* @param { Object } obj - obj obj Compare objects
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The equal method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Compares the specified object with this list for equality.if the object are the same as this list
* return true, otherwise return false.
*
* @param { Object } obj - obj obj Compare objects
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The equal method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
equal(obj: Object): boolean;
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
forEach(callbackFn: (value: T, index?: number, List?: List<T>) => void, thisArg?: Object): void;
/**
* Sorts this list according to the order induced by the specified comparator
*
* @param { function } comparator - comparator
* comparator (required) A function that accepts up to two arguments.
* Specifies the sort order. Must be a function,return number type,If it returns firstValue
* minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
* minus firstValue, it returns an list sorted in descending order;
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The sort method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Sorts this list according to the order induced by the specified comparator
*
* @param { function } comparator - comparator
* comparator (required) A function that accepts up to two arguments.
* Specifies the sort order. Must be a function,return number type,If it returns firstValue
* minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
* minus firstValue, it returns an list sorted in descending order;
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The sort method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Sorts this list according to the order induced by the specified comparator
*
* @param { function } comparator - comparator
* comparator (required) A function that accepts up to two arguments.
* Specifies the sort order. Must be a function,return number type,If it returns firstValue
* minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
* minus firstValue, it returns an list sorted in descending order;
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The sort method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
sort(comparator: (firstValue: T, secondValue: T) => number): void;
/**
* Removes all of the elements from this list.The list will
* be empty after this call returns.length becomes 0
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Removes all of the elements from this list.The list will
* be empty after this call returns.length becomes 0
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Removes all of the elements from this list.The list will
* be empty after this call returns.length becomes 0
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
clear(): void;
/**
* Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
*
* @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
* @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
* @returns { List<T> }
* @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
* @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
*
* @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
* @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
* @returns { List<T> }
* @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
* @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
*
* @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
* @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
* @returns { List<T> }
* @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
* @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getSubList(fromIndex: number, toIndex: number): List<T>;
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Replaces each element of this list with the result of applying the operator to that element.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
replaceAllElements(callbackFn: (value: T, index?: number, list?: List<T>) => T, thisArg?: Object): void;
/**
* convert list to array
*
* @returns { Array<T> } the Array type
* @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* convert list to array
*
* @returns { Array<T> } the Array type
* @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* convert list to array
*
* @returns { Array<T> } the Array type
* @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
convertToArray(): Array<T>;
/**
* Determine whether list is empty and whether there is an element
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Determine whether list is empty and whether there is an element
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Determine whether list is empty and whether there is an element
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
isEmpty(): boolean;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<T> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* returns an iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<T> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* returns an iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<T> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
[Symbol.iterator](): IterableIterator<T>;
}
export default List;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助