!12007 Support collections.Array's splice

Merge pull request !12007 from hzzhouzebin/splice
This commit is contained in:
openharmony_ci 2024-06-19 04:19:05 +00:00 committed by Gitee
commit 95cbbaf83c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -636,6 +636,39 @@ declare namespace collections {
* @since 12
*/
concat(...items: ConcatArray<T>[]): Array<T>;
/**
* Removes elements from the array at the specified position.
*
* @param { number } start - The zero-based index at which to start changing the contents of the array.
* All the elements from start to the end of the array will be deleted.
* @returns { Array<T> } An array containing the deleted elements.
* @throws { BusinessError } 401 - Parameter error.Possible causes:
* 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The splice method cannot be bound.
* @throws { BusinessError } 10200201 - Concurrent modification error.
* @syscap SystemCapability.Utils.Lang
* @since 12
*/
splice(start: number): Array<T>;
/**
* Removes elements from the array and, if necessary, inserts new elements at the specified position.
*
* @param { number } start - The zero-based index at which to start changing the contents of the array.
* @param { number } deleteCount - The number of elements to remove from the array,
* starting at the index specified by the start parameter.
* @param { T[] } items - An array of elements to insert into the array,
* starting at the index specified by the start parameter.
* @returns { Array<T> } An array containing the deleted elements.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The splice method cannot be bound.
* @throws { BusinessError } 10200201 - Concurrent modification error.
* @syscap SystemCapability.Utils.Lang
* @since 12
*/
splice(start: number, deleteCount: number, ...items: T[]): Array<T>;
}
/**