diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 1627e06e8ecab0f4b9adc718e136057defdc8b25..d3cca26d7e5b217d7fec342a2fe6e1332c1b0b88 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -3551,30 +3551,20 @@ declare namespace buffer { writeUIntLE(value: number, offset: number, byteLength: number): number; /** - * Returns the byte at the specified index. + * Returns the item at that index. * - * @param { number } index - byte index to read - * @returns { number | undefined } Returns the byte value at `index` + * @param { number } index - The zero-based index of the desired code unit. + * Throws error if index < 0 or index >= buffer.length. + * @returns { number } The element in the buffer matching the given index. + * @throws { BusinessError } 10200001 - The value of index is out of range. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - $_get(index: number): number | undefined; + [index: number]: number; - /** - * Sets the byte at the specified index. - * - * @param { number } index – byte index to write - * @param { number } value – byte value (0–255) - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - $_set(index: number, value: number): void; } /** diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index 55f957b50b620dc25299198c6f53b6d1a5c588c5..23618e27f5b3ff755c5ca3bdc132e2855bcb8970 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -800,37 +800,13 @@ declare class ArrayList { * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 10200001 - The value of index is out of range. * @syscap SystemCapability.Utils.Lang + * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ [index: number]: T; - /** - * Returns the item at that index. - * - * @param { number } index - The zero-based index of the desired code unit. - * @returns { T } The element in the arrayList matching the given index. - * @throws { BusinessError } 10200001 - The value of index is out of range. - * @syscap SystemCapability.Utils.Lang - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - $_get(index: number): T; - - /** - * Set the value of item at that index. - * - * @param { number } index - The index of the element to set. - * @param { T } value - The value to set at the specified index. - * @throws { BusinessError } 10200001 - The value of index is out of range. - * @syscap SystemCapability.Utils.Lang - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - $_set(index: number, value: T): void; - /** * 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 diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index 73f2f662e3e75fece772966d2acfe7056bf6af27..ddf7fcb85cf663b117e28d3067d3421d3bac51d9 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -427,31 +427,21 @@ declare class Deque { * @arkts 1.2 */ forEach(callbackFn: DequeForEachCb): void; - /** - * Returns the byte at the specified index. - * - * @param { number } index - The zero-based index of the desired code unit. - * @returns { T } The element in the deque matching the given index. - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - $_get(index: number): T; - /** - * Sets the byte at the specified index. - * - * @param { number } index – The index of the element to set. - * @param { T } value – The value to set at the specified index. + /** + * Returns the item at that index. + * + * @param { number } index - The zero-based index of the desired code unit. + * Throws error if index < 0 or index >= deque.length. + * @returns { T } The element in the deque matching the given index. + * @throws { BusinessError } 10200001 - The value of index is out of range. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - $_set(index: number, value: T): void; + [index: number]: T; /** * returns an iterator.Each item of the iterator is a Javascript Object diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index 405a412252cbb04e256a5274e86c9b5af6a78f0a..d462a06f10171a6f87249e5b195ddd4cc474340e 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -925,32 +925,22 @@ declare class List { * @arkts 1.1&1.2 */ isEmpty(): boolean; - /** - * Returns the item at that index - * - * @param { number } index - the zero-based index of the desired code unit. - * @returns { T | undefined } the element in the list matching the given index, - * or undefined if the index is out of range. - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - $_get(index: number): T | undefined; /** - * Set the value of item at that index. - * - * @param { number } index – the index of the element to set. - * @param { T } value – the value to set at the specified index + * Returns the item at that index. + * + * @param { number } index - The zero-based index of the desired code unit. + * Throws error if index < 0 or index >= list.length. + * @returns { T } The element in the list matching the given index. + * @throws { BusinessError } 10200001 - The value of index is out of range. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - $_set(index: number, value: T): void; + [index: number]: T; + /** * returns an iterator.Each item of the iterator is a Javascript Object * diff --git a/arkts/@arkts.collections.d.ets b/arkts/@arkts.collections.d.ets index f8127b775b4e2473e7f75e8417409d4f3245723d..11b52769f0892af7d013325a4ca4c1a0607109a7 100644 --- a/arkts/@arkts.collections.d.ets +++ b/arkts/@arkts.collections.d.ets @@ -11971,30 +11971,22 @@ declare namespace collections { * @arkts 1.2 */ values(): IterableIterator; + /** * Returns the item at that index. * * @param { number } index - The zero-based index of the desired code unit. - * @returns { number } The element in the bitVector matching the given index. + * Throws error if index < 0 or index >= bitVector.length. + * @returns { number } The element in the bitVector matching the given index. + * @throws { BusinessError } 10200001 - The value of index is out of range. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - $_get(index: number): number; - /** - * Set the value of item at that index. - * - * @param { number } index - The index of the element to set. - * @param { number } value - The value to set at the specified index. - * @syscap SystemCapability.Utils.Lang - * @atomicservice - * @crossplatform - * @since 20 - * @arkts 1.2 - */ - $_set(index: number, value: number): void; + [index: number]: number; + } /**