1/* 2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file Defines the collections for ArkTS 18 * @kit ArkTS 19 */ 20 21import lang from './@arkts.lang' 22 23/** 24 * ArkTS collections. 25 * 26 * @namespace collections 27 * @syscap SystemCapability.Utils.Lang 28 * @atomicservice 29 * @since 12 30 */ 31/** 32 * ArkTS collections. 33 * 34 * @namespace collections 35 * @syscap SystemCapability.Utils.Lang 36 * @crossplatform 37 * @atomicservice 38 * @since 18 39 */ 40declare namespace collections { 41 /** 42 * Callback function used in the typed Array's 'from' function. 43 * 44 * @typedef { function } TypedArrayFromMapFn 45 * @param { FromElementType } value - The value in the original array. 46 * @param { number } index - The index in the original array. 47 * @returns { ToElementType } The transformed value. 48 * @syscap SystemCapability.Utils.Lang 49 * @atomicservice 50 * @since 12 51 */ 52 /** 53 * Callback function used in the typed Array's 'from' function. 54 * 55 * @typedef { function } TypedArrayFromMapFn 56 * @param { FromElementType } value - The value in the original array. 57 * @param { number } index - The index in the original array. 58 * @returns { ToElementType } The transformed value. 59 * @syscap SystemCapability.Utils.Lang 60 * @crossplatform 61 * @atomicservice 62 * @since 18 63 */ 64 type TypedArrayFromMapFn<FromElementType, ToElementType> = (value: FromElementType, index: number) => ToElementType; 65 /** 66 * Callback function used in typed Array functions which needs to determine 67 * whether some element satisfies the specified predicate test 68 * 69 * @typedef { function } TypedArrayPredicateFn 70 * @param { ElementType } value - The value of the element. 71 * @param { number } index - The index of the element. 72 * @param { ArrayType } array - The array that the element belongs to. 73 * @returns { boolean } True if the value meets the predicate, otherwise false. 74 * @syscap SystemCapability.Utils.Lang 75 * @atomicservice 76 * @since 12 77 */ 78 /** 79 * Callback function used in typed Array functions which needs to determine 80 * whether some element satisfies the specified predicate test 81 * 82 * @typedef { function } TypedArrayPredicateFn 83 * @param { ElementType } value - The value of the element. 84 * @param { number } index - The index of the element. 85 * @param { ArrayType } array - The array that the element belongs to. 86 * @returns { boolean } True if the value meets the predicate, otherwise false. 87 * @syscap SystemCapability.Utils.Lang 88 * @crossplatform 89 * @atomicservice 90 * @since 18 91 */ 92 type TypedArrayPredicateFn<ElementType, ArrayType> = 93 (value: ElementType, index: number, array: ArrayType) => boolean; 94 /** 95 * Callback function used in typed Array functions that perform specific action for each element. 96 * 97 * @typedef { function } TypedArrayForEachCallback 98 * @param { ElementType } value - The value of the element. 99 * @param { number } index - The index of the element. 100 * @param { ArrayType } array - The array that the element belongs to. 101 * @syscap SystemCapability.Utils.Lang 102 * @atomicservice 103 * @since 12 104 */ 105 /** 106 * Callback function used in typed Array functions that perform specific action for each element. 107 * 108 * @typedef { function } TypedArrayForEachCallback 109 * @param { ElementType } value - The value of the element. 110 * @param { number } index - The index of the element. 111 * @param { ArrayType } array - The array that the element belongs to. 112 * @syscap SystemCapability.Utils.Lang 113 * @crossplatform 114 * @atomicservice 115 * @since 18 116 */ 117 type TypedArrayForEachCallback<ElementType, ArrayType> = 118 (value: ElementType, index: number, array: ArrayType) => void; 119 /** 120 * Callback function used in typed Array functions that perform specific action for each element and 121 * produce corresponding new element. 122 * 123 * @typedef { function } TypedArrayMapCallback 124 * @param { ElementType } value - The value of the element. 125 * @param { number } index - The index of the element. 126 * @param { ArrayType } array - The array that the element belongs to. 127 * @returns { ElementType } The result of the mapping. 128 * @syscap SystemCapability.Utils.Lang 129 * @atomicservice 130 * @since 12 131 */ 132 /** 133 * Callback function used in typed Array functions that perform specific action for each element and 134 * produce corresponding new element. 135 * 136 * @typedef { function } TypedArrayMapCallback 137 * @param { ElementType } value - The value of the element. 138 * @param { number } index - The index of the element. 139 * @param { ArrayType } array - The array that the element belongs to. 140 * @returns { ElementType } The result of the mapping. 141 * @syscap SystemCapability.Utils.Lang 142 * @crossplatform 143 * @atomicservice 144 * @since 18 145 */ 146 type TypedArrayMapCallback<ElementType, ArrayType> = 147 (value: ElementType, index: number, array: ArrayType) => ElementType; 148 /** 149 * Callback function used in typed Array functions that require a reduction. 150 * 151 * @typedef { function } TypedArrayReduceCallback 152 * @param { AccType } previousValue - The accumulator value. 153 * @param { ElementType } currentValue - The current element being processed in the array. 154 * @param { number } currentIndex - The index of the current element being processed in the array. 155 * @param { ArrayType } array - The array that the element belongs to. 156 * @returns { AccType } The result of the reduction. 157 * @syscap SystemCapability.Utils.Lang 158 * @atomicservice 159 * @since 12 160 */ 161 /** 162 * Callback function used in typed Array functions that require a reduction. 163 * 164 * @typedef { function } TypedArrayReduceCallback 165 * @param { AccType } previousValue - The accumulator value. 166 * @param { ElementType } currentValue - The current element being processed in the array. 167 * @param { number } currentIndex - The index of the current element being processed in the array. 168 * @param { ArrayType } array - The array that the element belongs to. 169 * @returns { AccType } The result of the reduction. 170 * @syscap SystemCapability.Utils.Lang 171 * @crossplatform 172 * @atomicservice 173 * @since 18 174 */ 175 type TypedArrayReduceCallback<AccType, ElementType, ArrayType> = 176 (previousValue: AccType, currentValue: ElementType, currentIndex: number, array: ArrayType) => AccType; 177 /** 178 * Callback function used in the typed Array's 'sort' function. 179 * 180 * @typedef { function } TypedArrayCompareFn 181 * @param { ElementType } first - The first element of the comparison. 182 * @param { ElementType } second - The second element of the comparison. 183 * @returns { number } The result of the comparison. 184 * @syscap SystemCapability.Utils.Lang 185 * @atomicservice 186 * @since 12 187 */ 188 /** 189 * Callback function used in the typed Array's 'sort' function. 190 * 191 * @typedef { function } TypedArrayCompareFn 192 * @param { ElementType } first - The first element of the comparison. 193 * @param { ElementType } second - The second element of the comparison. 194 * @returns { number } The result of the comparison. 195 * @syscap SystemCapability.Utils.Lang 196 * @crossplatform 197 * @atomicservice 198 * @since 18 199 */ 200 type TypedArrayCompareFn<ElementType> = (first: ElementType, second: ElementType) => number; 201 /** 202 * Callback function used in the Array's 'from' function. 203 * 204 * @typedef { function } ArrayFromMapFn 205 * @param { FromElementType } value - The value in the original array. 206 * @param { number } index - The index in the original array. 207 * @returns { ToElementType } The transformed value. 208 * @syscap SystemCapability.Utils.Lang 209 * @atomicservice 210 * @since 18 211 */ 212 type ArrayFromMapFn<FromElementType, ToElementType> = (value: FromElementType, index: number) => ToElementType; 213 214 /** 215 * Callback function used in Array functions which needs to determine 216 * whether some element satisfies the specified predicate test 217 * 218 * @typedef { function } ArrayPredicateFn 219 * @param { ElementType } value - The value of the element. 220 * @param { number } index - The index of the element. 221 * @param { ArrayType } array - The array that the element belongs to. 222 * @returns { boolean } True if the value meets the predicate, otherwise false. 223 * @syscap SystemCapability.Utils.Lang 224 * @atomicservice 225 * @since 18 226 */ 227 type ArrayPredicateFn<ElementType, ArrayType> = 228 (value: ElementType, index: number, array: ArrayType) => boolean; 229 230 /** 231 * Callback function used in Array functions that require a reduction. 232 * 233 * @typedef { function } ArrayReduceCallback 234 * @param { AccType } previousValue - The accumulator value. 235 * @param { ElementType } currentValue - The current element being processed in the array. 236 * @param { number } currentIndex - The index of the current element being processed in the array. 237 * @param { ArrayType } array - The array that the element belongs to. 238 * @returns { AccType } The result of the reduction. 239 * @syscap SystemCapability.Utils.Lang 240 * @atomicservice 241 * @since 18 242 */ 243 type ArrayReduceCallback<AccType, ElementType, ArrayType> = 244 (previousValue: AccType, currentValue: ElementType, currentIndex: number, array: ArrayType) => AccType; 245 /** 246 * Redefines ISendable for convenience. 247 * 248 * @typedef { lang.ISendable } ISendable 249 * @syscap SystemCapability.Utils.Lang 250 * @atomicservice 251 * @since 12 252 */ 253 /** 254 * Redefines ISendable for convenience. 255 * 256 * @typedef { lang.ISendable } ISendable 257 * @syscap SystemCapability.Utils.Lang 258 * @crossplatform 259 * @atomicservice 260 * @since 18 261 */ 262 type ISendable = lang.ISendable; 263 /** 264 * Represents an array-like object that can be concatenated. 265 * 266 * @interface ConcatArray 267 * @extends ISendable 268 * @syscap SystemCapability.Utils.Lang 269 * @atomicservice 270 * @since 12 271 */ 272 /** 273 * Represents an array-like object that can be concatenated. 274 * 275 * @interface ConcatArray 276 * @extends ISendable 277 * @syscap SystemCapability.Utils.Lang 278 * @crossplatform 279 * @atomicservice 280 * @since 18 281 */ 282 interface ConcatArray<T> extends ISendable { 283 /** 284 * Gets the length of the ArkTS ConcatArray. This is a number one higher than the highest index in the array. 285 * 286 * @type { number } 287 * @readonly 288 * @syscap SystemCapability.Utils.Lang 289 * @atomicservice 290 * @since 12 291 */ 292 /** 293 * Gets the length of the ArkTS ConcatArray. This is a number one higher than the highest index in the array. 294 * 295 * @type { number } 296 * @readonly 297 * @syscap SystemCapability.Utils.Lang 298 * @crossplatform 299 * @atomicservice 300 * @since 18 301 */ 302 readonly length: number; 303 /** 304 * Returns the item at that index. 305 * 306 * @param { number } index - The zero-based index of the desired code unit. 307 * Throws error if index < 0 or index >= array.length. 308 * @returns { T } The element in the ConcatArray matching the given index. 309 * @readonly 310 * @throws { BusinessError } 401 - Parameter error. Illegal index. 311 * @throws { BusinessError } 10200001 - The value of index is out of range. 312 * @syscap SystemCapability.Utils.Lang 313 * @since 12 314 */ 315 /** 316 * Returns the item at that index. 317 * 318 * @param { number } index - The zero-based index of the desired code unit. 319 * Throws error if index < 0 or index >= array.length. 320 * @returns { T } The element in the ConcatArray matching the given index. 321 * @readonly 322 * @throws { BusinessError } 401 - Parameter error. Illegal index. 323 * @throws { BusinessError } 10200001 - The value of index is out of range. 324 * @syscap SystemCapability.Utils.Lang 325 * @crossplatform 326 * @since 18 327 */ 328 readonly [index: number]: T; 329 /** 330 * Adds all the elements of an ArkTS ConcatArray into a string, separated by the specified separator string. 331 * 332 * @param { string } [separator] - A string used to separate one element of the array from 333 * the next in the resulting string. If omitted, the array elements are separated with a comma. 334 * @returns { string } A string with all array elements joined. 335 * If ConcatArray.length is 0, the empty string is returned. 336 * @throws { BusinessError } 401 - Parameter error. Invalid separator. 337 * @syscap SystemCapability.Utils.Lang 338 * @atomicservice 339 * @since 12 340 */ 341 /** 342 * Adds all the elements of an ArkTS ConcatArray into a string, separated by the specified separator string. 343 * 344 * @param { string } [separator] - A string used to separate one element of the array from 345 * the next in the resulting string. If omitted, the array elements are separated with a comma. 346 * @returns { string } A string with all array elements joined. 347 * If ConcatArray.length is 0, the empty string is returned. 348 * @throws { BusinessError } 401 - Parameter error. Invalid separator. 349 * @syscap SystemCapability.Utils.Lang 350 * @crossplatform 351 * @atomicservice 352 * @since 18 353 */ 354 join(separator?: string): string; 355 /** 356 * Returns a copy of a section of an ArkTS ConcatArray. 357 * 358 * @param { number } [start] - The beginning index of the specified portion of the array. 359 * If start is undefined, then the slice begins at index 0. 360 * @param { number } [end] - The end index of the specified portion of the array. 361 * This is exclusive of the element at the index 'end'. 362 * If end is undefined, then the slice extends to the end of the array. 363 * @returns { ConcatArray<T> } A new ConcatArray containing the extracted elements. 364 * @throws { BusinessError } 401 - Parameter error. Invalid `start` or `end` parameters. 365 * @syscap SystemCapability.Utils.Lang 366 * @atomicservice 367 * @since 12 368 */ 369 /** 370 * Returns a copy of a section of an ArkTS ConcatArray. 371 * 372 * @param { number } [start] - The beginning index of the specified portion of the array. 373 * If start is undefined, then the slice begins at index 0. 374 * @param { number } [end] - The end index of the specified portion of the array. 375 * This is exclusive of the element at the index 'end'. 376 * If end is undefined, then the slice extends to the end of the array. 377 * @returns { ConcatArray<T> } A new ConcatArray containing the extracted elements. 378 * @throws { BusinessError } 401 - Parameter error. Invalid `start` or `end` parameters. 379 * @syscap SystemCapability.Utils.Lang 380 * @crossplatform 381 * @atomicservice 382 * @since 18 383 */ 384 slice(start?: number, end?: number): ConcatArray<T>; 385 } 386 /** 387 * Array is a data structure that stores a collection of elements. 388 * If multiple threads access a Array instance concurrently, 389 * and at least one of the threads modifies the array structurally, 390 * it must be synchronized externally. 391 * 392 * @implements ConcatArray<T> 393 * @syscap SystemCapability.Utils.Lang 394 * @atomicservice 395 * @since 12 396 */ 397 /** 398 * Array is a data structure that stores a collection of elements. 399 * If multiple threads access a Array instance concurrently, 400 * and at least one of the threads modifies the array structurally, 401 * it must be synchronized externally. 402 * 403 * @implements ConcatArray<T> 404 * @syscap SystemCapability.Utils.Lang 405 * @crossplatform 406 * @atomicservice 407 * @since 18 408 */ 409 @Sendable 410 class Array<T> implements ConcatArray<T> { 411 /** 412 * Gets the length of the ArkTS array. This is a number one higher than the highest index in the ArkTS array. 413 * 414 * @type { number } 415 * @readonly 416 * @syscap SystemCapability.Utils.Lang 417 * @atomicservice 418 * @since 12 419 */ 420 /** 421 * Gets the length of the ArkTS array. This is a number one higher than the highest index in the ArkTS array. 422 * 423 * @type { number } 424 * @readonly 425 * @syscap SystemCapability.Utils.Lang 426 * @crossplatform 427 * @atomicservice 428 * @since 18 429 */ 430 readonly length: number; 431 /** 432 * Creates an ArkTS Array with arrayLength elements initialized to initialValue. 433 * 434 * @param { number } arrayLength - The length of the array. 435 * @param { T } initialValue - Element initial value that will be filled into the Array. 436 * @returns { Array<T> } A new Array instance 437 * @throws { BusinessError } 401 - Parameter error. 438 * @throws { BusinessError } 10200011 - The create method cannot be bound. 439 * @syscap SystemCapability.Utils.Lang 440 * @atomicservice 441 * @since 12 442 */ 443 /** 444 * Creates an ArkTS Array with arrayLength elements initialized to initialValue. 445 * 446 * @param { number } arrayLength - The length of the array. 447 * @param { T } initialValue - Element initial value that will be filled into the Array. 448 * @returns { Array<T> } A new Array instance 449 * @throws { BusinessError } 401 - Parameter error. 450 * @throws { BusinessError } 10200011 - The create method cannot be bound. 451 * @syscap SystemCapability.Utils.Lang 452 * @crossplatform 453 * @atomicservice 454 * @since 18 455 */ 456 static create<T>(arrayLength: number, initialValue: T): Array<T>; 457 /** 458 * Creates an ArkTS Array from an array-like object. 459 * 460 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an ArkTS Array. 461 * @returns { Array<T> } A new Array instance 462 * @throws { BusinessError } 401 - Parameter error. 463 * @throws { BusinessError } 10200011 - The from method cannot be bound. 464 * @static 465 * @syscap SystemCapability.Utils.Lang 466 * @atomicservice 467 * @since 12 468 */ 469 /** 470 * Creates an ArkTS Array from an array-like object. 471 * 472 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an ArkTS Array. 473 * @returns { Array<T> } A new Array instance 474 * @throws { BusinessError } 401 - Parameter error. 475 * @throws { BusinessError } 10200011 - The from method cannot be bound. 476 * @static 477 * @syscap SystemCapability.Utils.Lang 478 * @crossplatform 479 * @atomicservice 480 * @since 18 481 */ 482 static from<T>(arrayLike: ArrayLike<T>): Array<T>; 483 /** 484 * Creates an ArkTS Array from an iterable object. 485 * 486 * @param { Iterable<T> } iterable - An iterable object to convert to an ArkTS Array. 487 * @returns { Array<T> } A new Array instance 488 * @throws { BusinessError } 401 - Parameter error. 489 * @throws { BusinessError } 10200011 - The from method cannot be bound. 490 * @static 491 * @syscap SystemCapability.Utils.Lang 492 * @atomicservice 493 * @since 12 494 */ 495 /** 496 * Creates an ArkTS Array from an iterable object. 497 * 498 * @param { Iterable<T> } iterable - An iterable object to convert to an ArkTS Array. 499 * @returns { Array<T> } A new Array instance 500 * @throws { BusinessError } 401 - Parameter error. 501 * @throws { BusinessError } 10200011 - The from method cannot be bound. 502 * @static 503 * @syscap SystemCapability.Utils.Lang 504 * @crossplatform 505 * @atomicservice 506 * @since 18 507 */ 508 static from<T>(iterable: Iterable<T>): Array<T>; 509 /** 510 * Creates an ArkTS Array from an array-like object. 511 * 512 * @param { ArrayLike<T> | Iterable<T> } arrayLike - An object to convert to an ArkTS Array. 513 * @param { ArrayFromMapFn<T, T> } mapFn - A mapping function to call on every element of the array. 514 * @returns { Array<T> } A new Array instance 515 * @throws { BusinessError } 401 - Parameter error. 516 * @throws { BusinessError } 10200011 - The from method cannot be bound. 517 * @static 518 * @syscap SystemCapability.Utils.Lang 519 * @atomicservice 520 * @since 18 521 */ 522 static from<T>(arrayLike: ArrayLike<T> | Iterable<T>, mapFn: ArrayFromMapFn<T, T>): Array<T>; 523 /** 524 * Creates an ArkTS Array from an array-like object. 525 * 526 * @param { ArrayLike<U> | Iterable<U> } arrayLike - An object to convert to an ArkTS Array. 527 * @param { ArrayFromMapFn<U, T> } mapFn - A mapping function to call on every element of the object. 528 * @returns { Array<T> } A new Array instance 529 * @throws { BusinessError } 401 - Parameter error. 530 * @throws { BusinessError } 10200011 - The from method cannot be bound. 531 * @static 532 * @syscap SystemCapability.Utils.Lang 533 * @atomicservice 534 * @since 18 535 */ 536 static from<U, T>(arrayLike: ArrayLike<U> | Iterable<U>, mapFn: ArrayFromMapFn<U, T>): Array<T>; 537 /** 538 * A constructor used to create an ArkTS Array. 539 * 540 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 541 * @syscap SystemCapability.Utils.Lang 542 * @atomicservice 543 * @since 12 544 */ 545 /** 546 * A constructor used to create an ArkTS Array. 547 * 548 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 549 * @syscap SystemCapability.Utils.Lang 550 * @crossplatform 551 * @atomicservice 552 * @since 18 553 */ 554 constructor(); 555 /** 556 * A constructor used to create an ArkTS Array. 557 * 558 * @param { T } first - First element when initializing an ArkTS Array. 559 * @param { T[] } left - Left elements when initializing an ArkTS Array. 560 * @throws { BusinessError } 401 - Parameter error. 561 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 562 * @syscap SystemCapability.Utils.Lang 563 * @atomicservice 564 * @since 12 565 */ 566 /** 567 * A constructor used to create an ArkTS Array. 568 * 569 * @param { T } first - First element when initializing an ArkTS Array. 570 * @param { T[] } left - Left elements when initializing an ArkTS Array. 571 * @throws { BusinessError } 401 - Parameter error. 572 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 573 * @syscap SystemCapability.Utils.Lang 574 * @crossplatform 575 * @atomicservice 576 * @since 18 577 */ 578 constructor(first: T, ...left: T[]); 579 /** 580 * A constructor used to create an ArkTS Array. 581 * 582 * @param { T[] } items - Elements when initializing an ArkTS Array. 583 * @throws { BusinessError } 401 - Parameter error. 584 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 585 * @syscap SystemCapability.Utils.Lang 586 * @atomicservice 587 * @since 12 588 */ 589 /** 590 * A constructor used to create an ArkTS Array. 591 * 592 * @param { T[] } items - Elements when initializing an ArkTS Array. 593 * @throws { BusinessError } 401 - Parameter error. 594 * @throws { BusinessError } 10200012 - The Array's constructor cannot be directly invoked. 595 * @syscap SystemCapability.Utils.Lang 596 * @crossplatform 597 * @atomicservice 598 * @since 18 599 */ 600 constructor(...items: T[]); 601 /** 602 * Removes the last element from an ArkTS array and returns it. 603 * If the array is empty, undefined is returned and the array is not modified. 604 * 605 * @returns { T | undefined } - The removed element from the array; undefined if the array is empty. 606 * @throws { BusinessError } 10200011 - The pop method cannot be bound. 607 * @throws { BusinessError } 10200201 - Concurrent modification error. 608 * @syscap SystemCapability.Utils.Lang 609 * @atomicservice 610 * @since 12 611 */ 612 /** 613 * Removes the last element from an ArkTS array and returns it. 614 * If the array is empty, undefined is returned and the array is not modified. 615 * 616 * @returns { T | undefined } - The removed element from the array; undefined if the array is empty. 617 * @throws { BusinessError } 10200011 - The pop method cannot be bound. 618 * @throws { BusinessError } 10200201 - Concurrent modification error. 619 * @syscap SystemCapability.Utils.Lang 620 * @crossplatform 621 * @atomicservice 622 * @since 18 623 */ 624 pop(): T | undefined; 625 /** 626 * Appends new elements to the end of an ArkTS Array, and returns the new length of the array. 627 * 628 * @param { T[] } items - New elements to add to the ArkTS array. 629 * @returns { number } - The new length property of the object upon which the method was called. 630 * @throws { BusinessError } 401 - Parameter error. 631 * @throws { BusinessError } 10200011 - The push method cannot be bound. 632 * @throws { BusinessError } 10200201 - Concurrent modification error. 633 * @syscap SystemCapability.Utils.Lang 634 * @atomicservice 635 * @since 12 636 */ 637 /** 638 * Appends new elements to the end of an ArkTS Array, and returns the new length of the array. 639 * 640 * @param { T[] } items - New elements to add to the ArkTS array. 641 * @returns { number } - The new length property of the object upon which the method was called. 642 * @throws { BusinessError } 401 - Parameter error. 643 * @throws { BusinessError } 10200011 - The push method cannot be bound. 644 * @throws { BusinessError } 10200201 - Concurrent modification error. 645 * @syscap SystemCapability.Utils.Lang 646 * @crossplatform 647 * @atomicservice 648 * @since 18 649 */ 650 push(...items: T[]): number; 651 /** 652 * Adds all the elements of an ArkTS Array into a string, separated by the specified separator string. 653 * 654 * @param { string } [separator] - A string used to separate one element of the array from 655 * the next in the resulting string. If omitted, the array elements are separated with a comma. 656 * @returns { string } A string with all array elements joined. If Array.length is 0, the empty string is returned. 657 * @throws { BusinessError } 401 - Parameter error. 658 * @throws { BusinessError } 10200011 - The join method cannot be bound. 659 * @throws { BusinessError } 10200201 - Concurrent modification error. 660 * @syscap SystemCapability.Utils.Lang 661 * @atomicservice 662 * @since 12 663 */ 664 /** 665 * Adds all the elements of an ArkTS Array into a string, separated by the specified separator string. 666 * 667 * @param { string } [separator] - A string used to separate one element of the array from 668 * the next in the resulting string. If omitted, the array elements are separated with a comma. 669 * @returns { string } A string with all array elements joined. If Array.length is 0, the empty string is returned. 670 * @throws { BusinessError } 401 - Parameter error. 671 * @throws { BusinessError } 10200011 - The join method cannot be bound. 672 * @throws { BusinessError } 10200201 - Concurrent modification error. 673 * @syscap SystemCapability.Utils.Lang 674 * @crossplatform 675 * @atomicservice 676 * @since 18 677 */ 678 join(separator?: string): string; 679 /** 680 * Removes the first element from an ArkTS Array and returns it. 681 * If the array is empty, undefined is returned and the array is not modified. 682 * 683 * @returns { T | undefined } The removed element from the array; undefined if the array is empty 684 * @throws { BusinessError } 10200011 - The shift method cannot be bound. 685 * @throws { BusinessError } 10200201 - Concurrent modification error. 686 * @syscap SystemCapability.Utils.Lang 687 * @atomicservice 688 * @since 12 689 */ 690 /** 691 * Removes the first element from an ArkTS Array and returns it. 692 * If the array is empty, undefined is returned and the array is not modified. 693 * 694 * @returns { T | undefined } The removed element from the array; undefined if the array is empty 695 * @throws { BusinessError } 10200011 - The shift method cannot be bound. 696 * @throws { BusinessError } 10200201 - Concurrent modification error. 697 * @syscap SystemCapability.Utils.Lang 698 * @crossplatform 699 * @atomicservice 700 * @since 18 701 */ 702 shift(): T | undefined; 703 /** 704 * Inserts new elements at the start of an array, and returns the new length of the array. 705 * 706 * @param { T[] } items - Elements to insert at the start of the array. 707 * @returns { number } The new length property of the object upon which the method was called. 708 * @throws { BusinessError } 401 - Parameter error. 709 * @throws { BusinessError } 10200011 - The unshift method cannot be bound. 710 * @throws { BusinessError } 10200201 - Concurrent modification error. 711 * @syscap SystemCapability.Utils.Lang 712 * @atomicservice 713 * @since 12 714 */ 715 /** 716 * Inserts new elements at the start of an array, and returns the new length of the array. 717 * 718 * @param { T[] } items - Elements to insert at the start of the array. 719 * @returns { number } The new length property of the object upon which the method was called. 720 * @throws { BusinessError } 401 - Parameter error. 721 * @throws { BusinessError } 10200011 - The unshift method cannot be bound. 722 * @throws { BusinessError } 10200201 - Concurrent modification error. 723 * @syscap SystemCapability.Utils.Lang 724 * @crossplatform 725 * @atomicservice 726 * @since 18 727 */ 728 unshift(...items: T[]): number; 729 /** 730 * Returns a copy of a section of an ArkTS Array. 731 * For both start and end, a negative index can be used to indicate an offset from the end of the array. 732 * For example, -2 refers to the second to last element of the array. 733 * 734 * @param { number } [start] - The beginning index of the specified portion of the array. 735 * If start is undefined, then the slice begins at index 0. 736 * @param { number } [end] - The end index of the specified portion of the array. 737 * This is exclusive of the element at the index 'end'. 738 * If end is undefined, then the slice extends to the end of the array. 739 * @returns { Array<T> } A new array containing the extracted elements. 740 * @throws { BusinessError } 401 - Parameter error. 741 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 742 * @throws { BusinessError } 10200201 - Concurrent modification error. 743 * @syscap SystemCapability.Utils.Lang 744 * @atomicservice 745 * @since 12 746 */ 747 /** 748 * Returns a copy of a section of an ArkTS Array. 749 * For both start and end, a negative index can be used to indicate an offset from the end of the array. 750 * For example, -2 refers to the second to last element of the array. 751 * 752 * @param { number } [start] - The beginning index of the specified portion of the array. 753 * If start is undefined, then the slice begins at index 0. 754 * @param { number } [end] - The end index of the specified portion of the array. 755 * This is exclusive of the element at the index 'end'. 756 * If end is undefined, then the slice extends to the end of the array. 757 * @returns { Array<T> } A new array containing the extracted elements. 758 * @throws { BusinessError } 401 - Parameter error. 759 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 760 * @throws { BusinessError } 10200201 - Concurrent modification error. 761 * @syscap SystemCapability.Utils.Lang 762 * @crossplatform 763 * @atomicservice 764 * @since 18 765 */ 766 slice(start?: number, end?: number): Array<T>; 767 /** 768 * Sorts an array in place. This method mutates the array and returns a reference to the same array. 769 * 770 * @param { function } [compareFn] - Function used to determine the order of the elements. It is expected to return 771 * a negative value if the first argument is less than the second argument, zero if they're equal, 772 * and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. 773 * @returns { Array<T> } The reference to the original array, now sorted. 774 * @throws { BusinessError } 401 - Parameter error. 775 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 776 * @throws { BusinessError } 10200201 - Concurrent modification error. 777 * @syscap SystemCapability.Utils.Lang 778 * @atomicservice 779 * @since 12 780 */ 781 /** 782 * Sorts an array in place. This method mutates the array and returns a reference to the same array. 783 * 784 * @param { function } [compareFn] - Function used to determine the order of the elements. It is expected to return 785 * a negative value if the first argument is less than the second argument, zero if they're equal, 786 * and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. 787 * @returns { Array<T> } The reference to the original array, now sorted. 788 * @throws { BusinessError } 401 - Parameter error. 789 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 790 * @throws { BusinessError } 10200201 - Concurrent modification error. 791 * @syscap SystemCapability.Utils.Lang 792 * @crossplatform 793 * @atomicservice 794 * @since 18 795 */ 796 sort(compareFn?: (a: T, b: T) => number): Array<T>; 797 /** 798 * Returns the index of the first occurrence of a value in an ArkTS Array, or -1 if it is not present. 799 * 800 * @param { T } searchElement - The value to locate in the array. 801 * @param { number } [fromIndex] - The array index at which to begin the search. 802 * If fromIndex is omitted, the search starts at index 0. 803 * @returns { number } The first index of searchElement in the array; -1 if not found. 804 * @throws { BusinessError } 401 - Parameter error. 805 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 806 * @throws { BusinessError } 10200201 - Concurrent modification error. 807 * @syscap SystemCapability.Utils.Lang 808 * @atomicservice 809 * @since 12 810 */ 811 /** 812 * Returns the index of the first occurrence of a value in an ArkTS Array, or -1 if it is not present. 813 * 814 * @param { T } searchElement - The value to locate in the array. 815 * @param { number } [fromIndex] - The array index at which to begin the search. 816 * If fromIndex is omitted, the search starts at index 0. 817 * @returns { number } The first index of searchElement in the array; -1 if not found. 818 * @throws { BusinessError } 401 - Parameter error. 819 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 820 * @throws { BusinessError } 10200201 - Concurrent modification error. 821 * @syscap SystemCapability.Utils.Lang 822 * @crossplatform 823 * @atomicservice 824 * @since 18 825 */ 826 indexOf(searchElement: T, fromIndex?: number): number; 827 /** 828 * Executes a provided function once for each value in the Array object. 829 * 830 * @param { function } callbackFn - A function that accepts up to three arguments. 831 * The function to be called for each element. 832 * @throws { BusinessError } 401 - Parameter error. 833 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 834 * @throws { BusinessError } 10200201 - Concurrent modification error. 835 * @syscap SystemCapability.Utils.Lang 836 * @atomicservice 837 * @since 12 838 */ 839 /** 840 * Executes a provided function once for each value in the Array object. 841 * 842 * @param { function } callbackFn - A function that accepts up to three arguments. 843 * The function to be called for each element. 844 * @throws { BusinessError } 401 - Parameter error. 845 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 846 * @throws { BusinessError } 10200201 - Concurrent modification error. 847 * @syscap SystemCapability.Utils.Lang 848 * @crossplatform 849 * @atomicservice 850 * @since 18 851 */ 852 forEach(callbackFn: (value: T, index: number, array: Array<T>) => void): void; 853 /** 854 * Calls a defined callback function on each element of an ArkTS Array, 855 * and returns an array that contains the results. 856 * 857 * @param { function } callbackFn - A function that accepts up to three arguments. 858 * The map method calls the callbackFn function one time for each element in the array. 859 * @returns { Array<U> } A new array with each element being the result of the callback function. 860 * @throws { BusinessError } 401 - Parameter error. 861 * @throws { BusinessError } 10200011 - The map method cannot be bound. 862 * @throws { BusinessError } 10200201 - Concurrent modification error. 863 * @syscap SystemCapability.Utils.Lang 864 * @atomicservice 865 * @since 12 866 */ 867 /** 868 * Calls a defined callback function on each element of an ArkTS Array, 869 * and returns an array that contains the results. 870 * 871 * @param { function } callbackFn - A function that accepts up to three arguments. 872 * The map method calls the callbackFn function one time for each element in the array. 873 * @returns { Array<U> } A new array with each element being the result of the callback function. 874 * @throws { BusinessError } 401 - Parameter error. 875 * @throws { BusinessError } 10200011 - The map method cannot be bound. 876 * @throws { BusinessError } 10200201 - Concurrent modification error. 877 * @syscap SystemCapability.Utils.Lang 878 * @crossplatform 879 * @atomicservice 880 * @since 18 881 */ 882 map<U>(callbackFn: (value: T, index: number, array: Array<T>) => U): Array<U>; 883 /** 884 * Returns the elements of an ArkTS Array that meet the condition specified in a callback function. 885 * 886 * @param { function } predicate - A function that accepts up to three arguments. 887 * The filter method calls the predicate function one time for each element in the array. 888 * @returns { Array<T> } A shallow copy of the given containing just the elements that pass the test. 889 * If no elements pass the test, an empty array is returned. 890 * @throws { BusinessError } 401 - Parameter error. 891 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 892 * @throws { BusinessError } 10200201 - Concurrent modification error. 893 * @syscap SystemCapability.Utils.Lang 894 * @atomicservice 895 * @since 12 896 */ 897 /** 898 * Returns the elements of an ArkTS Array that meet the condition specified in a callback function. 899 * 900 * @param { function } predicate - A function that accepts up to three arguments. 901 * The filter method calls the predicate function one time for each element in the array. 902 * @returns { Array<T> } A shallow copy of the given containing just the elements that pass the test. 903 * If no elements pass the test, an empty array is returned. 904 * @throws { BusinessError } 401 - Parameter error. 905 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 906 * @throws { BusinessError } 10200201 - Concurrent modification error. 907 * @syscap SystemCapability.Utils.Lang 908 * @crossplatform 909 * @atomicservice 910 * @since 18 911 */ 912 filter(predicate: (value: T, index: number, array: Array<T>) => boolean): Array<T>; 913 /** 914 * Calls the specified callback function for all the elements in an ArkTS Array. 915 * The return value of the callback function is the accumulated result, 916 * and is provided as an argument in the next call to the callback function. 917 * 918 * @param { function } callbackFn - A function that accepts up to four arguments. 919 * The reduce method calls the callbackFn function one time for each element in the array. 920 * @returns { T } The value that results from running the "reducer" callback function to 921 * completion over the entire array. 922 * @throws { BusinessError } 401 - Parameter error. 923 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 924 * @throws { BusinessError } 10200201 - Concurrent modification error. 925 * @syscap SystemCapability.Utils.Lang 926 * @atomicservice 927 * @since 12 928 */ 929 /** 930 * Calls the specified callback function for all the elements in an ArkTS Array. 931 * The return value of the callback function is the accumulated result, 932 * and is provided as an argument in the next call to the callback function. 933 * 934 * @param { function } callbackFn - A function that accepts up to four arguments. 935 * The reduce method calls the callbackFn function one time for each element in the array. 936 * @returns { T } The value that results from running the "reducer" callback function to 937 * completion over the entire array. 938 * @throws { BusinessError } 401 - Parameter error. 939 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 940 * @throws { BusinessError } 10200201 - Concurrent modification error. 941 * @syscap SystemCapability.Utils.Lang 942 * @crossplatform 943 * @atomicservice 944 * @since 18 945 */ 946 reduce(callbackFn: (previousValue: T, currentValue: T, currentIndex: number, array: Array<T>) => T): T; 947 /** 948 * Calls the specified callback function for all the elements in an array. 949 * The return value of the callback function is the accumulated result, 950 * and is provided as an argument in the next call to the callback function. 951 * 952 * @param { function } callbackFn - A function that accepts up to four arguments. 953 * The reduce method calls the callbackFn function one time for each element in the array. 954 * @param { U } initialValue - If initialValue is specified, 955 * it is used as the initial value to start the accumulation. 956 * The first call to the callbackFn function provides this value as an argument instead of an array value. 957 * @returns { U } The value that results from running the "reducer" callback function to 958 * completion over the entire array. 959 * @throws { BusinessError } 401 - Parameter error. 960 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 961 * @throws { BusinessError } 10200201 - Concurrent modification error. 962 * @syscap SystemCapability.Utils.Lang 963 * @atomicservice 964 * @since 12 965 */ 966 /** 967 * Calls the specified callback function for all the elements in an array. 968 * The return value of the callback function is the accumulated result, 969 * and is provided as an argument in the next call to the callback function. 970 * 971 * @param { function } callbackFn - A function that accepts up to four arguments. 972 * The reduce method calls the callbackFn function one time for each element in the array. 973 * @param { U } initialValue - If initialValue is specified, 974 * it is used as the initial value to start the accumulation. 975 * The first call to the callbackFn function provides this value as an argument instead of an array value. 976 * @returns { U } The value that results from running the "reducer" callback function to 977 * completion over the entire array. 978 * @throws { BusinessError } 401 - Parameter error. 979 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 980 * @throws { BusinessError } 10200201 - Concurrent modification error. 981 * @syscap SystemCapability.Utils.Lang 982 * @crossplatform 983 * @atomicservice 984 * @since 18 985 */ 986 reduce<U>( 987 callbackFn: (previousValue: U, currentValue: T, currentIndex: number, array: Array<T>) => U, 988 initialValue: U 989 ): U; 990 /** 991 * Returns the item located at the specified index. 992 * 993 * @param { number } index - The zero-based index of the desired code unit. 994 * A negative index will count back from the last item. 995 * @returns { T | undefined } The element in the array matching the given index. 996 * Always returns undefined if index < -array.length or index >= array.length without 997 * attempting to access the corresponding property. 998 * @throws { BusinessError } 401 - Parameter error. 999 * @throws { BusinessError } 10200011 - The at method cannot be bound. 1000 * @throws { BusinessError } 10200201 - Concurrent modification error. 1001 * @syscap SystemCapability.Utils.Lang 1002 * @atomicservice 1003 * @since 12 1004 */ 1005 /** 1006 * Returns the item located at the specified index. 1007 * 1008 * @param { number } index - The zero-based index of the desired code unit. 1009 * A negative index will count back from the last item. 1010 * @returns { T | undefined } The element in the array matching the given index. 1011 * Always returns undefined if index < -array.length or index >= array.length without 1012 * attempting to access the corresponding property. 1013 * @throws { BusinessError } 401 - Parameter error. 1014 * @throws { BusinessError } 10200011 - The at method cannot be bound. 1015 * @throws { BusinessError } 10200201 - Concurrent modification error. 1016 * @syscap SystemCapability.Utils.Lang 1017 * @crossplatform 1018 * @atomicservice 1019 * @since 18 1020 */ 1021 at(index: number): T | undefined; 1022 /** 1023 * Returns an iterator that can be used to iterate over elements of type T. 1024 * 1025 * @returns { IterableIterator<T> } Iterator object. 1026 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 1027 * @syscap SystemCapability.Utils.Lang 1028 * @atomicservice 1029 * @since 12 1030 */ 1031 /** 1032 * Returns an iterator that can be used to iterate over elements of type T. 1033 * 1034 * @returns { IterableIterator<T> } Iterator object. 1035 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 1036 * @syscap SystemCapability.Utils.Lang 1037 * @crossplatform 1038 * @atomicservice 1039 * @since 18 1040 */ 1041 [Symbol.iterator](): IterableIterator<T>; 1042 /** 1043 * Returns an iterable of key, value pairs for every entry in the array 1044 * 1045 * @returns { IterableIterator<[number, T]> } A new iterable iterator object. 1046 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 1047 * @throws { BusinessError } 10200201 - Concurrent modification error. 1048 * @syscap SystemCapability.Utils.Lang 1049 * @atomicservice 1050 * @since 12 1051 */ 1052 /** 1053 * Returns an iterable of key, value pairs for every entry in the array 1054 * 1055 * @returns { IterableIterator<[number, T]> } A new iterable iterator object. 1056 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 1057 * @throws { BusinessError } 10200201 - Concurrent modification error. 1058 * @syscap SystemCapability.Utils.Lang 1059 * @crossplatform 1060 * @atomicservice 1061 * @since 18 1062 */ 1063 entries(): IterableIterator<[number, T]>; 1064 /** 1065 * Returns an iterable of keys in the array 1066 * 1067 * @returns { IterableIterator<number> } A new iterable iterator object. 1068 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 1069 * @throws { BusinessError } 10200201 - Concurrent modification error. 1070 * @syscap SystemCapability.Utils.Lang 1071 * @atomicservice 1072 * @since 12 1073 */ 1074 /** 1075 * Returns an iterable of keys in the array 1076 * 1077 * @returns { IterableIterator<number> } A new iterable iterator object. 1078 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 1079 * @throws { BusinessError } 10200201 - Concurrent modification error. 1080 * @syscap SystemCapability.Utils.Lang 1081 * @crossplatform 1082 * @atomicservice 1083 * @since 18 1084 */ 1085 keys(): IterableIterator<number>; 1086 /** 1087 * Returns an iterable of values in the array 1088 * 1089 * @returns { IterableIterator<T> } A new iterable iterator object. 1090 * @throws { BusinessError } 10200011 - The values method cannot be bound. 1091 * @throws { BusinessError } 10200201 - Concurrent modification error. 1092 * @syscap SystemCapability.Utils.Lang 1093 * @atomicservice 1094 * @since 12 1095 */ 1096 /** 1097 * Returns an iterable of values in the array 1098 * 1099 * @returns { IterableIterator<T> } A new iterable iterator object. 1100 * @throws { BusinessError } 10200011 - The values method cannot be bound. 1101 * @throws { BusinessError } 10200201 - Concurrent modification error. 1102 * @syscap SystemCapability.Utils.Lang 1103 * @crossplatform 1104 * @atomicservice 1105 * @since 18 1106 */ 1107 values(): IterableIterator<T>; 1108 /** 1109 * Returns the value of the first element in the array where predicate is true, and undefined 1110 * otherwise. 1111 * 1112 * @param { function } predicate - Find calls predicate once for each element of the array, in ascending 1113 * order, until it finds one where predicate returns true. 1114 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 1115 * @returns { T | undefined } The first element in the array that satisfies the provided testing function. 1116 * Otherwise, undefined is returned. 1117 * @throws { BusinessError } 401 - Parameter error. 1118 * @throws { BusinessError } 10200011 - The find method cannot be bound. 1119 * @throws { BusinessError } 10200201 - Concurrent modification error. 1120 * @syscap SystemCapability.Utils.Lang 1121 * @atomicservice 1122 * @since 12 1123 */ 1124 /** 1125 * Returns the value of the first element in the array where predicate is true, and undefined 1126 * otherwise. 1127 * 1128 * @param { function } predicate - Find calls predicate once for each element of the array, in ascending 1129 * order, until it finds one where predicate returns true. 1130 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 1131 * @returns { T | undefined } The first element in the array that satisfies the provided testing function. 1132 * Otherwise, undefined is returned. 1133 * @throws { BusinessError } 401 - Parameter error. 1134 * @throws { BusinessError } 10200011 - The find method cannot be bound. 1135 * @throws { BusinessError } 10200201 - Concurrent modification error. 1136 * @syscap SystemCapability.Utils.Lang 1137 * @crossplatform 1138 * @atomicservice 1139 * @since 18 1140 */ 1141 find(predicate: (value: T, index: number, obj: Array<T>) => boolean): T | undefined; 1142 /** 1143 * Determines whether an array includes a certain element, returning true or false as appropriate. 1144 * 1145 * @param { T } searchElement - The element to search for. 1146 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 1147 * @returns { boolean } A boolean value which is true if the value searchElement is found within 1148 * the array (or the part of the array indicated by the index fromIndex, if specified). 1149 * @throws { BusinessError } 401 - Parameter error. 1150 * @throws { BusinessError } 10200011 - The includes method cannot be bound. 1151 * @throws { BusinessError } 10200201 - Concurrent modification error. 1152 * @syscap SystemCapability.Utils.Lang 1153 * @atomicservice 1154 * @since 12 1155 */ 1156 /** 1157 * Determines whether an array includes a certain element, returning true or false as appropriate. 1158 * 1159 * @param { T } searchElement - The element to search for. 1160 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 1161 * @returns { boolean } A boolean value which is true if the value searchElement is found within 1162 * the array (or the part of the array indicated by the index fromIndex, if specified). 1163 * @throws { BusinessError } 401 - Parameter error. 1164 * @throws { BusinessError } 10200011 - The includes method cannot be bound. 1165 * @throws { BusinessError } 10200201 - Concurrent modification error. 1166 * @syscap SystemCapability.Utils.Lang 1167 * @crossplatform 1168 * @atomicservice 1169 * @since 18 1170 */ 1171 includes(searchElement: T, fromIndex?: number): boolean; 1172 /** 1173 * Returns the index of the first element in the array where predicate is true, and -1 1174 * otherwise. 1175 * 1176 * @param { function } predicate - Find calls predicate once for each element of the array, in ascending 1177 * order, until it finds one where predicate returns true. If such an element is found, 1178 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 1179 * @returns { number } The index of the first element in the array that passes the test. Otherwise, -1; 1180 * @throws { BusinessError } 401 - Parameter error. 1181 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 1182 * @throws { BusinessError } 10200201 - Concurrent modification error. 1183 * @syscap SystemCapability.Utils.Lang 1184 * @atomicservice 1185 * @since 12 1186 */ 1187 /** 1188 * Returns the index of the first element in the array where predicate is true, and -1 1189 * otherwise. 1190 * 1191 * @param { function } predicate - Find calls predicate once for each element of the array, in ascending 1192 * order, until it finds one where predicate returns true. If such an element is found, 1193 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 1194 * @returns { number } The index of the first element in the array that passes the test. Otherwise, -1; 1195 * @throws { BusinessError } 401 - Parameter error. 1196 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 1197 * @throws { BusinessError } 10200201 - Concurrent modification error. 1198 * @syscap SystemCapability.Utils.Lang 1199 * @crossplatform 1200 * @atomicservice 1201 * @since 18 1202 */ 1203 findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean): number; 1204 /** 1205 * Returns the this object after filling the section identified by start and end with value 1206 * 1207 * @param { T } value - Value to fill array section with 1208 * @param { number } [start] - Index to start filling the array at. If start is negative, it is treated as 1209 * length+start where length is the length of the array. 1210 * @param { number } [end] - Index to stop filling the array at. If end is negative, it is treated as 1211 * length+end. 1212 * @returns { Array<T> } The modified array, filled with value. 1213 * @throws { BusinessError } 401 - Parameter error. 1214 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 1215 * @throws { BusinessError } 10200201 - Concurrent modification error. 1216 * @syscap SystemCapability.Utils.Lang 1217 * @atomicservice 1218 * @since 12 1219 */ 1220 /** 1221 * Returns the this object after filling the section identified by start and end with value 1222 * 1223 * @param { T } value - Value to fill array section with 1224 * @param { number } [start] - Index to start filling the array at. If start is negative, it is treated as 1225 * length+start where length is the length of the array. 1226 * @param { number } [end] - Index to stop filling the array at. If end is negative, it is treated as 1227 * length+end. 1228 * @returns { Array<T> } The modified array, filled with value. 1229 * @throws { BusinessError } 401 - Parameter error. 1230 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 1231 * @throws { BusinessError } 10200201 - Concurrent modification error. 1232 * @syscap SystemCapability.Utils.Lang 1233 * @crossplatform 1234 * @atomicservice 1235 * @since 18 1236 */ 1237 fill(value: T, start?: number, end?: number): Array<T>; 1238 /** 1239 * Shrinks the ArkTS array to the given arrayLength. 1240 * 1241 * @param { number } arrayLength - The new Array length. 1242 * Throws error when arrayLength < 0 or arrayLength > 2^32. 1243 * If arrayLength > array.length, array remains unchanged. 1244 * @throws { BusinessError } 401 - Parameter error. 1245 * @throws { BusinessError } 10200011 - The shrinkTo method cannot be bound. 1246 * @throws { BusinessError } 10200201 - Concurrent modification error. 1247 * @syscap SystemCapability.Utils.Lang 1248 * @atomicservice 1249 * @since 12 1250 */ 1251 /** 1252 * Shrinks the ArkTS array to the given arrayLength. 1253 * 1254 * @param { number } arrayLength - The new Array length. 1255 * Throws error when arrayLength < 0 or arrayLength > 2^32. 1256 * If arrayLength > array.length, array remains unchanged. 1257 * @throws { BusinessError } 401 - Parameter error. 1258 * @throws { BusinessError } 10200011 - The shrinkTo method cannot be bound. 1259 * @throws { BusinessError } 10200201 - Concurrent modification error. 1260 * @syscap SystemCapability.Utils.Lang 1261 * @crossplatform 1262 * @atomicservice 1263 * @since 18 1264 */ 1265 shrinkTo(arrayLength: number): void; 1266 /** 1267 * Extends the ArkTS array to the given arrayLength, 1268 * and appends new elements with given initialValue up to the arrayLength. 1269 * 1270 * @param { number } arrayLength - The new Array length. 1271 * Throws error when arrayLength < 0 or arrayLength > 2^32. 1272 * If arrayLength < array.length, array remains unchanged. 1273 * @param { T } initialValue - Element initial value that will be appended to the array. 1274 * @throws { BusinessError } 401 - Parameter error. 1275 * @throws { BusinessError } 10200011 - The extendTo method cannot be bound. 1276 * @throws { BusinessError } 10200201 - Concurrent modification error. 1277 * @syscap SystemCapability.Utils.Lang 1278 * @atomicservice 1279 * @since 12 1280 */ 1281 /** 1282 * Extends the ArkTS array to the given arrayLength, 1283 * and appends new elements with given initialValue up to the arrayLength. 1284 * 1285 * @param { number } arrayLength - The new Array length. 1286 * Throws error when arrayLength < 0 or arrayLength > 2^32. 1287 * If arrayLength < array.length, array remains unchanged. 1288 * @param { T } initialValue - Element initial value that will be appended to the array. 1289 * @throws { BusinessError } 401 - Parameter error. 1290 * @throws { BusinessError } 10200011 - The extendTo method cannot be bound. 1291 * @throws { BusinessError } 10200201 - Concurrent modification error. 1292 * @syscap SystemCapability.Utils.Lang 1293 * @crossplatform 1294 * @atomicservice 1295 * @since 18 1296 */ 1297 extendTo(arrayLength: number, initialValue: T): void; 1298 /** 1299 * Returns the item at that index. 1300 * 1301 * @param { number } index - The zero-based index of the desired code unit. 1302 * Throws error if index < 0 or index >= array.length. 1303 * @returns { T } The element in the array matching the given index. 1304 * @throws { BusinessError } 401 - Parameter error. 1305 * @throws { BusinessError } 10200001 - The value of index is out of range. 1306 * @syscap SystemCapability.Utils.Lang 1307 * @atomicservice 1308 * @since 12 1309 */ 1310 /** 1311 * Returns the item at that index. 1312 * 1313 * @param { number } index - The zero-based index of the desired code unit. 1314 * Throws error if index < 0 or index >= array.length. 1315 * @returns { T } The element in the array matching the given index. 1316 * @throws { BusinessError } 401 - Parameter error. 1317 * @throws { BusinessError } 10200001 - The value of index is out of range. 1318 * @syscap SystemCapability.Utils.Lang 1319 * @crossplatform 1320 * @atomicservice 1321 * @since 18 1322 */ 1323 [index: number]: T; 1324 /** 1325 * Concatenates two or more arrays. 1326 * 1327 * @param { ConcatArray<T>[] } items - The arrays to concatenate. 1328 * @returns { Array<T> } A new array containing the elements of the concatenated arrays. 1329 * @throws { BusinessError } 401 - Parameter error. Not a valid array. 1330 * @throws { BusinessError } 10200011 - The concat method cannot be bound. 1331 * @throws { BusinessError } 10200201 - Concurrent modification error. 1332 * @syscap SystemCapability.Utils.Lang 1333 * @atomicservice 1334 * @since 12 1335 */ 1336 /** 1337 * Concatenates two or more arrays. 1338 * 1339 * @param { ConcatArray<T>[] } items - The arrays to concatenate. 1340 * @returns { Array<T> } A new array containing the elements of the concatenated arrays. 1341 * @throws { BusinessError } 401 - Parameter error. Not a valid array. 1342 * @throws { BusinessError } 10200011 - The concat method cannot be bound. 1343 * @throws { BusinessError } 10200201 - Concurrent modification error. 1344 * @syscap SystemCapability.Utils.Lang 1345 * @crossplatform 1346 * @atomicservice 1347 * @since 18 1348 */ 1349 concat(...items: ConcatArray<T>[]): Array<T>; 1350 /** 1351 * Removes elements from the array at the specified position. 1352 * 1353 * @param { number } start - The zero-based index at which to start changing the contents of the array. 1354 * All the elements from start to the end of the array will be deleted. 1355 * @returns { Array<T> } An array containing the deleted elements. 1356 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1357 * 1.Mandatory parameters are left unspecified. 1358 * 2.Incorrect parameter types. 1359 * @throws { BusinessError } 10200011 - The splice method cannot be bound. 1360 * @throws { BusinessError } 10200201 - Concurrent modification error. 1361 * @syscap SystemCapability.Utils.Lang 1362 * @atomicservice 1363 * @since 12 1364 */ 1365 /** 1366 * Removes elements from the array at the specified position. 1367 * 1368 * @param { number } start - The zero-based index at which to start changing the contents of the array. 1369 * All the elements from start to the end of the array will be deleted. 1370 * @returns { Array<T> } An array containing the deleted elements. 1371 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1372 * 1.Mandatory parameters are left unspecified. 1373 * 2.Incorrect parameter types. 1374 * @throws { BusinessError } 10200011 - The splice method cannot be bound. 1375 * @throws { BusinessError } 10200201 - Concurrent modification error. 1376 * @syscap SystemCapability.Utils.Lang 1377 * @crossplatform 1378 * @atomicservice 1379 * @since 18 1380 */ 1381 splice(start: number): Array<T>; 1382 /** 1383 * Removes elements from the array and, if necessary, inserts new elements at the specified position. 1384 * 1385 * @param { number } start - The zero-based index at which to start changing the contents of the array. 1386 * @param { number } deleteCount - The number of elements to remove from the array, 1387 * starting at the index specified by the start parameter. 1388 * @param { T[] } items - An array of elements to insert into the array, 1389 * starting at the index specified by the start parameter. 1390 * @returns { Array<T> } An array containing the deleted elements. 1391 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1392 * 1.Mandatory parameters are left unspecified. 1393 * 2.Incorrect parameter types. 1394 * @throws { BusinessError } 10200011 - The splice method cannot be bound. 1395 * @throws { BusinessError } 10200201 - Concurrent modification error. 1396 * @syscap SystemCapability.Utils.Lang 1397 * @atomicservice 1398 * @since 12 1399 */ 1400 /** 1401 * Removes elements from the array and, if necessary, inserts new elements at the specified position. 1402 * 1403 * @param { number } start - The zero-based index at which to start changing the contents of the array. 1404 * @param { number } deleteCount - The number of elements to remove from the array, 1405 * starting at the index specified by the start parameter. 1406 * @param { T[] } items - An array of elements to insert into the array, 1407 * starting at the index specified by the start parameter. 1408 * @returns { Array<T> } An array containing the deleted elements. 1409 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1410 * 1.Mandatory parameters are left unspecified. 1411 * 2.Incorrect parameter types. 1412 * @throws { BusinessError } 10200011 - The splice method cannot be bound. 1413 * @throws { BusinessError } 10200201 - Concurrent modification error. 1414 * @syscap SystemCapability.Utils.Lang 1415 * @crossplatform 1416 * @atomicservice 1417 * @since 18 1418 */ 1419 splice(start: number, deleteCount: number, ...items: T[]): Array<T>; 1420 /** 1421 * Check whether the value is an ArkTs Array. 1422 * 1423 * @param { Object|undefined|null } value - The value to be checked.. 1424 * @returns { boolean } Returns true if the value is an array; otherwise, returns false. 1425 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1426 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1427 * @static 1428 * @syscap SystemCapability.Utils.Lang 1429 * @atomicservice 1430 * @since 18 1431 */ 1432 static isArray(value: Object | undefined | null): boolean; 1433 /** 1434 * Create an ArkTs Array containing these parameters. 1435 * 1436 * @param { T[] } items - A variable number of arguments that will be used as the elements of the new array. 1437 * @returns { Array<T> } Returns a new Array instance containing the specified elements. 1438 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1439 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1440 * @static 1441 * @syscap SystemCapability.Utils.Lang 1442 * @atomicservice 1443 * @since 18 1444 */ 1445 static of<T>(...items: T[]): Array<T>; 1446 /** 1447 * Copy elements inside an ArkTs Array and move them to another location. 1448 * 1449 * @param { number } target - The index at which to copy the elements. 1450 * @param { number } start - The index to start copying elements from (default is 0). 1451 * @param { number } end - The index to stop copying elements (default is the array's length). 1452 * @returns { Array<T> } Returns the modified array after the copy operation. 1453 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1454 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1455 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 1456 * @throws { BusinessError } 10200201 - Concurrent modification error. 1457 * @syscap SystemCapability.Utils.Lang 1458 * @atomicservice 1459 * @since 18 1460 */ 1461 copyWithin(target: number, start: number, end?: number): Array<T>; 1462 /** 1463 * Reverses the elements in an Array. 1464 * 1465 * @returns { Array<T> } The reference to the original typed array, now reversed. 1466 * <br>Note that the typed array is reversed in place, and no copy is made. 1467 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 1468 * @throws { BusinessError } 10200201 - Concurrent modification error. 1469 * @syscap SystemCapability.Utils.Lang 1470 * @atomicservice 1471 * @since 18 1472 */ 1473 reverse(): Array<T>; 1474 /** 1475 * Find the last occurrence of a specified element in an ArkTs Array. 1476 * 1477 * @param { T } searchElement - Element to search for in the array.. 1478 * @param { number } fromIndex - The index at which to start the search. The default is the last 1479 * index of the array. <br>If this index is negative, it is treated as array.length + fromIndex. 1480 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 1481 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 1482 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 1483 * @throws { BusinessError } 10200201 - Concurrent modification error. 1484 * @syscap SystemCapability.Utils.Lang 1485 * @atomicservice 1486 * @since 18 1487 */ 1488 lastIndexOf(searchElement: T, fromIndex?: number): number; 1489 /** 1490 * Tests whether all elements in an ArkTs Array meets a specified condition. 1491 * 1492 * @param { ArrayPredicateFn<T, Array<T>> } predicate - A function that is called for each element in the array. 1493 * @returns { boolean } Returns true if the callback function returns a truthy value for every element; 1494 * <br>otherwise, it returns false. If the array is empty, it returns true. 1495 * @throws { BusinessError } 10200011 - The every method cannot be bound. 1496 * @throws { BusinessError } 10200201 - Concurrent modification error. 1497 * @syscap SystemCapability.Utils.Lang 1498 * @atomicservice 1499 * @since 18 1500 */ 1501 every(predicate: ArrayPredicateFn<T, Array<T>>): boolean; 1502 /** 1503 * Test whether at least one element in an ArkTs Array meets a specified condition. 1504 * 1505 * @param { ArrayPredicateFn<T, Array<T> } predicate - A function that is called for each element in the array. 1506 * @returns { boolean } Returns true if the callback function returns a truthy value for any element; 1507 * <br>otherwise, it returns false. If the array is empty, it returns false. 1508 * @throws { BusinessError } 10200011 - The some method cannot be bound. 1509 * @throws { BusinessError } 10200201 - Concurrent modification error. 1510 * @syscap SystemCapability.Utils.Lang 1511 * @atomicservice 1512 * @since 18 1513 */ 1514 some(predicate: ArrayPredicateFn<T, Array<T>>): boolean; 1515 /** 1516 * Convert an ArkTs Array to a string. 1517 * 1518 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 1519 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 1520 * @throws { BusinessError } 10200201 - Concurrent modification error. 1521 * @syscap SystemCapability.Utils.Lang 1522 * @atomicservice 1523 * @since 18 1524 */ 1525 toString(): string; 1526 /** 1527 * Convert an ArkTs Array to a string, The elements are converted to string using their toLocaleString methods. 1528 * 1529 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 1530 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 1531 * @throws { BusinessError } 10200201 - Concurrent modification error. 1532 * @syscap SystemCapability.Utils.Lang 1533 * @atomicservice 1534 * @since 18 1535 */ 1536 toLocaleString(): string; 1537 /** 1538 * Reduce elements in an ArkTs Array from right to left. 1539 * 1540 * @param { ArrayReduceCallback<U, T, Array<T>> } callbackFn - A function that is called for each element 1541 * in the array. 1542 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 1543 * <br>If no initial value is provided, the last element of the array will be used, 1544 * <br>and the callback will start with the second-to-last element. 1545 * @returns { U } Returns the single value that results from the reduction. 1546 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1547 * 1.Mandatory parameters are left unspecified. 1548 * 2.Incorrect parameter types. 1549 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 1550 * @throws { BusinessError } 10200201 - Concurrent modification error. 1551 * @syscap SystemCapability.Utils.Lang 1552 * @atomicservice 1553 * @since 18 1554 */ 1555 reduceRight<U = T>(callbackFn: ArrayReduceCallback<U, T, Array<T>>, initialValue: U): U; 1556 /** 1557 * Reduce elements in an ArkTs Array from right to left. 1558 * 1559 * @param { ArrayReduceCallback<T, T, Array<T>> } callbackFn - A function that is called for each element 1560 * in the array. 1561 * @returns { T } Returns the single value that results from the reduction. 1562 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1563 * 1.Mandatory parameters are left unspecified. 1564 * 2.Incorrect parameter types. 1565 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 1566 * @throws { BusinessError } 10200201 - Concurrent modification error. 1567 * @syscap SystemCapability.Utils.Lang 1568 * @atomicservice 1569 * @since 18 1570 */ 1571 reduceRight(callbackFn: ArrayReduceCallback<T, T, Array<T>>): T; 1572 } 1573 1574 /** 1575 * The Map holds key-value pairs. 1576 * If multiple threads access a Map instance concurrently, 1577 * and at least one of the threads modifies the map structurally, 1578 * it must be synchronized externally. 1579 * 1580 * @syscap SystemCapability.Utils.Lang 1581 * @atomicservice 1582 * @since 12 1583 */ 1584 /** 1585 * The Map holds key-value pairs. 1586 * If multiple threads access a Map instance concurrently, 1587 * and at least one of the threads modifies the map structurally, 1588 * it must be synchronized externally. 1589 * 1590 * @syscap SystemCapability.Utils.Lang 1591 * @crossplatform 1592 * @atomicservice 1593 * @since 18 1594 */ 1595 @Sendable 1596 class Map<K, V> { 1597 /** 1598 * Returns the number of elements in the Map. 1599 * 1600 * @type { number } 1601 * @readonly 1602 * @syscap SystemCapability.Utils.Lang 1603 * @atomicservice 1604 * @since 12 1605 */ 1606 /** 1607 * Returns the number of elements in the Map. 1608 * 1609 * @type { number } 1610 * @readonly 1611 * @syscap SystemCapability.Utils.Lang 1612 * @crossplatform 1613 * @atomicservice 1614 * @since 18 1615 */ 1616 readonly size: number; 1617 /** 1618 * A constructor used to create a Map. 1619 * 1620 * @param { readonly (readonly [K, V])[] | null } [entries] - An Array or other iterable object 1621 * whose elements are key-value pairs. 1622 * @throws { BusinessError } 401 - Parameter error. 1623 * @throws { BusinessError } 10200012 - The Map's constructor cannot be directly invoked. 1624 * @syscap SystemCapability.Utils.Lang 1625 * @atomicservice 1626 * @since 12 1627 */ 1628 /** 1629 * A constructor used to create a Map. 1630 * 1631 * @param { readonly (readonly [K, V])[] | null } [entries] - An Array or other iterable object 1632 * whose elements are key-value pairs. 1633 * @throws { BusinessError } 401 - Parameter error. 1634 * @throws { BusinessError } 10200012 - The Map's constructor cannot be directly invoked. 1635 * @syscap SystemCapability.Utils.Lang 1636 * @crossplatform 1637 * @atomicservice 1638 * @since 18 1639 */ 1640 constructor(entries?: readonly (readonly [K, V])[] | null) 1641 /** 1642 * A constructor used to create a Map. 1643 * 1644 * @param { Iterable<readonly [K, V]>} [iterable] - An iterable object to convert to an ArkTS Map. 1645 * whose elements are key-value pairs. 1646 * @throws { BusinessError } 401 - Parameter error. 1647 * @throws { BusinessError } 10200012 - The Map's constructor cannot be directly invoked. 1648 * @syscap SystemCapability.Utils.Lang 1649 * @atomicservice 1650 * @since 12 1651 */ 1652 /** 1653 * A constructor used to create a Map. 1654 * 1655 * @param { Iterable<readonly [K, V]>} [iterable] - An iterable object to convert to an ArkTS Map. 1656 * whose elements are key-value pairs. 1657 * @throws { BusinessError } 401 - Parameter error. 1658 * @throws { BusinessError } 10200012 - The Map's constructor cannot be directly invoked. 1659 * @syscap SystemCapability.Utils.Lang 1660 * @crossplatform 1661 * @atomicservice 1662 * @since 18 1663 */ 1664 constructor(iterable: Iterable<readonly [K, V]>); 1665 /** 1666 * Returns an iterator that iterates over key-value pairs. 1667 * 1668 * @returns { IterableIterator<[K, V]> } Iterator object that yields key-value pairs. 1669 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 1670 * @syscap SystemCapability.Utils.Lang 1671 * @atomicservice 1672 * @since 12 1673 */ 1674 /** 1675 * Returns an iterator that iterates over key-value pairs. 1676 * 1677 * @returns { IterableIterator<[K, V]> } Iterator object that yields key-value pairs. 1678 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 1679 * @syscap SystemCapability.Utils.Lang 1680 * @crossplatform 1681 * @atomicservice 1682 * @since 18 1683 */ 1684 [Symbol.iterator](): IterableIterator<[K, V]> 1685 /** 1686 * Returns an iterable of key, value pairs for every entry in the map. 1687 * 1688 * @returns { IterableIterator<[K, V]> } A new iterable iterator object. 1689 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 1690 * @throws { BusinessError } 10200201 - Concurrent modification error. 1691 * @syscap SystemCapability.Utils.Lang 1692 * @atomicservice 1693 * @since 12 1694 */ 1695 /** 1696 * Returns an iterable of key, value pairs for every entry in the map. 1697 * 1698 * @returns { IterableIterator<[K, V]> } A new iterable iterator object. 1699 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 1700 * @throws { BusinessError } 10200201 - Concurrent modification error. 1701 * @syscap SystemCapability.Utils.Lang 1702 * @crossplatform 1703 * @atomicservice 1704 * @since 18 1705 */ 1706 entries(): IterableIterator<[K, V]>; 1707 /** 1708 * Returns an iterable of keys in the map. 1709 * 1710 * @returns { IterableIterator<K> } A new iterable iterator object. 1711 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 1712 * @throws { BusinessError } 10200201 - Concurrent modification error. 1713 * @syscap SystemCapability.Utils.Lang 1714 * @atomicservice 1715 * @since 12 1716 */ 1717 /** 1718 * Returns an iterable of keys in the map. 1719 * 1720 * @returns { IterableIterator<K> } A new iterable iterator object. 1721 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 1722 * @throws { BusinessError } 10200201 - Concurrent modification error. 1723 * @syscap SystemCapability.Utils.Lang 1724 * @crossplatform 1725 * @atomicservice 1726 * @since 18 1727 */ 1728 keys(): IterableIterator<K>; 1729 /** 1730 * Returns an iterable of values in the map. 1731 * 1732 * @returns { IterableIterator<V> } A new iterable iterator object. 1733 * @throws { BusinessError } 10200011 - The values method cannot be bound. 1734 * @throws { BusinessError } 10200201 - Concurrent modification error. 1735 * @syscap SystemCapability.Utils.Lang 1736 * @atomicservice 1737 * @since 12 1738 */ 1739 /** 1740 * Returns an iterable of values in the map. 1741 * 1742 * @returns { IterableIterator<V> } A new iterable iterator object. 1743 * @throws { BusinessError } 10200011 - The values method cannot be bound. 1744 * @throws { BusinessError } 10200201 - Concurrent modification error. 1745 * @syscap SystemCapability.Utils.Lang 1746 * @crossplatform 1747 * @atomicservice 1748 * @since 18 1749 */ 1750 values(): IterableIterator<V>; 1751 /** 1752 * Clears the map. 1753 * 1754 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 1755 * @throws { BusinessError } 10200201 - Concurrent modification error. 1756 * @syscap SystemCapability.Utils.Lang 1757 * @atomicservice 1758 * @since 12 1759 */ 1760 /** 1761 * Clears the map. 1762 * 1763 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 1764 * @throws { BusinessError } 10200201 - Concurrent modification error. 1765 * @syscap SystemCapability.Utils.Lang 1766 * @crossplatform 1767 * @atomicservice 1768 * @since 18 1769 */ 1770 clear(): void; 1771 /** 1772 * Returns true if an element in the Map existed and has been removed, or false if the element does not exist. 1773 * 1774 * @param { K } key - The key of the element to remove from the Map object. 1775 * @returns { boolean } True if an element in the Map Object existed and has been removed, 1776 * or false if the element does not exist. 1777 * @throws { BusinessError } 401 - Parameter error. 1778 * @throws { BusinessError } 10200011 - The delete method cannot be bound. 1779 * @throws { BusinessError } 10200201 - Concurrent modification error. 1780 * @syscap SystemCapability.Utils.Lang 1781 * @atomicservice 1782 * @since 12 1783 */ 1784 /** 1785 * Returns true if an element in the Map existed and has been removed, or false if the element does not exist. 1786 * 1787 * @param { K } key - The key of the element to remove from the Map object. 1788 * @returns { boolean } True if an element in the Map Object existed and has been removed, 1789 * or false if the element does not exist. 1790 * @throws { BusinessError } 401 - Parameter error. 1791 * @throws { BusinessError } 10200011 - The delete method cannot be bound. 1792 * @throws { BusinessError } 10200201 - Concurrent modification error. 1793 * @syscap SystemCapability.Utils.Lang 1794 * @crossplatform 1795 * @atomicservice 1796 * @since 18 1797 */ 1798 delete(key: K): boolean; 1799 /** 1800 * Executes the provided callback once for each key of the map which actually exist. 1801 * 1802 * @param { function } callbackFn - A function that accepts up to three arguments. 1803 * The function to be called for each element. 1804 * @throws { BusinessError } 401 - Parameter error. 1805 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 1806 * @throws { BusinessError } 10200201 - Concurrent modification error. 1807 * @syscap SystemCapability.Utils.Lang 1808 * @atomicservice 1809 * @since 12 1810 */ 1811 /** 1812 * Executes the provided callback once for each key of the map which actually exist. 1813 * 1814 * @param { function } callbackFn - A function that accepts up to three arguments. 1815 * The function to be called for each element. 1816 * @throws { BusinessError } 401 - Parameter error. 1817 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 1818 * @throws { BusinessError } 10200201 - Concurrent modification error. 1819 * @syscap SystemCapability.Utils.Lang 1820 * @crossplatform 1821 * @atomicservice 1822 * @since 18 1823 */ 1824 forEach(callbackFn: (value: V, key: K, map: Map<K, V>) => void): void; 1825 /** 1826 * Returns a specified element from the Map object. 1827 * If the value that is associated to the provided key is an object, 1828 * then you will get a reference to that object and any change made to that object 1829 * will effectively modify it inside the Map. 1830 * 1831 * @param { K } key - The key of the element to return from the Map object 1832 * @returns { V | undefined } The element associated with the specified key, 1833 * or undefined if the key can''t be found in the Map object. 1834 * @throws { BusinessError } 401 - Parameter error. 1835 * @throws { BusinessError } 10200011 - The get method cannot be bound. 1836 * @throws { BusinessError } 10200201 - Concurrent modification error. 1837 * @syscap SystemCapability.Utils.Lang 1838 * @atomicservice 1839 * @since 12 1840 */ 1841 /** 1842 * Returns a specified element from the Map object. 1843 * If the value that is associated to the provided key is an object, 1844 * then you will get a reference to that object and any change made to that object 1845 * will effectively modify it inside the Map. 1846 * 1847 * @param { K } key - The key of the element to return from the Map object 1848 * @returns { V | undefined } The element associated with the specified key, 1849 * or undefined if the key can''t be found in the Map object. 1850 * @throws { BusinessError } 401 - Parameter error. 1851 * @throws { BusinessError } 10200011 - The get method cannot be bound. 1852 * @throws { BusinessError } 10200201 - Concurrent modification error. 1853 * @syscap SystemCapability.Utils.Lang 1854 * @crossplatform 1855 * @atomicservice 1856 * @since 18 1857 */ 1858 get(key: K): V | undefined; 1859 /** 1860 * Returns boolean indicating whether an element with the specified key exists or not. 1861 * 1862 * @param { K } key - The key of the element to test for presence in the Map object. 1863 * @returns { boolean } true if an element with the specified key exists in the Map Object; otherwise false. 1864 * @throws { BusinessError } 401 - Parameter error. 1865 * @throws { BusinessError } 10200011 - The has method cannot be bound. 1866 * @throws { BusinessError } 10200201 - Concurrent modification error. 1867 * @syscap SystemCapability.Utils.Lang 1868 * @atomicservice 1869 * @since 12 1870 */ 1871 /** 1872 * Returns boolean indicating whether an element with the specified key exists or not. 1873 * 1874 * @param { K } key - The key of the element to test for presence in the Map object. 1875 * @returns { boolean } true if an element with the specified key exists in the Map Object; otherwise false. 1876 * @throws { BusinessError } 401 - Parameter error. 1877 * @throws { BusinessError } 10200011 - The has method cannot be bound. 1878 * @throws { BusinessError } 10200201 - Concurrent modification error. 1879 * @syscap SystemCapability.Utils.Lang 1880 * @crossplatform 1881 * @atomicservice 1882 * @since 18 1883 */ 1884 has(key: K): boolean; 1885 /** 1886 * Adds a new element with a specified key and value to the Map. 1887 * If an element with the same key already exists, the element will be updated. 1888 * 1889 * @param { K } key - The key of the element to add to the Map object. 1890 * @param { V } value - The value of the element to add to the object. 1891 * @returns { Map<K, V> } The Object. 1892 * @throws { BusinessError } 401 - Parameter error. 1893 * @throws { BusinessError } 10200011 - The set method cannot be bound. 1894 * @throws { BusinessError } 10200201 - Concurrent modification error. 1895 * @syscap SystemCapability.Utils.Lang 1896 * @atomicservice 1897 * @since 12 1898 */ 1899 /** 1900 * Adds a new element with a specified key and value to the Map. 1901 * If an element with the same key already exists, the element will be updated. 1902 * 1903 * @param { K } key - The key of the element to add to the Map object. 1904 * @param { V } value - The value of the element to add to the object. 1905 * @returns { Map<K, V> } The Object. 1906 * @throws { BusinessError } 401 - Parameter error. 1907 * @throws { BusinessError } 10200011 - The set method cannot be bound. 1908 * @throws { BusinessError } 10200201 - Concurrent modification error. 1909 * @syscap SystemCapability.Utils.Lang 1910 * @crossplatform 1911 * @atomicservice 1912 * @since 18 1913 */ 1914 set(key: K, value: V): Map<K, V>; 1915 } 1916 1917 /** 1918 * Set lets you store unique values of any type. 1919 * If multiple threads access a Set instance concurrently, 1920 * and at least one of the threads modifies the set structurally, 1921 * it must be synchronized externally. 1922 * 1923 * @syscap SystemCapability.Utils.Lang 1924 * @atomicservice 1925 * @since 12 1926 */ 1927 /** 1928 * Set lets you store unique values of any type. 1929 * If multiple threads access a Set instance concurrently, 1930 * and at least one of the threads modifies the set structurally, 1931 * it must be synchronized externally. 1932 * 1933 * @syscap SystemCapability.Utils.Lang 1934 * @crossplatform 1935 * @atomicservice 1936 * @since 18 1937 */ 1938 @Sendable 1939 class Set<T> { 1940 /** 1941 * Returns the number of elements in the Set. 1942 * 1943 * @type { number } 1944 * @readonly 1945 * @syscap SystemCapability.Utils.Lang 1946 * @atomicservice 1947 * @since 12 1948 */ 1949 /** 1950 * Returns the number of elements in the Set. 1951 * 1952 * @type { number } 1953 * @readonly 1954 * @syscap SystemCapability.Utils.Lang 1955 * @crossplatform 1956 * @atomicservice 1957 * @since 18 1958 */ 1959 readonly size: number; 1960 /** 1961 * A constructor used to create a Set. 1962 * 1963 * @param { readonly T[] | null } [values] - If an iterable object is passed, 1964 * all of its elements will be added to the new Set. 1965 * If you don't specify this parameter, or its value is null, the new Set is empty. 1966 * @throws { BusinessError } 401 - Parameter error. 1967 * @throws { BusinessError } 10200012 - The Set's constructor cannot be directly invoked. 1968 * @syscap SystemCapability.Utils.Lang 1969 * @atomicservice 1970 * @since 12 1971 */ 1972 /** 1973 * A constructor used to create a Set. 1974 * 1975 * @param { readonly T[] | null } [values] - If an iterable object is passed, 1976 * all of its elements will be added to the new Set. 1977 * If you don't specify this parameter, or its value is null, the new Set is empty. 1978 * @throws { BusinessError } 401 - Parameter error. 1979 * @throws { BusinessError } 10200012 - The Set's constructor cannot be directly invoked. 1980 * @syscap SystemCapability.Utils.Lang 1981 * @crossplatform 1982 * @atomicservice 1983 * @since 18 1984 */ 1985 constructor(values?: readonly T[] | null); 1986 /** 1987 * A constructor used to create a Set. 1988 * 1989 * @param { Iterable<T>} [iterable] - If an iterable object is passed, 1990 * all of its elements will be added to the new Set. 1991 * If you don't specify this parameter, or its value is null, the new Set is empty. 1992 * @throws { BusinessError } 401 - Parameter error. 1993 * @throws { BusinessError } 10200012 - The Set's constructor cannot be directly invoked. 1994 * @syscap SystemCapability.Utils.Lang 1995 * @atomicservice 1996 * @since 12 1997 */ 1998 /** 1999 * A constructor used to create a Set. 2000 * 2001 * @param { Iterable<T>} [iterable] - If an iterable object is passed, 2002 * all of its elements will be added to the new Set. 2003 * If you don't specify this parameter, or its value is null, the new Set is empty. 2004 * @throws { BusinessError } 401 - Parameter error. 2005 * @throws { BusinessError } 10200012 - The Set's constructor cannot be directly invoked. 2006 * @syscap SystemCapability.Utils.Lang 2007 * @crossplatform 2008 * @atomicservice 2009 * @since 18 2010 */ 2011 constructor(iterable: Iterable<T>); 2012 /** 2013 * Returns an iterator that can be used to iterate over elements of type T. 2014 * 2015 * @returns { IterableIterator<T> } Iterator object. 2016 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 2017 * @syscap SystemCapability.Utils.Lang 2018 * @atomicservice 2019 * @since 12 2020 */ 2021 /** 2022 * Returns an iterator that can be used to iterate over elements of type T. 2023 * 2024 * @returns { IterableIterator<T> } Iterator object. 2025 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 2026 * @syscap SystemCapability.Utils.Lang 2027 * @crossplatform 2028 * @atomicservice 2029 * @since 18 2030 */ 2031 [Symbol.iterator](): IterableIterator<T>; 2032 /** 2033 * Returns an iterable of [value, value] pairs for each element in this set. 2034 * 2035 * @returns { IterableIterator<[T, T]> } A new iterable iterator object. 2036 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 2037 * @throws { BusinessError } 10200201 - Concurrent modification error. 2038 * @syscap SystemCapability.Utils.Lang 2039 * @atomicservice 2040 * @since 12 2041 */ 2042 /** 2043 * Returns an iterable of [value, value] pairs for each element in this set. 2044 * 2045 * @returns { IterableIterator<[T, T]> } A new iterable iterator object. 2046 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 2047 * @throws { BusinessError } 10200201 - Concurrent modification error. 2048 * @syscap SystemCapability.Utils.Lang 2049 * @crossplatform 2050 * @atomicservice 2051 * @since 18 2052 */ 2053 entries(): IterableIterator<[T, T]>; 2054 /** 2055 * Returns an iterable of the values in the set. 2056 * 2057 * @returns { IterableIterator<T> } A new iterable iterator object. 2058 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 2059 * @throws { BusinessError } 10200201 - Concurrent modification error. 2060 * @syscap SystemCapability.Utils.Lang 2061 * @atomicservice 2062 * @since 12 2063 */ 2064 /** 2065 * Returns an iterable of the values in the set. 2066 * 2067 * @returns { IterableIterator<T> } A new iterable iterator object. 2068 * @throws { BusinessError } 10200011 - The keys method cannot be bound. 2069 * @throws { BusinessError } 10200201 - Concurrent modification error. 2070 * @syscap SystemCapability.Utils.Lang 2071 * @crossplatform 2072 * @atomicservice 2073 * @since 18 2074 */ 2075 keys(): IterableIterator<T>; 2076 /** 2077 * Returns an iterable of values in the set. 2078 * 2079 * @returns { IterableIterator<T> } A new iterable iterator object. 2080 * @throws { BusinessError } 10200011 - The values method cannot be bound. 2081 * @throws { BusinessError } 10200201 - Concurrent modification error. 2082 * @syscap SystemCapability.Utils.Lang 2083 * @atomicservice 2084 * @since 12 2085 */ 2086 /** 2087 * Returns an iterable of values in the set. 2088 * 2089 * @returns { IterableIterator<T> } A new iterable iterator object. 2090 * @throws { BusinessError } 10200011 - The values method cannot be bound. 2091 * @throws { BusinessError } 10200201 - Concurrent modification error. 2092 * @syscap SystemCapability.Utils.Lang 2093 * @crossplatform 2094 * @atomicservice 2095 * @since 18 2096 */ 2097 values(): IterableIterator<T>; 2098 /** 2099 * Appends a new element with a specified value to the end of the Set. 2100 * 2101 * @param { T } value - The value of the element to add to the Set object. 2102 * @returns { Set<T> } The Set object with added value. 2103 * @throws { BusinessError } 10200011 - The add method cannot be bound. 2104 * @throws { BusinessError } 10200201 - Concurrent modification error. 2105 * @syscap SystemCapability.Utils.Lang 2106 * @atomicservice 2107 * @since 12 2108 */ 2109 /** 2110 * Appends a new element with a specified value to the end of the Set. 2111 * 2112 * @param { T } value - The value of the element to add to the Set object. 2113 * @returns { Set<T> } The Set object with added value. 2114 * @throws { BusinessError } 10200011 - The add method cannot be bound. 2115 * @throws { BusinessError } 10200201 - Concurrent modification error. 2116 * @syscap SystemCapability.Utils.Lang 2117 * @crossplatform 2118 * @atomicservice 2119 * @since 18 2120 */ 2121 add(value: T): Set<T>; 2122 /** 2123 * Clears the Set. 2124 * 2125 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 2126 * @throws { BusinessError } 10200201 - Concurrent modification error. 2127 * @syscap SystemCapability.Utils.Lang 2128 * @atomicservice 2129 * @since 12 2130 */ 2131 /** 2132 * Clears the Set. 2133 * 2134 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 2135 * @throws { BusinessError } 10200201 - Concurrent modification error. 2136 * @syscap SystemCapability.Utils.Lang 2137 * @crossplatform 2138 * @atomicservice 2139 * @since 18 2140 */ 2141 clear(): void; 2142 /** 2143 * Returns true if an element in the Set existed and has been removed, or false if the element does not exist. 2144 * 2145 * @param { T } value - The value to remove from Set. 2146 * @returns { boolean } Returns true if value was already in Set; otherwise false. 2147 * @throws { BusinessError } 10200011 - The delete method cannot be bound. 2148 * @throws { BusinessError } 10200201 - Concurrent modification error. 2149 * @syscap SystemCapability.Utils.Lang 2150 * @atomicservice 2151 * @since 12 2152 */ 2153 /** 2154 * Returns true if an element in the Set existed and has been removed, or false if the element does not exist. 2155 * 2156 * @param { T } value - The value to remove from Set. 2157 * @returns { boolean } Returns true if value was already in Set; otherwise false. 2158 * @throws { BusinessError } 10200011 - The delete method cannot be bound. 2159 * @throws { BusinessError } 10200201 - Concurrent modification error. 2160 * @syscap SystemCapability.Utils.Lang 2161 * @crossplatform 2162 * @atomicservice 2163 * @since 18 2164 */ 2165 delete(value: T): boolean; 2166 /** 2167 * Executes a provided function once per each value in the Set object, in insertion order. 2168 * 2169 * @param { function } callbackFn - A function that accepts up to three arguments. 2170 * The function to be called for each element. 2171 * @throws { BusinessError } 401 - Parameter error. 2172 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 2173 * @throws { BusinessError } 10200201 - Concurrent modification error. 2174 * @syscap SystemCapability.Utils.Lang 2175 * @atomicservice 2176 * @since 12 2177 */ 2178 /** 2179 * Executes a provided function once per each value in the Set object, in insertion order. 2180 * 2181 * @param { function } callbackFn - A function that accepts up to three arguments. 2182 * The function to be called for each element. 2183 * @throws { BusinessError } 401 - Parameter error. 2184 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 2185 * @throws { BusinessError } 10200201 - Concurrent modification error. 2186 * @syscap SystemCapability.Utils.Lang 2187 * @crossplatform 2188 * @atomicservice 2189 * @since 18 2190 */ 2191 forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void): void; 2192 /** 2193 * A boolean indicating whether an element with the specified value exists in the Set or not. 2194 * 2195 * @param { T } value - The value to test for presence in the Object. 2196 * @returns { boolean } Returns true if an element with the specified value exists in the Set object; 2197 * otherwise false. 2198 * @throws { BusinessError } 401 - Parameter error. 2199 * @throws { BusinessError } 10200011 - The has method cannot be bound. 2200 * @throws { BusinessError } 10200201 - Concurrent modification error. 2201 * @syscap SystemCapability.Utils.Lang 2202 * @atomicservice 2203 * @since 12 2204 */ 2205 /** 2206 * A boolean indicating whether an element with the specified value exists in the Set or not. 2207 * 2208 * @param { T } value - The value to test for presence in the Object. 2209 * @returns { boolean } Returns true if an element with the specified value exists in the Set object; 2210 * otherwise false. 2211 * @throws { BusinessError } 401 - Parameter error. 2212 * @throws { BusinessError } 10200011 - The has method cannot be bound. 2213 * @throws { BusinessError } 10200201 - Concurrent modification error. 2214 * @syscap SystemCapability.Utils.Lang 2215 * @crossplatform 2216 * @atomicservice 2217 * @since 18 2218 */ 2219 has(value: T): boolean; 2220 } 2221 /** 2222 * Represents a raw buffer of binary data, which is used to store data for the 2223 * different typed arrays. ArrayBuffers cannot be read from or written to directly, 2224 * but can be passed to a typed array or DataView Object to interpret the raw 2225 * buffer as needed. 2226 * If multiple threads access a ArrayBuffer instance concurrently, 2227 * and at least one of the threads modifies the buffer structurally, 2228 * it must be synchronized externally. 2229 * 2230 * @syscap SystemCapability.Utils.Lang 2231 * @atomicservice 2232 * @since 12 2233 */ 2234 /** 2235 * Represents a raw buffer of binary data, which is used to store data for the 2236 * different typed arrays. ArrayBuffers cannot be read from or written to directly, 2237 * but can be passed to a typed array or DataView Object to interpret the raw 2238 * buffer as needed. 2239 * If multiple threads access a ArrayBuffer instance concurrently, 2240 * and at least one of the threads modifies the buffer structurally, 2241 * it must be synchronized externally. 2242 * 2243 * @syscap SystemCapability.Utils.Lang 2244 * @crossplatform 2245 * @atomicservice 2246 * @since 18 2247 */ 2248 @Sendable 2249 class ArrayBuffer { 2250 /** 2251 * Read-only. The length of the ArrayBuffer (in bytes). 2252 * 2253 * @type { number } 2254 * @readonly 2255 * @syscap SystemCapability.Utils.Lang 2256 * @atomicservice 2257 * @since 12 2258 */ 2259 /** 2260 * Read-only. The length of the ArrayBuffer (in bytes). 2261 * 2262 * @type { number } 2263 * @readonly 2264 * @syscap SystemCapability.Utils.Lang 2265 * @crossplatform 2266 * @atomicservice 2267 * @since 18 2268 */ 2269 readonly byteLength: number; 2270 /** 2271 * A constructor used to create a ArrayBuffer. 2272 * 2273 * @param { number } byteLength - The length of the ArkTS array buffer 2274 * @throws { BusinessError } 10200012 - The ArrayBuffer's constructor cannot be directly invoked. 2275 * @throws { BusinessError } 401 - Parameter error. 2276 * @syscap SystemCapability.Utils.Lang 2277 * @atomicservice 2278 * @since 12 2279 */ 2280 /** 2281 * A constructor used to create a ArrayBuffer. 2282 * 2283 * @param { number } byteLength - The length of the ArkTS array buffer 2284 * @throws { BusinessError } 10200012 - The ArrayBuffer's constructor cannot be directly invoked. 2285 * @throws { BusinessError } 401 - Parameter error. 2286 * @syscap SystemCapability.Utils.Lang 2287 * @crossplatform 2288 * @atomicservice 2289 * @since 18 2290 */ 2291 constructor(byteLength: number); 2292 /** 2293 * Returns a section of an ArrayBuffer. 2294 * 2295 * @param { number } begin - Zero-based index at which to start extraction, converted to an integer. 2296 * @param { number } [end] - Zero-based index at which to end extraction, converted to an integer. 2297 * Default is buffer.length 2298 * @returns { ArrayBuffer } A new ArrayBuffer containing the extracted elements. 2299 * @throws { BusinessError } 401 - Parameter error. 2300 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 2301 * @throws { BusinessError } 10200201 - Concurrent modification error. 2302 * @syscap SystemCapability.Utils.Lang 2303 * @atomicservice 2304 * @since 12 2305 */ 2306 /** 2307 * Returns a section of an ArrayBuffer. 2308 * 2309 * @param { number } begin - Zero-based index at which to start extraction, converted to an integer. 2310 * @param { number } [end] - Zero-based index at which to end extraction, converted to an integer. 2311 * Default is buffer.length 2312 * @returns { ArrayBuffer } A new ArrayBuffer containing the extracted elements. 2313 * @throws { BusinessError } 401 - Parameter error. 2314 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 2315 * @throws { BusinessError } 10200201 - Concurrent modification error. 2316 * @syscap SystemCapability.Utils.Lang 2317 * @crossplatform 2318 * @atomicservice 2319 * @since 18 2320 */ 2321 slice(begin: number, end?: number): ArrayBuffer; 2322 } 2323 2324 /** 2325 * A typed array of 8-bit integer values. The contents are initialized to 0. 2326 * If multiple threads access a Int8Array instance concurrently, 2327 * and at least one of the threads modifies the array structurally, 2328 * it must be synchronized externally. 2329 * 2330 * @syscap SystemCapability.Utils.Lang 2331 * @atomicservice 2332 * @since 12 2333 */ 2334 /** 2335 * A typed array of 8-bit integer values. The contents are initialized to 0. 2336 * If multiple threads access a Int8Array instance concurrently, 2337 * and at least one of the threads modifies the array structurally, 2338 * it must be synchronized externally. 2339 * 2340 * @syscap SystemCapability.Utils.Lang 2341 * @crossplatform 2342 * @atomicservice 2343 * @since 18 2344 */ 2345 @Sendable 2346 class Int8Array { 2347 /** 2348 * The size in bytes of each element in the array. 2349 * 2350 * @type { number } 2351 * @readonly 2352 * @static 2353 * @syscap SystemCapability.Utils.Lang 2354 * @atomicservice 2355 * @since 12 2356 */ 2357 /** 2358 * The size in bytes of each element in the array. 2359 * 2360 * @type { number } 2361 * @readonly 2362 * @static 2363 * @syscap SystemCapability.Utils.Lang 2364 * @crossplatform 2365 * @atomicservice 2366 * @since 18 2367 */ 2368 static readonly BYTES_PER_ELEMENT: number; 2369 /** 2370 * The ArrayBuffer instance referenced by the array. 2371 * 2372 * @type { ArrayBuffer } 2373 * @readonly 2374 * @syscap SystemCapability.Utils.Lang 2375 * @atomicservice 2376 * @since 12 2377 */ 2378 /** 2379 * The ArrayBuffer instance referenced by the array. 2380 * 2381 * @type { ArrayBuffer } 2382 * @readonly 2383 * @syscap SystemCapability.Utils.Lang 2384 * @crossplatform 2385 * @atomicservice 2386 * @since 18 2387 */ 2388 readonly buffer: ArrayBuffer; 2389 /** 2390 * The length in bytes of the array. 2391 * 2392 * @type { number } 2393 * @readonly 2394 * @syscap SystemCapability.Utils.Lang 2395 * @atomicservice 2396 * @since 12 2397 */ 2398 /** 2399 * The length in bytes of the array. 2400 * 2401 * @type { number } 2402 * @readonly 2403 * @syscap SystemCapability.Utils.Lang 2404 * @crossplatform 2405 * @atomicservice 2406 * @since 18 2407 */ 2408 readonly byteLength: number; 2409 /** 2410 * The offset in bytes of the array. 2411 * 2412 * @type { number } 2413 * @readonly 2414 * @syscap SystemCapability.Utils.Lang 2415 * @atomicservice 2416 * @since 12 2417 */ 2418 /** 2419 * The offset in bytes of the array. 2420 * 2421 * @type { number } 2422 * @readonly 2423 * @syscap SystemCapability.Utils.Lang 2424 * @crossplatform 2425 * @atomicservice 2426 * @since 18 2427 */ 2428 readonly byteOffset: number; 2429 /** 2430 * The length of the array. 2431 * 2432 * @type { number } 2433 * @readonly 2434 * @syscap SystemCapability.Utils.Lang 2435 * @atomicservice 2436 * @since 12 2437 */ 2438 /** 2439 * The length of the array. 2440 * 2441 * @type { number } 2442 * @readonly 2443 * @syscap SystemCapability.Utils.Lang 2444 * @crossplatform 2445 * @atomicservice 2446 * @since 18 2447 */ 2448 readonly length: number; 2449 /** 2450 * A constructor used to create an Int8Array. 2451 * 2452 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2453 * @syscap SystemCapability.Utils.Lang 2454 * @atomicservice 2455 * @since 12 2456 */ 2457 /** 2458 * A constructor used to create an Int8Array. 2459 * 2460 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2461 * @syscap SystemCapability.Utils.Lang 2462 * @crossplatform 2463 * @atomicservice 2464 * @since 18 2465 */ 2466 constructor(); 2467 /** 2468 * A constructor used to create an Int8Array. 2469 * 2470 * @param { number } length - The length of the array 2471 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2472 * @throws { BusinessError } 401 - Parameter error. 2473 * @syscap SystemCapability.Utils.Lang 2474 * @atomicservice 2475 * @since 12 2476 */ 2477 /** 2478 * A constructor used to create an Int8Array. 2479 * 2480 * @param { number } length - The length of the array 2481 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2482 * @throws { BusinessError } 401 - Parameter error. 2483 * @syscap SystemCapability.Utils.Lang 2484 * @crossplatform 2485 * @atomicservice 2486 * @since 18 2487 */ 2488 constructor(length: number); 2489 /** 2490 * A constructor used to create an Int8Array. 2491 * 2492 * @param { Iterable<number> } elements - An iterable object to convert to an Int8Array. 2493 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2494 * @throws { BusinessError } 401 - Parameter error. 2495 * @syscap SystemCapability.Utils.Lang 2496 * @atomicservice 2497 * @since 12 2498 */ 2499 /** 2500 * A constructor used to create an Int8Array. 2501 * 2502 * @param { Iterable<number> } elements - An iterable object to convert to an Int8Array. 2503 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2504 * @throws { BusinessError } 401 - Parameter error. 2505 * @syscap SystemCapability.Utils.Lang 2506 * @crossplatform 2507 * @atomicservice 2508 * @since 18 2509 */ 2510 constructor(elements: Iterable<number>); 2511 /** 2512 * A constructor used to create an Int8Array. 2513 * 2514 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 2515 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2516 * @throws { BusinessError } 401 - Parameter error. 2517 * @syscap SystemCapability.Utils.Lang 2518 * @atomicservice 2519 * @since 12 2520 */ 2521 /** 2522 * A constructor used to create an Int8Array. 2523 * 2524 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 2525 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2526 * @throws { BusinessError } 401 - Parameter error. 2527 * @syscap SystemCapability.Utils.Lang 2528 * @crossplatform 2529 * @atomicservice 2530 * @since 18 2531 */ 2532 constructor(array: ArrayLike<number> | ArrayBuffer); 2533 /** 2534 * A constructor used to create an Int8Array. 2535 * 2536 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 2537 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 2538 * that will be exposed by the typed array view. 2539 * @param { number } [length] - The length parameter specifies the memory range 2540 * that will be exposed by the typed array view. 2541 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2542 * @throws { BusinessError } 401 - Parameter error. 2543 * @syscap SystemCapability.Utils.Lang 2544 * @atomicservice 2545 * @since 12 2546 */ 2547 /** 2548 * A constructor used to create an Int8Array. 2549 * 2550 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 2551 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 2552 * that will be exposed by the typed array view. 2553 * @param { number } [length] - The length parameter specifies the memory range 2554 * that will be exposed by the typed array view. 2555 * @throws { BusinessError } 10200012 - The Int8Array's constructor cannot be directly invoked. 2556 * @throws { BusinessError } 401 - Parameter error. 2557 * @syscap SystemCapability.Utils.Lang 2558 * @crossplatform 2559 * @atomicservice 2560 * @since 18 2561 */ 2562 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 2563 /** 2564 * Creates an Int8Array from an array-like object. 2565 * 2566 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int8Array. 2567 * @returns { Int8Array } A new Int8Array instance 2568 * @throws { BusinessError } 401 - Parameter error. 2569 * @static 2570 * @syscap SystemCapability.Utils.Lang 2571 * @atomicservice 2572 * @since 12 2573 */ 2574 /** 2575 * Creates an Int8Array from an array-like object. 2576 * 2577 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int8Array. 2578 * @returns { Int8Array } A new Int8Array instance 2579 * @throws { BusinessError } 401 - Parameter error. 2580 * @static 2581 * @syscap SystemCapability.Utils.Lang 2582 * @crossplatform 2583 * @atomicservice 2584 * @since 18 2585 */ 2586 static from(arrayLike: ArrayLike<number>): Int8Array; 2587 2588 /** 2589 * Creates an Int8Array from an array-like object. 2590 * 2591 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int8Array. 2592 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 2593 * @returns { Int8Array } A new Int8Array instance 2594 * @throws { BusinessError } 401 - Parameter error. 2595 * @static 2596 * @syscap SystemCapability.Utils.Lang 2597 * @atomicservice 2598 * @since 12 2599 */ 2600 /** 2601 * Creates an Int8Array from an array-like object. 2602 * 2603 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int8Array. 2604 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 2605 * @returns { Int8Array } A new Int8Array instance 2606 * @throws { BusinessError } 401 - Parameter error. 2607 * @static 2608 * @syscap SystemCapability.Utils.Lang 2609 * @crossplatform 2610 * @atomicservice 2611 * @since 18 2612 */ 2613 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Int8Array; 2614 /** 2615 * Creates an Int8Array from an iterable object. 2616 * 2617 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int8Array. 2618 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 2619 * call on every element of the array. 2620 * @returns { Int8Array } A new Int8Array instance 2621 * @throws { BusinessError } 401 - Parameter error. 2622 * @static 2623 * @syscap SystemCapability.Utils.Lang 2624 * @atomicservice 2625 * @since 12 2626 */ 2627 /** 2628 * Creates an Int8Array from an iterable object. 2629 * 2630 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int8Array. 2631 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 2632 * call on every element of the array. 2633 * @returns { Int8Array } A new Int8Array instance 2634 * @throws { BusinessError } 401 - Parameter error. 2635 * @static 2636 * @syscap SystemCapability.Utils.Lang 2637 * @crossplatform 2638 * @atomicservice 2639 * @since 18 2640 */ 2641 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Int8Array; 2642 /** 2643 * Returns the this object after copying a section of the array identified by start and end 2644 * to the same array starting at position target. 2645 * 2646 * @param { number } target - If target is negative, it is treated as length+target where length is the 2647 * length of the array. 2648 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 2649 * is treated as length+end. 2650 * @param { number } [end] - If not specified, length of the this object is used as its default value. 2651 * @returns { Int8Array } The array itself. 2652 * @throws { BusinessError } 401 - Parameter error. 2653 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 2654 * @throws { BusinessError } 10200201 - Concurrent modification error. 2655 * @syscap SystemCapability.Utils.Lang 2656 * @atomicservice 2657 * @since 12 2658 */ 2659 /** 2660 * Returns the this object after copying a section of the array identified by start and end 2661 * to the same array starting at position target. 2662 * 2663 * @param { number } target - If target is negative, it is treated as length+target where length is the 2664 * length of the array. 2665 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 2666 * is treated as length+end. 2667 * @param { number } [end] - If not specified, length of the this object is used as its default value. 2668 * @returns { Int8Array } The array itself. 2669 * @throws { BusinessError } 401 - Parameter error. 2670 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 2671 * @throws { BusinessError } 10200201 - Concurrent modification error. 2672 * @syscap SystemCapability.Utils.Lang 2673 * @crossplatform 2674 * @atomicservice 2675 * @since 18 2676 */ 2677 copyWithin(target: number, start: number, end?: number): Int8Array; 2678 /** 2679 * Determines whether all the members of an array satisfy the specified test. 2680 * 2681 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 2682 * The every method calls the predicate function for each element in the array until 2683 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 2684 * @returns { boolean } true unless predicate returns a false value for a typed array element, 2685 * in which case false is immediately returned. 2686 * @throws { BusinessError } 401 - Parameter error. 2687 * @throws { BusinessError } 10200011 - The every method cannot be bound. 2688 * @throws { BusinessError } 10200201 - Concurrent modification error. 2689 * @syscap SystemCapability.Utils.Lang 2690 * @atomicservice 2691 * @since 12 2692 */ 2693 /** 2694 * Determines whether all the members of an array satisfy the specified test. 2695 * 2696 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 2697 * The every method calls the predicate function for each element in the array until 2698 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 2699 * @returns { boolean } true unless predicate returns a false value for a typed array element, 2700 * in which case false is immediately returned. 2701 * @throws { BusinessError } 401 - Parameter error. 2702 * @throws { BusinessError } 10200011 - The every method cannot be bound. 2703 * @throws { BusinessError } 10200201 - Concurrent modification error. 2704 * @syscap SystemCapability.Utils.Lang 2705 * @crossplatform 2706 * @atomicservice 2707 * @since 18 2708 */ 2709 every(predicate: TypedArrayPredicateFn<number, Int8Array>): boolean; 2710 /** 2711 * Returns the this object after filling the section identified by start and end with value. 2712 * 2713 * @param { number } value - value to fill array section with. 2714 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 2715 * length+start where length is the length of the array. 2716 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 2717 * length+end. 2718 * @returns { Int8Array } The array itself. 2719 * @throws { BusinessError } 401 - Parameter error. 2720 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 2721 * @throws { BusinessError } 10200201 - Concurrent modification error. 2722 * @syscap SystemCapability.Utils.Lang 2723 * @atomicservice 2724 * @since 12 2725 */ 2726 /** 2727 * Returns the this object after filling the section identified by start and end with value. 2728 * 2729 * @param { number } value - value to fill array section with. 2730 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 2731 * length+start where length is the length of the array. 2732 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 2733 * length+end. 2734 * @returns { Int8Array } The array itself. 2735 * @throws { BusinessError } 401 - Parameter error. 2736 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 2737 * @throws { BusinessError } 10200201 - Concurrent modification error. 2738 * @syscap SystemCapability.Utils.Lang 2739 * @crossplatform 2740 * @atomicservice 2741 * @since 18 2742 */ 2743 fill(value: number, start?: number, end?: number): Int8Array; 2744 /** 2745 * Returns the elements of an array that meet the condition specified in a callback function. 2746 * 2747 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 2748 * The filter method calls the predicate function one time for each element in the array. 2749 * @returns { Int8Array } The array itself. 2750 * @throws { BusinessError } 401 - Parameter error. 2751 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 2752 * @throws { BusinessError } 10200201 - Concurrent modification error. 2753 * @syscap SystemCapability.Utils.Lang 2754 * @atomicservice 2755 * @since 12 2756 */ 2757 /** 2758 * Returns the elements of an array that meet the condition specified in a callback function. 2759 * 2760 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 2761 * The filter method calls the predicate function one time for each element in the array. 2762 * @returns { Int8Array } The array itself. 2763 * @throws { BusinessError } 401 - Parameter error. 2764 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 2765 * @throws { BusinessError } 10200201 - Concurrent modification error. 2766 * @syscap SystemCapability.Utils.Lang 2767 * @crossplatform 2768 * @atomicservice 2769 * @since 18 2770 */ 2771 filter(predicate: TypedArrayPredicateFn<number, Int8Array>): Int8Array; 2772 /** 2773 * Returns the value of the first element in the array where predicate is true, and undefined 2774 * otherwise. 2775 * 2776 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - find calls predicate once for each element of 2777 * the array, in ascending order, until it finds one where predicate returns true. 2778 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 2779 * @returns { number | undefined } The first element in the typed array 2780 * that satisfies the provided testing function. Otherwise, undefined is returned. 2781 * @throws { BusinessError } 401 - Parameter error. 2782 * @throws { BusinessError } 10200011 - The find method cannot be bound. 2783 * @throws { BusinessError } 10200201 - Concurrent modification error. 2784 * @syscap SystemCapability.Utils.Lang 2785 * @atomicservice 2786 * @since 12 2787 */ 2788 /** 2789 * Returns the value of the first element in the array where predicate is true, and undefined 2790 * otherwise. 2791 * 2792 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - find calls predicate once for each element of 2793 * the array, in ascending order, until it finds one where predicate returns true. 2794 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 2795 * @returns { number | undefined } The first element in the typed array 2796 * that satisfies the provided testing function. Otherwise, undefined is returned. 2797 * @throws { BusinessError } 401 - Parameter error. 2798 * @throws { BusinessError } 10200011 - The find method cannot be bound. 2799 * @throws { BusinessError } 10200201 - Concurrent modification error. 2800 * @syscap SystemCapability.Utils.Lang 2801 * @crossplatform 2802 * @atomicservice 2803 * @since 18 2804 */ 2805 find(predicate: TypedArrayPredicateFn<number, Int8Array>): number | undefined; 2806 /** 2807 * Returns the index of the first element in the array where predicate is true, and -1 2808 * otherwise. 2809 * 2810 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - find calls predicate once for each element of 2811 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 2812 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 2813 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 2814 * @throws { BusinessError } 401 - Parameter error. 2815 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 2816 * @throws { BusinessError } 10200201 - Concurrent modification error. 2817 * @syscap SystemCapability.Utils.Lang 2818 * @atomicservice 2819 * @since 12 2820 */ 2821 /** 2822 * Returns the index of the first element in the array where predicate is true, and -1 2823 * otherwise. 2824 * 2825 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - find calls predicate once for each element of 2826 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 2827 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 2828 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 2829 * @throws { BusinessError } 401 - Parameter error. 2830 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 2831 * @throws { BusinessError } 10200201 - Concurrent modification error. 2832 * @syscap SystemCapability.Utils.Lang 2833 * @crossplatform 2834 * @atomicservice 2835 * @since 18 2836 */ 2837 findIndex(predicate: TypedArrayPredicateFn<number, Int8Array>): number; 2838 /** 2839 * Performs the specified action for each element in an array. 2840 * 2841 * @param { TypedArrayForEachCallback<number, Int8Array> } callbackFn - A function that 2842 * accepts up to three arguments. 2843 * forEach calls the callbackfn function one time for each element in the array. 2844 * @throws { BusinessError } 401 - Parameter error. 2845 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 2846 * @throws { BusinessError } 10200201 - Concurrent modification error. 2847 * @syscap SystemCapability.Utils.Lang 2848 * @atomicservice 2849 * @since 12 2850 */ 2851 /** 2852 * Performs the specified action for each element in an array. 2853 * 2854 * @param { TypedArrayForEachCallback<number, Int8Array> } callbackFn - A function that 2855 * accepts up to three arguments. 2856 * forEach calls the callbackfn function one time for each element in the array. 2857 * @throws { BusinessError } 401 - Parameter error. 2858 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 2859 * @throws { BusinessError } 10200201 - Concurrent modification error. 2860 * @syscap SystemCapability.Utils.Lang 2861 * @crossplatform 2862 * @atomicservice 2863 * @since 18 2864 */ 2865 forEach(callbackFn: TypedArrayForEachCallback<number, Int8Array>): void; 2866 /** 2867 * Returns the index of the first occurrence of a value in an array. 2868 * 2869 * @param { number } searchElement - The value to locate in the array. 2870 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 2871 * search starts at index 0. 2872 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 2873 * @throws { BusinessError } 401 - Parameter error. 2874 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 2875 * @throws { BusinessError } 10200201 - Concurrent modification error. 2876 * @syscap SystemCapability.Utils.Lang 2877 * @atomicservice 2878 * @since 12 2879 */ 2880 /** 2881 * Returns the index of the first occurrence of a value in an array. 2882 * 2883 * @param { number } searchElement - The value to locate in the array. 2884 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 2885 * search starts at index 0. 2886 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 2887 * @throws { BusinessError } 401 - Parameter error. 2888 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 2889 * @throws { BusinessError } 10200201 - Concurrent modification error. 2890 * @syscap SystemCapability.Utils.Lang 2891 * @crossplatform 2892 * @atomicservice 2893 * @since 18 2894 */ 2895 indexOf(searchElement: number, fromIndex?: number): number; 2896 /** 2897 * Adds all the elements of an array separated by the specified separator string. 2898 * @param { string } [separator] - A string used to separate one element of an array from the next in the 2899 * resulting String. If omitted, the array elements are separated with a comma. 2900 * @returns { string } A string with all typed array elements joined. 2901 * If array.length is 0, the empty string is returned. 2902 * @throws { BusinessError } 401 - Parameter error. 2903 * @throws { BusinessError } 10200011 - The join method cannot be bound. 2904 * @throws { BusinessError } 10200201 - Concurrent modification error. 2905 * @syscap SystemCapability.Utils.Lang 2906 * @atomicservice 2907 * @since 12 2908 */ 2909 /** 2910 * Adds all the elements of an array separated by the specified separator string. 2911 * @param { string } [separator] - A string used to separate one element of an array from the next in the 2912 * resulting String. If omitted, the array elements are separated with a comma. 2913 * @returns { string } A string with all typed array elements joined. 2914 * If array.length is 0, the empty string is returned. 2915 * @throws { BusinessError } 401 - Parameter error. 2916 * @throws { BusinessError } 10200011 - The join method cannot be bound. 2917 * @throws { BusinessError } 10200201 - Concurrent modification error. 2918 * @syscap SystemCapability.Utils.Lang 2919 * @crossplatform 2920 * @atomicservice 2921 * @since 18 2922 */ 2923 join(separator?: string): string; 2924 /** 2925 * Calls a defined callback function on each element of an array, and returns an array that 2926 * contains the results. 2927 * 2928 * @param { TypedArrayMapCallback<number, Int8Array> } callbackFn - A function that 2929 * accepts up to three arguments. 2930 * The map method calls the callbackfn function one time for each element in the array. 2931 * @returns { Int8Array } The array itself. 2932 * @throws { BusinessError } 401 - Parameter error. 2933 * @throws { BusinessError } 10200011 - The map method cannot be bound. 2934 * @throws { BusinessError } 10200201 - Concurrent modification error. 2935 * @syscap SystemCapability.Utils.Lang 2936 * @atomicservice 2937 * @since 12 2938 */ 2939 /** 2940 * Calls a defined callback function on each element of an array, and returns an array that 2941 * contains the results. 2942 * 2943 * @param { TypedArrayMapCallback<number, Int8Array> } callbackFn - A function that 2944 * accepts up to three arguments. 2945 * The map method calls the callbackfn function one time for each element in the array. 2946 * @returns { Int8Array } The array itself. 2947 * @throws { BusinessError } 401 - Parameter error. 2948 * @throws { BusinessError } 10200011 - The map method cannot be bound. 2949 * @throws { BusinessError } 10200201 - Concurrent modification error. 2950 * @syscap SystemCapability.Utils.Lang 2951 * @crossplatform 2952 * @atomicservice 2953 * @since 18 2954 */ 2955 map(callbackFn: TypedArrayMapCallback<number, Int8Array>): Int8Array; 2956 /** 2957 * Calls the specified callback function for all the elements in an array. The return value of 2958 * the callback function is the accumulated result, and is provided as an argument in the next 2959 * call to the callback function. 2960 * 2961 * @param { TypedArrayReduceCallback<number, number, Int8Array> } callbackFn - A function that 2962 * accepts up to four arguments. 2963 * The reduce method calls the callbackfn function one time for each element in the array. 2964 * @returns { number } The value that results from running the "reducer" callback function to 2965 * completion over the entire typed array. 2966 * @throws { BusinessError } 401 - Parameter error. 2967 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 2968 * @throws { BusinessError } 10200201 - Concurrent modification error. 2969 * @syscap SystemCapability.Utils.Lang 2970 * @atomicservice 2971 * @since 12 2972 */ 2973 /** 2974 * Calls the specified callback function for all the elements in an array. The return value of 2975 * the callback function is the accumulated result, and is provided as an argument in the next 2976 * call to the callback function. 2977 * 2978 * @param { TypedArrayReduceCallback<number, number, Int8Array> } callbackFn - A function that 2979 * accepts up to four arguments. 2980 * The reduce method calls the callbackfn function one time for each element in the array. 2981 * @returns { number } The value that results from running the "reducer" callback function to 2982 * completion over the entire typed array. 2983 * @throws { BusinessError } 401 - Parameter error. 2984 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 2985 * @throws { BusinessError } 10200201 - Concurrent modification error. 2986 * @syscap SystemCapability.Utils.Lang 2987 * @crossplatform 2988 * @atomicservice 2989 * @since 18 2990 */ 2991 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int8Array>): number; 2992 /** 2993 * Calls the specified callback function for all the elements in an array. The return value of 2994 * the callback function is the accumulated result, and is provided as an argument in the next 2995 * call to the callback function. 2996 * 2997 * @param { TypedArrayReduceCallback<number, number, Int8Array> } callbackFn - A function that 2998 * accepts up to four arguments. 2999 * The reduce method calls the callbackfn function one time for each element in the array. 3000 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 3001 * the accumulation. The first call to the callbackfn function provides this value as an argument 3002 * instead of an array value. 3003 * @returns { number } The value that results from running the "reducer" callback function to 3004 * completion over the entire typed array. 3005 * @throws { BusinessError } 401 - Parameter error. 3006 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 3007 * @throws { BusinessError } 10200201 - Concurrent modification error. 3008 * @syscap SystemCapability.Utils.Lang 3009 * @atomicservice 3010 * @since 12 3011 */ 3012 /** 3013 * Calls the specified callback function for all the elements in an array. The return value of 3014 * the callback function is the accumulated result, and is provided as an argument in the next 3015 * call to the callback function. 3016 * 3017 * @param { TypedArrayReduceCallback<number, number, Int8Array> } callbackFn - A function that 3018 * accepts up to four arguments. 3019 * The reduce method calls the callbackfn function one time for each element in the array. 3020 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 3021 * the accumulation. The first call to the callbackfn function provides this value as an argument 3022 * instead of an array value. 3023 * @returns { number } The value that results from running the "reducer" callback function to 3024 * completion over the entire typed array. 3025 * @throws { BusinessError } 401 - Parameter error. 3026 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 3027 * @throws { BusinessError } 10200201 - Concurrent modification error. 3028 * @syscap SystemCapability.Utils.Lang 3029 * @crossplatform 3030 * @atomicservice 3031 * @since 18 3032 */ 3033 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int8Array>, initialValue: number): number; 3034 /** 3035 * Calls the specified callback function for all the elements in an array. The return value of 3036 * the callback function is the accumulated result, and is provided as an argument in the next 3037 * call to the callback function. 3038 * 3039 * @param { TypedArrayReduceCallback<U, number, Int8Array> } callbackFn - A function that 3040 * accepts up to four arguments. 3041 * The reduce method calls the callbackfn function one time for each element in the array. 3042 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 3043 * the accumulation. The first call to the callbackfn function provides this value as an argument 3044 * instead of an array value. 3045 * @returns { U } The value that results from running the "reducer" callback function to 3046 * completion over the entire typed array. 3047 * @throws { BusinessError } 401 - Parameter error. 3048 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 3049 * @throws { BusinessError } 10200201 - Concurrent modification error. 3050 * @syscap SystemCapability.Utils.Lang 3051 * @atomicservice 3052 * @since 12 3053 */ 3054 /** 3055 * Calls the specified callback function for all the elements in an array. The return value of 3056 * the callback function is the accumulated result, and is provided as an argument in the next 3057 * call to the callback function. 3058 * 3059 * @param { TypedArrayReduceCallback<U, number, Int8Array> } callbackFn - A function that 3060 * accepts up to four arguments. 3061 * The reduce method calls the callbackfn function one time for each element in the array. 3062 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 3063 * the accumulation. The first call to the callbackfn function provides this value as an argument 3064 * instead of an array value. 3065 * @returns { U } The value that results from running the "reducer" callback function to 3066 * completion over the entire typed array. 3067 * @throws { BusinessError } 401 - Parameter error. 3068 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 3069 * @throws { BusinessError } 10200201 - Concurrent modification error. 3070 * @syscap SystemCapability.Utils.Lang 3071 * @crossplatform 3072 * @atomicservice 3073 * @since 18 3074 */ 3075 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Int8Array>, initialValue: U): U; 3076 /** 3077 * Reverses the elements in an Array. 3078 * 3079 * @returns { Int8Array } The reference to the original typed array, now reversed. 3080 * <br>Note that the typed array is reversed in place, and no copy is made. 3081 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 3082 * @throws { BusinessError } 10200201 - Concurrent modification error. 3083 * @syscap SystemCapability.Utils.Lang 3084 * @atomicservice 3085 * @since 12 3086 */ 3087 /** 3088 * Reverses the elements in an Array. 3089 * 3090 * @returns { Int8Array } The reference to the original typed array, now reversed. 3091 * <br>Note that the typed array is reversed in place, and no copy is made. 3092 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 3093 * @throws { BusinessError } 10200201 - Concurrent modification error. 3094 * @syscap SystemCapability.Utils.Lang 3095 * @crossplatform 3096 * @atomicservice 3097 * @since 18 3098 */ 3099 reverse(): Int8Array; 3100 /** 3101 * Sets a value or an array of values. 3102 * 3103 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 3104 * @param { number } [offset] - The index in the current array at which the values are to be written. 3105 * @throws { BusinessError } 401 - Parameter error. 3106 * @throws { BusinessError } 10200011 - The set method cannot be bound. 3107 * @throws { BusinessError } 10200201 - Concurrent modification error. 3108 * @syscap SystemCapability.Utils.Lang 3109 * @atomicservice 3110 * @since 12 3111 */ 3112 /** 3113 * Sets a value or an array of values. 3114 * 3115 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 3116 * @param { number } [offset] - The index in the current array at which the values are to be written. 3117 * @throws { BusinessError } 401 - Parameter error. 3118 * @throws { BusinessError } 10200011 - The set method cannot be bound. 3119 * @throws { BusinessError } 10200201 - Concurrent modification error. 3120 * @syscap SystemCapability.Utils.Lang 3121 * @crossplatform 3122 * @atomicservice 3123 * @since 18 3124 */ 3125 set(array: ArrayLike<number>, offset?: number): void; 3126 /** 3127 * Returns a section of an array. 3128 * 3129 * @param { number } [start] - The beginning of the specified portion of the array. 3130 * @param { number } [end] - The end of the specified portion of the array. 3131 * This is exclusive of the element at the index 'end'. 3132 * @returns { Int8Array } A new typed array containing the extracted elements. 3133 * @throws { BusinessError } 401 - Parameter error. 3134 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 3135 * @throws { BusinessError } 10200201 - Concurrent modification error. 3136 * @syscap SystemCapability.Utils.Lang 3137 * @atomicservice 3138 * @since 12 3139 */ 3140 /** 3141 * Returns a section of an array. 3142 * 3143 * @param { number } [start] - The beginning of the specified portion of the array. 3144 * @param { number } [end] - The end of the specified portion of the array. 3145 * This is exclusive of the element at the index 'end'. 3146 * @returns { Int8Array } A new typed array containing the extracted elements. 3147 * @throws { BusinessError } 401 - Parameter error. 3148 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 3149 * @throws { BusinessError } 10200201 - Concurrent modification error. 3150 * @syscap SystemCapability.Utils.Lang 3151 * @crossplatform 3152 * @atomicservice 3153 * @since 18 3154 */ 3155 slice(start?: number, end?: number): Int8Array; 3156 /** 3157 * Determines whether the specified callback function returns true for any element of an array. 3158 * 3159 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 3160 * The some method calls the predicate function for each element in the array until 3161 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 3162 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 3163 * in which case true is immediately returned. 3164 * @throws { BusinessError } 401 - Parameter error. 3165 * @throws { BusinessError } 10200011 - The some method cannot be bound. 3166 * @throws { BusinessError } 10200201 - Concurrent modification error. 3167 * @syscap SystemCapability.Utils.Lang 3168 * @atomicservice 3169 * @since 12 3170 */ 3171 /** 3172 * Determines whether the specified callback function returns true for any element of an array. 3173 * 3174 * @param { TypedArrayPredicateFn<number, Int8Array> } predicate - A function that accepts up to three arguments. 3175 * The some method calls the predicate function for each element in the array until 3176 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 3177 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 3178 * in which case true is immediately returned. 3179 * @throws { BusinessError } 401 - Parameter error. 3180 * @throws { BusinessError } 10200011 - The some method cannot be bound. 3181 * @throws { BusinessError } 10200201 - Concurrent modification error. 3182 * @syscap SystemCapability.Utils.Lang 3183 * @crossplatform 3184 * @atomicservice 3185 * @since 18 3186 */ 3187 some(predicate: TypedArrayPredicateFn<number, Int8Array>): boolean; 3188 /** 3189 * Sorts an array. 3190 * 3191 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 3192 * It is expected to return a negative value if first argument is less than second argument, 3193 * zero if they're equal and a positive value otherwise. 3194 * If omitted, the elements are sorted in ascending, ASCII character order. 3195 * @returns { Int8Array } The reference to the original typed array, now sorted. 3196 * Note that the typed array is sorted in place and no copy is made. 3197 * @throws { BusinessError } 401 - Parameter error. 3198 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 3199 * @throws { BusinessError } 10200201 - Concurrent modification error. 3200 * @syscap SystemCapability.Utils.Lang 3201 * @atomicservice 3202 * @since 12 3203 */ 3204 /** 3205 * Sorts an array. 3206 * 3207 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 3208 * It is expected to return a negative value if first argument is less than second argument, 3209 * zero if they're equal and a positive value otherwise. 3210 * If omitted, the elements are sorted in ascending, ASCII character order. 3211 * @returns { Int8Array } The reference to the original typed array, now sorted. 3212 * Note that the typed array is sorted in place and no copy is made. 3213 * @throws { BusinessError } 401 - Parameter error. 3214 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 3215 * @throws { BusinessError } 10200201 - Concurrent modification error. 3216 * @syscap SystemCapability.Utils.Lang 3217 * @crossplatform 3218 * @atomicservice 3219 * @since 18 3220 */ 3221 sort(compareFn?: TypedArrayCompareFn<number>): Int8Array; 3222 /** 3223 * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements 3224 * at begin, inclusive, up to end, exclusive. 3225 * 3226 * @param { number } [begin] - The index of the beginning of the array. 3227 * @param { number } [end] - The index of the end of the array. 3228 * @returns { Int8Array } A new Int8Array object. 3229 * @throws { BusinessError } 401 - Parameter error. 3230 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 3231 * @throws { BusinessError } 10200201 - Concurrent modification error. 3232 * @syscap SystemCapability.Utils.Lang 3233 * @atomicservice 3234 * @since 12 3235 */ 3236 /** 3237 * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements 3238 * at begin, inclusive, up to end, exclusive. 3239 * 3240 * @param { number } [begin] - The index of the beginning of the array. 3241 * @param { number } [end] - The index of the end of the array. 3242 * @returns { Int8Array } A new Int8Array object. 3243 * @throws { BusinessError } 401 - Parameter error. 3244 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 3245 * @throws { BusinessError } 10200201 - Concurrent modification error. 3246 * @syscap SystemCapability.Utils.Lang 3247 * @crossplatform 3248 * @atomicservice 3249 * @since 18 3250 */ 3251 subarray(begin?: number, end?: number): Int8Array; 3252 /** 3253 * Returns the item located at the specified index. 3254 * 3255 * @param { number } index - The zero-based index of the desired code unit.<br/> 3256 * A negative index will count back from the last item. 3257 * @returns { number | undefined } The element in the array matching the given index.<br/> 3258 * Always returns undefined if index < -array.length or 3259 * index >= array.length without attempting to access the corresponding property. 3260 * @throws { BusinessError } 401 - Parameter error. 3261 * @throws { BusinessError } 10200011 - The at method cannot be bound. 3262 * @throws { BusinessError } 10200201 - Concurrent modification error. 3263 * @syscap SystemCapability.Utils.Lang 3264 * @atomicservice 3265 * @since 12 3266 */ 3267 /** 3268 * Returns the item located at the specified index. 3269 * 3270 * @param { number } index - The zero-based index of the desired code unit.<br/> 3271 * A negative index will count back from the last item. 3272 * @returns { number | undefined } The element in the array matching the given index.<br/> 3273 * Always returns undefined if index < -array.length or 3274 * index >= array.length without attempting to access the corresponding property. 3275 * @throws { BusinessError } 401 - Parameter error. 3276 * @throws { BusinessError } 10200011 - The at method cannot be bound. 3277 * @throws { BusinessError } 10200201 - Concurrent modification error. 3278 * @syscap SystemCapability.Utils.Lang 3279 * @crossplatform 3280 * @atomicservice 3281 * @since 18 3282 */ 3283 at(index: number): number | undefined; 3284 /** 3285 * Returns an iterator that iterates over numbers. 3286 * 3287 * @returns { IterableIterator<number> } Iterator object that yields numbers. 3288 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 3289 * @syscap SystemCapability.Utils.Lang 3290 * @atomicservice 3291 * @since 12 3292 */ 3293 /** 3294 * Returns an iterator that iterates over numbers. 3295 * 3296 * @returns { IterableIterator<number> } Iterator object that yields numbers. 3297 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 3298 * @syscap SystemCapability.Utils.Lang 3299 * @crossplatform 3300 * @atomicservice 3301 * @since 18 3302 */ 3303 [Symbol.iterator](): IterableIterator<number>; 3304 /** 3305 * Returns an iterable of key, value pairs for every entry in the array 3306 * 3307 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 3308 * @throws { BusinessError } 10200011 - The method cannot be bound. 3309 * @throws { BusinessError } 10200201 - Concurrent modification error. 3310 * @syscap SystemCapability.Utils.Lang 3311 * @atomicservice 3312 * @since 12 3313 */ 3314 /** 3315 * Returns an iterable of key, value pairs for every entry in the array 3316 * 3317 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 3318 * @throws { BusinessError } 10200011 - The method cannot be bound. 3319 * @throws { BusinessError } 10200201 - Concurrent modification error. 3320 * @syscap SystemCapability.Utils.Lang 3321 * @crossplatform 3322 * @atomicservice 3323 * @since 18 3324 */ 3325 entries(): IterableIterator<[number, number]>; 3326 /** 3327 * Returns an iterable of keys in the array 3328 * 3329 * @returns { IterableIterator<number> } A new iterable iterator object. 3330 * @throws { BusinessError } 10200011 - The method cannot be bound. 3331 * @throws { BusinessError } 10200201 - Concurrent modification error. 3332 * @syscap SystemCapability.Utils.Lang 3333 * @atomicservice 3334 * @since 12 3335 */ 3336 /** 3337 * Returns an iterable of keys in the array 3338 * 3339 * @returns { IterableIterator<number> } A new iterable iterator object. 3340 * @throws { BusinessError } 10200011 - The method cannot be bound. 3341 * @throws { BusinessError } 10200201 - Concurrent modification error. 3342 * @syscap SystemCapability.Utils.Lang 3343 * @crossplatform 3344 * @atomicservice 3345 * @since 18 3346 */ 3347 keys(): IterableIterator<number>; 3348 /** 3349 * Returns an iterable of values in the array 3350 * 3351 * @returns { IterableIterator<number> } A new iterable iterator object. 3352 * @throws { BusinessError } 10200011 - The method cannot be bound. 3353 * @throws { BusinessError } 10200201 - Concurrent modification error. 3354 * @syscap SystemCapability.Utils.Lang 3355 * @atomicservice 3356 * @since 12 3357 */ 3358 /** 3359 * Returns an iterable of values in the array 3360 * 3361 * @returns { IterableIterator<number> } A new iterable iterator object. 3362 * @throws { BusinessError } 10200011 - The method cannot be bound. 3363 * @throws { BusinessError } 10200201 - Concurrent modification error. 3364 * @syscap SystemCapability.Utils.Lang 3365 * @crossplatform 3366 * @atomicservice 3367 * @since 18 3368 */ 3369 values(): IterableIterator<number>; 3370 /** 3371 * Determines whether an array includes a certain element, returning true or false as appropriate. 3372 * 3373 * @param { number } searchElement - The element to search for. 3374 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 3375 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 3376 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 3377 * @throws { BusinessError } 401 - Parameter error. 3378 * @throws { BusinessError } 10200011 - The at method cannot be bound. 3379 * @throws { BusinessError } 10200201 - Concurrent modification error. 3380 * @syscap SystemCapability.Utils.Lang 3381 * @atomicservice 3382 * @since 12 3383 */ 3384 /** 3385 * Determines whether an array includes a certain element, returning true or false as appropriate. 3386 * 3387 * @param { number } searchElement - The element to search for. 3388 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 3389 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 3390 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 3391 * @throws { BusinessError } 401 - Parameter error. 3392 * @throws { BusinessError } 10200011 - The at method cannot be bound. 3393 * @throws { BusinessError } 10200201 - Concurrent modification error. 3394 * @syscap SystemCapability.Utils.Lang 3395 * @crossplatform 3396 * @atomicservice 3397 * @since 18 3398 */ 3399 includes(searchElement: number, fromIndex?: number): boolean; 3400 /** 3401 * Returns the item at that index. 3402 * 3403 * @syscap SystemCapability.Utils.Lang 3404 * @atomicservice 3405 * @since 12 3406 */ 3407 /** 3408 * Returns the item at that index. 3409 * 3410 * @syscap SystemCapability.Utils.Lang 3411 * @crossplatform 3412 * @atomicservice 3413 * @since 18 3414 */ 3415 [index: number]: number; 3416 /** 3417 * Find the last occurrence of a specified element in an Int8Array. 3418 * 3419 * @param { number } searchElement - Element to search for in the Int8Array.. 3420 * @param { number } fromIndex - The index at which to start the search. If provided: 3421 * <br>If this index is negative, it is treated as Int8Array.length + fromIndex. 3422 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 3423 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 3424 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 3425 * @syscap SystemCapability.Utils.Lang 3426 * @atomicservice 3427 * @since 18 3428 */ 3429 lastIndexOf(searchElement: number, fromIndex?: number): number; 3430 /** 3431 * Reduce elements in an Int8Array from right to left. 3432 * 3433 * @param { TypedArrayReduceCallback<U, number, Int8Array> } callbackFn - A function that is called for 3434 * each element in the Int8Array. 3435 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 3436 * <br>If no initial value is provided, the last element of the Int8Array will be used, 3437 * <br>and the callback will start with the second-to-last element. 3438 * @returns { U } Returns the single value that results from the reduction. 3439 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3440 * 1.Mandatory parameters are left unspecified. 3441 * 2.Incorrect parameter types. 3442 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 3443 * @throws { BusinessError } 10200201 - Concurrent modification error. 3444 * @syscap SystemCapability.Utils.Lang 3445 * @atomicservice 3446 * @since 18 3447 */ 3448 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Int8Array>, initialValue: U): U; 3449 /** 3450 * Reduce elements in an Int8Array from right to left. 3451 * 3452 * @param { TypedArrayReduceCallback<number, number, Int8Array> } callbackFn - A function that is called for 3453 * each element in the Int8Array. 3454 * @returns { number } Returns the single value that results from the reduction. 3455 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3456 * 1.Mandatory parameters are left unspecified. 3457 * 2.Incorrect parameter types. 3458 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 3459 * @throws { BusinessError } 10200201 - Concurrent modification error. 3460 * @syscap SystemCapability.Utils.Lang 3461 * @atomicservice 3462 * @since 18 3463 */ 3464 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Int8Array>): number; 3465 /** 3466 * Convert an Int8Array to a string. 3467 * 3468 * @returns { string } Returns a string representing the specified Int8Array and its elements, separated by commas. 3469 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 3470 * @throws { BusinessError } 10200201 - Concurrent modification error. 3471 * @syscap SystemCapability.Utils.Lang 3472 * @atomicservice 3473 * @since 18 3474 */ 3475 toString(): string; 3476 /** 3477 * Convert an Int8Array to a string, The elements are converted to string using their toLocaleString methods. 3478 * 3479 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 3480 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 3481 * @throws { BusinessError } 10200201 - Concurrent modification error. 3482 * @syscap SystemCapability.Utils.Lang 3483 * @atomicservice 3484 * @since 18 3485 */ 3486 toLocaleString(): string; 3487 /** 3488 * Create an Int8Array containing these parameters. 3489 * 3490 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Int8Array. 3491 * @returns { Int8Array } Returns a new Int8Array instance containing the specified elements. 3492 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3493 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3494 * @static 3495 * @syscap SystemCapability.Utils.Lang 3496 * @atomicservice 3497 * @since 18 3498 */ 3499 static of(...items: number[]): Int8Array; 3500 } 3501 3502 /** 3503 * The Uint8ClampedArray typed array represents an array of 8-bit unsigned integers clamped to 0–255. 3504 * The contents are initialized to 0. 3505 * If multiple threads access a Uint8ClampedArray instance concurrently, 3506 * and at least one of the threads modifies the array structurally, 3507 * it must be synchronized externally. 3508 * 3509 * @syscap SystemCapability.Utils.Lang 3510 * @atomicservice 3511 * @since 12 3512 */ 3513 /** 3514 * The Uint8ClampedArray typed array represents an array of 8-bit unsigned integers clamped to 0–255. 3515 * The contents are initialized to 0. 3516 * If multiple threads access a Uint8ClampedArray instance concurrently, 3517 * and at least one of the threads modifies the array structurally, 3518 * it must be synchronized externally. 3519 * 3520 * @syscap SystemCapability.Utils.Lang 3521 * @crossplatform 3522 * @atomicservice 3523 * @since 18 3524 */ 3525 @Sendable 3526 class Uint8ClampedArray { 3527 /** 3528 * The size in bytes of each element in the array. 3529 * 3530 * @type { number } 3531 * @readonly 3532 * @static 3533 * @syscap SystemCapability.Utils.Lang 3534 * @atomicservice 3535 * @since 12 3536 */ 3537 /** 3538 * The size in bytes of each element in the array. 3539 * 3540 * @type { number } 3541 * @readonly 3542 * @static 3543 * @syscap SystemCapability.Utils.Lang 3544 * @crossplatform 3545 * @atomicservice 3546 * @since 18 3547 */ 3548 static readonly BYTES_PER_ELEMENT: number; 3549 /** 3550 * The ArrayBuffer instance referenced by the array. 3551 * 3552 * @type { ArrayBuffer } 3553 * @readonly 3554 * @syscap SystemCapability.Utils.Lang 3555 * @atomicservice 3556 * @since 12 3557 */ 3558 /** 3559 * The ArrayBuffer instance referenced by the array. 3560 * 3561 * @type { ArrayBuffer } 3562 * @readonly 3563 * @syscap SystemCapability.Utils.Lang 3564 * @crossplatform 3565 * @atomicservice 3566 * @since 18 3567 */ 3568 readonly buffer: ArrayBuffer; 3569 /** 3570 * The length in bytes of the array. 3571 * 3572 * @type { number } 3573 * @readonly 3574 * @syscap SystemCapability.Utils.Lang 3575 * @atomicservice 3576 * @since 12 3577 */ 3578 /** 3579 * The length in bytes of the array. 3580 * 3581 * @type { number } 3582 * @readonly 3583 * @syscap SystemCapability.Utils.Lang 3584 * @crossplatform 3585 * @atomicservice 3586 * @since 18 3587 */ 3588 readonly byteLength: number; 3589 /** 3590 * The offset in bytes of the array. 3591 * 3592 * @type { number } 3593 * @readonly 3594 * @syscap SystemCapability.Utils.Lang 3595 * @atomicservice 3596 * @since 12 3597 */ 3598 /** 3599 * The offset in bytes of the array. 3600 * 3601 * @type { number } 3602 * @readonly 3603 * @syscap SystemCapability.Utils.Lang 3604 * @crossplatform 3605 * @atomicservice 3606 * @since 18 3607 */ 3608 readonly byteOffset: number; 3609 /** 3610 * The length of the array. 3611 * 3612 * @type { number } 3613 * @readonly 3614 * @syscap SystemCapability.Utils.Lang 3615 * @atomicservice 3616 * @since 12 3617 */ 3618 /** 3619 * The length of the array. 3620 * 3621 * @type { number } 3622 * @readonly 3623 * @syscap SystemCapability.Utils.Lang 3624 * @crossplatform 3625 * @atomicservice 3626 * @since 18 3627 */ 3628 readonly length: number; 3629 /** 3630 * A constructor used to create an Uint8ClampedArray. 3631 * 3632 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3633 * @syscap SystemCapability.Utils.Lang 3634 * @atomicservice 3635 * @since 12 3636 */ 3637 /** 3638 * A constructor used to create an Uint8ClampedArray. 3639 * 3640 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3641 * @syscap SystemCapability.Utils.Lang 3642 * @crossplatform 3643 * @atomicservice 3644 * @since 18 3645 */ 3646 constructor(); 3647 /** 3648 * A constructor used to create an Uint8ClampedArray. 3649 * 3650 * @param { number } length - The length of the array 3651 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3652 * @throws { BusinessError } 401 - Parameter error. 3653 * @syscap SystemCapability.Utils.Lang 3654 * @atomicservice 3655 * @since 12 3656 */ 3657 /** 3658 * A constructor used to create an Uint8ClampedArray. 3659 * 3660 * @param { number } length - The length of the array 3661 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3662 * @throws { BusinessError } 401 - Parameter error. 3663 * @syscap SystemCapability.Utils.Lang 3664 * @crossplatform 3665 * @atomicservice 3666 * @since 18 3667 */ 3668 constructor(length: number); 3669 /** 3670 * A constructor used to create an Uint8ClampedArray. 3671 * 3672 * @param { Iterable<number> } elements - An iterable object to convert to an Uint8ClampedArray. 3673 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3674 * @throws { BusinessError } 401 - Parameter error. 3675 * @syscap SystemCapability.Utils.Lang 3676 * @atomicservice 3677 * @since 12 3678 */ 3679 /** 3680 * A constructor used to create an Uint8ClampedArray. 3681 * 3682 * @param { Iterable<number> } elements - An iterable object to convert to an Uint8ClampedArray. 3683 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3684 * @throws { BusinessError } 401 - Parameter error. 3685 * @syscap SystemCapability.Utils.Lang 3686 * @crossplatform 3687 * @atomicservice 3688 * @since 18 3689 */ 3690 constructor(elements: Iterable<number>); 3691 /** 3692 * A constructor used to create an Uint8ClampedArray. 3693 * 3694 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 3695 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3696 * @throws { BusinessError } 401 - Parameter error. 3697 * @syscap SystemCapability.Utils.Lang 3698 * @atomicservice 3699 * @since 12 3700 */ 3701 /** 3702 * A constructor used to create an Uint8ClampedArray. 3703 * 3704 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 3705 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3706 * @throws { BusinessError } 401 - Parameter error. 3707 * @syscap SystemCapability.Utils.Lang 3708 * @crossplatform 3709 * @atomicservice 3710 * @since 18 3711 */ 3712 constructor(array: ArrayLike<number> | ArrayBuffer); 3713 /** 3714 * A constructor used to create an Uint8ClampedArray. 3715 * 3716 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 3717 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 3718 * that will be exposed by the typed array view. 3719 * @param { number } [length] - The length parameter specifies the memory range 3720 * that will be exposed by the typed array view. 3721 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3722 * @throws { BusinessError } 401 - Parameter error. 3723 * @syscap SystemCapability.Utils.Lang 3724 * @atomicservice 3725 * @since 12 3726 */ 3727 /** 3728 * A constructor used to create an Uint8ClampedArray. 3729 * 3730 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 3731 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 3732 * that will be exposed by the typed array view. 3733 * @param { number } [length] - The length parameter specifies the memory range 3734 * that will be exposed by the typed array view. 3735 * @throws { BusinessError } 10200012 - The Uint8ClampedArray's constructor cannot be directly invoked. 3736 * @throws { BusinessError } 401 - Parameter error. 3737 * @syscap SystemCapability.Utils.Lang 3738 * @crossplatform 3739 * @atomicservice 3740 * @since 18 3741 */ 3742 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 3743 /** 3744 * Creates an Uint8ClampedArray from an array-like object. 3745 * 3746 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint8ClampedArray. 3747 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3748 * @throws { BusinessError } 401 - Parameter error. 3749 * @static 3750 * @syscap SystemCapability.Utils.Lang 3751 * @atomicservice 3752 * @since 12 3753 */ 3754 /** 3755 * Creates an Uint8ClampedArray from an array-like object. 3756 * 3757 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint8ClampedArray. 3758 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3759 * @throws { BusinessError } 401 - Parameter error. 3760 * @static 3761 * @syscap SystemCapability.Utils.Lang 3762 * @crossplatform 3763 * @atomicservice 3764 * @since 18 3765 */ 3766 static from(arrayLike: ArrayLike<number>): Uint8ClampedArray; 3767 3768 /** 3769 * Creates an Uint8ClampedArray from an array-like object. 3770 * 3771 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint8ClampedArray. 3772 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 3773 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3774 * @throws { BusinessError } 401 - Parameter error. 3775 * @static 3776 * @syscap SystemCapability.Utils.Lang 3777 * @atomicservice 3778 * @since 12 3779 */ 3780 /** 3781 * Creates an Uint8ClampedArray from an array-like object. 3782 * 3783 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint8ClampedArray. 3784 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 3785 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3786 * @throws { BusinessError } 401 - Parameter error. 3787 * @static 3788 * @syscap SystemCapability.Utils.Lang 3789 * @crossplatform 3790 * @atomicservice 3791 * @since 18 3792 */ 3793 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Uint8ClampedArray; 3794 /** 3795 * Creates an Uint8ClampedArray from an iterable object. 3796 * 3797 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint8ClampedArray. 3798 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 3799 * call on every element of the array. 3800 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3801 * @throws { BusinessError } 401 - Parameter error. 3802 * @static 3803 * @syscap SystemCapability.Utils.Lang 3804 * @atomicservice 3805 * @since 12 3806 */ 3807 /** 3808 * Creates an Uint8ClampedArray from an iterable object. 3809 * 3810 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint8ClampedArray. 3811 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 3812 * call on every element of the array. 3813 * @returns { Uint8ClampedArray } A new Uint8ClampedArray instance 3814 * @throws { BusinessError } 401 - Parameter error. 3815 * @static 3816 * @syscap SystemCapability.Utils.Lang 3817 * @crossplatform 3818 * @atomicservice 3819 * @since 18 3820 */ 3821 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Uint8ClampedArray; 3822 /** 3823 * Returns the this object after copying a section of the array identified by start and end 3824 * to the same array starting at position target. 3825 * 3826 * @param { number } target - If target is negative, it is treated as length+target where length is the 3827 * length of the array. 3828 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 3829 * is treated as length+end. 3830 * @param { number } [end] - If not specified, length of the this object is used as its default value. 3831 * @returns { Uint8ClampedArray } The array itself. 3832 * @throws { BusinessError } 401 - Parameter error. 3833 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 3834 * @throws { BusinessError } 10200201 - Concurrent modification error. 3835 * @syscap SystemCapability.Utils.Lang 3836 * @atomicservice 3837 * @since 12 3838 */ 3839 /** 3840 * Returns the this object after copying a section of the array identified by start and end 3841 * to the same array starting at position target. 3842 * 3843 * @param { number } target - If target is negative, it is treated as length+target where length is the 3844 * length of the array. 3845 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 3846 * is treated as length+end. 3847 * @param { number } [end] - If not specified, length of the this object is used as its default value. 3848 * @returns { Uint8ClampedArray } The array itself. 3849 * @throws { BusinessError } 401 - Parameter error. 3850 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 3851 * @throws { BusinessError } 10200201 - Concurrent modification error. 3852 * @syscap SystemCapability.Utils.Lang 3853 * @crossplatform 3854 * @atomicservice 3855 * @since 18 3856 */ 3857 copyWithin(target: number, start: number, end?: number): Uint8ClampedArray; 3858 /** 3859 * Determines whether all the members of an array satisfy the specified test. 3860 * 3861 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 3862 * that accepts up to three arguments. 3863 * The every method calls the predicate function for each element in the array until 3864 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 3865 * @returns { boolean } true unless predicate returns a false value for a typed array element, 3866 * in which case false is immediately returned. 3867 * @throws { BusinessError } 401 - Parameter error. 3868 * @throws { BusinessError } 10200011 - The every method cannot be bound. 3869 * @throws { BusinessError } 10200201 - Concurrent modification error. 3870 * @syscap SystemCapability.Utils.Lang 3871 * @atomicservice 3872 * @since 12 3873 */ 3874 /** 3875 * Determines whether all the members of an array satisfy the specified test. 3876 * 3877 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 3878 * that accepts up to three arguments. 3879 * The every method calls the predicate function for each element in the array until 3880 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 3881 * @returns { boolean } true unless predicate returns a false value for a typed array element, 3882 * in which case false is immediately returned. 3883 * @throws { BusinessError } 401 - Parameter error. 3884 * @throws { BusinessError } 10200011 - The every method cannot be bound. 3885 * @throws { BusinessError } 10200201 - Concurrent modification error. 3886 * @syscap SystemCapability.Utils.Lang 3887 * @crossplatform 3888 * @atomicservice 3889 * @since 18 3890 */ 3891 every(predicate: TypedArrayPredicateFn<number, Uint8ClampedArray>): boolean; 3892 /** 3893 * Returns the this object after filling the section identified by start and end with value. 3894 * 3895 * @param { number } value - value to fill array section with. 3896 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 3897 * length+start where length is the length of the array. 3898 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 3899 * length+end. 3900 * @returns { Uint8ClampedArray } The array itself. 3901 * @throws { BusinessError } 401 - Parameter error. 3902 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 3903 * @throws { BusinessError } 10200201 - Concurrent modification error. 3904 * @syscap SystemCapability.Utils.Lang 3905 * @atomicservice 3906 * @since 12 3907 */ 3908 /** 3909 * Returns the this object after filling the section identified by start and end with value. 3910 * 3911 * @param { number } value - value to fill array section with. 3912 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 3913 * length+start where length is the length of the array. 3914 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 3915 * length+end. 3916 * @returns { Uint8ClampedArray } The array itself. 3917 * @throws { BusinessError } 401 - Parameter error. 3918 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 3919 * @throws { BusinessError } 10200201 - Concurrent modification error. 3920 * @syscap SystemCapability.Utils.Lang 3921 * @crossplatform 3922 * @atomicservice 3923 * @since 18 3924 */ 3925 fill(value: number, start?: number, end?: number): Uint8ClampedArray; 3926 /** 3927 * Returns the elements of an array that meet the condition specified in a callback function. 3928 * 3929 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 3930 * that accepts up to three arguments. 3931 * The filter method calls the predicate function one time for each element in the array. 3932 * @returns { Uint8ClampedArray } The array itself. 3933 * @throws { BusinessError } 401 - Parameter error. 3934 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 3935 * @throws { BusinessError } 10200201 - Concurrent modification error. 3936 * @syscap SystemCapability.Utils.Lang 3937 * @atomicservice 3938 * @since 12 3939 */ 3940 /** 3941 * Returns the elements of an array that meet the condition specified in a callback function. 3942 * 3943 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 3944 * that accepts up to three arguments. 3945 * The filter method calls the predicate function one time for each element in the array. 3946 * @returns { Uint8ClampedArray } The array itself. 3947 * @throws { BusinessError } 401 - Parameter error. 3948 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 3949 * @throws { BusinessError } 10200201 - Concurrent modification error. 3950 * @syscap SystemCapability.Utils.Lang 3951 * @crossplatform 3952 * @atomicservice 3953 * @since 18 3954 */ 3955 filter(predicate: TypedArrayPredicateFn<number, Uint8ClampedArray>): Uint8ClampedArray; 3956 /** 3957 * Returns the value of the first element in the array where predicate is true, and undefined 3958 * otherwise. 3959 * 3960 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - find calls predicate once for 3961 * each element of the array, in ascending order, until it finds one where predicate returns true. 3962 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 3963 * @returns { number | undefined } The first element in the typed array 3964 * that satisfies the provided testing function. Otherwise, undefined is returned. 3965 * @throws { BusinessError } 401 - Parameter error. 3966 * @throws { BusinessError } 10200011 - The find method cannot be bound. 3967 * @throws { BusinessError } 10200201 - Concurrent modification error. 3968 * @syscap SystemCapability.Utils.Lang 3969 * @atomicservice 3970 * @since 12 3971 */ 3972 /** 3973 * Returns the value of the first element in the array where predicate is true, and undefined 3974 * otherwise. 3975 * 3976 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - find calls predicate once for 3977 * each element of the array, in ascending order, until it finds one where predicate returns true. 3978 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 3979 * @returns { number | undefined } The first element in the typed array 3980 * that satisfies the provided testing function. Otherwise, undefined is returned. 3981 * @throws { BusinessError } 401 - Parameter error. 3982 * @throws { BusinessError } 10200011 - The find method cannot be bound. 3983 * @throws { BusinessError } 10200201 - Concurrent modification error. 3984 * @syscap SystemCapability.Utils.Lang 3985 * @crossplatform 3986 * @atomicservice 3987 * @since 18 3988 */ 3989 find(predicate: TypedArrayPredicateFn<number, Uint8ClampedArray>): number | undefined; 3990 /** 3991 * Returns the index of the first element in the array where predicate is true, and -1 3992 * otherwise. 3993 * 3994 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - find calls predicate once for 3995 * each element of the array, in ascending order, until it finds one where predicate returns true. 3996 * If such an element is found, findIndex immediately returns that element index. 3997 * Otherwise, findIndex returns -1. 3998 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 3999 * @throws { BusinessError } 401 - Parameter error. 4000 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 4001 * @throws { BusinessError } 10200201 - Concurrent modification error. 4002 * @syscap SystemCapability.Utils.Lang 4003 * @atomicservice 4004 * @since 12 4005 */ 4006 /** 4007 * Returns the index of the first element in the array where predicate is true, and -1 4008 * otherwise. 4009 * 4010 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - find calls predicate once for 4011 * each element of the array, in ascending order, until it finds one where predicate returns true. 4012 * If such an element is found, findIndex immediately returns that element index. 4013 * Otherwise, findIndex returns -1. 4014 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 4015 * @throws { BusinessError } 401 - Parameter error. 4016 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 4017 * @throws { BusinessError } 10200201 - Concurrent modification error. 4018 * @syscap SystemCapability.Utils.Lang 4019 * @crossplatform 4020 * @atomicservice 4021 * @since 18 4022 */ 4023 findIndex(predicate: TypedArrayPredicateFn<number, Uint8ClampedArray>): number; 4024 /** 4025 * Performs the specified action for each element in an array. 4026 * 4027 * @param { TypedArrayForEachCallback<number, Uint8ClampedArray> } callbackFn - A function that 4028 * accepts up to three arguments. 4029 * forEach calls the callbackfn function one time for each element in the array. 4030 * @throws { BusinessError } 401 - Parameter error. 4031 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 4032 * @throws { BusinessError } 10200201 - Concurrent modification error. 4033 * @syscap SystemCapability.Utils.Lang 4034 * @atomicservice 4035 * @since 12 4036 */ 4037 /** 4038 * Performs the specified action for each element in an array. 4039 * 4040 * @param { TypedArrayForEachCallback<number, Uint8ClampedArray> } callbackFn - A function that 4041 * accepts up to three arguments. 4042 * forEach calls the callbackfn function one time for each element in the array. 4043 * @throws { BusinessError } 401 - Parameter error. 4044 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 4045 * @throws { BusinessError } 10200201 - Concurrent modification error. 4046 * @syscap SystemCapability.Utils.Lang 4047 * @crossplatform 4048 * @atomicservice 4049 * @since 18 4050 */ 4051 forEach(callbackFn: TypedArrayForEachCallback<number, Uint8ClampedArray>): void; 4052 /** 4053 * Returns the index of the first occurrence of a value in an array. 4054 * 4055 * @param { number } searchElement - The value to locate in the array. 4056 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 4057 * search starts at index 0. 4058 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 4059 * @throws { BusinessError } 401 - Parameter error. 4060 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 4061 * @throws { BusinessError } 10200201 - Concurrent modification error. 4062 * @syscap SystemCapability.Utils.Lang 4063 * @atomicservice 4064 * @since 12 4065 */ 4066 /** 4067 * Returns the index of the first occurrence of a value in an array. 4068 * 4069 * @param { number } searchElement - The value to locate in the array. 4070 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 4071 * search starts at index 0. 4072 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 4073 * @throws { BusinessError } 401 - Parameter error. 4074 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 4075 * @throws { BusinessError } 10200201 - Concurrent modification error. 4076 * @syscap SystemCapability.Utils.Lang 4077 * @crossplatform 4078 * @atomicservice 4079 * @since 18 4080 */ 4081 indexOf(searchElement: number, fromIndex?: number): number; 4082 /** 4083 * Adds all the elements of an array separated by the specified separator string. 4084 * @param { string } [separator] - A string used to separate one element of an array from the next in the 4085 * resulting String. If omitted, the array elements are separated with a comma. 4086 * @returns { string } A string with all typed array elements joined. 4087 * If array.length is 0, the empty string is returned. 4088 * @throws { BusinessError } 401 - Parameter error. 4089 * @throws { BusinessError } 10200011 - The join method cannot be bound. 4090 * @throws { BusinessError } 10200201 - Concurrent modification error. 4091 * @syscap SystemCapability.Utils.Lang 4092 * @atomicservice 4093 * @since 12 4094 */ 4095 /** 4096 * Adds all the elements of an array separated by the specified separator string. 4097 * @param { string } [separator] - A string used to separate one element of an array from the next in the 4098 * resulting String. If omitted, the array elements are separated with a comma. 4099 * @returns { string } A string with all typed array elements joined. 4100 * If array.length is 0, the empty string is returned. 4101 * @throws { BusinessError } 401 - Parameter error. 4102 * @throws { BusinessError } 10200011 - The join method cannot be bound. 4103 * @throws { BusinessError } 10200201 - Concurrent modification error. 4104 * @syscap SystemCapability.Utils.Lang 4105 * @crossplatform 4106 * @atomicservice 4107 * @since 18 4108 */ 4109 join(separator?: string): string; 4110 /** 4111 * Calls a defined callback function on each element of an array, and returns an array that 4112 * contains the results. 4113 * 4114 * @param { TypedArrayMapCallback<number, Uint8ClampedArray> } callbackFn - A function that 4115 * accepts up to three arguments. 4116 * The map method calls the callbackfn function one time for each element in the array. 4117 * @returns { Uint8ClampedArray } The array itself. 4118 * @throws { BusinessError } 401 - Parameter error. 4119 * @throws { BusinessError } 10200011 - The map method cannot be bound. 4120 * @throws { BusinessError } 10200201 - Concurrent modification error. 4121 * @syscap SystemCapability.Utils.Lang 4122 * @atomicservice 4123 * @since 12 4124 */ 4125 /** 4126 * Calls a defined callback function on each element of an array, and returns an array that 4127 * contains the results. 4128 * 4129 * @param { TypedArrayMapCallback<number, Uint8ClampedArray> } callbackFn - A function that 4130 * accepts up to three arguments. 4131 * The map method calls the callbackfn function one time for each element in the array. 4132 * @returns { Uint8ClampedArray } The array itself. 4133 * @throws { BusinessError } 401 - Parameter error. 4134 * @throws { BusinessError } 10200011 - The map method cannot be bound. 4135 * @throws { BusinessError } 10200201 - Concurrent modification error. 4136 * @syscap SystemCapability.Utils.Lang 4137 * @crossplatform 4138 * @atomicservice 4139 * @since 18 4140 */ 4141 map(callbackFn: TypedArrayMapCallback<number, Uint8ClampedArray>): Uint8ClampedArray; 4142 /** 4143 * Calls the specified callback function for all the elements in an array. The return value of 4144 * the callback function is the accumulated result, and is provided as an argument in the next 4145 * call to the callback function. 4146 * 4147 * @param { TypedArrayReduceCallback<number, number, Uint8ClampedArray> } callbackFn - A function that 4148 * accepts up to four arguments. 4149 * The reduce method calls the callbackfn function one time for each element in the array. 4150 * @returns { number } The value that results from running the "reducer" callback function to 4151 * completion over the entire typed array. 4152 * @throws { BusinessError } 401 - Parameter error. 4153 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 4154 * @throws { BusinessError } 10200201 - Concurrent modification error. 4155 * @syscap SystemCapability.Utils.Lang 4156 * @atomicservice 4157 * @since 12 4158 */ 4159 /** 4160 * Calls the specified callback function for all the elements in an array. The return value of 4161 * the callback function is the accumulated result, and is provided as an argument in the next 4162 * call to the callback function. 4163 * 4164 * @param { TypedArrayReduceCallback<number, number, Uint8ClampedArray> } callbackFn - A function that 4165 * accepts up to four arguments. 4166 * The reduce method calls the callbackfn function one time for each element in the array. 4167 * @returns { number } The value that results from running the "reducer" callback function to 4168 * completion over the entire typed array. 4169 * @throws { BusinessError } 401 - Parameter error. 4170 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 4171 * @throws { BusinessError } 10200201 - Concurrent modification error. 4172 * @syscap SystemCapability.Utils.Lang 4173 * @crossplatform 4174 * @atomicservice 4175 * @since 18 4176 */ 4177 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint8ClampedArray>): number; 4178 /** 4179 * Calls the specified callback function for all the elements in an array. The return value of 4180 * the callback function is the accumulated result, and is provided as an argument in the next 4181 * call to the callback function. 4182 * 4183 * @param { TypedArrayReduceCallback<U, number, Uint8ClampedArray> } callbackFn - A function that 4184 * accepts up to four arguments. 4185 * The reduce method calls the callbackfn function one time for each element in the array. 4186 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 4187 * the accumulation. The first call to the callbackfn function provides this value as an argument 4188 * instead of an array value. 4189 * @returns { U } The value that results from running the "reducer" callback function to 4190 * completion over the entire typed array. 4191 * @throws { BusinessError } 401 - Parameter error. 4192 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 4193 * @throws { BusinessError } 10200201 - Concurrent modification error. 4194 * @syscap SystemCapability.Utils.Lang 4195 * @atomicservice 4196 * @since 12 4197 */ 4198 /** 4199 * Calls the specified callback function for all the elements in an array. The return value of 4200 * the callback function is the accumulated result, and is provided as an argument in the next 4201 * call to the callback function. 4202 * 4203 * @param { TypedArrayReduceCallback<U, number, Uint8ClampedArray> } callbackFn - A function that 4204 * accepts up to four arguments. 4205 * The reduce method calls the callbackfn function one time for each element in the array. 4206 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 4207 * the accumulation. The first call to the callbackfn function provides this value as an argument 4208 * instead of an array value. 4209 * @returns { U } The value that results from running the "reducer" callback function to 4210 * completion over the entire typed array. 4211 * @throws { BusinessError } 401 - Parameter error. 4212 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 4213 * @throws { BusinessError } 10200201 - Concurrent modification error. 4214 * @syscap SystemCapability.Utils.Lang 4215 * @crossplatform 4216 * @atomicservice 4217 * @since 18 4218 */ 4219 reduce<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Uint8ClampedArray>, initialValue: U): U; 4220 /** 4221 * Reverses the elements in an Array. 4222 * 4223 * @returns { Uint8ClampedArray } The reference to the original typed array, now reversed. 4224 * <br>Note that the typed array is reversed in place, and no copy is made. 4225 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 4226 * @throws { BusinessError } 10200201 - Concurrent modification error. 4227 * @syscap SystemCapability.Utils.Lang 4228 * @atomicservice 4229 * @since 12 4230 */ 4231 /** 4232 * Reverses the elements in an Array. 4233 * 4234 * @returns { Uint8ClampedArray } The reference to the original typed array, now reversed. 4235 * <br>Note that the typed array is reversed in place, and no copy is made. 4236 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 4237 * @throws { BusinessError } 10200201 - Concurrent modification error. 4238 * @syscap SystemCapability.Utils.Lang 4239 * @crossplatform 4240 * @atomicservice 4241 * @since 18 4242 */ 4243 reverse(): Uint8ClampedArray; 4244 /** 4245 * Sets a value or an array of values. 4246 * 4247 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 4248 * @param { number } [offset] - The index in the current array at which the values are to be written. 4249 * @throws { BusinessError } 401 - Parameter error. 4250 * @throws { BusinessError } 10200011 - The set method cannot be bound. 4251 * @throws { BusinessError } 10200201 - Concurrent modification error. 4252 * @syscap SystemCapability.Utils.Lang 4253 * @atomicservice 4254 * @since 12 4255 */ 4256 /** 4257 * Sets a value or an array of values. 4258 * 4259 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 4260 * @param { number } [offset] - The index in the current array at which the values are to be written. 4261 * @throws { BusinessError } 401 - Parameter error. 4262 * @throws { BusinessError } 10200011 - The set method cannot be bound. 4263 * @throws { BusinessError } 10200201 - Concurrent modification error. 4264 * @syscap SystemCapability.Utils.Lang 4265 * @crossplatform 4266 * @atomicservice 4267 * @since 18 4268 */ 4269 set(array: ArrayLike<number>, offset?: number): void; 4270 /** 4271 * Returns a section of an array. 4272 * 4273 * @param { number } [start] - The beginning of the specified portion of the array. 4274 * @param { number } [end] - The end of the specified portion of the array. 4275 * This is exclusive of the element at the index 'end'. 4276 * @returns { Uint8ClampedArray } A new typed array containing the extracted elements. 4277 * @throws { BusinessError } 401 - Parameter error. 4278 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 4279 * @throws { BusinessError } 10200201 - Concurrent modification error. 4280 * @syscap SystemCapability.Utils.Lang 4281 * @atomicservice 4282 * @since 12 4283 */ 4284 /** 4285 * Returns a section of an array. 4286 * 4287 * @param { number } [start] - The beginning of the specified portion of the array. 4288 * @param { number } [end] - The end of the specified portion of the array. 4289 * This is exclusive of the element at the index 'end'. 4290 * @returns { Uint8ClampedArray } A new typed array containing the extracted elements. 4291 * @throws { BusinessError } 401 - Parameter error. 4292 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 4293 * @throws { BusinessError } 10200201 - Concurrent modification error. 4294 * @syscap SystemCapability.Utils.Lang 4295 * @crossplatform 4296 * @atomicservice 4297 * @since 18 4298 */ 4299 slice(start?: number, end?: number): Uint8ClampedArray; 4300 /** 4301 * Determines whether the specified callback function returns true for any element of an array. 4302 * 4303 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 4304 * that accepts up to three arguments. 4305 * The some method calls the predicate function for each element in the array until 4306 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 4307 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 4308 * in which case true is immediately returned. 4309 * @throws { BusinessError } 401 - Parameter error. 4310 * @throws { BusinessError } 10200011 - The some method cannot be bound. 4311 * @throws { BusinessError } 10200201 - Concurrent modification error. 4312 * @syscap SystemCapability.Utils.Lang 4313 * @atomicservice 4314 * @since 12 4315 */ 4316 /** 4317 * Determines whether the specified callback function returns true for any element of an array. 4318 * 4319 * @param { TypedArrayPredicateFn<number, Uint8ClampedArray> } predicate - A function 4320 * that accepts up to three arguments. 4321 * The some method calls the predicate function for each element in the array until 4322 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 4323 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 4324 * in which case true is immediately returned. 4325 * @throws { BusinessError } 401 - Parameter error. 4326 * @throws { BusinessError } 10200011 - The some method cannot be bound. 4327 * @throws { BusinessError } 10200201 - Concurrent modification error. 4328 * @syscap SystemCapability.Utils.Lang 4329 * @crossplatform 4330 * @atomicservice 4331 * @since 18 4332 */ 4333 some(predicate: TypedArrayPredicateFn<number, Uint8ClampedArray>): boolean; 4334 /** 4335 * Sorts an array. 4336 * 4337 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 4338 * It is expected to return a negative value if first argument is less than second argument, 4339 * zero if they're equal and a positive value otherwise. 4340 * If omitted, the elements are sorted in ascending, ASCII character order. 4341 * @returns { Uint8ClampedArray } The reference to the original typed array, now sorted. 4342 * Note that the typed array is sorted in place and no copy is made. 4343 * @throws { BusinessError } 401 - Parameter error. 4344 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 4345 * @throws { BusinessError } 10200201 - Concurrent modification error. 4346 * @syscap SystemCapability.Utils.Lang 4347 * @atomicservice 4348 * @since 12 4349 */ 4350 /** 4351 * Sorts an array. 4352 * 4353 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 4354 * It is expected to return a negative value if first argument is less than second argument, 4355 * zero if they're equal and a positive value otherwise. 4356 * If omitted, the elements are sorted in ascending, ASCII character order. 4357 * @returns { Uint8ClampedArray } The reference to the original typed array, now sorted. 4358 * Note that the typed array is sorted in place and no copy is made. 4359 * @throws { BusinessError } 401 - Parameter error. 4360 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 4361 * @throws { BusinessError } 10200201 - Concurrent modification error. 4362 * @syscap SystemCapability.Utils.Lang 4363 * @crossplatform 4364 * @atomicservice 4365 * @since 18 4366 */ 4367 sort(compareFn?: TypedArrayCompareFn<number>): Uint8ClampedArray; 4368 /** 4369 * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements 4370 * at begin, inclusive, up to end, exclusive. 4371 * 4372 * @param { number } [begin] - The index of the beginning of the array. 4373 * @param { number } [end] - The index of the end of the array. 4374 * @returns { Uint8ClampedArray } A new Uint8ClampedArray object. 4375 * @throws { BusinessError } 401 - Parameter error. 4376 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 4377 * @throws { BusinessError } 10200201 - Concurrent modification error. 4378 * @syscap SystemCapability.Utils.Lang 4379 * @atomicservice 4380 * @since 12 4381 */ 4382 /** 4383 * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements 4384 * at begin, inclusive, up to end, exclusive. 4385 * 4386 * @param { number } [begin] - The index of the beginning of the array. 4387 * @param { number } [end] - The index of the end of the array. 4388 * @returns { Uint8ClampedArray } A new Uint8ClampedArray object. 4389 * @throws { BusinessError } 401 - Parameter error. 4390 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 4391 * @throws { BusinessError } 10200201 - Concurrent modification error. 4392 * @syscap SystemCapability.Utils.Lang 4393 * @crossplatform 4394 * @atomicservice 4395 * @since 18 4396 */ 4397 subarray(begin?: number, end?: number): Uint8ClampedArray; 4398 /** 4399 * Returns the item located at the specified index. 4400 * 4401 * @param { number } index - The zero-based index of the desired code unit.<br/> 4402 * A negative index will count back from the last item. 4403 * @returns { number | undefined } The element in the array matching the given index.<br/> 4404 * Always returns undefined if index < -array.length or 4405 * index >= array.length without attempting to access the corresponding property. 4406 * @throws { BusinessError } 401 - Parameter error. 4407 * @throws { BusinessError } 10200011 - The at method cannot be bound. 4408 * @throws { BusinessError } 10200201 - Concurrent modification error. 4409 * @syscap SystemCapability.Utils.Lang 4410 * @atomicservice 4411 * @since 12 4412 */ 4413 /** 4414 * Returns the item located at the specified index. 4415 * 4416 * @param { number } index - The zero-based index of the desired code unit.<br/> 4417 * A negative index will count back from the last item. 4418 * @returns { number | undefined } The element in the array matching the given index.<br/> 4419 * Always returns undefined if index < -array.length or 4420 * index >= array.length without attempting to access the corresponding property. 4421 * @throws { BusinessError } 401 - Parameter error. 4422 * @throws { BusinessError } 10200011 - The at method cannot be bound. 4423 * @throws { BusinessError } 10200201 - Concurrent modification error. 4424 * @syscap SystemCapability.Utils.Lang 4425 * @crossplatform 4426 * @atomicservice 4427 * @since 18 4428 */ 4429 at(index: number): number | undefined; 4430 /** 4431 * Returns an iterator that iterates over numbers. 4432 * 4433 * @returns { IterableIterator<number> } Iterator object that yields numbers. 4434 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 4435 * @syscap SystemCapability.Utils.Lang 4436 * @atomicservice 4437 * @since 12 4438 */ 4439 /** 4440 * Returns an iterator that iterates over numbers. 4441 * 4442 * @returns { IterableIterator<number> } Iterator object that yields numbers. 4443 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 4444 * @syscap SystemCapability.Utils.Lang 4445 * @crossplatform 4446 * @atomicservice 4447 * @since 18 4448 */ 4449 [Symbol.iterator](): IterableIterator<number>; 4450 /** 4451 * Returns an iterable of key, value pairs for every entry in the array 4452 * 4453 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 4454 * @throws { BusinessError } 10200011 - The method cannot be bound. 4455 * @throws { BusinessError } 10200201 - Concurrent modification error. 4456 * @syscap SystemCapability.Utils.Lang 4457 * @atomicservice 4458 * @since 12 4459 */ 4460 /** 4461 * Returns an iterable of key, value pairs for every entry in the array 4462 * 4463 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 4464 * @throws { BusinessError } 10200011 - The method cannot be bound. 4465 * @throws { BusinessError } 10200201 - Concurrent modification error. 4466 * @syscap SystemCapability.Utils.Lang 4467 * @crossplatform 4468 * @atomicservice 4469 * @since 18 4470 */ 4471 entries(): IterableIterator<[number, number]>; 4472 /** 4473 * Returns an iterable of keys in the array 4474 * 4475 * @returns { IterableIterator<number> } A new iterable iterator object. 4476 * @throws { BusinessError } 10200011 - The method cannot be bound. 4477 * @throws { BusinessError } 10200201 - Concurrent modification error. 4478 * @syscap SystemCapability.Utils.Lang 4479 * @atomicservice 4480 * @since 12 4481 */ 4482 /** 4483 * Returns an iterable of keys in the array 4484 * 4485 * @returns { IterableIterator<number> } A new iterable iterator object. 4486 * @throws { BusinessError } 10200011 - The method cannot be bound. 4487 * @throws { BusinessError } 10200201 - Concurrent modification error. 4488 * @syscap SystemCapability.Utils.Lang 4489 * @crossplatform 4490 * @atomicservice 4491 * @since 18 4492 */ 4493 keys(): IterableIterator<number>; 4494 /** 4495 * Returns an iterable of values in the array 4496 * 4497 * @returns { IterableIterator<number> } A new iterable iterator object. 4498 * @throws { BusinessError } 10200011 - The method cannot be bound. 4499 * @throws { BusinessError } 10200201 - Concurrent modification error. 4500 * @syscap SystemCapability.Utils.Lang 4501 * @atomicservice 4502 * @since 12 4503 */ 4504 /** 4505 * Returns an iterable of values in the array 4506 * 4507 * @returns { IterableIterator<number> } A new iterable iterator object. 4508 * @throws { BusinessError } 10200011 - The method cannot be bound. 4509 * @throws { BusinessError } 10200201 - Concurrent modification error. 4510 * @syscap SystemCapability.Utils.Lang 4511 * @crossplatform 4512 * @atomicservice 4513 * @since 18 4514 */ 4515 values(): IterableIterator<number>; 4516 /** 4517 * Determines whether an array includes a certain element, returning true or false as appropriate. 4518 * 4519 * @param { number } searchElement - The element to search for. 4520 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 4521 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 4522 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 4523 * @throws { BusinessError } 401 - Parameter error. 4524 * @throws { BusinessError } 10200011 - The at method cannot be bound. 4525 * @throws { BusinessError } 10200201 - Concurrent modification error. 4526 * @syscap SystemCapability.Utils.Lang 4527 * @atomicservice 4528 * @since 12 4529 */ 4530 /** 4531 * Determines whether an array includes a certain element, returning true or false as appropriate. 4532 * 4533 * @param { number } searchElement - The element to search for. 4534 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 4535 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 4536 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 4537 * @throws { BusinessError } 401 - Parameter error. 4538 * @throws { BusinessError } 10200011 - The at method cannot be bound. 4539 * @throws { BusinessError } 10200201 - Concurrent modification error. 4540 * @syscap SystemCapability.Utils.Lang 4541 * @crossplatform 4542 * @atomicservice 4543 * @since 18 4544 */ 4545 includes(searchElement: number, fromIndex?: number): boolean; 4546 /** 4547 * Returns the item at that index. 4548 * 4549 * @syscap SystemCapability.Utils.Lang 4550 * @atomicservice 4551 * @since 12 4552 */ 4553 /** 4554 * Returns the item at that index. 4555 * 4556 * @syscap SystemCapability.Utils.Lang 4557 * @crossplatform 4558 * @atomicservice 4559 * @since 18 4560 */ 4561 [index: number]: number; 4562 /** 4563 * Find the last occurrence of a specified element in an Uint8ClampedArray. 4564 * 4565 * @param { number } searchElement - Element to search for in the Uint8ClampedArray.. 4566 * @param { number } fromIndex - The index at which to start the search. If provided: 4567 * <br>If this index is negative, it is treated as Uint8ClampedArray.length + fromIndex. 4568 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 4569 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 4570 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 4571 * @syscap SystemCapability.Utils.Lang 4572 * @atomicservice 4573 * @since 18 4574 */ 4575 lastIndexOf(searchElement: number, fromIndex?: number): number; 4576 /** 4577 * Reduce elements in an Uint8ClampedArray from right to left. 4578 * 4579 * @param { TypedArrayReduceCallback<U, number, Uint8ClampedArray> } callbackFn - A function that is called for 4580 * each element in the Uint8ClampedArray. 4581 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 4582 * <br>If no initial value is provided, the last element of the Uint8ClampedArray will be used, 4583 * <br>and the callback will start with the second-to-last element. 4584 * @returns { U } Returns the single value that results from the reduction. 4585 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4586 * 1.Mandatory parameters are left unspecified. 4587 * 2.Incorrect parameter types. 4588 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 4589 * @throws { BusinessError } 10200201 - Concurrent modification error. 4590 * @syscap SystemCapability.Utils.Lang 4591 * @atomicservice 4592 * @since 18 4593 */ 4594 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Uint8ClampedArray>, initialValue: U): U; 4595 /** 4596 * Reduce elements in an Uint8ClampedArray from right to left. 4597 * 4598 * @param { TypedArrayReduceCallback<number, number, Uint8ClampedArray> } callbackFn - A function that is called for 4599 * each element in the Uint8ClampedArray. 4600 * @returns { number } Returns the single value that results from the reduction. 4601 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4602 * 1.Mandatory parameters are left unspecified. 4603 * 2.Incorrect parameter types. 4604 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 4605 * @throws { BusinessError } 10200201 - Concurrent modification error. 4606 * @syscap SystemCapability.Utils.Lang 4607 * @atomicservice 4608 * @since 18 4609 */ 4610 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Uint8ClampedArray>): number; 4611 /** 4612 * Convert an Uint8ClampedArray to a string. 4613 * 4614 * @returns { string } Returns a string representing the specified Uint8ClampedArray and its elements, 4615 * separated by commas. 4616 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 4617 * @throws { BusinessError } 10200201 - Concurrent modification error. 4618 * @syscap SystemCapability.Utils.Lang 4619 * @atomicservice 4620 * @since 18 4621 */ 4622 toString(): string; 4623 /** 4624 * Convert an Uint8ClampedArray to a string, The elements are converted to string using their 4625 * toLocaleString methods. 4626 * 4627 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 4628 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 4629 * @throws { BusinessError } 10200201 - Concurrent modification error. 4630 * @syscap SystemCapability.Utils.Lang 4631 * @atomicservice 4632 * @since 18 4633 */ 4634 toLocaleString(): string; 4635 /** 4636 * Create an Uint8ClampedArray containing these parameters. 4637 * 4638 * @param { number[] } items - A variable number of arguments that will be used as the elements of the 4639 * Uint8ClampedArray. 4640 * @returns { Uint8ClampedArray } Returns a new Uint8ClampedArray instance containing the specified elements. 4641 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4642 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4643 * @static 4644 * @syscap SystemCapability.Utils.Lang 4645 * @atomicservice 4646 * @since 18 4647 */ 4648 static of(...items: number[]): Uint8ClampedArray; 4649 } 4650 4651 /** 4652 * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. 4653 * If multiple threads access a Uint8Array instance concurrently, 4654 * and at least one of the threads modifies the array structurally, 4655 * it must be synchronized externally. 4656 * 4657 * @syscap SystemCapability.Utils.Lang 4658 * @atomicservice 4659 * @since 12 4660 */ 4661 /** 4662 * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. 4663 * If multiple threads access a Uint8Array instance concurrently, 4664 * and at least one of the threads modifies the array structurally, 4665 * it must be synchronized externally. 4666 * 4667 * @syscap SystemCapability.Utils.Lang 4668 * @crossplatform 4669 * @atomicservice 4670 * @since 18 4671 */ 4672 @Sendable 4673 class Uint8Array { 4674 /** 4675 * The size in bytes of each element in the array. 4676 * 4677 * @type { number } 4678 * @readonly 4679 * @static 4680 * @syscap SystemCapability.Utils.Lang 4681 * @atomicservice 4682 * @since 12 4683 */ 4684 /** 4685 * The size in bytes of each element in the array. 4686 * 4687 * @type { number } 4688 * @readonly 4689 * @static 4690 * @syscap SystemCapability.Utils.Lang 4691 * @crossplatform 4692 * @atomicservice 4693 * @since 18 4694 */ 4695 static readonly BYTES_PER_ELEMENT: number; 4696 /** 4697 * The ArrayBuffer instance referenced by the array. 4698 * 4699 * @type { ArrayBuffer } 4700 * @readonly 4701 * @syscap SystemCapability.Utils.Lang 4702 * @atomicservice 4703 * @since 12 4704 */ 4705 /** 4706 * The ArrayBuffer instance referenced by the array. 4707 * 4708 * @type { ArrayBuffer } 4709 * @readonly 4710 * @syscap SystemCapability.Utils.Lang 4711 * @crossplatform 4712 * @atomicservice 4713 * @since 18 4714 */ 4715 readonly buffer: ArrayBuffer; 4716 /** 4717 * The length in bytes of the array. 4718 * 4719 * @type { number } 4720 * @readonly 4721 * @syscap SystemCapability.Utils.Lang 4722 * @atomicservice 4723 * @since 12 4724 */ 4725 /** 4726 * The length in bytes of the array. 4727 * 4728 * @type { number } 4729 * @readonly 4730 * @syscap SystemCapability.Utils.Lang 4731 * @crossplatform 4732 * @atomicservice 4733 * @since 18 4734 */ 4735 readonly byteLength: number; 4736 /** 4737 * The offset in bytes of the array. 4738 * 4739 * @type { number } 4740 * @readonly 4741 * @syscap SystemCapability.Utils.Lang 4742 * @atomicservice 4743 * @since 12 4744 */ 4745 /** 4746 * The offset in bytes of the array. 4747 * 4748 * @type { number } 4749 * @readonly 4750 * @syscap SystemCapability.Utils.Lang 4751 * @crossplatform 4752 * @atomicservice 4753 * @since 18 4754 */ 4755 readonly byteOffset: number; 4756 /** 4757 * The length of the array. 4758 * 4759 * @type { number } 4760 * @readonly 4761 * @syscap SystemCapability.Utils.Lang 4762 * @atomicservice 4763 * @since 12 4764 */ 4765 /** 4766 * The length of the array. 4767 * 4768 * @type { number } 4769 * @readonly 4770 * @syscap SystemCapability.Utils.Lang 4771 * @crossplatform 4772 * @atomicservice 4773 * @since 18 4774 */ 4775 readonly length: number; 4776 /** 4777 * A constructor used to create an Uint8Array. 4778 * 4779 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4780 * @syscap SystemCapability.Utils.Lang 4781 * @atomicservice 4782 * @since 12 4783 */ 4784 /** 4785 * A constructor used to create an Uint8Array. 4786 * 4787 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4788 * @syscap SystemCapability.Utils.Lang 4789 * @crossplatform 4790 * @atomicservice 4791 * @since 18 4792 */ 4793 constructor(); 4794 /** 4795 * A constructor used to create an Uint8Array. 4796 * 4797 * @param { number } length - The length of the array 4798 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4799 * @throws { BusinessError } 401 - Parameter error. 4800 * @syscap SystemCapability.Utils.Lang 4801 * @atomicservice 4802 * @since 12 4803 */ 4804 /** 4805 * A constructor used to create an Uint8Array. 4806 * 4807 * @param { number } length - The length of the array 4808 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4809 * @throws { BusinessError } 401 - Parameter error. 4810 * @syscap SystemCapability.Utils.Lang 4811 * @crossplatform 4812 * @atomicservice 4813 * @since 18 4814 */ 4815 constructor(length: number); 4816 /** 4817 * A constructor used to create an Uint8Array. 4818 * 4819 * @param { Iterable<number> } elements - An iterable object to convert to an Uint8Array. 4820 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4821 * @throws { BusinessError } 401 - Parameter error. 4822 * @syscap SystemCapability.Utils.Lang 4823 * @atomicservice 4824 * @since 12 4825 */ 4826 /** 4827 * A constructor used to create an Uint8Array. 4828 * 4829 * @param { Iterable<number> } elements - An iterable object to convert to an Uint8Array. 4830 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4831 * @throws { BusinessError } 401 - Parameter error. 4832 * @syscap SystemCapability.Utils.Lang 4833 * @crossplatform 4834 * @atomicservice 4835 * @since 18 4836 */ 4837 constructor(elements: Iterable<number>); 4838 /** 4839 * A constructor used to create an Uint8Array. 4840 * 4841 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 4842 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4843 * @throws { BusinessError } 401 - Parameter error. 4844 * @syscap SystemCapability.Utils.Lang 4845 * @atomicservice 4846 * @since 12 4847 */ 4848 /** 4849 * A constructor used to create an Uint8Array. 4850 * 4851 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 4852 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4853 * @throws { BusinessError } 401 - Parameter error. 4854 * @syscap SystemCapability.Utils.Lang 4855 * @crossplatform 4856 * @atomicservice 4857 * @since 18 4858 */ 4859 constructor(array: ArrayLike<number> | ArrayBuffer); 4860 /** 4861 * A constructor used to create an Uint8Array. 4862 * 4863 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 4864 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 4865 * that will be exposed by the typed array view. 4866 * @param { number } [length] - The length parameter specifies the memory range 4867 * that will be exposed by the typed array view. 4868 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4869 * @throws { BusinessError } 401 - Parameter error. 4870 * @syscap SystemCapability.Utils.Lang 4871 * @atomicservice 4872 * @since 12 4873 */ 4874 /** 4875 * A constructor used to create an Uint8Array. 4876 * 4877 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 4878 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 4879 * that will be exposed by the typed array view. 4880 * @param { number } [length] - The length parameter specifies the memory range 4881 * that will be exposed by the typed array view. 4882 * @throws { BusinessError } 10200012 - The Uint8Array's constructor cannot be directly invoked. 4883 * @throws { BusinessError } 401 - Parameter error. 4884 * @syscap SystemCapability.Utils.Lang 4885 * @crossplatform 4886 * @atomicservice 4887 * @since 18 4888 */ 4889 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 4890 /** 4891 * Creates an Uint8Array from an array-like object. 4892 * 4893 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint8Array. 4894 * @returns { Uint8Array } A new Uint8Array instance 4895 * @throws { BusinessError } 401 - Parameter error. 4896 * @static 4897 * @syscap SystemCapability.Utils.Lang 4898 * @atomicservice 4899 * @since 12 4900 */ 4901 /** 4902 * Creates an Uint8Array from an array-like object. 4903 * 4904 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint8Array. 4905 * @returns { Uint8Array } A new Uint8Array instance 4906 * @throws { BusinessError } 401 - Parameter error. 4907 * @static 4908 * @syscap SystemCapability.Utils.Lang 4909 * @crossplatform 4910 * @atomicservice 4911 * @since 18 4912 */ 4913 static from(arrayLike: ArrayLike<number>): Uint8Array; 4914 /** 4915 * Creates an Uint8Array from an array-like object. 4916 * 4917 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint8Array. 4918 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 4919 * @returns { Uint8Array } A new Uint8Array instance 4920 * @throws { BusinessError } 401 - Parameter error. 4921 * @static 4922 * @syscap SystemCapability.Utils.Lang 4923 * @atomicservice 4924 * @since 12 4925 */ 4926 /** 4927 * Creates an Uint8Array from an array-like object. 4928 * 4929 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint8Array. 4930 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 4931 * @returns { Uint8Array } A new Uint8Array instance 4932 * @throws { BusinessError } 401 - Parameter error. 4933 * @static 4934 * @syscap SystemCapability.Utils.Lang 4935 * @crossplatform 4936 * @atomicservice 4937 * @since 18 4938 */ 4939 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Uint8Array; 4940 /** 4941 * Creates an Uint8Array from an iterable object. 4942 * 4943 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint8Array. 4944 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 4945 * call on every element of the array. 4946 * @returns { Uint8Array } A new Uint8Array instance 4947 * @throws { BusinessError } 401 - Parameter error. 4948 * @static 4949 * @syscap SystemCapability.Utils.Lang 4950 * @atomicservice 4951 * @since 12 4952 */ 4953 /** 4954 * Creates an Uint8Array from an iterable object. 4955 * 4956 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint8Array. 4957 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 4958 * call on every element of the array. 4959 * @returns { Uint8Array } A new Uint8Array instance 4960 * @throws { BusinessError } 401 - Parameter error. 4961 * @static 4962 * @syscap SystemCapability.Utils.Lang 4963 * @crossplatform 4964 * @atomicservice 4965 * @since 18 4966 */ 4967 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Uint8Array; 4968 /** 4969 * Returns the this object after copying a section of the array identified by start and end 4970 * to the same array starting at position target. 4971 * 4972 * @param { number } target - If target is negative, it is treated as length+target where length is the 4973 * length of the array. 4974 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 4975 * is treated as length+end. 4976 * @param { number } [end] - If not specified, length of the this object is used as its default value. 4977 * @returns { Uint8Array } The array itself. 4978 * @throws { BusinessError } 401 - Parameter error. 4979 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 4980 * @throws { BusinessError } 10200201 - Concurrent modification error. 4981 * @syscap SystemCapability.Utils.Lang 4982 * @atomicservice 4983 * @since 12 4984 */ 4985 /** 4986 * Returns the this object after copying a section of the array identified by start and end 4987 * to the same array starting at position target. 4988 * 4989 * @param { number } target - If target is negative, it is treated as length+target where length is the 4990 * length of the array. 4991 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 4992 * is treated as length+end. 4993 * @param { number } [end] - If not specified, length of the this object is used as its default value. 4994 * @returns { Uint8Array } The array itself. 4995 * @throws { BusinessError } 401 - Parameter error. 4996 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 4997 * @throws { BusinessError } 10200201 - Concurrent modification error. 4998 * @syscap SystemCapability.Utils.Lang 4999 * @crossplatform 5000 * @atomicservice 5001 * @since 18 5002 */ 5003 copyWithin(target: number, start: number, end?: number): Uint8Array; 5004 /** 5005 * Determines whether all the members of an array satisfy the specified test. 5006 * 5007 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5008 * The every method calls the predicate function for each element in the array until 5009 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 5010 * @returns { boolean } true unless predicate returns a false value for a typed array element, 5011 * in which case false is immediately returned. 5012 * @throws { BusinessError } 401 - Parameter error. 5013 * @throws { BusinessError } 10200011 - The every method cannot be bound. 5014 * @throws { BusinessError } 10200201 - Concurrent modification error. 5015 * @syscap SystemCapability.Utils.Lang 5016 * @atomicservice 5017 * @since 12 5018 */ 5019 /** 5020 * Determines whether all the members of an array satisfy the specified test. 5021 * 5022 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5023 * The every method calls the predicate function for each element in the array until 5024 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 5025 * @returns { boolean } true unless predicate returns a false value for a typed array element, 5026 * in which case false is immediately returned. 5027 * @throws { BusinessError } 401 - Parameter error. 5028 * @throws { BusinessError } 10200011 - The every method cannot be bound. 5029 * @throws { BusinessError } 10200201 - Concurrent modification error. 5030 * @syscap SystemCapability.Utils.Lang 5031 * @crossplatform 5032 * @atomicservice 5033 * @since 18 5034 */ 5035 every(predicate: TypedArrayPredicateFn<number, Uint8Array>): boolean; 5036 /** 5037 * Returns the this object after filling the section identified by start and end with value. 5038 * 5039 * @param { number } value - value to fill array section with. 5040 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 5041 * length+start where length is the length of the array. 5042 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 5043 * length+end. 5044 * @returns { Uint8Array } The array itself. 5045 * @throws { BusinessError } 401 - Parameter error. 5046 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 5047 * @throws { BusinessError } 10200201 - Concurrent modification error. 5048 * @syscap SystemCapability.Utils.Lang 5049 * @atomicservice 5050 * @since 12 5051 */ 5052 /** 5053 * Returns the this object after filling the section identified by start and end with value. 5054 * 5055 * @param { number } value - value to fill array section with. 5056 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 5057 * length+start where length is the length of the array. 5058 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 5059 * length+end. 5060 * @returns { Uint8Array } The array itself. 5061 * @throws { BusinessError } 401 - Parameter error. 5062 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 5063 * @throws { BusinessError } 10200201 - Concurrent modification error. 5064 * @syscap SystemCapability.Utils.Lang 5065 * @crossplatform 5066 * @atomicservice 5067 * @since 18 5068 */ 5069 fill(value: number, start?: number, end?: number): Uint8Array; 5070 /** 5071 * Returns the elements of an array that meet the condition specified in a callback function. 5072 * 5073 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5074 * The filter method calls the predicate function one time for each element in the array. 5075 * @returns { Uint8Array } The array itself. 5076 * @throws { BusinessError } 401 - Parameter error. 5077 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 5078 * @throws { BusinessError } 10200201 - Concurrent modification error. 5079 * @syscap SystemCapability.Utils.Lang 5080 * @atomicservice 5081 * @since 12 5082 */ 5083 /** 5084 * Returns the elements of an array that meet the condition specified in a callback function. 5085 * 5086 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5087 * The filter method calls the predicate function one time for each element in the array. 5088 * @returns { Uint8Array } The array itself. 5089 * @throws { BusinessError } 401 - Parameter error. 5090 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 5091 * @throws { BusinessError } 10200201 - Concurrent modification error. 5092 * @syscap SystemCapability.Utils.Lang 5093 * @crossplatform 5094 * @atomicservice 5095 * @since 18 5096 */ 5097 filter(predicate: TypedArrayPredicateFn<number, Uint8Array>): Uint8Array; 5098 /** 5099 * Returns the value of the first element in the array where predicate is true, and undefined 5100 * otherwise. 5101 * 5102 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - find calls predicate once for each element of 5103 * the array, in ascending order, until it finds one where predicate returns true. 5104 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 5105 * @returns { number | undefined } The first element in the typed array 5106 * that satisfies the provided testing function. Otherwise, undefined is returned. 5107 * @throws { BusinessError } 401 - Parameter error. 5108 * @throws { BusinessError } 10200011 - The find method cannot be bound. 5109 * @throws { BusinessError } 10200201 - Concurrent modification error. 5110 * @syscap SystemCapability.Utils.Lang 5111 * @atomicservice 5112 * @since 12 5113 */ 5114 /** 5115 * Returns the value of the first element in the array where predicate is true, and undefined 5116 * otherwise. 5117 * 5118 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - find calls predicate once for each element of 5119 * the array, in ascending order, until it finds one where predicate returns true. 5120 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 5121 * @returns { number | undefined } The first element in the typed array 5122 * that satisfies the provided testing function. Otherwise, undefined is returned. 5123 * @throws { BusinessError } 401 - Parameter error. 5124 * @throws { BusinessError } 10200011 - The find method cannot be bound. 5125 * @throws { BusinessError } 10200201 - Concurrent modification error. 5126 * @syscap SystemCapability.Utils.Lang 5127 * @crossplatform 5128 * @atomicservice 5129 * @since 18 5130 */ 5131 find(predicate: TypedArrayPredicateFn<number, Uint8Array>): number | undefined; 5132 /** 5133 * Returns the index of the first element in the array where predicate is true, and -1 5134 * otherwise. 5135 * 5136 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - find calls predicate once for each element of 5137 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 5138 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 5139 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 5140 * @throws { BusinessError } 401 - Parameter error. 5141 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 5142 * @throws { BusinessError } 10200201 - Concurrent modification error. 5143 * @syscap SystemCapability.Utils.Lang 5144 * @atomicservice 5145 * @since 12 5146 */ 5147 /** 5148 * Returns the index of the first element in the array where predicate is true, and -1 5149 * otherwise. 5150 * 5151 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - find calls predicate once for each element of 5152 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 5153 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 5154 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 5155 * @throws { BusinessError } 401 - Parameter error. 5156 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 5157 * @throws { BusinessError } 10200201 - Concurrent modification error. 5158 * @syscap SystemCapability.Utils.Lang 5159 * @crossplatform 5160 * @atomicservice 5161 * @since 18 5162 */ 5163 findIndex(predicate: TypedArrayPredicateFn<number, Uint8Array>): number; 5164 /** 5165 * Performs the specified action for each element in an array. 5166 * 5167 * @param { TypedArrayForEachCallback<number, Uint8Array> } callbackFn - A function that 5168 * accepts up to three arguments. 5169 * forEach calls the callbackfn function one time for each element in the array. 5170 * @throws { BusinessError } 401 - Parameter error. 5171 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 5172 * @throws { BusinessError } 10200201 - Concurrent modification error. 5173 * @syscap SystemCapability.Utils.Lang 5174 * @atomicservice 5175 * @since 12 5176 */ 5177 /** 5178 * Performs the specified action for each element in an array. 5179 * 5180 * @param { TypedArrayForEachCallback<number, Uint8Array> } callbackFn - A function that 5181 * accepts up to three arguments. 5182 * forEach calls the callbackfn function one time for each element in the array. 5183 * @throws { BusinessError } 401 - Parameter error. 5184 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 5185 * @throws { BusinessError } 10200201 - Concurrent modification error. 5186 * @syscap SystemCapability.Utils.Lang 5187 * @crossplatform 5188 * @atomicservice 5189 * @since 18 5190 */ 5191 forEach(callbackFn: TypedArrayForEachCallback<number, Uint8Array>): void; 5192 /** 5193 * Returns the index of the first occurrence of a value in an array. 5194 * 5195 * @param { number } searchElement - The value to locate in the array. 5196 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 5197 * search starts at index 0. 5198 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 5199 * @throws { BusinessError } 401 - Parameter error. 5200 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 5201 * @throws { BusinessError } 10200201 - Concurrent modification error. 5202 * @syscap SystemCapability.Utils.Lang 5203 * @atomicservice 5204 * @since 12 5205 */ 5206 /** 5207 * Returns the index of the first occurrence of a value in an array. 5208 * 5209 * @param { number } searchElement - The value to locate in the array. 5210 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 5211 * search starts at index 0. 5212 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 5213 * @throws { BusinessError } 401 - Parameter error. 5214 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 5215 * @throws { BusinessError } 10200201 - Concurrent modification error. 5216 * @syscap SystemCapability.Utils.Lang 5217 * @crossplatform 5218 * @atomicservice 5219 * @since 18 5220 */ 5221 indexOf(searchElement: number, fromIndex?: number): number; 5222 /** 5223 * Adds all the elements of an array separated by the specified separator string. 5224 * @param { string } [separator] - A string used to separate one element of an array from the next in the 5225 * resulting String. If omitted, the array elements are separated with a comma. 5226 * @returns { string } A string with all typed array elements joined. 5227 * If array.length is 0, the empty string is returned. 5228 * @throws { BusinessError } 401 - Parameter error. 5229 * @throws { BusinessError } 10200011 - The join method cannot be bound. 5230 * @throws { BusinessError } 10200201 - Concurrent modification error. 5231 * @syscap SystemCapability.Utils.Lang 5232 * @atomicservice 5233 * @since 12 5234 */ 5235 /** 5236 * Adds all the elements of an array separated by the specified separator string. 5237 * @param { string } [separator] - A string used to separate one element of an array from the next in the 5238 * resulting String. If omitted, the array elements are separated with a comma. 5239 * @returns { string } A string with all typed array elements joined. 5240 * If array.length is 0, the empty string is returned. 5241 * @throws { BusinessError } 401 - Parameter error. 5242 * @throws { BusinessError } 10200011 - The join method cannot be bound. 5243 * @throws { BusinessError } 10200201 - Concurrent modification error. 5244 * @syscap SystemCapability.Utils.Lang 5245 * @crossplatform 5246 * @atomicservice 5247 * @since 18 5248 */ 5249 join(separator?: string): string; 5250 /** 5251 * Calls a defined callback function on each element of an array, and returns an array that 5252 * contains the results. 5253 * 5254 * @param { TypedArrayMapCallback<number, Uint8Array> } callbackFn - A function that 5255 * accepts up to three arguments. 5256 * The map method calls the callbackfn function one time for each element in the array. 5257 * @returns { Uint8Array } The array itself. 5258 * @throws { BusinessError } 401 - Parameter error. 5259 * @throws { BusinessError } 10200011 - The map method cannot be bound. 5260 * @throws { BusinessError } 10200201 - Concurrent modification error. 5261 * @syscap SystemCapability.Utils.Lang 5262 * @atomicservice 5263 * @since 12 5264 */ 5265 /** 5266 * Calls a defined callback function on each element of an array, and returns an array that 5267 * contains the results. 5268 * 5269 * @param { TypedArrayMapCallback<number, Uint8Array> } callbackFn - A function that 5270 * accepts up to three arguments. 5271 * The map method calls the callbackfn function one time for each element in the array. 5272 * @returns { Uint8Array } The array itself. 5273 * @throws { BusinessError } 401 - Parameter error. 5274 * @throws { BusinessError } 10200011 - The map method cannot be bound. 5275 * @throws { BusinessError } 10200201 - Concurrent modification error. 5276 * @syscap SystemCapability.Utils.Lang 5277 * @crossplatform 5278 * @atomicservice 5279 * @since 18 5280 */ 5281 map(callbackFn: TypedArrayMapCallback<number, Uint8Array>): Uint8Array; 5282 /** 5283 * Calls the specified callback function for all the elements in an array. The return value of 5284 * the callback function is the accumulated result, and is provided as an argument in the next 5285 * call to the callback function. 5286 * 5287 * @param { TypedArrayReduceCallback<number, number, Uint8Array> } callbackFn - A function that 5288 * accepts up to four arguments. 5289 * The reduce method calls the callbackfn function one time for each element in the array. 5290 * @returns { number } The value that results from running the "reducer" callback function to 5291 * completion over the entire typed array. 5292 * @throws { BusinessError } 401 - Parameter error. 5293 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5294 * @throws { BusinessError } 10200201 - Concurrent modification error. 5295 * @syscap SystemCapability.Utils.Lang 5296 * @atomicservice 5297 * @since 12 5298 */ 5299 /** 5300 * Calls the specified callback function for all the elements in an array. The return value of 5301 * the callback function is the accumulated result, and is provided as an argument in the next 5302 * call to the callback function. 5303 * 5304 * @param { TypedArrayReduceCallback<number, number, Uint8Array> } callbackFn - A function that 5305 * accepts up to four arguments. 5306 * The reduce method calls the callbackfn function one time for each element in the array. 5307 * @returns { number } The value that results from running the "reducer" callback function to 5308 * completion over the entire typed array. 5309 * @throws { BusinessError } 401 - Parameter error. 5310 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5311 * @throws { BusinessError } 10200201 - Concurrent modification error. 5312 * @syscap SystemCapability.Utils.Lang 5313 * @crossplatform 5314 * @atomicservice 5315 * @since 18 5316 */ 5317 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint8Array>): number; 5318 /** 5319 * Calls the specified callback function for all the elements in an array. The return value of 5320 * the callback function is the accumulated result, and is provided as an argument in the next 5321 * call to the callback function. 5322 * 5323 * @param { TypedArrayReduceCallback<number, number, Uint8Array> } callbackFn - A function that 5324 * accepts up to four arguments. 5325 * The reduce method calls the callbackfn function one time for each element in the array. 5326 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 5327 * the accumulation. The first call to the callbackfn function provides this value as an argument 5328 * instead of an array value. 5329 * @returns { number } The value that results from running the "reducer" callback function to 5330 * completion over the entire typed array. 5331 * @throws { BusinessError } 401 - Parameter error. 5332 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5333 * @throws { BusinessError } 10200201 - Concurrent modification error. 5334 * @syscap SystemCapability.Utils.Lang 5335 * @atomicservice 5336 * @since 12 5337 */ 5338 /** 5339 * Calls the specified callback function for all the elements in an array. The return value of 5340 * the callback function is the accumulated result, and is provided as an argument in the next 5341 * call to the callback function. 5342 * 5343 * @param { TypedArrayReduceCallback<number, number, Uint8Array> } callbackFn - A function that 5344 * accepts up to four arguments. 5345 * The reduce method calls the callbackfn function one time for each element in the array. 5346 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 5347 * the accumulation. The first call to the callbackfn function provides this value as an argument 5348 * instead of an array value. 5349 * @returns { number } The value that results from running the "reducer" callback function to 5350 * completion over the entire typed array. 5351 * @throws { BusinessError } 401 - Parameter error. 5352 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5353 * @throws { BusinessError } 10200201 - Concurrent modification error. 5354 * @syscap SystemCapability.Utils.Lang 5355 * @crossplatform 5356 * @atomicservice 5357 * @since 18 5358 */ 5359 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint8Array>, initialValue: number): number; 5360 /** 5361 * Calls the specified callback function for all the elements in an array. The return value of 5362 * the callback function is the accumulated result, and is provided as an argument in the next 5363 * call to the callback function. 5364 * 5365 * @param { TypedArrayReduceCallback<U, number, Uint8Array> } callbackFn - A function that 5366 * accepts up to four arguments. 5367 * The reduce method calls the callbackfn function one time for each element in the array. 5368 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 5369 * the accumulation. The first call to the callbackfn function provides this value as an argument 5370 * instead of an array value. 5371 * @returns { U } The value that results from running the "reducer" callback function to 5372 * completion over the entire typed array. 5373 * @throws { BusinessError } 401 - Parameter error. 5374 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5375 * @throws { BusinessError } 10200201 - Concurrent modification error. 5376 * @syscap SystemCapability.Utils.Lang 5377 * @atomicservice 5378 * @since 12 5379 */ 5380 /** 5381 * Calls the specified callback function for all the elements in an array. The return value of 5382 * the callback function is the accumulated result, and is provided as an argument in the next 5383 * call to the callback function. 5384 * 5385 * @param { TypedArrayReduceCallback<U, number, Uint8Array> } callbackFn - A function that 5386 * accepts up to four arguments. 5387 * The reduce method calls the callbackfn function one time for each element in the array. 5388 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 5389 * the accumulation. The first call to the callbackfn function provides this value as an argument 5390 * instead of an array value. 5391 * @returns { U } The value that results from running the "reducer" callback function to 5392 * completion over the entire typed array. 5393 * @throws { BusinessError } 401 - Parameter error. 5394 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 5395 * @throws { BusinessError } 10200201 - Concurrent modification error. 5396 * @syscap SystemCapability.Utils.Lang 5397 * @crossplatform 5398 * @atomicservice 5399 * @since 18 5400 */ 5401 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Uint8Array>, initialValue: U): U; 5402 /** 5403 * Reverses the elements in an Array. 5404 * 5405 * @returns { Uint8Array } The reference to the original typed array, now reversed. 5406 * <br>Note that the typed array is reversed in place, and no copy is made. 5407 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 5408 * @throws { BusinessError } 10200201 - Concurrent modification error. 5409 * @syscap SystemCapability.Utils.Lang 5410 * @atomicservice 5411 * @since 12 5412 */ 5413 /** 5414 * Reverses the elements in an Array. 5415 * 5416 * @returns { Uint8Array } The reference to the original typed array, now reversed. 5417 * <br>Note that the typed array is reversed in place, and no copy is made. 5418 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 5419 * @throws { BusinessError } 10200201 - Concurrent modification error. 5420 * @syscap SystemCapability.Utils.Lang 5421 * @crossplatform 5422 * @atomicservice 5423 * @since 18 5424 */ 5425 reverse(): Uint8Array; 5426 /** 5427 * Sets a value or an array of values. 5428 * 5429 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 5430 * @param { number } [offset] - The index in the current array at which the values are to be written. 5431 * @throws { BusinessError } 401 - Parameter error. 5432 * @throws { BusinessError } 10200011 - The set method cannot be bound. 5433 * @throws { BusinessError } 10200201 - Concurrent modification error. 5434 * @syscap SystemCapability.Utils.Lang 5435 * @atomicservice 5436 * @since 12 5437 */ 5438 /** 5439 * Sets a value or an array of values. 5440 * 5441 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 5442 * @param { number } [offset] - The index in the current array at which the values are to be written. 5443 * @throws { BusinessError } 401 - Parameter error. 5444 * @throws { BusinessError } 10200011 - The set method cannot be bound. 5445 * @throws { BusinessError } 10200201 - Concurrent modification error. 5446 * @syscap SystemCapability.Utils.Lang 5447 * @crossplatform 5448 * @atomicservice 5449 * @since 18 5450 */ 5451 set(array: ArrayLike<number>, offset?: number): void; 5452 /** 5453 * Returns a section of an array. 5454 * 5455 * @param { number } [start] - The beginning of the specified portion of the array. 5456 * @param { number } [end] - The end of the specified portion of the array. 5457 * This is exclusive of the element at the index 'end'. 5458 * @returns { Uint8Array } A new typed array containing the extracted elements. 5459 * @throws { BusinessError } 401 - Parameter error. 5460 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 5461 * @throws { BusinessError } 10200201 - Concurrent modification error. 5462 * @syscap SystemCapability.Utils.Lang 5463 * @atomicservice 5464 * @since 12 5465 */ 5466 /** 5467 * Returns a section of an array. 5468 * 5469 * @param { number } [start] - The beginning of the specified portion of the array. 5470 * @param { number } [end] - The end of the specified portion of the array. 5471 * This is exclusive of the element at the index 'end'. 5472 * @returns { Uint8Array } A new typed array containing the extracted elements. 5473 * @throws { BusinessError } 401 - Parameter error. 5474 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 5475 * @throws { BusinessError } 10200201 - Concurrent modification error. 5476 * @syscap SystemCapability.Utils.Lang 5477 * @crossplatform 5478 * @atomicservice 5479 * @since 18 5480 */ 5481 slice(start?: number, end?: number): Uint8Array; 5482 /** 5483 * Determines whether the specified callback function returns true for any element of an array. 5484 * 5485 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5486 * The some method calls the predicate function for each element in the array until 5487 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 5488 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 5489 * in which case true is immediately returned. 5490 * @throws { BusinessError } 401 - Parameter error. 5491 * @throws { BusinessError } 10200011 - The some method cannot be bound. 5492 * @throws { BusinessError } 10200201 - Concurrent modification error. 5493 * @syscap SystemCapability.Utils.Lang 5494 * @atomicservice 5495 * @since 12 5496 */ 5497 /** 5498 * Determines whether the specified callback function returns true for any element of an array. 5499 * 5500 * @param { TypedArrayPredicateFn<number, Uint8Array> } predicate - A function that accepts up to three arguments. 5501 * The some method calls the predicate function for each element in the array until 5502 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 5503 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 5504 * in which case true is immediately returned. 5505 * @throws { BusinessError } 401 - Parameter error. 5506 * @throws { BusinessError } 10200011 - The some method cannot be bound. 5507 * @throws { BusinessError } 10200201 - Concurrent modification error. 5508 * @syscap SystemCapability.Utils.Lang 5509 * @crossplatform 5510 * @atomicservice 5511 * @since 18 5512 */ 5513 some(predicate: TypedArrayPredicateFn<number, Uint8Array>): boolean; 5514 /** 5515 * Sorts an array. 5516 * 5517 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 5518 * It is expected to return a negative value if first argument is less than second argument, 5519 * zero if they're equal and a positive value otherwise. 5520 * If omitted, the elements are sorted in ascending, ASCII character order. 5521 * @returns { Uint8Array } The reference to the original typed array, now sorted. 5522 * Note that the typed array is sorted in place and no copy is made. 5523 * @throws { BusinessError } 401 - Parameter error. 5524 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 5525 * @throws { BusinessError } 10200201 - Concurrent modification error. 5526 * @syscap SystemCapability.Utils.Lang 5527 * @atomicservice 5528 * @since 12 5529 */ 5530 /** 5531 * Sorts an array. 5532 * 5533 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 5534 * It is expected to return a negative value if first argument is less than second argument, 5535 * zero if they're equal and a positive value otherwise. 5536 * If omitted, the elements are sorted in ascending, ASCII character order. 5537 * @returns { Uint8Array } The reference to the original typed array, now sorted. 5538 * Note that the typed array is sorted in place and no copy is made. 5539 * @throws { BusinessError } 401 - Parameter error. 5540 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 5541 * @throws { BusinessError } 10200201 - Concurrent modification error. 5542 * @syscap SystemCapability.Utils.Lang 5543 * @crossplatform 5544 * @atomicservice 5545 * @since 18 5546 */ 5547 sort(compareFn?: TypedArrayCompareFn<number>): Uint8Array; 5548 /** 5549 * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements 5550 * at begin, inclusive, up to end, exclusive. 5551 * 5552 * @param { number } [begin] - The index of the beginning of the array. 5553 * @param { number } [end] - The index of the end of the array. 5554 * @returns { Uint8Array } A new Uint8Array object. 5555 * @throws { BusinessError } 401 - Parameter error. 5556 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 5557 * @throws { BusinessError } 10200201 - Concurrent modification error. 5558 * @syscap SystemCapability.Utils.Lang 5559 * @atomicservice 5560 * @since 12 5561 */ 5562 /** 5563 * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements 5564 * at begin, inclusive, up to end, exclusive. 5565 * 5566 * @param { number } [begin] - The index of the beginning of the array. 5567 * @param { number } [end] - The index of the end of the array. 5568 * @returns { Uint8Array } A new Uint8Array object. 5569 * @throws { BusinessError } 401 - Parameter error. 5570 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 5571 * @throws { BusinessError } 10200201 - Concurrent modification error. 5572 * @syscap SystemCapability.Utils.Lang 5573 * @crossplatform 5574 * @atomicservice 5575 * @since 18 5576 */ 5577 subarray(begin?: number, end?: number): Uint8Array; 5578 /** 5579 * Returns the item located at the specified index. 5580 * 5581 * @param { number } index - The zero-based index of the desired code unit.<br/> 5582 * A negative index will count back from the last item. 5583 * @returns { number | undefined } The element in the array matching the given index.<br/> 5584 * Always returns undefined if index < -array.length or 5585 * index >= array.length without attempting to access the corresponding property. 5586 * @throws { BusinessError } 401 - Parameter error. 5587 * @throws { BusinessError } 10200011 - The at method cannot be bound. 5588 * @throws { BusinessError } 10200201 - Concurrent modification error. 5589 * @syscap SystemCapability.Utils.Lang 5590 * @atomicservice 5591 * @since 12 5592 */ 5593 /** 5594 * Returns the item located at the specified index. 5595 * 5596 * @param { number } index - The zero-based index of the desired code unit.<br/> 5597 * A negative index will count back from the last item. 5598 * @returns { number | undefined } The element in the array matching the given index.<br/> 5599 * Always returns undefined if index < -array.length or 5600 * index >= array.length without attempting to access the corresponding property. 5601 * @throws { BusinessError } 401 - Parameter error. 5602 * @throws { BusinessError } 10200011 - The at method cannot be bound. 5603 * @throws { BusinessError } 10200201 - Concurrent modification error. 5604 * @syscap SystemCapability.Utils.Lang 5605 * @crossplatform 5606 * @atomicservice 5607 * @since 18 5608 */ 5609 at(index: number): number | undefined; 5610 /** 5611 * Returns an iterator that iterates over numbers. 5612 * 5613 * @returns { IterableIterator<number> } Iterator object that yields numbers. 5614 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 5615 * @syscap SystemCapability.Utils.Lang 5616 * @atomicservice 5617 * @since 12 5618 */ 5619 /** 5620 * Returns an iterator that iterates over numbers. 5621 * 5622 * @returns { IterableIterator<number> } Iterator object that yields numbers. 5623 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 5624 * @syscap SystemCapability.Utils.Lang 5625 * @crossplatform 5626 * @atomicservice 5627 * @since 18 5628 */ 5629 [Symbol.iterator](): IterableIterator<number>; 5630 /** 5631 * Returns an iterable of key, value pairs for every entry in the array 5632 * 5633 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 5634 * @throws { BusinessError } 10200011 - The method cannot be bound. 5635 * @throws { BusinessError } 10200201 - Concurrent modification error. 5636 * @syscap SystemCapability.Utils.Lang 5637 * @atomicservice 5638 * @since 12 5639 */ 5640 /** 5641 * Returns an iterable of key, value pairs for every entry in the array 5642 * 5643 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 5644 * @throws { BusinessError } 10200011 - The method cannot be bound. 5645 * @throws { BusinessError } 10200201 - Concurrent modification error. 5646 * @syscap SystemCapability.Utils.Lang 5647 * @crossplatform 5648 * @atomicservice 5649 * @since 18 5650 */ 5651 entries(): IterableIterator<[number, number]>; 5652 /** 5653 * Returns an iterable of keys in the array 5654 * 5655 * @returns { IterableIterator<number> } A new iterable iterator object. 5656 * @throws { BusinessError } 10200011 - The method cannot be bound. 5657 * @throws { BusinessError } 10200201 - Concurrent modification error. 5658 * @syscap SystemCapability.Utils.Lang 5659 * @atomicservice 5660 * @since 12 5661 */ 5662 /** 5663 * Returns an iterable of keys in the array 5664 * 5665 * @returns { IterableIterator<number> } A new iterable iterator object. 5666 * @throws { BusinessError } 10200011 - The method cannot be bound. 5667 * @throws { BusinessError } 10200201 - Concurrent modification error. 5668 * @syscap SystemCapability.Utils.Lang 5669 * @crossplatform 5670 * @atomicservice 5671 * @since 18 5672 */ 5673 keys(): IterableIterator<number>; 5674 /** 5675 * Returns an iterable of values in the array 5676 * 5677 * @returns { IterableIterator<number> } A new iterable iterator object. 5678 * @throws { BusinessError } 10200011 - The method cannot be bound. 5679 * @throws { BusinessError } 10200201 - Concurrent modification error. 5680 * @syscap SystemCapability.Utils.Lang 5681 * @atomicservice 5682 * @since 12 5683 */ 5684 /** 5685 * Returns an iterable of values in the array 5686 * 5687 * @returns { IterableIterator<number> } A new iterable iterator object. 5688 * @throws { BusinessError } 10200011 - The method cannot be bound. 5689 * @throws { BusinessError } 10200201 - Concurrent modification error. 5690 * @syscap SystemCapability.Utils.Lang 5691 * @crossplatform 5692 * @atomicservice 5693 * @since 18 5694 */ 5695 values(): IterableIterator<number>; 5696 /** 5697 * Determines whether an array includes a certain element, returning true or false as appropriate. 5698 * 5699 * @param { number } searchElement - The element to search for. 5700 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 5701 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 5702 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 5703 * @throws { BusinessError } 401 - Parameter error. 5704 * @throws { BusinessError } 10200011 - The at method cannot be bound. 5705 * @throws { BusinessError } 10200201 - Concurrent modification error. 5706 * @syscap SystemCapability.Utils.Lang 5707 * @atomicservice 5708 * @since 12 5709 */ 5710 /** 5711 * Determines whether an array includes a certain element, returning true or false as appropriate. 5712 * 5713 * @param { number } searchElement - The element to search for. 5714 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 5715 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 5716 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 5717 * @throws { BusinessError } 401 - Parameter error. 5718 * @throws { BusinessError } 10200011 - The at method cannot be bound. 5719 * @throws { BusinessError } 10200201 - Concurrent modification error. 5720 * @syscap SystemCapability.Utils.Lang 5721 * @crossplatform 5722 * @atomicservice 5723 * @since 18 5724 */ 5725 includes(searchElement: number, fromIndex?: number): boolean; 5726 /** 5727 * Returns the item at that index. 5728 * 5729 * @syscap SystemCapability.Utils.Lang 5730 * @atomicservice 5731 * @since 12 5732 */ 5733 /** 5734 * Returns the item at that index. 5735 * 5736 * @syscap SystemCapability.Utils.Lang 5737 * @crossplatform 5738 * @atomicservice 5739 * @since 18 5740 */ 5741 [index: number]: number; 5742 /** 5743 * Find the last occurrence of a specified element in an Uint8Array. 5744 * 5745 * @param { number } searchElement - Element to search for in the Uint8Array.. 5746 * @param { number } fromIndex - The index at which to start the search. If provided: 5747 * <br>If this index is negative, it is treated as Uint8Array.length + fromIndex. 5748 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 5749 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 5750 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 5751 * @syscap SystemCapability.Utils.Lang 5752 * @atomicservice 5753 * @since 18 5754 */ 5755 lastIndexOf(searchElement: number, fromIndex?: number): number; 5756 /** 5757 * Reduce elements in an Uint8Array from right to left. 5758 * 5759 * @param { TypedArrayReduceCallback<U, number, Uint8Array> } callbackFn - A function that is called for 5760 * each element in the Uint8Array. 5761 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 5762 * <br>If no initial value is provided, the last element of the Uint8Array will be used, 5763 * <br>and the callback will start with the second-to-last element. 5764 * @returns { U } Returns the single value that results from the reduction. 5765 * @throws { BusinessError } 401 - Parameter error. Possible causes: 5766 * 1.Mandatory parameters are left unspecified. 5767 * 2.Incorrect parameter types. 5768 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 5769 * @throws { BusinessError } 10200201 - Concurrent modification error. 5770 * @syscap SystemCapability.Utils.Lang 5771 * @atomicservice 5772 * @since 18 5773 */ 5774 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Uint8Array>, initialValue: U): U; 5775 /** 5776 * Reduce elements in an Uint8Array from right to left. 5777 * 5778 * @param { TypedArrayReduceCallback<number, number, Uint8Array> } callbackFn - A function that is called for 5779 * each element in the Uint8Array. 5780 * @returns { number } Returns the single value that results from the reduction. 5781 * @throws { BusinessError } 401 - Parameter error. Possible causes: 5782 * 1.Mandatory parameters are left unspecified. 5783 * 2.Incorrect parameter types. 5784 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 5785 * @throws { BusinessError } 10200201 - Concurrent modification error. 5786 * @syscap SystemCapability.Utils.Lang 5787 * @atomicservice 5788 * @since 18 5789 */ 5790 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Uint8Array>): number; 5791 /** 5792 * Convert an Uint8Array to a string. 5793 * 5794 * @returns { string } Returns a string representing the specified Uint8Array and its elements, 5795 * separated by commas. 5796 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 5797 * @throws { BusinessError } 10200201 - Concurrent modification error. 5798 * @syscap SystemCapability.Utils.Lang 5799 * @atomicservice 5800 * @since 18 5801 */ 5802 toString(): string; 5803 /** 5804 * Convert an Uint8Array to a string, The elements are converted to string using their toLocaleString methods. 5805 * 5806 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 5807 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 5808 * @throws { BusinessError } 10200201 - Concurrent modification error. 5809 * @syscap SystemCapability.Utils.Lang 5810 * @atomicservice 5811 * @since 18 5812 */ 5813 toLocaleString(): string; 5814 /** 5815 * Create an Uint8Array containing these parameters. 5816 * 5817 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Uint8Array. 5818 * @returns { Uint8Array } Returns a new Uint8Array instance containing the specified elements. 5819 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5820 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5821 * @static 5822 * @syscap SystemCapability.Utils.Lang 5823 * @atomicservice 5824 * @since 18 5825 */ 5826 static of(...items: number[]): Uint8Array; 5827 } 5828 5829 /** 5830 * A typed array of 16-bit integer values. The contents are initialized to 0. 5831 * If multiple threads access a Int16Array instance concurrently, 5832 * and at least one of the threads modifies the array structurally, 5833 * it must be synchronized externally. 5834 * 5835 * @syscap SystemCapability.Utils.Lang 5836 * @atomicservice 5837 * @since 12 5838 */ 5839 /** 5840 * A typed array of 16-bit integer values. The contents are initialized to 0. 5841 * If multiple threads access a Int16Array instance concurrently, 5842 * and at least one of the threads modifies the array structurally, 5843 * it must be synchronized externally. 5844 * 5845 * @syscap SystemCapability.Utils.Lang 5846 * @crossplatform 5847 * @atomicservice 5848 * @since 18 5849 */ 5850 @Sendable 5851 class Int16Array { 5852 /** 5853 * The size in bytes of each element in the array. 5854 * 5855 * @type { number } 5856 * @readonly 5857 * @static 5858 * @syscap SystemCapability.Utils.Lang 5859 * @atomicservice 5860 * @since 12 5861 */ 5862 /** 5863 * The size in bytes of each element in the array. 5864 * 5865 * @type { number } 5866 * @readonly 5867 * @static 5868 * @syscap SystemCapability.Utils.Lang 5869 * @crossplatform 5870 * @atomicservice 5871 * @since 18 5872 */ 5873 static readonly BYTES_PER_ELEMENT: number; 5874 /** 5875 * The ArrayBuffer instance referenced by the array. 5876 * 5877 * @type { ArrayBuffer } 5878 * @readonly 5879 * @syscap SystemCapability.Utils.Lang 5880 * @atomicservice 5881 * @since 12 5882 */ 5883 /** 5884 * The ArrayBuffer instance referenced by the array. 5885 * 5886 * @type { ArrayBuffer } 5887 * @readonly 5888 * @syscap SystemCapability.Utils.Lang 5889 * @crossplatform 5890 * @atomicservice 5891 * @since 18 5892 */ 5893 readonly buffer: ArrayBuffer; 5894 /** 5895 * The length in bytes of the array. 5896 * 5897 * @type { number } 5898 * @readonly 5899 * @syscap SystemCapability.Utils.Lang 5900 * @atomicservice 5901 * @since 12 5902 */ 5903 /** 5904 * The length in bytes of the array. 5905 * 5906 * @type { number } 5907 * @readonly 5908 * @syscap SystemCapability.Utils.Lang 5909 * @crossplatform 5910 * @atomicservice 5911 * @since 18 5912 */ 5913 readonly byteLength: number; 5914 /** 5915 * The offset in bytes of the array. 5916 * 5917 * @type { number } 5918 * @readonly 5919 * @syscap SystemCapability.Utils.Lang 5920 * @atomicservice 5921 * @since 12 5922 */ 5923 /** 5924 * The offset in bytes of the array. 5925 * 5926 * @type { number } 5927 * @readonly 5928 * @syscap SystemCapability.Utils.Lang 5929 * @crossplatform 5930 * @atomicservice 5931 * @since 18 5932 */ 5933 readonly byteOffset: number; 5934 /** 5935 * The length of the array. 5936 * 5937 * @type { number } 5938 * @readonly 5939 * @syscap SystemCapability.Utils.Lang 5940 * @atomicservice 5941 * @since 12 5942 */ 5943 /** 5944 * The length of the array. 5945 * 5946 * @type { number } 5947 * @readonly 5948 * @syscap SystemCapability.Utils.Lang 5949 * @crossplatform 5950 * @atomicservice 5951 * @since 18 5952 */ 5953 readonly length: number; 5954 /** 5955 * A constructor used to create an Int16Array. 5956 * 5957 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 5958 * @syscap SystemCapability.Utils.Lang 5959 * @atomicservice 5960 * @since 12 5961 */ 5962 /** 5963 * A constructor used to create an Int16Array. 5964 * 5965 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 5966 * @syscap SystemCapability.Utils.Lang 5967 * @crossplatform 5968 * @atomicservice 5969 * @since 18 5970 */ 5971 constructor(); 5972 /** 5973 * A constructor used to create an Int16Array. 5974 * 5975 * @param { number } length - The length of the array 5976 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 5977 * @throws { BusinessError } 401 - Parameter error. 5978 * @syscap SystemCapability.Utils.Lang 5979 * @atomicservice 5980 * @since 12 5981 */ 5982 /** 5983 * A constructor used to create an Int16Array. 5984 * 5985 * @param { number } length - The length of the array 5986 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 5987 * @throws { BusinessError } 401 - Parameter error. 5988 * @syscap SystemCapability.Utils.Lang 5989 * @crossplatform 5990 * @atomicservice 5991 * @since 18 5992 */ 5993 constructor(length: number); 5994 /** 5995 * A constructor used to create an Int16Array. 5996 * 5997 * @param { Iterable<number> } elements - An iterable object to convert to an Int16Array. 5998 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 5999 * @throws { BusinessError } 401 - Parameter error. 6000 * @syscap SystemCapability.Utils.Lang 6001 * @atomicservice 6002 * @since 12 6003 */ 6004 /** 6005 * A constructor used to create an Int16Array. 6006 * 6007 * @param { Iterable<number> } elements - An iterable object to convert to an Int16Array. 6008 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 6009 * @throws { BusinessError } 401 - Parameter error. 6010 * @syscap SystemCapability.Utils.Lang 6011 * @crossplatform 6012 * @atomicservice 6013 * @since 18 6014 */ 6015 constructor(elements: Iterable<number>); 6016 /** 6017 * A constructor used to create an Int16Array. 6018 * 6019 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 6020 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 6021 * @throws { BusinessError } 401 - Parameter error. 6022 * @syscap SystemCapability.Utils.Lang 6023 * @atomicservice 6024 * @since 12 6025 */ 6026 /** 6027 * A constructor used to create an Int16Array. 6028 * 6029 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 6030 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 6031 * @throws { BusinessError } 401 - Parameter error. 6032 * @syscap SystemCapability.Utils.Lang 6033 * @crossplatform 6034 * @atomicservice 6035 * @since 18 6036 */ 6037 constructor(array: ArrayLike<number> | ArrayBuffer); 6038 /** 6039 * A constructor used to create an Int16Array. 6040 * 6041 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 6042 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 6043 * that will be exposed by the typed array view. 6044 * @param { number } [length] - The length parameter specifies the memory range 6045 * that will be exposed by the typed array view. 6046 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 6047 * @throws { BusinessError } 401 - Parameter error. 6048 * @syscap SystemCapability.Utils.Lang 6049 * @atomicservice 6050 * @since 12 6051 */ 6052 /** 6053 * A constructor used to create an Int16Array. 6054 * 6055 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 6056 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 6057 * that will be exposed by the typed array view. 6058 * @param { number } [length] - The length parameter specifies the memory range 6059 * that will be exposed by the typed array view. 6060 * @throws { BusinessError } 10200012 - The Int16Array's constructor cannot be directly invoked. 6061 * @throws { BusinessError } 401 - Parameter error. 6062 * @syscap SystemCapability.Utils.Lang 6063 * @crossplatform 6064 * @atomicservice 6065 * @since 18 6066 */ 6067 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 6068 /** 6069 * Creates an Int16Array from an array-like object. 6070 * 6071 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int16Array. 6072 * @returns { Int16Array } A new Int16Array instance 6073 * @throws { BusinessError } 401 - Parameter error. 6074 * @static 6075 * @syscap SystemCapability.Utils.Lang 6076 * @atomicservice 6077 * @since 12 6078 */ 6079 /** 6080 * Creates an Int16Array from an array-like object. 6081 * 6082 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int16Array. 6083 * @returns { Int16Array } A new Int16Array instance 6084 * @throws { BusinessError } 401 - Parameter error. 6085 * @static 6086 * @syscap SystemCapability.Utils.Lang 6087 * @crossplatform 6088 * @atomicservice 6089 * @since 18 6090 */ 6091 static from(arrayLike: ArrayLike<number>): Int16Array; 6092 /** 6093 * Creates an Int16Array from an array-like object. 6094 * 6095 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int16Array. 6096 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 6097 * @returns { Int16Array } A new Int16Array instance 6098 * @throws { BusinessError } 401 - Parameter error. 6099 * @static 6100 * @syscap SystemCapability.Utils.Lang 6101 * @atomicservice 6102 * @since 12 6103 */ 6104 /** 6105 * Creates an Int16Array from an array-like object. 6106 * 6107 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int16Array. 6108 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 6109 * @returns { Int16Array } A new Int16Array instance 6110 * @throws { BusinessError } 401 - Parameter error. 6111 * @static 6112 * @syscap SystemCapability.Utils.Lang 6113 * @crossplatform 6114 * @atomicservice 6115 * @since 18 6116 */ 6117 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Int16Array; 6118 /** 6119 * Creates an Int16Array from an iterable object. 6120 * 6121 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int16Array. 6122 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 6123 * call on every element of the array. 6124 * @returns { Int16Array } A new Int16Array instance 6125 * @throws { BusinessError } 401 - Parameter error. 6126 * @static 6127 * @syscap SystemCapability.Utils.Lang 6128 * @atomicservice 6129 * @since 12 6130 */ 6131 /** 6132 * Creates an Int16Array from an iterable object. 6133 * 6134 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int16Array. 6135 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 6136 * call on every element of the array. 6137 * @returns { Int16Array } A new Int16Array instance 6138 * @throws { BusinessError } 401 - Parameter error. 6139 * @static 6140 * @syscap SystemCapability.Utils.Lang 6141 * @crossplatform 6142 * @atomicservice 6143 * @since 18 6144 */ 6145 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Int16Array; 6146 /** 6147 * Returns the this object after copying a section of the array identified by start and end 6148 * to the same array starting at position target. 6149 * 6150 * @param { number } target - If target is negative, it is treated as length+target where length is the 6151 * length of the array. 6152 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 6153 * is treated as length+end. 6154 * @param { number } [end] - If not specified, length of the this object is used as its default value. 6155 * @returns { Int16Array } The array itself. 6156 * @throws { BusinessError } 401 - Parameter error. 6157 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 6158 * @throws { BusinessError } 10200201 - Concurrent modification error. 6159 * @syscap SystemCapability.Utils.Lang 6160 * @atomicservice 6161 * @since 12 6162 */ 6163 /** 6164 * Returns the this object after copying a section of the array identified by start and end 6165 * to the same array starting at position target. 6166 * 6167 * @param { number } target - If target is negative, it is treated as length+target where length is the 6168 * length of the array. 6169 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 6170 * is treated as length+end. 6171 * @param { number } [end] - If not specified, length of the this object is used as its default value. 6172 * @returns { Int16Array } The array itself. 6173 * @throws { BusinessError } 401 - Parameter error. 6174 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 6175 * @throws { BusinessError } 10200201 - Concurrent modification error. 6176 * @syscap SystemCapability.Utils.Lang 6177 * @crossplatform 6178 * @atomicservice 6179 * @since 18 6180 */ 6181 copyWithin(target: number, start: number, end?: number): Int16Array; 6182 /** 6183 * Determines whether all the members of an array satisfy the specified test. 6184 * 6185 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6186 * The every method calls the predicate function for each element in the array until 6187 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 6188 * @returns { boolean } true unless predicate returns a false value for a typed array element, 6189 * in which case false is immediately returned. 6190 * @throws { BusinessError } 401 - Parameter error. 6191 * @throws { BusinessError } 10200011 - The every method cannot be bound. 6192 * @throws { BusinessError } 10200201 - Concurrent modification error. 6193 * @syscap SystemCapability.Utils.Lang 6194 * @atomicservice 6195 * @since 12 6196 */ 6197 /** 6198 * Determines whether all the members of an array satisfy the specified test. 6199 * 6200 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6201 * The every method calls the predicate function for each element in the array until 6202 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 6203 * @returns { boolean } true unless predicate returns a false value for a typed array element, 6204 * in which case false is immediately returned. 6205 * @throws { BusinessError } 401 - Parameter error. 6206 * @throws { BusinessError } 10200011 - The every method cannot be bound. 6207 * @throws { BusinessError } 10200201 - Concurrent modification error. 6208 * @syscap SystemCapability.Utils.Lang 6209 * @crossplatform 6210 * @atomicservice 6211 * @since 18 6212 */ 6213 every(predicate: TypedArrayPredicateFn<number, Int16Array>): boolean; 6214 /** 6215 * Returns the this object after filling the section identified by start and end with value. 6216 * 6217 * @param { number } value - value to fill array section with. 6218 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 6219 * length+start where length is the length of the array. 6220 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 6221 * length+end. 6222 * @returns { Int16Array } The array itself. 6223 * @throws { BusinessError } 401 - Parameter error. 6224 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 6225 * @throws { BusinessError } 10200201 - Concurrent modification error. 6226 * @syscap SystemCapability.Utils.Lang 6227 * @atomicservice 6228 * @since 12 6229 */ 6230 /** 6231 * Returns the this object after filling the section identified by start and end with value. 6232 * 6233 * @param { number } value - value to fill array section with. 6234 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 6235 * length+start where length is the length of the array. 6236 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 6237 * length+end. 6238 * @returns { Int16Array } The array itself. 6239 * @throws { BusinessError } 401 - Parameter error. 6240 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 6241 * @throws { BusinessError } 10200201 - Concurrent modification error. 6242 * @syscap SystemCapability.Utils.Lang 6243 * @crossplatform 6244 * @atomicservice 6245 * @since 18 6246 */ 6247 fill(value: number, start?: number, end?: number): Int16Array; 6248 /** 6249 * Returns the elements of an array that meet the condition specified in a callback function. 6250 * 6251 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6252 * The filter method calls the predicate function one time for each element in the array. 6253 * @returns { Int16Array } The array itself. 6254 * @throws { BusinessError } 401 - Parameter error. 6255 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 6256 * @throws { BusinessError } 10200201 - Concurrent modification error. 6257 * @syscap SystemCapability.Utils.Lang 6258 * @atomicservice 6259 * @since 12 6260 */ 6261 /** 6262 * Returns the elements of an array that meet the condition specified in a callback function. 6263 * 6264 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6265 * The filter method calls the predicate function one time for each element in the array. 6266 * @returns { Int16Array } The array itself. 6267 * @throws { BusinessError } 401 - Parameter error. 6268 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 6269 * @throws { BusinessError } 10200201 - Concurrent modification error. 6270 * @syscap SystemCapability.Utils.Lang 6271 * @crossplatform 6272 * @atomicservice 6273 * @since 18 6274 */ 6275 filter(predicate: TypedArrayPredicateFn<number, Int16Array>): Int16Array; 6276 /** 6277 * Returns the value of the first element in the array where predicate is true, and undefined 6278 * otherwise. 6279 * 6280 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - find calls predicate once for each element of 6281 * the array, in ascending order, until it finds one where predicate returns true. 6282 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 6283 * @returns { number | undefined } The first element in the typed array 6284 * that satisfies the provided testing function. Otherwise, undefined is returned. 6285 * @throws { BusinessError } 401 - Parameter error. 6286 * @throws { BusinessError } 10200011 - The find method cannot be bound. 6287 * @throws { BusinessError } 10200201 - Concurrent modification error. 6288 * @syscap SystemCapability.Utils.Lang 6289 * @atomicservice 6290 * @since 12 6291 */ 6292 /** 6293 * Returns the value of the first element in the array where predicate is true, and undefined 6294 * otherwise. 6295 * 6296 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - find calls predicate once for each element of 6297 * the array, in ascending order, until it finds one where predicate returns true. 6298 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 6299 * @returns { number | undefined } The first element in the typed array 6300 * that satisfies the provided testing function. Otherwise, undefined is returned. 6301 * @throws { BusinessError } 401 - Parameter error. 6302 * @throws { BusinessError } 10200011 - The find method cannot be bound. 6303 * @throws { BusinessError } 10200201 - Concurrent modification error. 6304 * @syscap SystemCapability.Utils.Lang 6305 * @crossplatform 6306 * @atomicservice 6307 * @since 18 6308 */ 6309 find(predicate: TypedArrayPredicateFn<number, Int16Array>): number | undefined; 6310 /** 6311 * Returns the index of the first element in the array where predicate is true, and -1 6312 * otherwise. 6313 * 6314 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - find calls predicate once for each element of 6315 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 6316 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 6317 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 6318 * @throws { BusinessError } 401 - Parameter error. 6319 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 6320 * @throws { BusinessError } 10200201 - Concurrent modification error. 6321 * @syscap SystemCapability.Utils.Lang 6322 * @atomicservice 6323 * @since 12 6324 */ 6325 /** 6326 * Returns the index of the first element in the array where predicate is true, and -1 6327 * otherwise. 6328 * 6329 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - find calls predicate once for each element of 6330 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 6331 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 6332 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 6333 * @throws { BusinessError } 401 - Parameter error. 6334 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 6335 * @throws { BusinessError } 10200201 - Concurrent modification error. 6336 * @syscap SystemCapability.Utils.Lang 6337 * @crossplatform 6338 * @atomicservice 6339 * @since 18 6340 */ 6341 findIndex(predicate: TypedArrayPredicateFn<number, Int16Array>): number; 6342 /** 6343 * Performs the specified action for each element in an array. 6344 * 6345 * @param { TypedArrayForEachCallback<number, Int16Array> } callbackFn - A function that 6346 * accepts up to three arguments. 6347 * forEach calls the callbackfn function one time for each element in the array. 6348 * @throws { BusinessError } 401 - Parameter error. 6349 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 6350 * @throws { BusinessError } 10200201 - Concurrent modification error. 6351 * @syscap SystemCapability.Utils.Lang 6352 * @atomicservice 6353 * @since 12 6354 */ 6355 /** 6356 * Performs the specified action for each element in an array. 6357 * 6358 * @param { TypedArrayForEachCallback<number, Int16Array> } callbackFn - A function that 6359 * accepts up to three arguments. 6360 * forEach calls the callbackfn function one time for each element in the array. 6361 * @throws { BusinessError } 401 - Parameter error. 6362 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 6363 * @throws { BusinessError } 10200201 - Concurrent modification error. 6364 * @syscap SystemCapability.Utils.Lang 6365 * @crossplatform 6366 * @atomicservice 6367 * @since 18 6368 */ 6369 forEach(callbackFn: TypedArrayForEachCallback<number, Int16Array>): void; 6370 /** 6371 * Returns the index of the first occurrence of a value in an array. 6372 * 6373 * @param { number } searchElement - The value to locate in the array. 6374 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 6375 * search starts at index 0. 6376 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 6377 * @throws { BusinessError } 401 - Parameter error. 6378 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 6379 * @throws { BusinessError } 10200201 - Concurrent modification error. 6380 * @syscap SystemCapability.Utils.Lang 6381 * @atomicservice 6382 * @since 12 6383 */ 6384 /** 6385 * Returns the index of the first occurrence of a value in an array. 6386 * 6387 * @param { number } searchElement - The value to locate in the array. 6388 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 6389 * search starts at index 0. 6390 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 6391 * @throws { BusinessError } 401 - Parameter error. 6392 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 6393 * @throws { BusinessError } 10200201 - Concurrent modification error. 6394 * @syscap SystemCapability.Utils.Lang 6395 * @crossplatform 6396 * @atomicservice 6397 * @since 18 6398 */ 6399 indexOf(searchElement: number, fromIndex?: number): number; 6400 /** 6401 * Adds all the elements of an array separated by the specified separator string. 6402 * @param { string } [separator] - A string used to separate one element of an array from the next in the 6403 * resulting String. If omitted, the array elements are separated with a comma. 6404 * @returns { string } A string with all typed array elements joined. 6405 * If array.length is 0, the empty string is returned. 6406 * @throws { BusinessError } 401 - Parameter error. 6407 * @throws { BusinessError } 10200011 - The join method cannot be bound. 6408 * @throws { BusinessError } 10200201 - Concurrent modification error. 6409 * @syscap SystemCapability.Utils.Lang 6410 * @atomicservice 6411 * @since 12 6412 */ 6413 /** 6414 * Adds all the elements of an array separated by the specified separator string. 6415 * @param { string } [separator] - A string used to separate one element of an array from the next in the 6416 * resulting String. If omitted, the array elements are separated with a comma. 6417 * @returns { string } A string with all typed array elements joined. 6418 * If array.length is 0, the empty string is returned. 6419 * @throws { BusinessError } 401 - Parameter error. 6420 * @throws { BusinessError } 10200011 - The join method cannot be bound. 6421 * @throws { BusinessError } 10200201 - Concurrent modification error. 6422 * @syscap SystemCapability.Utils.Lang 6423 * @crossplatform 6424 * @atomicservice 6425 * @since 18 6426 */ 6427 join(separator?: string): string; 6428 /** 6429 * Calls a defined callback function on each element of an array, and returns an array that 6430 * contains the results. 6431 * 6432 * @param { TypedArrayMapCallback<number, Int16Array> } callbackFn - A function that 6433 * accepts up to three arguments. 6434 * The map method calls the callbackfn function one time for each element in the array. 6435 * @returns { Int16Array } The array itself. 6436 * @throws { BusinessError } 401 - Parameter error. 6437 * @throws { BusinessError } 10200011 - The map method cannot be bound. 6438 * @throws { BusinessError } 10200201 - Concurrent modification error. 6439 * @syscap SystemCapability.Utils.Lang 6440 * @atomicservice 6441 * @since 12 6442 */ 6443 /** 6444 * Calls a defined callback function on each element of an array, and returns an array that 6445 * contains the results. 6446 * 6447 * @param { TypedArrayMapCallback<number, Int16Array> } callbackFn - A function that 6448 * accepts up to three arguments. 6449 * The map method calls the callbackfn function one time for each element in the array. 6450 * @returns { Int16Array } The array itself. 6451 * @throws { BusinessError } 401 - Parameter error. 6452 * @throws { BusinessError } 10200011 - The map method cannot be bound. 6453 * @throws { BusinessError } 10200201 - Concurrent modification error. 6454 * @syscap SystemCapability.Utils.Lang 6455 * @crossplatform 6456 * @atomicservice 6457 * @since 18 6458 */ 6459 map(callbackFn: TypedArrayMapCallback<number, Int16Array>): Int16Array; 6460 /** 6461 * Calls the specified callback function for all the elements in an array. The return value of 6462 * the callback function is the accumulated result, and is provided as an argument in the next 6463 * call to the callback function. 6464 * 6465 * @param { TypedArrayReduceCallback<number, number, Int16Array> } callbackFn - A function that 6466 * accepts up to four arguments. 6467 * The reduce method calls the callbackfn function one time for each element in the array. 6468 * @returns { number } The value that results from running the "reducer" callback function to 6469 * completion over the entire typed array. 6470 * @throws { BusinessError } 401 - Parameter error. 6471 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6472 * @throws { BusinessError } 10200201 - Concurrent modification error. 6473 * @syscap SystemCapability.Utils.Lang 6474 * @atomicservice 6475 * @since 12 6476 */ 6477 /** 6478 * Calls the specified callback function for all the elements in an array. The return value of 6479 * the callback function is the accumulated result, and is provided as an argument in the next 6480 * call to the callback function. 6481 * 6482 * @param { TypedArrayReduceCallback<number, number, Int16Array> } callbackFn - A function that 6483 * accepts up to four arguments. 6484 * The reduce method calls the callbackfn function one time for each element in the array. 6485 * @returns { number } The value that results from running the "reducer" callback function to 6486 * completion over the entire typed array. 6487 * @throws { BusinessError } 401 - Parameter error. 6488 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6489 * @throws { BusinessError } 10200201 - Concurrent modification error. 6490 * @syscap SystemCapability.Utils.Lang 6491 * @crossplatform 6492 * @atomicservice 6493 * @since 18 6494 */ 6495 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int16Array>): number; 6496 /** 6497 * Calls the specified callback function for all the elements in an array. The return value of 6498 * the callback function is the accumulated result, and is provided as an argument in the next 6499 * call to the callback function. 6500 * 6501 * @param { TypedArrayReduceCallback<number, number, Int16Array> } callbackFn - A function that 6502 * accepts up to four arguments. 6503 * The reduce method calls the callbackfn function one time for each element in the array. 6504 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 6505 * the accumulation. The first call to the callbackfn function provides this value as an argument 6506 * instead of an array value. 6507 * @returns { number } The value that results from running the "reducer" callback function to 6508 * completion over the entire typed array. 6509 * @throws { BusinessError } 401 - Parameter error. 6510 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6511 * @throws { BusinessError } 10200201 - Concurrent modification error. 6512 * @syscap SystemCapability.Utils.Lang 6513 * @atomicservice 6514 * @since 12 6515 */ 6516 /** 6517 * Calls the specified callback function for all the elements in an array. The return value of 6518 * the callback function is the accumulated result, and is provided as an argument in the next 6519 * call to the callback function. 6520 * 6521 * @param { TypedArrayReduceCallback<number, number, Int16Array> } callbackFn - A function that 6522 * accepts up to four arguments. 6523 * The reduce method calls the callbackfn function one time for each element in the array. 6524 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 6525 * the accumulation. The first call to the callbackfn function provides this value as an argument 6526 * instead of an array value. 6527 * @returns { number } The value that results from running the "reducer" callback function to 6528 * completion over the entire typed array. 6529 * @throws { BusinessError } 401 - Parameter error. 6530 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6531 * @throws { BusinessError } 10200201 - Concurrent modification error. 6532 * @syscap SystemCapability.Utils.Lang 6533 * @crossplatform 6534 * @atomicservice 6535 * @since 18 6536 */ 6537 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int16Array>, initialValue: number): number; 6538 /** 6539 * Calls the specified callback function for all the elements in an array. The return value of 6540 * the callback function is the accumulated result, and is provided as an argument in the next 6541 * call to the callback function. 6542 * 6543 * @param { TypedArrayReduceCallback<U, number, Int16Array> } callbackFn - A function that 6544 * accepts up to four arguments. 6545 * The reduce method calls the callbackfn function one time for each element in the array. 6546 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 6547 * the accumulation. The first call to the callbackfn function provides this value as an argument 6548 * instead of an array value. 6549 * @returns { U } The value that results from running the "reducer" callback function to 6550 * completion over the entire typed array. 6551 * @throws { BusinessError } 401 - Parameter error. 6552 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6553 * @throws { BusinessError } 10200201 - Concurrent modification error. 6554 * @syscap SystemCapability.Utils.Lang 6555 * @atomicservice 6556 * @since 12 6557 */ 6558 /** 6559 * Calls the specified callback function for all the elements in an array. The return value of 6560 * the callback function is the accumulated result, and is provided as an argument in the next 6561 * call to the callback function. 6562 * 6563 * @param { TypedArrayReduceCallback<U, number, Int16Array> } callbackFn - A function that 6564 * accepts up to four arguments. 6565 * The reduce method calls the callbackfn function one time for each element in the array. 6566 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 6567 * the accumulation. The first call to the callbackfn function provides this value as an argument 6568 * instead of an array value. 6569 * @returns { U } The value that results from running the "reducer" callback function to 6570 * completion over the entire typed array. 6571 * @throws { BusinessError } 401 - Parameter error. 6572 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 6573 * @throws { BusinessError } 10200201 - Concurrent modification error. 6574 * @syscap SystemCapability.Utils.Lang 6575 * @crossplatform 6576 * @atomicservice 6577 * @since 18 6578 */ 6579 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Int16Array>, initialValue: U): U; 6580 /** 6581 * Reverses the elements in an Array. 6582 * 6583 * @returns { Int16Array } The reference to the original typed array, now reversed. 6584 * <br>Note that the typed array is reversed in place, and no copy is made. 6585 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 6586 * @throws { BusinessError } 10200201 - Concurrent modification error. 6587 * @syscap SystemCapability.Utils.Lang 6588 * @atomicservice 6589 * @since 12 6590 */ 6591 /** 6592 * Reverses the elements in an Array. 6593 * 6594 * @returns { Int16Array } The reference to the original typed array, now reversed. 6595 * <br>Note that the typed array is reversed in place, and no copy is made. 6596 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 6597 * @throws { BusinessError } 10200201 - Concurrent modification error. 6598 * @syscap SystemCapability.Utils.Lang 6599 * @crossplatform 6600 * @atomicservice 6601 * @since 18 6602 */ 6603 reverse(): Int16Array; 6604 /** 6605 * Sets a value or an array of values. 6606 * 6607 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 6608 * @param { number } [offset] - The index in the current array at which the values are to be written. 6609 * @throws { BusinessError } 401 - Parameter error. 6610 * @throws { BusinessError } 10200011 - The set method cannot be bound. 6611 * @throws { BusinessError } 10200201 - Concurrent modification error. 6612 * @syscap SystemCapability.Utils.Lang 6613 * @atomicservice 6614 * @since 12 6615 */ 6616 /** 6617 * Sets a value or an array of values. 6618 * 6619 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 6620 * @param { number } [offset] - The index in the current array at which the values are to be written. 6621 * @throws { BusinessError } 401 - Parameter error. 6622 * @throws { BusinessError } 10200011 - The set method cannot be bound. 6623 * @throws { BusinessError } 10200201 - Concurrent modification error. 6624 * @syscap SystemCapability.Utils.Lang 6625 * @crossplatform 6626 * @atomicservice 6627 * @since 18 6628 */ 6629 set(array: ArrayLike<number>, offset?: number): void; 6630 /** 6631 * Returns a section of an array. 6632 * 6633 * @param { number } [start] - The beginning of the specified portion of the array. 6634 * @param { number } [end] - The end of the specified portion of the array. 6635 * This is exclusive of the element at the index 'end'. 6636 * @returns { Int16Array } A new typed array containing the extracted elements. 6637 * @throws { BusinessError } 401 - Parameter error. 6638 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 6639 * @throws { BusinessError } 10200201 - Concurrent modification error. 6640 * @syscap SystemCapability.Utils.Lang 6641 * @atomicservice 6642 * @since 12 6643 */ 6644 /** 6645 * Returns a section of an array. 6646 * 6647 * @param { number } [start] - The beginning of the specified portion of the array. 6648 * @param { number } [end] - The end of the specified portion of the array. 6649 * This is exclusive of the element at the index 'end'. 6650 * @returns { Int16Array } A new typed array containing the extracted elements. 6651 * @throws { BusinessError } 401 - Parameter error. 6652 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 6653 * @throws { BusinessError } 10200201 - Concurrent modification error. 6654 * @syscap SystemCapability.Utils.Lang 6655 * @crossplatform 6656 * @atomicservice 6657 * @since 18 6658 */ 6659 slice(start?: number, end?: number): Int16Array; 6660 /** 6661 * Determines whether the specified callback function returns true for any element of an array. 6662 * 6663 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6664 * The some method calls the predicate function for each element in the array until 6665 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 6666 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 6667 * in which case true is immediately returned. 6668 * @throws { BusinessError } 401 - Parameter error. 6669 * @throws { BusinessError } 10200011 - The some method cannot be bound. 6670 * @throws { BusinessError } 10200201 - Concurrent modification error. 6671 * @syscap SystemCapability.Utils.Lang 6672 * @atomicservice 6673 * @since 12 6674 */ 6675 /** 6676 * Determines whether the specified callback function returns true for any element of an array. 6677 * 6678 * @param { TypedArrayPredicateFn<number, Int16Array> } predicate - A function that accepts up to three arguments. 6679 * The some method calls the predicate function for each element in the array until 6680 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 6681 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 6682 * in which case true is immediately returned. 6683 * @throws { BusinessError } 401 - Parameter error. 6684 * @throws { BusinessError } 10200011 - The some method cannot be bound. 6685 * @throws { BusinessError } 10200201 - Concurrent modification error. 6686 * @syscap SystemCapability.Utils.Lang 6687 * @crossplatform 6688 * @atomicservice 6689 * @since 18 6690 */ 6691 some(predicate: TypedArrayPredicateFn<number, Int16Array>): boolean; 6692 /** 6693 * Sorts an array. 6694 * 6695 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 6696 * It is expected to return a negative value if first argument is less than second argument, 6697 * zero if they're equal and a positive value otherwise. 6698 * If omitted, the elements are sorted in ascending, ASCII character order. 6699 * @returns { Int16Array } The reference to the original typed array, now sorted. 6700 * Note that the typed array is sorted in place and no copy is made. 6701 * @throws { BusinessError } 401 - Parameter error. 6702 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 6703 * @throws { BusinessError } 10200201 - Concurrent modification error. 6704 * @syscap SystemCapability.Utils.Lang 6705 * @atomicservice 6706 * @since 12 6707 */ 6708 /** 6709 * Sorts an array. 6710 * 6711 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 6712 * It is expected to return a negative value if first argument is less than second argument, 6713 * zero if they're equal and a positive value otherwise. 6714 * If omitted, the elements are sorted in ascending, ASCII character order. 6715 * @returns { Int16Array } The reference to the original typed array, now sorted. 6716 * Note that the typed array is sorted in place and no copy is made. 6717 * @throws { BusinessError } 401 - Parameter error. 6718 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 6719 * @throws { BusinessError } 10200201 - Concurrent modification error. 6720 * @syscap SystemCapability.Utils.Lang 6721 * @crossplatform 6722 * @atomicservice 6723 * @since 18 6724 */ 6725 sort(compareFn?: TypedArrayCompareFn<number>): Int16Array; 6726 /** 6727 * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements 6728 * at begin, inclusive, up to end, exclusive. 6729 * 6730 * @param { number } [begin] - The index of the beginning of the array. 6731 * @param { number } [end] - The index of the end of the array. 6732 * @returns { Int16Array } A new Int16Array object. 6733 * @throws { BusinessError } 401 - Parameter error. 6734 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 6735 * @throws { BusinessError } 10200201 - Concurrent modification error. 6736 * @syscap SystemCapability.Utils.Lang 6737 * @atomicservice 6738 * @since 12 6739 */ 6740 /** 6741 * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements 6742 * at begin, inclusive, up to end, exclusive. 6743 * 6744 * @param { number } [begin] - The index of the beginning of the array. 6745 * @param { number } [end] - The index of the end of the array. 6746 * @returns { Int16Array } A new Int16Array object. 6747 * @throws { BusinessError } 401 - Parameter error. 6748 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 6749 * @throws { BusinessError } 10200201 - Concurrent modification error. 6750 * @syscap SystemCapability.Utils.Lang 6751 * @crossplatform 6752 * @atomicservice 6753 * @since 18 6754 */ 6755 subarray(begin?: number, end?: number): Int16Array; 6756 /** 6757 * Returns the item located at the specified index. 6758 * 6759 * @param { number } index - The zero-based index of the desired code unit.<br/> 6760 * A negative index will count back from the last item. 6761 * @returns { number | undefined } The element in the array matching the given index.<br/> 6762 * Always returns undefined if index < -array.length or 6763 * index >= array.length without attempting to access the corresponding property. 6764 * @throws { BusinessError } 401 - Parameter error. 6765 * @throws { BusinessError } 10200011 - The at method cannot be bound. 6766 * @throws { BusinessError } 10200201 - Concurrent modification error. 6767 * @syscap SystemCapability.Utils.Lang 6768 * @atomicservice 6769 * @since 12 6770 */ 6771 /** 6772 * Returns the item located at the specified index. 6773 * 6774 * @param { number } index - The zero-based index of the desired code unit.<br/> 6775 * A negative index will count back from the last item. 6776 * @returns { number | undefined } The element in the array matching the given index.<br/> 6777 * Always returns undefined if index < -array.length or 6778 * index >= array.length without attempting to access the corresponding property. 6779 * @throws { BusinessError } 401 - Parameter error. 6780 * @throws { BusinessError } 10200011 - The at method cannot be bound. 6781 * @throws { BusinessError } 10200201 - Concurrent modification error. 6782 * @syscap SystemCapability.Utils.Lang 6783 * @crossplatform 6784 * @atomicservice 6785 * @since 18 6786 */ 6787 at(index: number): number | undefined; 6788 /** 6789 * Returns an iterator that iterates over numbers. 6790 * 6791 * @returns { IterableIterator<number> } Iterator object that yields numbers. 6792 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 6793 * @syscap SystemCapability.Utils.Lang 6794 * @atomicservice 6795 * @since 12 6796 */ 6797 /** 6798 * Returns an iterator that iterates over numbers. 6799 * 6800 * @returns { IterableIterator<number> } Iterator object that yields numbers. 6801 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 6802 * @syscap SystemCapability.Utils.Lang 6803 * @crossplatform 6804 * @atomicservice 6805 * @since 18 6806 */ 6807 [Symbol.iterator](): IterableIterator<number>; 6808 /** 6809 * Returns an iterable of key, value pairs for every entry in the array 6810 * 6811 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 6812 * @throws { BusinessError } 10200011 - The method cannot be bound. 6813 * @throws { BusinessError } 10200201 - Concurrent modification error. 6814 * @syscap SystemCapability.Utils.Lang 6815 * @atomicservice 6816 * @since 12 6817 */ 6818 /** 6819 * Returns an iterable of key, value pairs for every entry in the array 6820 * 6821 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 6822 * @throws { BusinessError } 10200011 - The method cannot be bound. 6823 * @throws { BusinessError } 10200201 - Concurrent modification error. 6824 * @syscap SystemCapability.Utils.Lang 6825 * @crossplatform 6826 * @atomicservice 6827 * @since 18 6828 */ 6829 entries(): IterableIterator<[number, number]>; 6830 /** 6831 * Returns an iterable of keys in the array 6832 * 6833 * @returns { IterableIterator<number> } A new iterable iterator object. 6834 * @throws { BusinessError } 10200011 - The method cannot be bound. 6835 * @throws { BusinessError } 10200201 - Concurrent modification error. 6836 * @syscap SystemCapability.Utils.Lang 6837 * @atomicservice 6838 * @since 12 6839 */ 6840 /** 6841 * Returns an iterable of keys in the array 6842 * 6843 * @returns { IterableIterator<number> } A new iterable iterator object. 6844 * @throws { BusinessError } 10200011 - The method cannot be bound. 6845 * @throws { BusinessError } 10200201 - Concurrent modification error. 6846 * @syscap SystemCapability.Utils.Lang 6847 * @crossplatform 6848 * @atomicservice 6849 * @since 18 6850 */ 6851 keys(): IterableIterator<number>; 6852 /** 6853 * Returns an iterable of values in the array 6854 * 6855 * @returns { IterableIterator<number> } A new iterable iterator object. 6856 * @throws { BusinessError } 10200011 - The method cannot be bound. 6857 * @throws { BusinessError } 10200201 - Concurrent modification error. 6858 * @syscap SystemCapability.Utils.Lang 6859 * @atomicservice 6860 * @since 12 6861 */ 6862 /** 6863 * Returns an iterable of values in the array 6864 * 6865 * @returns { IterableIterator<number> } A new iterable iterator object. 6866 * @throws { BusinessError } 10200011 - The method cannot be bound. 6867 * @throws { BusinessError } 10200201 - Concurrent modification error. 6868 * @syscap SystemCapability.Utils.Lang 6869 * @crossplatform 6870 * @atomicservice 6871 * @since 18 6872 */ 6873 values(): IterableIterator<number>; 6874 /** 6875 * Determines whether an array includes a certain element, returning true or false as appropriate. 6876 * 6877 * @param { number } searchElement - The element to search for. 6878 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 6879 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 6880 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 6881 * @throws { BusinessError } 401 - Parameter error. 6882 * @throws { BusinessError } 10200011 - The at method cannot be bound. 6883 * @throws { BusinessError } 10200201 - Concurrent modification error. 6884 * @syscap SystemCapability.Utils.Lang 6885 * @atomicservice 6886 * @since 12 6887 */ 6888 /** 6889 * Determines whether an array includes a certain element, returning true or false as appropriate. 6890 * 6891 * @param { number } searchElement - The element to search for. 6892 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 6893 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 6894 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 6895 * @throws { BusinessError } 401 - Parameter error. 6896 * @throws { BusinessError } 10200011 - The at method cannot be bound. 6897 * @throws { BusinessError } 10200201 - Concurrent modification error. 6898 * @syscap SystemCapability.Utils.Lang 6899 * @crossplatform 6900 * @atomicservice 6901 * @since 18 6902 */ 6903 includes(searchElement: number, fromIndex?: number): boolean; 6904 /** 6905 * Returns the item at that index. 6906 * 6907 * @syscap SystemCapability.Utils.Lang 6908 * @atomicservice 6909 * @since 12 6910 */ 6911 /** 6912 * Returns the item at that index. 6913 * 6914 * @syscap SystemCapability.Utils.Lang 6915 * @crossplatform 6916 * @atomicservice 6917 * @since 18 6918 */ 6919 [index: number]: number; 6920 /** 6921 * Find the last occurrence of a specified element in an Int16Array. 6922 * 6923 * @param { number } searchElement - Element to search for in the Int16Array.. 6924 * @param { number } fromIndex - The index at which to start the search. If provided: 6925 * <br>If this index is negative, it is treated as Int16Array.length + fromIndex. 6926 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 6927 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 6928 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 6929 * @syscap SystemCapability.Utils.Lang 6930 * @atomicservice 6931 * @since 18 6932 */ 6933 lastIndexOf(searchElement: number, fromIndex?: number): number; 6934 /** 6935 * Reduce elements in an Int16Array from right to left. 6936 * 6937 * @param { TypedArrayReduceCallback<U, number, Int16Array> } callbackFn - A function that is called for 6938 * each element in the Int16Array. 6939 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 6940 * <br>If no initial value is provided, the last element of the Int16Array will be used, 6941 * <br>and the callback will start with the second-to-last element. 6942 * @returns { U } Returns the single value that results from the reduction. 6943 * @throws { BusinessError } 401 - Parameter error. Possible causes: 6944 * 1.Mandatory parameters are left unspecified. 6945 * 2.Incorrect parameter types. 6946 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 6947 * @throws { BusinessError } 10200201 - Concurrent modification error. 6948 * @syscap SystemCapability.Utils.Lang 6949 * @atomicservice 6950 * @since 18 6951 */ 6952 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Int16Array>, initialValue: U): U; 6953 /** 6954 * Reduce elements in an Int16Array from right to left. 6955 * 6956 * @param { TypedArrayReduceCallback<number, number, Int16Array> } callbackFn - A function that is called for 6957 * each element in the Int16Array. 6958 * @returns { number } Returns the single value that results from the reduction. 6959 * @throws { BusinessError } 401 - Parameter error. Possible causes: 6960 * 1.Mandatory parameters are left unspecified. 6961 * 2.Incorrect parameter types. 6962 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 6963 * @throws { BusinessError } 10200201 - Concurrent modification error. 6964 * @syscap SystemCapability.Utils.Lang 6965 * @atomicservice 6966 * @since 18 6967 */ 6968 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Int16Array>): number; 6969 /** 6970 * Convert an Int16Array to a string. 6971 * 6972 * @returns { string } Returns a string representing the specified Int16Array and its elements, 6973 * separated by commas. 6974 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 6975 * @throws { BusinessError } 10200201 - Concurrent modification error. 6976 * @syscap SystemCapability.Utils.Lang 6977 * @atomicservice 6978 * @since 18 6979 */ 6980 toString(): string; 6981 /** 6982 * Convert an Int16Array to a string, The elements are converted to string using their toLocaleString methods. 6983 * 6984 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 6985 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 6986 * @throws { BusinessError } 10200201 - Concurrent modification error. 6987 * @syscap SystemCapability.Utils.Lang 6988 * @atomicservice 6989 * @since 18 6990 */ 6991 toLocaleString(): string; 6992 /** 6993 * Create an Int16Array containing these parameters. 6994 * 6995 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Int16Array. 6996 * @returns { Int16Array } Returns a new Int16Array instance containing the specified elements. 6997 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6998 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6999 * @static 7000 * @syscap SystemCapability.Utils.Lang 7001 * @atomicservice 7002 * @since 18 7003 */ 7004 static of(...items: number[]): Int16Array; 7005 } 7006 7007 /** 7008 * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. 7009 * If multiple threads access a Uint16Array instance concurrently, 7010 * and at least one of the threads modifies the array structurally, 7011 * it must be synchronized externally. 7012 * 7013 * @syscap SystemCapability.Utils.Lang 7014 * @atomicservice 7015 * @since 12 7016 */ 7017 /** 7018 * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. 7019 * If multiple threads access a Uint16Array instance concurrently, 7020 * and at least one of the threads modifies the array structurally, 7021 * it must be synchronized externally. 7022 * 7023 * @syscap SystemCapability.Utils.Lang 7024 * @crossplatform 7025 * @atomicservice 7026 * @since 18 7027 */ 7028 @Sendable 7029 class Uint16Array { 7030 /** 7031 * The size in bytes of each element in the array. 7032 * 7033 * @type { number } 7034 * @readonly 7035 * @static 7036 * @syscap SystemCapability.Utils.Lang 7037 * @atomicservice 7038 * @since 12 7039 */ 7040 /** 7041 * The size in bytes of each element in the array. 7042 * 7043 * @type { number } 7044 * @readonly 7045 * @static 7046 * @syscap SystemCapability.Utils.Lang 7047 * @crossplatform 7048 * @atomicservice 7049 * @since 18 7050 */ 7051 static readonly BYTES_PER_ELEMENT: number; 7052 /** 7053 * The ArrayBuffer instance referenced by the array. 7054 * 7055 * @type { ArrayBuffer } 7056 * @readonly 7057 * @syscap SystemCapability.Utils.Lang 7058 * @atomicservice 7059 * @since 12 7060 */ 7061 /** 7062 * The ArrayBuffer instance referenced by the array. 7063 * 7064 * @type { ArrayBuffer } 7065 * @readonly 7066 * @syscap SystemCapability.Utils.Lang 7067 * @crossplatform 7068 * @atomicservice 7069 * @since 18 7070 */ 7071 readonly buffer: ArrayBuffer; 7072 /** 7073 * The length in bytes of the array. 7074 * 7075 * @type { number } 7076 * @readonly 7077 * @syscap SystemCapability.Utils.Lang 7078 * @atomicservice 7079 * @since 12 7080 */ 7081 /** 7082 * The length in bytes of the array. 7083 * 7084 * @type { number } 7085 * @readonly 7086 * @syscap SystemCapability.Utils.Lang 7087 * @crossplatform 7088 * @atomicservice 7089 * @since 18 7090 */ 7091 readonly byteLength: number; 7092 /** 7093 * The offset in bytes of the array. 7094 * 7095 * @type { number } 7096 * @readonly 7097 * @syscap SystemCapability.Utils.Lang 7098 * @atomicservice 7099 * @since 12 7100 */ 7101 /** 7102 * The offset in bytes of the array. 7103 * 7104 * @type { number } 7105 * @readonly 7106 * @syscap SystemCapability.Utils.Lang 7107 * @crossplatform 7108 * @atomicservice 7109 * @since 18 7110 */ 7111 readonly byteOffset: number; 7112 /** 7113 * The length of the array. 7114 * 7115 * @type { number } 7116 * @readonly 7117 * @syscap SystemCapability.Utils.Lang 7118 * @atomicservice 7119 * @since 12 7120 */ 7121 /** 7122 * The length of the array. 7123 * 7124 * @type { number } 7125 * @readonly 7126 * @syscap SystemCapability.Utils.Lang 7127 * @crossplatform 7128 * @atomicservice 7129 * @since 18 7130 */ 7131 readonly length: number; 7132 /** 7133 * A constructor used to create an Uint16Array. 7134 * 7135 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7136 * @syscap SystemCapability.Utils.Lang 7137 * @atomicservice 7138 * @since 12 7139 */ 7140 /** 7141 * A constructor used to create an Uint16Array. 7142 * 7143 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7144 * @syscap SystemCapability.Utils.Lang 7145 * @crossplatform 7146 * @atomicservice 7147 * @since 18 7148 */ 7149 constructor(); 7150 /** 7151 * A constructor used to create an Uint16Array. 7152 * 7153 * @param { number } length - The length of the array 7154 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7155 * @throws { BusinessError } 401 - Parameter error. 7156 * @syscap SystemCapability.Utils.Lang 7157 * @atomicservice 7158 * @since 12 7159 */ 7160 /** 7161 * A constructor used to create an Uint16Array. 7162 * 7163 * @param { number } length - The length of the array 7164 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7165 * @throws { BusinessError } 401 - Parameter error. 7166 * @syscap SystemCapability.Utils.Lang 7167 * @crossplatform 7168 * @atomicservice 7169 * @since 18 7170 */ 7171 constructor(length: number); 7172 /** 7173 * A constructor used to create an Uint16Array. 7174 * 7175 * @param { Iterable<number> } elements - An iterable object to convert to an Uint16Array. 7176 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7177 * @throws { BusinessError } 401 - Parameter error. 7178 * @syscap SystemCapability.Utils.Lang 7179 * @atomicservice 7180 * @since 12 7181 */ 7182 /** 7183 * A constructor used to create an Uint16Array. 7184 * 7185 * @param { Iterable<number> } elements - An iterable object to convert to an Uint16Array. 7186 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7187 * @throws { BusinessError } 401 - Parameter error. 7188 * @syscap SystemCapability.Utils.Lang 7189 * @crossplatform 7190 * @atomicservice 7191 * @since 18 7192 */ 7193 constructor(elements: Iterable<number>); 7194 /** 7195 * A constructor used to create an Uint16Array. 7196 * 7197 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 7198 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7199 * @throws { BusinessError } 401 - Parameter error. 7200 * @syscap SystemCapability.Utils.Lang 7201 * @atomicservice 7202 * @since 12 7203 */ 7204 /** 7205 * A constructor used to create an Uint16Array. 7206 * 7207 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 7208 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7209 * @throws { BusinessError } 401 - Parameter error. 7210 * @syscap SystemCapability.Utils.Lang 7211 * @crossplatform 7212 * @atomicservice 7213 * @since 18 7214 */ 7215 constructor(array: ArrayLike<number> | ArrayBuffer); 7216 /** 7217 * A constructor used to create an Uint16Array. 7218 * 7219 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 7220 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 7221 * that will be exposed by the typed array view. 7222 * @param { number } [length] - The length parameter specifies the memory range 7223 * that will be exposed by the typed array view. 7224 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7225 * @throws { BusinessError } 401 - Parameter error. 7226 * @syscap SystemCapability.Utils.Lang 7227 * @atomicservice 7228 * @since 12 7229 */ 7230 /** 7231 * A constructor used to create an Uint16Array. 7232 * 7233 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 7234 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 7235 * that will be exposed by the typed array view. 7236 * @param { number } [length] - The length parameter specifies the memory range 7237 * that will be exposed by the typed array view. 7238 * @throws { BusinessError } 10200012 - The Uint16Array's constructor cannot be directly invoked. 7239 * @throws { BusinessError } 401 - Parameter error. 7240 * @syscap SystemCapability.Utils.Lang 7241 * @crossplatform 7242 * @atomicservice 7243 * @since 18 7244 */ 7245 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 7246 /** 7247 * Creates an Uint16Array from an array-like object. 7248 * 7249 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint16Array. 7250 * @returns { Uint16Array } A new Uint16Array instance 7251 * @throws { BusinessError } 401 - Parameter error. 7252 * @static 7253 * @syscap SystemCapability.Utils.Lang 7254 * @atomicservice 7255 * @since 12 7256 */ 7257 /** 7258 * Creates an Uint16Array from an array-like object. 7259 * 7260 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint16Array. 7261 * @returns { Uint16Array } A new Uint16Array instance 7262 * @throws { BusinessError } 401 - Parameter error. 7263 * @static 7264 * @syscap SystemCapability.Utils.Lang 7265 * @crossplatform 7266 * @atomicservice 7267 * @since 18 7268 */ 7269 static from(arrayLike: ArrayLike<number>): Uint16Array; 7270 /** 7271 * Creates an Uint16Array from an array-like object. 7272 * 7273 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint16Array. 7274 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 7275 * @returns { Uint16Array } A new Uint16Array instance 7276 * @throws { BusinessError } 401 - Parameter error. 7277 * @static 7278 * @syscap SystemCapability.Utils.Lang 7279 * @atomicservice 7280 * @since 12 7281 */ 7282 /** 7283 * Creates an Uint16Array from an array-like object. 7284 * 7285 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint16Array. 7286 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 7287 * @returns { Uint16Array } A new Uint16Array instance 7288 * @throws { BusinessError } 401 - Parameter error. 7289 * @static 7290 * @syscap SystemCapability.Utils.Lang 7291 * @crossplatform 7292 * @atomicservice 7293 * @since 18 7294 */ 7295 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Uint16Array; 7296 /** 7297 * Creates an Uint16Array from an iterable object. 7298 * 7299 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint16Array. 7300 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 7301 * call on every element of the array. 7302 * @returns { Uint16Array } A new Uint16Array instance 7303 * @throws { BusinessError } 401 - Parameter error. 7304 * @static 7305 * @syscap SystemCapability.Utils.Lang 7306 * @atomicservice 7307 * @since 12 7308 */ 7309 /** 7310 * Creates an Uint16Array from an iterable object. 7311 * 7312 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint16Array. 7313 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 7314 * call on every element of the array. 7315 * @returns { Uint16Array } A new Uint16Array instance 7316 * @throws { BusinessError } 401 - Parameter error. 7317 * @static 7318 * @syscap SystemCapability.Utils.Lang 7319 * @crossplatform 7320 * @atomicservice 7321 * @since 18 7322 */ 7323 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Uint16Array; 7324 /** 7325 * Returns the this object after copying a section of the array identified by start and end 7326 * to the same array starting at position target. 7327 * 7328 * @param { number } target - If target is negative, it is treated as length+target where length is the 7329 * length of the array. 7330 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 7331 * is treated as length+end. 7332 * @param { number } [end] - If not specified, length of the this object is used as its default value. 7333 * @returns { Uint16Array } The array itself. 7334 * @throws { BusinessError } 401 - Parameter error. 7335 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 7336 * @throws { BusinessError } 10200201 - Concurrent modification error. 7337 * @syscap SystemCapability.Utils.Lang 7338 * @atomicservice 7339 * @since 12 7340 */ 7341 /** 7342 * Returns the this object after copying a section of the array identified by start and end 7343 * to the same array starting at position target. 7344 * 7345 * @param { number } target - If target is negative, it is treated as length+target where length is the 7346 * length of the array. 7347 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 7348 * is treated as length+end. 7349 * @param { number } [end] - If not specified, length of the this object is used as its default value. 7350 * @returns { Uint16Array } The array itself. 7351 * @throws { BusinessError } 401 - Parameter error. 7352 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 7353 * @throws { BusinessError } 10200201 - Concurrent modification error. 7354 * @syscap SystemCapability.Utils.Lang 7355 * @crossplatform 7356 * @atomicservice 7357 * @since 18 7358 */ 7359 copyWithin(target: number, start: number, end?: number): Uint16Array; 7360 /** 7361 * Determines whether all the members of an array satisfy the specified test. 7362 * 7363 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7364 * The every method calls the predicate function for each element in the array until 7365 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 7366 * @returns { boolean } true unless predicate returns a false value for a typed array element, 7367 * in which case false is immediately returned. 7368 * @throws { BusinessError } 401 - Parameter error. 7369 * @throws { BusinessError } 10200011 - The every method cannot be bound. 7370 * @throws { BusinessError } 10200201 - Concurrent modification error. 7371 * @syscap SystemCapability.Utils.Lang 7372 * @atomicservice 7373 * @since 12 7374 */ 7375 /** 7376 * Determines whether all the members of an array satisfy the specified test. 7377 * 7378 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7379 * The every method calls the predicate function for each element in the array until 7380 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 7381 * @returns { boolean } true unless predicate returns a false value for a typed array element, 7382 * in which case false is immediately returned. 7383 * @throws { BusinessError } 401 - Parameter error. 7384 * @throws { BusinessError } 10200011 - The every method cannot be bound. 7385 * @throws { BusinessError } 10200201 - Concurrent modification error. 7386 * @syscap SystemCapability.Utils.Lang 7387 * @crossplatform 7388 * @atomicservice 7389 * @since 18 7390 */ 7391 every(predicate: TypedArrayPredicateFn<number, Uint16Array>): boolean; 7392 /** 7393 * Returns the this object after filling the section identified by start and end with value. 7394 * 7395 * @param { number } value - value to fill array section with. 7396 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 7397 * length+start where length is the length of the array. 7398 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 7399 * length+end. 7400 * @returns { Uint16Array } The array itself. 7401 * @throws { BusinessError } 401 - Parameter error. 7402 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 7403 * @throws { BusinessError } 10200201 - Concurrent modification error. 7404 * @syscap SystemCapability.Utils.Lang 7405 * @atomicservice 7406 * @since 12 7407 */ 7408 /** 7409 * Returns the this object after filling the section identified by start and end with value. 7410 * 7411 * @param { number } value - value to fill array section with. 7412 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 7413 * length+start where length is the length of the array. 7414 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 7415 * length+end. 7416 * @returns { Uint16Array } The array itself. 7417 * @throws { BusinessError } 401 - Parameter error. 7418 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 7419 * @throws { BusinessError } 10200201 - Concurrent modification error. 7420 * @syscap SystemCapability.Utils.Lang 7421 * @crossplatform 7422 * @atomicservice 7423 * @since 18 7424 */ 7425 fill(value: number, start?: number, end?: number): Uint16Array; 7426 /** 7427 * Returns the elements of an array that meet the condition specified in a callback function. 7428 * 7429 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7430 * The filter method calls the predicate function one time for each element in the array. 7431 * @returns { Uint16Array } The array itself. 7432 * @throws { BusinessError } 401 - Parameter error. 7433 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 7434 * @throws { BusinessError } 10200201 - Concurrent modification error. 7435 * @syscap SystemCapability.Utils.Lang 7436 * @atomicservice 7437 * @since 12 7438 */ 7439 /** 7440 * Returns the elements of an array that meet the condition specified in a callback function. 7441 * 7442 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7443 * The filter method calls the predicate function one time for each element in the array. 7444 * @returns { Uint16Array } The array itself. 7445 * @throws { BusinessError } 401 - Parameter error. 7446 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 7447 * @throws { BusinessError } 10200201 - Concurrent modification error. 7448 * @syscap SystemCapability.Utils.Lang 7449 * @crossplatform 7450 * @atomicservice 7451 * @since 18 7452 */ 7453 filter(predicate: TypedArrayPredicateFn<number, Uint16Array>): Uint16Array; 7454 /** 7455 * Returns the value of the first element in the array where predicate is true, and undefined 7456 * otherwise. 7457 * 7458 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - find calls predicate once for each element of 7459 * the array, in ascending order, until it finds one where predicate returns true. 7460 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 7461 * @returns { number | undefined } The first element in the typed array 7462 * that satisfies the provided testing function. Otherwise, undefined is returned. 7463 * @throws { BusinessError } 401 - Parameter error. 7464 * @throws { BusinessError } 10200011 - The find method cannot be bound. 7465 * @throws { BusinessError } 10200201 - Concurrent modification error. 7466 * @syscap SystemCapability.Utils.Lang 7467 * @atomicservice 7468 * @since 12 7469 */ 7470 /** 7471 * Returns the value of the first element in the array where predicate is true, and undefined 7472 * otherwise. 7473 * 7474 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - find calls predicate once for each element of 7475 * the array, in ascending order, until it finds one where predicate returns true. 7476 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 7477 * @returns { number | undefined } The first element in the typed array 7478 * that satisfies the provided testing function. Otherwise, undefined is returned. 7479 * @throws { BusinessError } 401 - Parameter error. 7480 * @throws { BusinessError } 10200011 - The find method cannot be bound. 7481 * @throws { BusinessError } 10200201 - Concurrent modification error. 7482 * @syscap SystemCapability.Utils.Lang 7483 * @crossplatform 7484 * @atomicservice 7485 * @since 18 7486 */ 7487 find(predicate: TypedArrayPredicateFn<number, Uint16Array>): number | undefined; 7488 /** 7489 * Returns the index of the first element in the array where predicate is true, and -1 7490 * otherwise. 7491 * 7492 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - find calls predicate once for each element of 7493 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 7494 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 7495 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 7496 * @throws { BusinessError } 401 - Parameter error. 7497 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 7498 * @throws { BusinessError } 10200201 - Concurrent modification error. 7499 * @syscap SystemCapability.Utils.Lang 7500 * @atomicservice 7501 * @since 12 7502 */ 7503 /** 7504 * Returns the index of the first element in the array where predicate is true, and -1 7505 * otherwise. 7506 * 7507 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - find calls predicate once for each element of 7508 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 7509 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 7510 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 7511 * @throws { BusinessError } 401 - Parameter error. 7512 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 7513 * @throws { BusinessError } 10200201 - Concurrent modification error. 7514 * @syscap SystemCapability.Utils.Lang 7515 * @crossplatform 7516 * @atomicservice 7517 * @since 18 7518 */ 7519 findIndex(predicate: TypedArrayPredicateFn<number, Uint16Array>): number; 7520 /** 7521 * Performs the specified action for each element in an array. 7522 * 7523 * @param { TypedArrayForEachCallback<number, Uint16Array> } callbackFn - A function that 7524 * accepts up to three arguments. 7525 * forEach calls the callbackfn function one time for each element in the array. 7526 * @throws { BusinessError } 401 - Parameter error. 7527 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 7528 * @throws { BusinessError } 10200201 - Concurrent modification error. 7529 * @syscap SystemCapability.Utils.Lang 7530 * @atomicservice 7531 * @since 12 7532 */ 7533 /** 7534 * Performs the specified action for each element in an array. 7535 * 7536 * @param { TypedArrayForEachCallback<number, Uint16Array> } callbackFn - A function that 7537 * accepts up to three arguments. 7538 * forEach calls the callbackfn function one time for each element in the array. 7539 * @throws { BusinessError } 401 - Parameter error. 7540 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 7541 * @throws { BusinessError } 10200201 - Concurrent modification error. 7542 * @syscap SystemCapability.Utils.Lang 7543 * @crossplatform 7544 * @atomicservice 7545 * @since 18 7546 */ 7547 forEach(callbackFn: TypedArrayForEachCallback<number, Uint16Array>): void; 7548 /** 7549 * Returns the index of the first occurrence of a value in an array. 7550 * 7551 * @param { number } searchElement - The value to locate in the array. 7552 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 7553 * search starts at index 0. 7554 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 7555 * @throws { BusinessError } 401 - Parameter error. 7556 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 7557 * @throws { BusinessError } 10200201 - Concurrent modification error. 7558 * @syscap SystemCapability.Utils.Lang 7559 * @atomicservice 7560 * @since 12 7561 */ 7562 /** 7563 * Returns the index of the first occurrence of a value in an array. 7564 * 7565 * @param { number } searchElement - The value to locate in the array. 7566 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 7567 * search starts at index 0. 7568 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 7569 * @throws { BusinessError } 401 - Parameter error. 7570 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 7571 * @throws { BusinessError } 10200201 - Concurrent modification error. 7572 * @syscap SystemCapability.Utils.Lang 7573 * @crossplatform 7574 * @atomicservice 7575 * @since 18 7576 */ 7577 indexOf(searchElement: number, fromIndex?: number): number; 7578 /** 7579 * Adds all the elements of an array separated by the specified separator string. 7580 * @param { string } [separator] - A string used to separate one element of an array from the next in the 7581 * resulting String. If omitted, the array elements are separated with a comma. 7582 * @returns { string } A string with all typed array elements joined. 7583 * If array.length is 0, the empty string is returned. 7584 * @throws { BusinessError } 401 - Parameter error. 7585 * @throws { BusinessError } 10200011 - The join method cannot be bound. 7586 * @throws { BusinessError } 10200201 - Concurrent modification error. 7587 * @syscap SystemCapability.Utils.Lang 7588 * @atomicservice 7589 * @since 12 7590 */ 7591 /** 7592 * Adds all the elements of an array separated by the specified separator string. 7593 * @param { string } [separator] - A string used to separate one element of an array from the next in the 7594 * resulting String. If omitted, the array elements are separated with a comma. 7595 * @returns { string } A string with all typed array elements joined. 7596 * If array.length is 0, the empty string is returned. 7597 * @throws { BusinessError } 401 - Parameter error. 7598 * @throws { BusinessError } 10200011 - The join method cannot be bound. 7599 * @throws { BusinessError } 10200201 - Concurrent modification error. 7600 * @syscap SystemCapability.Utils.Lang 7601 * @crossplatform 7602 * @atomicservice 7603 * @since 18 7604 */ 7605 join(separator?: string): string; 7606 /** 7607 * Calls a defined callback function on each element of an array, and returns an array that 7608 * contains the results. 7609 * 7610 * @param { TypedArrayMapCallback<number, Uint16Array> } callbackFn - A function that accepts up to 7611 * three arguments. The map method calls the callbackfn function one time for each element in the array. 7612 * @returns { Uint16Array } The array itself. 7613 * @throws { BusinessError } 401 - Parameter error. 7614 * @throws { BusinessError } 10200011 - The map method cannot be bound. 7615 * @throws { BusinessError } 10200201 - Concurrent modification error. 7616 * @syscap SystemCapability.Utils.Lang 7617 * @atomicservice 7618 * @since 12 7619 */ 7620 /** 7621 * Calls a defined callback function on each element of an array, and returns an array that 7622 * contains the results. 7623 * 7624 * @param { TypedArrayMapCallback<number, Uint16Array> } callbackFn - A function that accepts up to 7625 * three arguments. The map method calls the callbackfn function one time for each element in the array. 7626 * @returns { Uint16Array } The array itself. 7627 * @throws { BusinessError } 401 - Parameter error. 7628 * @throws { BusinessError } 10200011 - The map method cannot be bound. 7629 * @throws { BusinessError } 10200201 - Concurrent modification error. 7630 * @syscap SystemCapability.Utils.Lang 7631 * @crossplatform 7632 * @atomicservice 7633 * @since 18 7634 */ 7635 map(callbackFn: TypedArrayMapCallback<number, Uint16Array>): Uint16Array; 7636 /** 7637 * Calls the specified callback function for all the elements in an array. The return value of 7638 * the callback function is the accumulated result, and is provided as an argument in the next 7639 * call to the callback function. 7640 * 7641 * @param { TypedArrayReduceCallback<number, number, Uint16Array> } callbackFn - A function that 7642 * accepts up to four arguments. 7643 * The reduce method calls the callbackfn function one time for each element in the array. 7644 * @returns { number } The value that results from running the "reducer" callback function to 7645 * completion over the entire typed array. 7646 * @throws { BusinessError } 401 - Parameter error. 7647 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7648 * @throws { BusinessError } 10200201 - Concurrent modification error. 7649 * @syscap SystemCapability.Utils.Lang 7650 * @atomicservice 7651 * @since 12 7652 */ 7653 /** 7654 * Calls the specified callback function for all the elements in an array. The return value of 7655 * the callback function is the accumulated result, and is provided as an argument in the next 7656 * call to the callback function. 7657 * 7658 * @param { TypedArrayReduceCallback<number, number, Uint16Array> } callbackFn - A function that 7659 * accepts up to four arguments. 7660 * The reduce method calls the callbackfn function one time for each element in the array. 7661 * @returns { number } The value that results from running the "reducer" callback function to 7662 * completion over the entire typed array. 7663 * @throws { BusinessError } 401 - Parameter error. 7664 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7665 * @throws { BusinessError } 10200201 - Concurrent modification error. 7666 * @syscap SystemCapability.Utils.Lang 7667 * @crossplatform 7668 * @atomicservice 7669 * @since 18 7670 */ 7671 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint16Array>): number; 7672 /** 7673 * Calls the specified callback function for all the elements in an array. The return value of 7674 * the callback function is the accumulated result, and is provided as an argument in the next 7675 * call to the callback function. 7676 * 7677 * @param { TypedArrayReduceCallback<number, number, Uint16Array> } callbackFn - A function that 7678 * accepts up to four arguments. 7679 * The reduce method calls the callbackfn function one time for each element in the array. 7680 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 7681 * the accumulation. The first call to the callbackfn function provides this value as an argument 7682 * instead of an array value. 7683 * @returns { number } The value that results from running the "reducer" callback function to 7684 * completion over the entire typed array. 7685 * @throws { BusinessError } 401 - Parameter error. 7686 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7687 * @throws { BusinessError } 10200201 - Concurrent modification error. 7688 * @syscap SystemCapability.Utils.Lang 7689 * @atomicservice 7690 * @since 12 7691 */ 7692 /** 7693 * Calls the specified callback function for all the elements in an array. The return value of 7694 * the callback function is the accumulated result, and is provided as an argument in the next 7695 * call to the callback function. 7696 * 7697 * @param { TypedArrayReduceCallback<number, number, Uint16Array> } callbackFn - A function that 7698 * accepts up to four arguments. 7699 * The reduce method calls the callbackfn function one time for each element in the array. 7700 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 7701 * the accumulation. The first call to the callbackfn function provides this value as an argument 7702 * instead of an array value. 7703 * @returns { number } The value that results from running the "reducer" callback function to 7704 * completion over the entire typed array. 7705 * @throws { BusinessError } 401 - Parameter error. 7706 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7707 * @throws { BusinessError } 10200201 - Concurrent modification error. 7708 * @syscap SystemCapability.Utils.Lang 7709 * @crossplatform 7710 * @atomicservice 7711 * @since 18 7712 */ 7713 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint16Array>, initialValue: number): number; 7714 /** 7715 * Calls the specified callback function for all the elements in an array. The return value of 7716 * the callback function is the accumulated result, and is provided as an argument in the next 7717 * call to the callback function. 7718 * 7719 * @param { TypedArrayReduceCallback<U, number, Uint16Array> } callbackFn - A function that 7720 * accepts up to four arguments. 7721 * The reduce method calls the callbackfn function one time for each element in the array. 7722 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 7723 * the accumulation. The first call to the callbackfn function provides this value as an argument 7724 * instead of an array value. 7725 * @returns { U } The value that results from running the "reducer" callback function to 7726 * completion over the entire typed array. 7727 * @throws { BusinessError } 401 - Parameter error. 7728 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7729 * @throws { BusinessError } 10200201 - Concurrent modification error. 7730 * @syscap SystemCapability.Utils.Lang 7731 * @atomicservice 7732 * @since 12 7733 */ 7734 /** 7735 * Calls the specified callback function for all the elements in an array. The return value of 7736 * the callback function is the accumulated result, and is provided as an argument in the next 7737 * call to the callback function. 7738 * 7739 * @param { TypedArrayReduceCallback<U, number, Uint16Array> } callbackFn - A function that 7740 * accepts up to four arguments. 7741 * The reduce method calls the callbackfn function one time for each element in the array. 7742 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 7743 * the accumulation. The first call to the callbackfn function provides this value as an argument 7744 * instead of an array value. 7745 * @returns { U } The value that results from running the "reducer" callback function to 7746 * completion over the entire typed array. 7747 * @throws { BusinessError } 401 - Parameter error. 7748 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 7749 * @throws { BusinessError } 10200201 - Concurrent modification error. 7750 * @syscap SystemCapability.Utils.Lang 7751 * @crossplatform 7752 * @atomicservice 7753 * @since 18 7754 */ 7755 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Uint16Array>, initialValue: U): U; 7756 /** 7757 * Reverses the elements in an Array. 7758 * 7759 * @returns { Uint16Array } The reference to the original typed array, now reversed. 7760 * <br/>Note that the typed array is reversed in place, and no copy is made. 7761 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 7762 * @throws { BusinessError } 10200201 - Concurrent modification error. 7763 * @syscap SystemCapability.Utils.Lang 7764 * @atomicservice 7765 * @since 12 7766 */ 7767 /** 7768 * Reverses the elements in an Array. 7769 * 7770 * @returns { Uint16Array } The reference to the original typed array, now reversed. 7771 * <br/>Note that the typed array is reversed in place, and no copy is made. 7772 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 7773 * @throws { BusinessError } 10200201 - Concurrent modification error. 7774 * @syscap SystemCapability.Utils.Lang 7775 * @crossplatform 7776 * @atomicservice 7777 * @since 18 7778 */ 7779 reverse(): Uint16Array; 7780 /** 7781 * Sets a value or an array of values. 7782 * 7783 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 7784 * @param { number } [offset] - The index in the current array at which the values are to be written. 7785 * @throws { BusinessError } 401 - Parameter error. 7786 * @throws { BusinessError } 10200011 - The set method cannot be bound. 7787 * @throws { BusinessError } 10200201 - Concurrent modification error. 7788 * @syscap SystemCapability.Utils.Lang 7789 * @atomicservice 7790 * @since 12 7791 */ 7792 /** 7793 * Sets a value or an array of values. 7794 * 7795 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 7796 * @param { number } [offset] - The index in the current array at which the values are to be written. 7797 * @throws { BusinessError } 401 - Parameter error. 7798 * @throws { BusinessError } 10200011 - The set method cannot be bound. 7799 * @throws { BusinessError } 10200201 - Concurrent modification error. 7800 * @syscap SystemCapability.Utils.Lang 7801 * @crossplatform 7802 * @atomicservice 7803 * @since 18 7804 */ 7805 set(array: ArrayLike<number>, offset?: number): void; 7806 /** 7807 * Returns a section of an array. 7808 * 7809 * @param { number } [start] - The beginning of the specified portion of the array. 7810 * @param { number } [end] - The end of the specified portion of the array. 7811 * This is exclusive of the element at the index 'end'. 7812 * @returns { Uint16Array } A new typed array containing the extracted elements. 7813 * @throws { BusinessError } 401 - Parameter error. 7814 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 7815 * @throws { BusinessError } 10200201 - Concurrent modification error. 7816 * @syscap SystemCapability.Utils.Lang 7817 * @atomicservice 7818 * @since 12 7819 */ 7820 /** 7821 * Returns a section of an array. 7822 * 7823 * @param { number } [start] - The beginning of the specified portion of the array. 7824 * @param { number } [end] - The end of the specified portion of the array. 7825 * This is exclusive of the element at the index 'end'. 7826 * @returns { Uint16Array } A new typed array containing the extracted elements. 7827 * @throws { BusinessError } 401 - Parameter error. 7828 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 7829 * @throws { BusinessError } 10200201 - Concurrent modification error. 7830 * @syscap SystemCapability.Utils.Lang 7831 * @crossplatform 7832 * @atomicservice 7833 * @since 18 7834 */ 7835 slice(start?: number, end?: number): Uint16Array; 7836 /** 7837 * Determines whether the specified callback function returns true for any element of an array. 7838 * 7839 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7840 * The some method calls the predicate function for each element in the array until 7841 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 7842 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 7843 * in which case true is immediately returned. 7844 * @throws { BusinessError } 401 - Parameter error. 7845 * @throws { BusinessError } 10200011 - The some method cannot be bound. 7846 * @throws { BusinessError } 10200201 - Concurrent modification error. 7847 * @syscap SystemCapability.Utils.Lang 7848 * @atomicservice 7849 * @since 12 7850 */ 7851 /** 7852 * Determines whether the specified callback function returns true for any element of an array. 7853 * 7854 * @param { TypedArrayPredicateFn<number, Uint16Array> } predicate - A function that accepts up to three arguments. 7855 * The some method calls the predicate function for each element in the array until 7856 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 7857 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 7858 * in which case true is immediately returned. 7859 * @throws { BusinessError } 401 - Parameter error. 7860 * @throws { BusinessError } 10200011 - The some method cannot be bound. 7861 * @throws { BusinessError } 10200201 - Concurrent modification error. 7862 * @syscap SystemCapability.Utils.Lang 7863 * @crossplatform 7864 * @atomicservice 7865 * @since 18 7866 */ 7867 some(predicate: TypedArrayPredicateFn<number, Uint16Array>): boolean; 7868 /** 7869 * Sorts an array. 7870 * 7871 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 7872 * It is expected to return a negative value if first argument is less than second argument, 7873 * zero if they're equal and a positive value otherwise. 7874 * If omitted, the elements are sorted in ascending, ASCII character order. 7875 * @returns { Uint16Array } The reference to the original typed array, now sorted. 7876 * Note that the typed array is sorted in place and no copy is made. 7877 * @throws { BusinessError } 401 - Parameter error. 7878 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 7879 * @throws { BusinessError } 10200201 - Concurrent modification error. 7880 * @syscap SystemCapability.Utils.Lang 7881 * @atomicservice 7882 * @since 12 7883 */ 7884 /** 7885 * Sorts an array. 7886 * 7887 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 7888 * It is expected to return a negative value if first argument is less than second argument, 7889 * zero if they're equal and a positive value otherwise. 7890 * If omitted, the elements are sorted in ascending, ASCII character order. 7891 * @returns { Uint16Array } The reference to the original typed array, now sorted. 7892 * Note that the typed array is sorted in place and no copy is made. 7893 * @throws { BusinessError } 401 - Parameter error. 7894 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 7895 * @throws { BusinessError } 10200201 - Concurrent modification error. 7896 * @syscap SystemCapability.Utils.Lang 7897 * @crossplatform 7898 * @atomicservice 7899 * @since 18 7900 */ 7901 sort(compareFn?: TypedArrayCompareFn<number>): Uint16Array; 7902 /** 7903 * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements 7904 * at begin, inclusive, up to end, exclusive. 7905 * 7906 * @param { number } [begin] - The index of the beginning of the array. 7907 * @param { number } [end] - The index of the end of the array. 7908 * @returns { Uint16Array } A new Uint16Array object. 7909 * @throws { BusinessError } 401 - Parameter error. 7910 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 7911 * @throws { BusinessError } 10200201 - Concurrent modification error. 7912 * @syscap SystemCapability.Utils.Lang 7913 * @atomicservice 7914 * @since 12 7915 */ 7916 /** 7917 * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements 7918 * at begin, inclusive, up to end, exclusive. 7919 * 7920 * @param { number } [begin] - The index of the beginning of the array. 7921 * @param { number } [end] - The index of the end of the array. 7922 * @returns { Uint16Array } A new Uint16Array object. 7923 * @throws { BusinessError } 401 - Parameter error. 7924 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 7925 * @throws { BusinessError } 10200201 - Concurrent modification error. 7926 * @syscap SystemCapability.Utils.Lang 7927 * @crossplatform 7928 * @atomicservice 7929 * @since 18 7930 */ 7931 subarray(begin?: number, end?: number): Uint16Array; 7932 /** 7933 * Returns the item located at the specified index. 7934 * 7935 * @param { number } index - The zero-based index of the desired code unit.<br/> 7936 * A negative index will count back from the last item. 7937 * @returns { number | undefined } The element in the array matching the given index.<br/> 7938 * Always returns undefined if index < -array.length or 7939 * index >= array.length without attempting to access the corresponding property. 7940 * @throws { BusinessError } 401 - Parameter error. 7941 * @throws { BusinessError } 10200011 - The at method cannot be bound. 7942 * @throws { BusinessError } 10200201 - Concurrent modification error. 7943 * @syscap SystemCapability.Utils.Lang 7944 * @atomicservice 7945 * @since 12 7946 */ 7947 /** 7948 * Returns the item located at the specified index. 7949 * 7950 * @param { number } index - The zero-based index of the desired code unit.<br/> 7951 * A negative index will count back from the last item. 7952 * @returns { number | undefined } The element in the array matching the given index.<br/> 7953 * Always returns undefined if index < -array.length or 7954 * index >= array.length without attempting to access the corresponding property. 7955 * @throws { BusinessError } 401 - Parameter error. 7956 * @throws { BusinessError } 10200011 - The at method cannot be bound. 7957 * @throws { BusinessError } 10200201 - Concurrent modification error. 7958 * @syscap SystemCapability.Utils.Lang 7959 * @crossplatform 7960 * @atomicservice 7961 * @since 18 7962 */ 7963 at(index: number): number | undefined; 7964 /** 7965 * Returns an iterator that iterates over numbers. 7966 * 7967 * @returns { IterableIterator<number> } Iterator object that yields numbers. 7968 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 7969 * @syscap SystemCapability.Utils.Lang 7970 * @atomicservice 7971 * @since 12 7972 */ 7973 /** 7974 * Returns an iterator that iterates over numbers. 7975 * 7976 * @returns { IterableIterator<number> } Iterator object that yields numbers. 7977 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 7978 * @syscap SystemCapability.Utils.Lang 7979 * @crossplatform 7980 * @atomicservice 7981 * @since 18 7982 */ 7983 [Symbol.iterator](): IterableIterator<number>; 7984 /** 7985 * Returns an iterable of key, value pairs for every entry in the array 7986 * 7987 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 7988 * @throws { BusinessError } 10200011 - The method cannot be bound. 7989 * @throws { BusinessError } 10200201 - Concurrent modification error. 7990 * @syscap SystemCapability.Utils.Lang 7991 * @atomicservice 7992 * @since 12 7993 */ 7994 /** 7995 * Returns an iterable of key, value pairs for every entry in the array 7996 * 7997 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 7998 * @throws { BusinessError } 10200011 - The method cannot be bound. 7999 * @throws { BusinessError } 10200201 - Concurrent modification error. 8000 * @syscap SystemCapability.Utils.Lang 8001 * @crossplatform 8002 * @atomicservice 8003 * @since 18 8004 */ 8005 entries(): IterableIterator<[number, number]>; 8006 /** 8007 * Returns an iterable of keys in the array 8008 * 8009 * @returns { IterableIterator<number> } A new iterable iterator object. 8010 * @throws { BusinessError } 10200011 - The method cannot be bound. 8011 * @throws { BusinessError } 10200201 - Concurrent modification error. 8012 * @syscap SystemCapability.Utils.Lang 8013 * @atomicservice 8014 * @since 12 8015 */ 8016 /** 8017 * Returns an iterable of keys in the array 8018 * 8019 * @returns { IterableIterator<number> } A new iterable iterator object. 8020 * @throws { BusinessError } 10200011 - The method cannot be bound. 8021 * @throws { BusinessError } 10200201 - Concurrent modification error. 8022 * @syscap SystemCapability.Utils.Lang 8023 * @crossplatform 8024 * @atomicservice 8025 * @since 18 8026 */ 8027 keys(): IterableIterator<number>; 8028 /** 8029 * Returns an iterable of values in the array 8030 * 8031 * @returns { IterableIterator<number> } A new iterable iterator object. 8032 * @throws { BusinessError } 10200011 - The method cannot be bound. 8033 * @throws { BusinessError } 10200201 - Concurrent modification error. 8034 * @syscap SystemCapability.Utils.Lang 8035 * @atomicservice 8036 * @since 12 8037 */ 8038 /** 8039 * Returns an iterable of values in the array 8040 * 8041 * @returns { IterableIterator<number> } A new iterable iterator object. 8042 * @throws { BusinessError } 10200011 - The method cannot be bound. 8043 * @throws { BusinessError } 10200201 - Concurrent modification error. 8044 * @syscap SystemCapability.Utils.Lang 8045 * @crossplatform 8046 * @atomicservice 8047 * @since 18 8048 */ 8049 values(): IterableIterator<number>; 8050 /** 8051 * Determines whether an array includes a certain element, returning true or false as appropriate. 8052 * 8053 * @param { number } searchElement - The element to search for. 8054 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 8055 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 8056 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 8057 * @throws { BusinessError } 401 - Parameter error. 8058 * @throws { BusinessError } 10200011 - The at method cannot be bound. 8059 * @throws { BusinessError } 10200201 - Concurrent modification error. 8060 * @syscap SystemCapability.Utils.Lang 8061 * @atomicservice 8062 * @since 12 8063 */ 8064 /** 8065 * Determines whether an array includes a certain element, returning true or false as appropriate. 8066 * 8067 * @param { number } searchElement - The element to search for. 8068 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 8069 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 8070 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 8071 * @throws { BusinessError } 401 - Parameter error. 8072 * @throws { BusinessError } 10200011 - The at method cannot be bound. 8073 * @throws { BusinessError } 10200201 - Concurrent modification error. 8074 * @syscap SystemCapability.Utils.Lang 8075 * @crossplatform 8076 * @atomicservice 8077 * @since 18 8078 */ 8079 includes(searchElement: number, fromIndex?: number): boolean; 8080 /** 8081 * Returns the item at that index. 8082 * 8083 * @syscap SystemCapability.Utils.Lang 8084 * @atomicservice 8085 * @since 12 8086 */ 8087 /** 8088 * Returns the item at that index. 8089 * 8090 * @syscap SystemCapability.Utils.Lang 8091 * @crossplatform 8092 * @atomicservice 8093 * @since 18 8094 */ 8095 [index: number]: number; 8096 /** 8097 * Find the last occurrence of a specified element in an Uint16Array. 8098 * 8099 * @param { number } searchElement - Element to search for in the Uint16Array.. 8100 * @param { number } fromIndex - The index at which to start the search. If provided: 8101 * <br>If this index is negative, it is treated as Uint16Array.length + fromIndex. 8102 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 8103 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 8104 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 8105 * @syscap SystemCapability.Utils.Lang 8106 * @atomicservice 8107 * @since 18 8108 */ 8109 lastIndexOf(searchElement: number, fromIndex?: number): number; 8110 /** 8111 * Reduce elements in an Uint16Array from right to left. 8112 * 8113 * @param { TypedArrayReduceCallback<U, number, Uint16Array> } callbackFn - A function that is called for 8114 * each element in the Uint16Array. 8115 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 8116 * <br>If no initial value is provided, the last element of the Uint16Array will be used, 8117 * <br>and the callback will start with the second-to-last element. 8118 * @returns { U } Returns the single value that results from the reduction. 8119 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8120 * 1.Mandatory parameters are left unspecified. 8121 * 2.Incorrect parameter types. 8122 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 8123 * @throws { BusinessError } 10200201 - Concurrent modification error. 8124 * @syscap SystemCapability.Utils.Lang 8125 * @atomicservice 8126 * @since 18 8127 */ 8128 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Uint16Array>, initialValue: U): U; 8129 /** 8130 * Reduce elements in an Uint16Array from right to left. 8131 * 8132 * @param { TypedArrayReduceCallback<number, number, Uint16Array> } callbackFn - A function that is called for 8133 * each element in the Uint16Array. 8134 * @returns { number } Returns the single value that results from the reduction. 8135 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8136 * 1.Mandatory parameters are left unspecified. 8137 * 2.Incorrect parameter types. 8138 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 8139 * @throws { BusinessError } 10200201 - Concurrent modification error. 8140 * @syscap SystemCapability.Utils.Lang 8141 * @atomicservice 8142 * @since 18 8143 */ 8144 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Uint16Array>): number; 8145 /** 8146 * Convert an Uint16Array to a string. 8147 * 8148 * @returns { string } Returns a string representing the specified Uint16Array and its elements, 8149 * separated by commas. 8150 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 8151 * @throws { BusinessError } 10200201 - Concurrent modification error. 8152 * @syscap SystemCapability.Utils.Lang 8153 * @atomicservice 8154 * @since 18 8155 */ 8156 toString(): string; 8157 /** 8158 * Convert an Uint16Array to a string, The elements are converted to string using their toLocaleString methods. 8159 * 8160 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 8161 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 8162 * @throws { BusinessError } 10200201 - Concurrent modification error. 8163 * @syscap SystemCapability.Utils.Lang 8164 * @atomicservice 8165 * @since 18 8166 */ 8167 toLocaleString(): string; 8168 /** 8169 * Create an Uint16Array containing these parameters. 8170 * 8171 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Uint16Array. 8172 * @returns { Uint16Array } Returns a new Uint16Array instance containing the specified elements. 8173 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 8174 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 8175 * @static 8176 * @syscap SystemCapability.Utils.Lang 8177 * @atomicservice 8178 * @since 18 8179 */ 8180 static of(...items: number[]): Uint16Array; 8181 } 8182 8183 /** 8184 * A typed array of 32-bit integer values. The contents are initialized to 0. 8185 * If multiple threads access a Int32Array instance concurrently, 8186 * and at least one of the threads modifies the array structurally, 8187 * it must be synchronized externally. 8188 * 8189 * @syscap SystemCapability.Utils.Lang 8190 * @atomicservice 8191 * @since 12 8192 */ 8193 /** 8194 * A typed array of 32-bit integer values. The contents are initialized to 0. 8195 * If multiple threads access a Int32Array instance concurrently, 8196 * and at least one of the threads modifies the array structurally, 8197 * it must be synchronized externally. 8198 * 8199 * @syscap SystemCapability.Utils.Lang 8200 * @crossplatform 8201 * @atomicservice 8202 * @since 18 8203 */ 8204 @Sendable 8205 class Int32Array { 8206 /** 8207 * The size in bytes of each element in the array. 8208 * 8209 * @type { number } 8210 * @readonly 8211 * @static 8212 * @syscap SystemCapability.Utils.Lang 8213 * @atomicservice 8214 * @since 12 8215 */ 8216 /** 8217 * The size in bytes of each element in the array. 8218 * 8219 * @type { number } 8220 * @readonly 8221 * @static 8222 * @syscap SystemCapability.Utils.Lang 8223 * @crossplatform 8224 * @atomicservice 8225 * @since 18 8226 */ 8227 static readonly BYTES_PER_ELEMENT: number; 8228 /** 8229 * The ArrayBuffer instance referenced by the array. 8230 * 8231 * @type { ArrayBuffer } 8232 * @readonly 8233 * @syscap SystemCapability.Utils.Lang 8234 * @atomicservice 8235 * @since 12 8236 */ 8237 /** 8238 * The ArrayBuffer instance referenced by the array. 8239 * 8240 * @type { ArrayBuffer } 8241 * @readonly 8242 * @syscap SystemCapability.Utils.Lang 8243 * @crossplatform 8244 * @atomicservice 8245 * @since 18 8246 */ 8247 readonly buffer: ArrayBuffer; 8248 /** 8249 * The length in bytes of the array. 8250 * 8251 * @type { number } 8252 * @readonly 8253 * @syscap SystemCapability.Utils.Lang 8254 * @atomicservice 8255 * @since 12 8256 */ 8257 /** 8258 * The length in bytes of the array. 8259 * 8260 * @type { number } 8261 * @readonly 8262 * @syscap SystemCapability.Utils.Lang 8263 * @crossplatform 8264 * @atomicservice 8265 * @since 18 8266 */ 8267 readonly byteLength: number; 8268 /** 8269 * The offset in bytes of the array. 8270 * 8271 * @type { number } 8272 * @readonly 8273 * @syscap SystemCapability.Utils.Lang 8274 * @atomicservice 8275 * @since 12 8276 */ 8277 /** 8278 * The offset in bytes of the array. 8279 * 8280 * @type { number } 8281 * @readonly 8282 * @syscap SystemCapability.Utils.Lang 8283 * @crossplatform 8284 * @atomicservice 8285 * @since 18 8286 */ 8287 readonly byteOffset: number; 8288 /** 8289 * The length of the array. 8290 * 8291 * @type { number } 8292 * @readonly 8293 * @syscap SystemCapability.Utils.Lang 8294 * @atomicservice 8295 * @since 12 8296 */ 8297 /** 8298 * The length of the array. 8299 * 8300 * @type { number } 8301 * @readonly 8302 * @syscap SystemCapability.Utils.Lang 8303 * @crossplatform 8304 * @atomicservice 8305 * @since 18 8306 */ 8307 readonly length: number; 8308 /** 8309 * A constructor used to create an Int32Array. 8310 * 8311 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8312 * @syscap SystemCapability.Utils.Lang 8313 * @atomicservice 8314 * @since 12 8315 */ 8316 /** 8317 * A constructor used to create an Int32Array. 8318 * 8319 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8320 * @syscap SystemCapability.Utils.Lang 8321 * @crossplatform 8322 * @atomicservice 8323 * @since 18 8324 */ 8325 constructor(); 8326 /** 8327 * A constructor used to create an Int32Array. 8328 * 8329 * @param { number } length - The length of the array 8330 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8331 * @throws { BusinessError } 401 - Parameter error. 8332 * @syscap SystemCapability.Utils.Lang 8333 * @atomicservice 8334 * @since 12 8335 */ 8336 /** 8337 * A constructor used to create an Int32Array. 8338 * 8339 * @param { number } length - The length of the array 8340 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8341 * @throws { BusinessError } 401 - Parameter error. 8342 * @syscap SystemCapability.Utils.Lang 8343 * @crossplatform 8344 * @atomicservice 8345 * @since 18 8346 */ 8347 constructor(length: number); 8348 /** 8349 * A constructor used to create an Int32Array. 8350 * 8351 * @param { Iterable<number> } elements - An iterable object to convert to an Int32Array. 8352 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8353 * @throws { BusinessError } 401 - Parameter error. 8354 * @syscap SystemCapability.Utils.Lang 8355 * @atomicservice 8356 * @since 12 8357 */ 8358 /** 8359 * A constructor used to create an Int32Array. 8360 * 8361 * @param { Iterable<number> } elements - An iterable object to convert to an Int32Array. 8362 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8363 * @throws { BusinessError } 401 - Parameter error. 8364 * @syscap SystemCapability.Utils.Lang 8365 * @crossplatform 8366 * @atomicservice 8367 * @since 18 8368 */ 8369 constructor(elements: Iterable<number>); 8370 /** 8371 * A constructor used to create an Int32Array. 8372 * 8373 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 8374 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8375 * @throws { BusinessError } 401 - Parameter error. 8376 * @syscap SystemCapability.Utils.Lang 8377 * @atomicservice 8378 * @since 12 8379 */ 8380 /** 8381 * A constructor used to create an Int32Array. 8382 * 8383 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 8384 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8385 * @throws { BusinessError } 401 - Parameter error. 8386 * @syscap SystemCapability.Utils.Lang 8387 * @crossplatform 8388 * @atomicservice 8389 * @since 18 8390 */ 8391 constructor(array: ArrayLike<number> | ArrayBuffer); 8392 /** 8393 * A constructor used to create an Int32Array. 8394 * 8395 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 8396 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 8397 * that will be exposed by the typed array view. 8398 * @param { number } [length] - The length parameter specifies the memory range 8399 * that will be exposed by the typed array view. 8400 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8401 * @throws { BusinessError } 401 - Parameter error. 8402 * @syscap SystemCapability.Utils.Lang 8403 * @atomicservice 8404 * @since 12 8405 */ 8406 /** 8407 * A constructor used to create an Int32Array. 8408 * 8409 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 8410 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 8411 * that will be exposed by the typed array view. 8412 * @param { number } [length] - The length parameter specifies the memory range 8413 * that will be exposed by the typed array view. 8414 * @throws { BusinessError } 10200012 - The Int32Array's constructor cannot be directly invoked. 8415 * @throws { BusinessError } 401 - Parameter error. 8416 * @syscap SystemCapability.Utils.Lang 8417 * @crossplatform 8418 * @atomicservice 8419 * @since 18 8420 */ 8421 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 8422 /** 8423 * Creates an Int32Array from an array-like object. 8424 * 8425 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int32Array. 8426 * @returns { Int32Array } A new Int32Array instance 8427 * @throws { BusinessError } 401 - Parameter error. 8428 * @static 8429 * @syscap SystemCapability.Utils.Lang 8430 * @atomicservice 8431 * @since 12 8432 */ 8433 /** 8434 * Creates an Int32Array from an array-like object. 8435 * 8436 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Int32Array. 8437 * @returns { Int32Array } A new Int32Array instance 8438 * @throws { BusinessError } 401 - Parameter error. 8439 * @static 8440 * @syscap SystemCapability.Utils.Lang 8441 * @crossplatform 8442 * @atomicservice 8443 * @since 18 8444 */ 8445 static from(arrayLike: ArrayLike<number>): Int32Array; 8446 /** 8447 * Creates an Int32Array from an array-like object. 8448 * 8449 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int32Array. 8450 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 8451 * @returns { Int32Array } A new Int32Array instance 8452 * @throws { BusinessError } 401 - Parameter error. 8453 * @static 8454 * @syscap SystemCapability.Utils.Lang 8455 * @atomicservice 8456 * @since 12 8457 */ 8458 /** 8459 * Creates an Int32Array from an array-like object. 8460 * 8461 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Int32Array. 8462 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 8463 * @returns { Int32Array } A new Int32Array instance 8464 * @throws { BusinessError } 401 - Parameter error. 8465 * @static 8466 * @syscap SystemCapability.Utils.Lang 8467 * @crossplatform 8468 * @atomicservice 8469 * @since 18 8470 */ 8471 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Int32Array; 8472 /** 8473 * Creates an Int32Array from an iterable object. 8474 * 8475 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int32Array. 8476 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 8477 * call on every element of the array. 8478 * @returns { Int32Array } A new Int32Array instance 8479 * @throws { BusinessError } 401 - Parameter error. 8480 * @static 8481 * @syscap SystemCapability.Utils.Lang 8482 * @atomicservice 8483 * @since 12 8484 */ 8485 /** 8486 * Creates an Int32Array from an iterable object. 8487 * 8488 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Int32Array. 8489 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 8490 * call on every element of the array. 8491 * @returns { Int32Array } A new Int32Array instance 8492 * @throws { BusinessError } 401 - Parameter error. 8493 * @static 8494 * @syscap SystemCapability.Utils.Lang 8495 * @crossplatform 8496 * @atomicservice 8497 * @since 18 8498 */ 8499 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Int32Array; 8500 /** 8501 * Returns the this object after copying a section of the array identified by start and end 8502 * to the same array starting at position target. 8503 * 8504 * @param { number } target - If target is negative, it is treated as length+target where length is the 8505 * length of the array. 8506 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 8507 * is treated as length+end. 8508 * @param { number } [end] - If not specified, length of the this object is used as its default value. 8509 * @returns { Int32Array } The array itself. 8510 * @throws { BusinessError } 401 - Parameter error. 8511 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 8512 * @throws { BusinessError } 10200201 - Concurrent modification error. 8513 * @syscap SystemCapability.Utils.Lang 8514 * @atomicservice 8515 * @since 12 8516 */ 8517 /** 8518 * Returns the this object after copying a section of the array identified by start and end 8519 * to the same array starting at position target. 8520 * 8521 * @param { number } target - If target is negative, it is treated as length+target where length is the 8522 * length of the array. 8523 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 8524 * is treated as length+end. 8525 * @param { number } [end] - If not specified, length of the this object is used as its default value. 8526 * @returns { Int32Array } The array itself. 8527 * @throws { BusinessError } 401 - Parameter error. 8528 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 8529 * @throws { BusinessError } 10200201 - Concurrent modification error. 8530 * @syscap SystemCapability.Utils.Lang 8531 * @crossplatform 8532 * @atomicservice 8533 * @since 18 8534 */ 8535 copyWithin(target: number, start: number, end?: number): Int32Array; 8536 /** 8537 * Determines whether all the members of an array satisfy the specified test. 8538 * 8539 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 8540 * The every method calls the predicate function for each element in the array until 8541 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 8542 * @returns { boolean } true unless predicate returns a false value for a typed array element, 8543 * in which case false is immediately returned. 8544 * @throws { BusinessError } 401 - Parameter error. 8545 * @throws { BusinessError } 10200011 - The every method cannot be bound. 8546 * @throws { BusinessError } 10200201 - Concurrent modification error. 8547 * @syscap SystemCapability.Utils.Lang 8548 * @atomicservice 8549 * @since 12 8550 */ 8551 /** 8552 * Determines whether all the members of an array satisfy the specified test. 8553 * 8554 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 8555 * The every method calls the predicate function for each element in the array until 8556 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 8557 * @returns { boolean } true unless predicate returns a false value for a typed array element, 8558 * in which case false is immediately returned. 8559 * @throws { BusinessError } 401 - Parameter error. 8560 * @throws { BusinessError } 10200011 - The every method cannot be bound. 8561 * @throws { BusinessError } 10200201 - Concurrent modification error. 8562 * @syscap SystemCapability.Utils.Lang 8563 * @crossplatform 8564 * @atomicservice 8565 * @since 18 8566 */ 8567 every(predicate: TypedArrayPredicateFn<number, Int32Array>): boolean; 8568 /** 8569 * Returns the this object after filling the section identified by start and end with value. 8570 * 8571 * @param { number } value - value to fill array section with. 8572 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 8573 * length+start where length is the length of the array. 8574 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 8575 * length+end. 8576 * @returns { Int32Array } The array itself. 8577 * @throws { BusinessError } 401 - Parameter error. 8578 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 8579 * @throws { BusinessError } 10200201 - Concurrent modification error. 8580 * @syscap SystemCapability.Utils.Lang 8581 * @atomicservice 8582 * @since 12 8583 */ 8584 /** 8585 * Returns the this object after filling the section identified by start and end with value. 8586 * 8587 * @param { number } value - value to fill array section with. 8588 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 8589 * length+start where length is the length of the array. 8590 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 8591 * length+end. 8592 * @returns { Int32Array } The array itself. 8593 * @throws { BusinessError } 401 - Parameter error. 8594 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 8595 * @throws { BusinessError } 10200201 - Concurrent modification error. 8596 * @syscap SystemCapability.Utils.Lang 8597 * @crossplatform 8598 * @atomicservice 8599 * @since 18 8600 */ 8601 fill(value: number, start?: number, end?: number): Int32Array; 8602 /** 8603 * Returns the elements of an array that meet the condition specified in a callback function. 8604 * 8605 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 8606 * The filter method calls the predicate function one time for each element in the array. 8607 * @returns { Int32Array } The array itself. 8608 * @throws { BusinessError } 401 - Parameter error. 8609 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 8610 * @throws { BusinessError } 10200201 - Concurrent modification error. 8611 * @syscap SystemCapability.Utils.Lang 8612 * @atomicservice 8613 * @since 12 8614 */ 8615 /** 8616 * Returns the elements of an array that meet the condition specified in a callback function. 8617 * 8618 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 8619 * The filter method calls the predicate function one time for each element in the array. 8620 * @returns { Int32Array } The array itself. 8621 * @throws { BusinessError } 401 - Parameter error. 8622 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 8623 * @throws { BusinessError } 10200201 - Concurrent modification error. 8624 * @syscap SystemCapability.Utils.Lang 8625 * @crossplatform 8626 * @atomicservice 8627 * @since 18 8628 */ 8629 filter(predicate: TypedArrayPredicateFn<number, Int32Array>): Int32Array; 8630 /** 8631 * Returns the value of the first element in the array where predicate is true, and undefined 8632 * otherwise. 8633 * 8634 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - find calls predicate once for each element of 8635 * the array, in ascending order, until it finds one where predicate returns true. 8636 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 8637 * @returns { number | undefined } The first element in the typed array 8638 * that satisfies the provided testing function. Otherwise, undefined is returned. 8639 * @throws { BusinessError } 401 - Parameter error. 8640 * @throws { BusinessError } 10200011 - The find method cannot be bound. 8641 * @throws { BusinessError } 10200201 - Concurrent modification error. 8642 * @syscap SystemCapability.Utils.Lang 8643 * @atomicservice 8644 * @since 12 8645 */ 8646 /** 8647 * Returns the value of the first element in the array where predicate is true, and undefined 8648 * otherwise. 8649 * 8650 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - find calls predicate once for each element of 8651 * the array, in ascending order, until it finds one where predicate returns true. 8652 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 8653 * @returns { number | undefined } The first element in the typed array 8654 * that satisfies the provided testing function. Otherwise, undefined is returned. 8655 * @throws { BusinessError } 401 - Parameter error. 8656 * @throws { BusinessError } 10200011 - The find method cannot be bound. 8657 * @throws { BusinessError } 10200201 - Concurrent modification error. 8658 * @syscap SystemCapability.Utils.Lang 8659 * @crossplatform 8660 * @atomicservice 8661 * @since 18 8662 */ 8663 find(predicate: TypedArrayPredicateFn<number, Int32Array>): number | undefined; 8664 /** 8665 * Returns the index of the first element in the array where predicate is true, and -1 8666 * otherwise. 8667 * 8668 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - find calls predicate once for each element of 8669 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 8670 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 8671 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 8672 * @throws { BusinessError } 401 - Parameter error. 8673 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 8674 * @throws { BusinessError } 10200201 - Concurrent modification error. 8675 * @syscap SystemCapability.Utils.Lang 8676 * @atomicservice 8677 * @since 12 8678 */ 8679 /** 8680 * Returns the index of the first element in the array where predicate is true, and -1 8681 * otherwise. 8682 * 8683 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - find calls predicate once for each element of 8684 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 8685 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 8686 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 8687 * @throws { BusinessError } 401 - Parameter error. 8688 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 8689 * @throws { BusinessError } 10200201 - Concurrent modification error. 8690 * @syscap SystemCapability.Utils.Lang 8691 * @crossplatform 8692 * @atomicservice 8693 * @since 18 8694 */ 8695 findIndex(predicate: TypedArrayPredicateFn<number, Int32Array>): number; 8696 /** 8697 * Performs the specified action for each element in an array. 8698 * 8699 * @param { TypedArrayForEachCallback<number, Int32Array> } callbackFn - A function that 8700 * accepts up to three arguments. 8701 * forEach calls the callbackfn function one time for each element in the array. 8702 * @throws { BusinessError } 401 - Parameter error. 8703 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 8704 * @throws { BusinessError } 10200201 - Concurrent modification error. 8705 * @syscap SystemCapability.Utils.Lang 8706 * @atomicservice 8707 * @since 12 8708 */ 8709 /** 8710 * Performs the specified action for each element in an array. 8711 * 8712 * @param { TypedArrayForEachCallback<number, Int32Array> } callbackFn - A function that 8713 * accepts up to three arguments. 8714 * forEach calls the callbackfn function one time for each element in the array. 8715 * @throws { BusinessError } 401 - Parameter error. 8716 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 8717 * @throws { BusinessError } 10200201 - Concurrent modification error. 8718 * @syscap SystemCapability.Utils.Lang 8719 * @crossplatform 8720 * @atomicservice 8721 * @since 18 8722 */ 8723 forEach(callbackFn: TypedArrayForEachCallback<number, Int32Array>): void; 8724 /** 8725 * Returns the index of the first occurrence of a value in an array. 8726 * 8727 * @param { number } searchElement - The value to locate in the array. 8728 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 8729 * search starts at index 0. 8730 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 8731 * @throws { BusinessError } 401 - Parameter error. 8732 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 8733 * @throws { BusinessError } 10200201 - Concurrent modification error. 8734 * @syscap SystemCapability.Utils.Lang 8735 * @atomicservice 8736 * @since 12 8737 */ 8738 /** 8739 * Returns the index of the first occurrence of a value in an array. 8740 * 8741 * @param { number } searchElement - The value to locate in the array. 8742 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 8743 * search starts at index 0. 8744 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 8745 * @throws { BusinessError } 401 - Parameter error. 8746 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 8747 * @throws { BusinessError } 10200201 - Concurrent modification error. 8748 * @syscap SystemCapability.Utils.Lang 8749 * @crossplatform 8750 * @atomicservice 8751 * @since 18 8752 */ 8753 indexOf(searchElement: number, fromIndex?: number): number; 8754 /** 8755 * Adds all the elements of an array separated by the specified separator string. 8756 * @param { string } [separator] - A string used to separate one element of an array from the next in the 8757 * resulting String. If omitted, the array elements are separated with a comma. 8758 * @returns { string } A string with all typed array elements joined. 8759 * If array.length is 0, the empty string is returned. 8760 * @throws { BusinessError } 401 - Parameter error. 8761 * @throws { BusinessError } 10200011 - The join method cannot be bound. 8762 * @throws { BusinessError } 10200201 - Concurrent modification error. 8763 * @syscap SystemCapability.Utils.Lang 8764 * @atomicservice 8765 * @since 12 8766 */ 8767 /** 8768 * Adds all the elements of an array separated by the specified separator string. 8769 * @param { string } [separator] - A string used to separate one element of an array from the next in the 8770 * resulting String. If omitted, the array elements are separated with a comma. 8771 * @returns { string } A string with all typed array elements joined. 8772 * If array.length is 0, the empty string is returned. 8773 * @throws { BusinessError } 401 - Parameter error. 8774 * @throws { BusinessError } 10200011 - The join method cannot be bound. 8775 * @throws { BusinessError } 10200201 - Concurrent modification error. 8776 * @syscap SystemCapability.Utils.Lang 8777 * @crossplatform 8778 * @atomicservice 8779 * @since 18 8780 */ 8781 join(separator?: string): string; 8782 /** 8783 * Calls a defined callback function on each element of an array, and returns an array that 8784 * contains the results. 8785 * 8786 * @param { TypedArrayMapCallback<number, Int32Array> } callbackFn - A function that 8787 * accepts up to three arguments. 8788 * The map method calls the callbackfn function one time for each element in the array. 8789 * @returns { Int32Array } The array itself. 8790 * @throws { BusinessError } 401 - Parameter error. 8791 * @throws { BusinessError } 10200011 - The map method cannot be bound. 8792 * @throws { BusinessError } 10200201 - Concurrent modification error. 8793 * @syscap SystemCapability.Utils.Lang 8794 * @atomicservice 8795 * @since 12 8796 */ 8797 /** 8798 * Calls a defined callback function on each element of an array, and returns an array that 8799 * contains the results. 8800 * 8801 * @param { TypedArrayMapCallback<number, Int32Array> } callbackFn - A function that 8802 * accepts up to three arguments. 8803 * The map method calls the callbackfn function one time for each element in the array. 8804 * @returns { Int32Array } The array itself. 8805 * @throws { BusinessError } 401 - Parameter error. 8806 * @throws { BusinessError } 10200011 - The map method cannot be bound. 8807 * @throws { BusinessError } 10200201 - Concurrent modification error. 8808 * @syscap SystemCapability.Utils.Lang 8809 * @crossplatform 8810 * @atomicservice 8811 * @since 18 8812 */ 8813 map(callbackFn: TypedArrayMapCallback<number, Int32Array>): Int32Array; 8814 /** 8815 * Calls the specified callback function for all the elements in an array. The return value of 8816 * the callback function is the accumulated result, and is provided as an argument in the next 8817 * call to the callback function. 8818 * 8819 * @param { TypedArrayReduceCallback<number, number, Int32Array> } callbackFn - A function that 8820 * accepts up to four arguments. 8821 * The reduce method calls the callbackfn function one time for each element in the array. 8822 * @returns { number } The value that results from running the "reducer" callback function to 8823 * completion over the entire typed array. 8824 * @throws { BusinessError } 401 - Parameter error. 8825 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8826 * @throws { BusinessError } 10200201 - Concurrent modification error. 8827 * @syscap SystemCapability.Utils.Lang 8828 * @atomicservice 8829 * @since 12 8830 */ 8831 /** 8832 * Calls the specified callback function for all the elements in an array. The return value of 8833 * the callback function is the accumulated result, and is provided as an argument in the next 8834 * call to the callback function. 8835 * 8836 * @param { TypedArrayReduceCallback<number, number, Int32Array> } callbackFn - A function that 8837 * accepts up to four arguments. 8838 * The reduce method calls the callbackfn function one time for each element in the array. 8839 * @returns { number } The value that results from running the "reducer" callback function to 8840 * completion over the entire typed array. 8841 * @throws { BusinessError } 401 - Parameter error. 8842 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8843 * @throws { BusinessError } 10200201 - Concurrent modification error. 8844 * @syscap SystemCapability.Utils.Lang 8845 * @crossplatform 8846 * @atomicservice 8847 * @since 18 8848 */ 8849 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int32Array>): number; 8850 /** 8851 * Calls the specified callback function for all the elements in an array. The return value of 8852 * the callback function is the accumulated result, and is provided as an argument in the next 8853 * call to the callback function. 8854 * 8855 * @param { TypedArrayReduceCallback<number, number, Int32Array> } callbackFn - A function that 8856 * accepts up to four arguments. 8857 * The reduce method calls the callbackfn function one time for each element in the array. 8858 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 8859 * the accumulation. The first call to the callbackfn function provides this value as an argument 8860 * instead of an array value. 8861 * @returns { number } The value that results from running the "reducer" callback function to 8862 * completion over the entire typed array. 8863 * @throws { BusinessError } 401 - Parameter error. 8864 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8865 * @throws { BusinessError } 10200201 - Concurrent modification error. 8866 * @syscap SystemCapability.Utils.Lang 8867 * @atomicservice 8868 * @since 12 8869 */ 8870 /** 8871 * Calls the specified callback function for all the elements in an array. The return value of 8872 * the callback function is the accumulated result, and is provided as an argument in the next 8873 * call to the callback function. 8874 * 8875 * @param { TypedArrayReduceCallback<number, number, Int32Array> } callbackFn - A function that 8876 * accepts up to four arguments. 8877 * The reduce method calls the callbackfn function one time for each element in the array. 8878 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 8879 * the accumulation. The first call to the callbackfn function provides this value as an argument 8880 * instead of an array value. 8881 * @returns { number } The value that results from running the "reducer" callback function to 8882 * completion over the entire typed array. 8883 * @throws { BusinessError } 401 - Parameter error. 8884 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8885 * @throws { BusinessError } 10200201 - Concurrent modification error. 8886 * @syscap SystemCapability.Utils.Lang 8887 * @crossplatform 8888 * @atomicservice 8889 * @since 18 8890 */ 8891 reduce(callbackFn: TypedArrayReduceCallback<number, number, Int32Array>, initialValue: number): number; 8892 /** 8893 * Calls the specified callback function for all the elements in an array. The return value of 8894 * the callback function is the accumulated result, and is provided as an argument in the next 8895 * call to the callback function. 8896 * 8897 * @param { TypedArrayReduceCallback<U, number, Int32Array> } callbackFn - A function that 8898 * accepts up to four arguments. 8899 * The reduce method calls the callbackfn function one time for each element in the array. 8900 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 8901 * the accumulation. The first call to the callbackfn function provides this value as an argument 8902 * instead of an array value. 8903 * @returns { U } The value that results from running the "reducer" callback function to 8904 * completion over the entire typed array. 8905 * @throws { BusinessError } 401 - Parameter error. 8906 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8907 * @throws { BusinessError } 10200201 - Concurrent modification error. 8908 * @syscap SystemCapability.Utils.Lang 8909 * @atomicservice 8910 * @since 12 8911 */ 8912 /** 8913 * Calls the specified callback function for all the elements in an array. The return value of 8914 * the callback function is the accumulated result, and is provided as an argument in the next 8915 * call to the callback function. 8916 * 8917 * @param { TypedArrayReduceCallback<U, number, Int32Array> } callbackFn - A function that 8918 * accepts up to four arguments. 8919 * The reduce method calls the callbackfn function one time for each element in the array. 8920 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 8921 * the accumulation. The first call to the callbackfn function provides this value as an argument 8922 * instead of an array value. 8923 * @returns { U } The value that results from running the "reducer" callback function to 8924 * completion over the entire typed array. 8925 * @throws { BusinessError } 401 - Parameter error. 8926 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 8927 * @throws { BusinessError } 10200201 - Concurrent modification error. 8928 * @syscap SystemCapability.Utils.Lang 8929 * @crossplatform 8930 * @atomicservice 8931 * @since 18 8932 */ 8933 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Int32Array>, initialValue: U): U; 8934 /** 8935 * Reverses the elements in an Array. 8936 * 8937 * @returns { Int32Array } The reference to the original typed array, now reversed. 8938 * <br/>Note that the typed array is reversed in place, and no copy is made. 8939 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 8940 * @throws { BusinessError } 10200201 - Concurrent modification error. 8941 * @syscap SystemCapability.Utils.Lang 8942 * @atomicservice 8943 * @since 12 8944 */ 8945 /** 8946 * Reverses the elements in an Array. 8947 * 8948 * @returns { Int32Array } The reference to the original typed array, now reversed. 8949 * <br/>Note that the typed array is reversed in place, and no copy is made. 8950 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 8951 * @throws { BusinessError } 10200201 - Concurrent modification error. 8952 * @syscap SystemCapability.Utils.Lang 8953 * @crossplatform 8954 * @atomicservice 8955 * @since 18 8956 */ 8957 reverse(): Int32Array; 8958 /** 8959 * Sets a value or an array of values. 8960 * 8961 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 8962 * @param { number } [offset] - The index in the current array at which the values are to be written. 8963 * @throws { BusinessError } 401 - Parameter error. 8964 * @throws { BusinessError } 10200011 - The set method cannot be bound. 8965 * @throws { BusinessError } 10200201 - Concurrent modification error. 8966 * @syscap SystemCapability.Utils.Lang 8967 * @atomicservice 8968 * @since 12 8969 */ 8970 /** 8971 * Sets a value or an array of values. 8972 * 8973 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 8974 * @param { number } [offset] - The index in the current array at which the values are to be written. 8975 * @throws { BusinessError } 401 - Parameter error. 8976 * @throws { BusinessError } 10200011 - The set method cannot be bound. 8977 * @throws { BusinessError } 10200201 - Concurrent modification error. 8978 * @syscap SystemCapability.Utils.Lang 8979 * @crossplatform 8980 * @atomicservice 8981 * @since 18 8982 */ 8983 set(array: ArrayLike<number>, offset?: number): void; 8984 /** 8985 * Returns a section of an array. 8986 * 8987 * @param { number } [start] - The beginning of the specified portion of the array. 8988 * @param { number } [end] - The end of the specified portion of the array. 8989 * This is exclusive of the element at the index 'end'. 8990 * @returns { Int32Array } A new typed array containing the extracted elements. 8991 * @throws { BusinessError } 401 - Parameter error. 8992 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 8993 * @throws { BusinessError } 10200201 - Concurrent modification error. 8994 * @syscap SystemCapability.Utils.Lang 8995 * @atomicservice 8996 * @since 12 8997 */ 8998 /** 8999 * Returns a section of an array. 9000 * 9001 * @param { number } [start] - The beginning of the specified portion of the array. 9002 * @param { number } [end] - The end of the specified portion of the array. 9003 * This is exclusive of the element at the index 'end'. 9004 * @returns { Int32Array } A new typed array containing the extracted elements. 9005 * @throws { BusinessError } 401 - Parameter error. 9006 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 9007 * @throws { BusinessError } 10200201 - Concurrent modification error. 9008 * @syscap SystemCapability.Utils.Lang 9009 * @crossplatform 9010 * @atomicservice 9011 * @since 18 9012 */ 9013 slice(start?: number, end?: number): Int32Array; 9014 /** 9015 * Determines whether the specified callback function returns true for any element of an array. 9016 * 9017 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 9018 * The some method calls the predicate function for each element in the array until 9019 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 9020 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 9021 * in which case true is immediately returned. 9022 * @throws { BusinessError } 401 - Parameter error. 9023 * @throws { BusinessError } 10200011 - The some method cannot be bound. 9024 * @throws { BusinessError } 10200201 - Concurrent modification error. 9025 * @syscap SystemCapability.Utils.Lang 9026 * @atomicservice 9027 * @since 12 9028 */ 9029 /** 9030 * Determines whether the specified callback function returns true for any element of an array. 9031 * 9032 * @param { TypedArrayPredicateFn<number, Int32Array> } predicate - A function that accepts up to three arguments. 9033 * The some method calls the predicate function for each element in the array until 9034 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 9035 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 9036 * in which case true is immediately returned. 9037 * @throws { BusinessError } 401 - Parameter error. 9038 * @throws { BusinessError } 10200011 - The some method cannot be bound. 9039 * @throws { BusinessError } 10200201 - Concurrent modification error. 9040 * @syscap SystemCapability.Utils.Lang 9041 * @crossplatform 9042 * @atomicservice 9043 * @since 18 9044 */ 9045 some(predicate: TypedArrayPredicateFn<number, Int32Array>): boolean; 9046 /** 9047 * Sorts an array. 9048 * 9049 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 9050 * It is expected to return a negative value if first argument is less than second argument, 9051 * zero if they're equal and a positive value otherwise. 9052 * If omitted, the elements are sorted in ascending, ASCII character order. 9053 * @returns { Int32Array } The reference to the original typed array, now sorted. 9054 * Note that the typed array is sorted in place and no copy is made. 9055 * @throws { BusinessError } 401 - Parameter error. 9056 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 9057 * @throws { BusinessError } 10200201 - Concurrent modification error. 9058 * @syscap SystemCapability.Utils.Lang 9059 * @atomicservice 9060 * @since 12 9061 */ 9062 /** 9063 * Sorts an array. 9064 * 9065 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 9066 * It is expected to return a negative value if first argument is less than second argument, 9067 * zero if they're equal and a positive value otherwise. 9068 * If omitted, the elements are sorted in ascending, ASCII character order. 9069 * @returns { Int32Array } The reference to the original typed array, now sorted. 9070 * Note that the typed array is sorted in place and no copy is made. 9071 * @throws { BusinessError } 401 - Parameter error. 9072 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 9073 * @throws { BusinessError } 10200201 - Concurrent modification error. 9074 * @syscap SystemCapability.Utils.Lang 9075 * @crossplatform 9076 * @atomicservice 9077 * @since 18 9078 */ 9079 sort(compareFn?: TypedArrayCompareFn<number>): Int32Array; 9080 /** 9081 * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements 9082 * at begin, inclusive, up to end, exclusive. 9083 * 9084 * @param { number } [begin] - The index of the beginning of the array. 9085 * @param { number } [end] - The index of the end of the array. 9086 * @returns { Int32Array } A new Int32Array object. 9087 * @throws { BusinessError } 401 - Parameter error. 9088 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 9089 * @throws { BusinessError } 10200201 - Concurrent modification error. 9090 * @syscap SystemCapability.Utils.Lang 9091 * @atomicservice 9092 * @since 12 9093 */ 9094 /** 9095 * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements 9096 * at begin, inclusive, up to end, exclusive. 9097 * 9098 * @param { number } [begin] - The index of the beginning of the array. 9099 * @param { number } [end] - The index of the end of the array. 9100 * @returns { Int32Array } A new Int32Array object. 9101 * @throws { BusinessError } 401 - Parameter error. 9102 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 9103 * @throws { BusinessError } 10200201 - Concurrent modification error. 9104 * @syscap SystemCapability.Utils.Lang 9105 * @crossplatform 9106 * @atomicservice 9107 * @since 18 9108 */ 9109 subarray(begin?: number, end?: number): Int32Array; 9110 /** 9111 * Returns the item located at the specified index. 9112 * 9113 * @param { number } index - The zero-based index of the desired code unit.<br/> 9114 * A negative index will count back from the last item. 9115 * @returns { number | undefined } The element in the array matching the given index.<br/> 9116 * Always returns undefined if index < -array.length or 9117 * index >= array.length without attempting to access the corresponding property. 9118 * @throws { BusinessError } 401 - Parameter error. 9119 * @throws { BusinessError } 10200011 - The at method cannot be bound. 9120 * @throws { BusinessError } 10200201 - Concurrent modification error. 9121 * @syscap SystemCapability.Utils.Lang 9122 * @atomicservice 9123 * @since 12 9124 */ 9125 /** 9126 * Returns the item located at the specified index. 9127 * 9128 * @param { number } index - The zero-based index of the desired code unit.<br/> 9129 * A negative index will count back from the last item. 9130 * @returns { number | undefined } The element in the array matching the given index.<br/> 9131 * Always returns undefined if index < -array.length or 9132 * index >= array.length without attempting to access the corresponding property. 9133 * @throws { BusinessError } 401 - Parameter error. 9134 * @throws { BusinessError } 10200011 - The at method cannot be bound. 9135 * @throws { BusinessError } 10200201 - Concurrent modification error. 9136 * @syscap SystemCapability.Utils.Lang 9137 * @crossplatform 9138 * @atomicservice 9139 * @since 18 9140 */ 9141 at(index: number): number | undefined; 9142 /** 9143 * Returns an iterator that iterates over numbers. 9144 * 9145 * @returns { IterableIterator<number> } Iterator object that yields numbers. 9146 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 9147 * @syscap SystemCapability.Utils.Lang 9148 * @atomicservice 9149 * @since 12 9150 */ 9151 /** 9152 * Returns an iterator that iterates over numbers. 9153 * 9154 * @returns { IterableIterator<number> } Iterator object that yields numbers. 9155 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 9156 * @syscap SystemCapability.Utils.Lang 9157 * @crossplatform 9158 * @atomicservice 9159 * @since 18 9160 */ 9161 [Symbol.iterator](): IterableIterator<number>; 9162 /** 9163 * Returns an iterable of key, value pairs for every entry in the array 9164 * 9165 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 9166 * @throws { BusinessError } 10200011 - The method cannot be bound. 9167 * @throws { BusinessError } 10200201 - Concurrent modification error. 9168 * @syscap SystemCapability.Utils.Lang 9169 * @atomicservice 9170 * @since 12 9171 */ 9172 /** 9173 * Returns an iterable of key, value pairs for every entry in the array 9174 * 9175 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 9176 * @throws { BusinessError } 10200011 - The method cannot be bound. 9177 * @throws { BusinessError } 10200201 - Concurrent modification error. 9178 * @syscap SystemCapability.Utils.Lang 9179 * @crossplatform 9180 * @atomicservice 9181 * @since 18 9182 */ 9183 entries(): IterableIterator<[number, number]>; 9184 /** 9185 * Returns an iterable of keys in the array 9186 * 9187 * @returns { IterableIterator<number> } A new iterable iterator object. 9188 * @throws { BusinessError } 10200011 - The method cannot be bound. 9189 * @throws { BusinessError } 10200201 - Concurrent modification error. 9190 * @syscap SystemCapability.Utils.Lang 9191 * @atomicservice 9192 * @since 12 9193 */ 9194 /** 9195 * Returns an iterable of keys in the array 9196 * 9197 * @returns { IterableIterator<number> } A new iterable iterator object. 9198 * @throws { BusinessError } 10200011 - The method cannot be bound. 9199 * @throws { BusinessError } 10200201 - Concurrent modification error. 9200 * @syscap SystemCapability.Utils.Lang 9201 * @crossplatform 9202 * @atomicservice 9203 * @since 18 9204 */ 9205 keys(): IterableIterator<number>; 9206 /** 9207 * Returns an iterable of values in the array 9208 * 9209 * @returns { IterableIterator<number> } A new iterable iterator object. 9210 * @throws { BusinessError } 10200011 - The method cannot be bound. 9211 * @throws { BusinessError } 10200201 - Concurrent modification error. 9212 * @syscap SystemCapability.Utils.Lang 9213 * @atomicservice 9214 * @since 12 9215 */ 9216 /** 9217 * Returns an iterable of values in the array 9218 * 9219 * @returns { IterableIterator<number> } A new iterable iterator object. 9220 * @throws { BusinessError } 10200011 - The method cannot be bound. 9221 * @throws { BusinessError } 10200201 - Concurrent modification error. 9222 * @syscap SystemCapability.Utils.Lang 9223 * @crossplatform 9224 * @atomicservice 9225 * @since 18 9226 */ 9227 values(): IterableIterator<number>; 9228 /** 9229 * Determines whether an array includes a certain element, returning true or false as appropriate. 9230 * 9231 * @param { number } searchElement - The element to search for. 9232 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 9233 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 9234 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 9235 * @throws { BusinessError } 401 - Parameter error. 9236 * @throws { BusinessError } 10200011 - The at method cannot be bound. 9237 * @throws { BusinessError } 10200201 - Concurrent modification error. 9238 * @syscap SystemCapability.Utils.Lang 9239 * @atomicservice 9240 * @since 12 9241 */ 9242 /** 9243 * Determines whether an array includes a certain element, returning true or false as appropriate. 9244 * 9245 * @param { number } searchElement - The element to search for. 9246 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 9247 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 9248 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 9249 * @throws { BusinessError } 401 - Parameter error. 9250 * @throws { BusinessError } 10200011 - The at method cannot be bound. 9251 * @throws { BusinessError } 10200201 - Concurrent modification error. 9252 * @syscap SystemCapability.Utils.Lang 9253 * @crossplatform 9254 * @atomicservice 9255 * @since 18 9256 */ 9257 includes(searchElement: number, fromIndex?: number): boolean; 9258 /** 9259 * Returns the item at that index. 9260 * 9261 * @syscap SystemCapability.Utils.Lang 9262 * @atomicservice 9263 * @since 12 9264 */ 9265 /** 9266 * Returns the item at that index. 9267 * 9268 * @syscap SystemCapability.Utils.Lang 9269 * @crossplatform 9270 * @atomicservice 9271 * @since 18 9272 */ 9273 [index: number]: number; 9274 /** 9275 * Find the last occurrence of a specified element in an Int32Array. 9276 * 9277 * @param { number } searchElement - Element to search for in the Int32Array.. 9278 * @param { number } fromIndex - The index at which to start the search. If provided: 9279 * <br>If this index is negative, it is treated as Int32Array.length + fromIndex. 9280 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 9281 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 9282 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 9283 * @syscap SystemCapability.Utils.Lang 9284 * @atomicservice 9285 * @since 18 9286 */ 9287 lastIndexOf(searchElement: number, fromIndex?: number): number; 9288 /** 9289 * Reduce elements in an Int32Array from right to left. 9290 * 9291 * @param { TypedArrayReduceCallback<U, number, Int32Array> } callbackFn - A function that is called for 9292 * each element in the Int32Array. 9293 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 9294 * <br>If no initial value is provided, the last element of the Int32Array will be used, 9295 * <br>and the callback will start with the second-to-last element. 9296 * @returns { U } Returns the single value that results from the reduction. 9297 * @throws { BusinessError } 401 - Parameter error. Possible causes: 9298 * 1.Mandatory parameters are left unspecified. 9299 * 2.Incorrect parameter types. 9300 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 9301 * @throws { BusinessError } 10200201 - Concurrent modification error. 9302 * @syscap SystemCapability.Utils.Lang 9303 * @atomicservice 9304 * @since 18 9305 */ 9306 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Int32Array>, initialValue: U): U; 9307 /** 9308 * Reduce elements in an Int32Array from right to left. 9309 * 9310 * @param { TypedArrayReduceCallback<number, number, Int32Array> } callbackFn - A function that is called for 9311 * each element in the Int32Array. 9312 * @returns { number } Returns the single value that results from the reduction. 9313 * @throws { BusinessError } 401 - Parameter error. Possible causes: 9314 * 1.Mandatory parameters are left unspecified. 9315 * 2.Incorrect parameter types. 9316 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 9317 * @throws { BusinessError } 10200201 - Concurrent modification error. 9318 * @syscap SystemCapability.Utils.Lang 9319 * @atomicservice 9320 * @since 18 9321 */ 9322 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Int32Array>): number; 9323 /** 9324 * Convert an Int32Array to a string. 9325 * 9326 * @returns { string } Returns a string representing the specified Int32Array and its elements, 9327 * separated by commas. 9328 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 9329 * @throws { BusinessError } 10200201 - Concurrent modification error. 9330 * @syscap SystemCapability.Utils.Lang 9331 * @atomicservice 9332 * @since 18 9333 */ 9334 toString(): string; 9335 /** 9336 * Convert an Int32Array to a string, The elements are converted to string using their toLocaleString methods. 9337 * 9338 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 9339 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 9340 * @throws { BusinessError } 10200201 - Concurrent modification error. 9341 * @syscap SystemCapability.Utils.Lang 9342 * @atomicservice 9343 * @since 18 9344 */ 9345 toLocaleString(): string; 9346 /** 9347 * Create an Int32Array containing these parameters. 9348 * 9349 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Int32Array. 9350 * @returns { Int32Array } Returns a new Int32Array instance containing the specified elements. 9351 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 9352 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 9353 * @static 9354 * @syscap SystemCapability.Utils.Lang 9355 * @atomicservice 9356 * @since 18 9357 */ 9358 static of(...items: number[]): Int32Array; 9359 } 9360 9361 /** 9362 * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. 9363 * If multiple threads access a Uint32Array instance concurrently, 9364 * and at least one of the threads modifies the array structurally, 9365 * it must be synchronized externally. 9366 * 9367 * @syscap SystemCapability.Utils.Lang 9368 * @atomicservice 9369 * @since 12 9370 */ 9371 /** 9372 * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. 9373 * If multiple threads access a Uint32Array instance concurrently, 9374 * and at least one of the threads modifies the array structurally, 9375 * it must be synchronized externally. 9376 * 9377 * @syscap SystemCapability.Utils.Lang 9378 * @crossplatform 9379 * @atomicservice 9380 * @since 18 9381 */ 9382 @Sendable 9383 class Uint32Array { 9384 /** 9385 * The size in bytes of each element in the array. 9386 * 9387 * @type { number } 9388 * @readonly 9389 * @static 9390 * @syscap SystemCapability.Utils.Lang 9391 * @atomicservice 9392 * @since 12 9393 */ 9394 /** 9395 * The size in bytes of each element in the array. 9396 * 9397 * @type { number } 9398 * @readonly 9399 * @static 9400 * @syscap SystemCapability.Utils.Lang 9401 * @crossplatform 9402 * @atomicservice 9403 * @since 18 9404 */ 9405 static readonly BYTES_PER_ELEMENT: number; 9406 /** 9407 * The ArrayBuffer instance referenced by the array. 9408 * 9409 * @type { ArrayBuffer } 9410 * @readonly 9411 * @syscap SystemCapability.Utils.Lang 9412 * @atomicservice 9413 * @since 12 9414 */ 9415 /** 9416 * The ArrayBuffer instance referenced by the array. 9417 * 9418 * @type { ArrayBuffer } 9419 * @readonly 9420 * @syscap SystemCapability.Utils.Lang 9421 * @crossplatform 9422 * @atomicservice 9423 * @since 18 9424 */ 9425 readonly buffer: ArrayBuffer; 9426 /** 9427 * The length in bytes of the array. 9428 * 9429 * @type { number } 9430 * @readonly 9431 * @syscap SystemCapability.Utils.Lang 9432 * @atomicservice 9433 * @since 12 9434 */ 9435 /** 9436 * The length in bytes of the array. 9437 * 9438 * @type { number } 9439 * @readonly 9440 * @syscap SystemCapability.Utils.Lang 9441 * @crossplatform 9442 * @atomicservice 9443 * @since 18 9444 */ 9445 readonly byteLength: number; 9446 /** 9447 * The offset in bytes of the array. 9448 * 9449 * @type { number } 9450 * @readonly 9451 * @syscap SystemCapability.Utils.Lang 9452 * @atomicservice 9453 * @since 12 9454 */ 9455 /** 9456 * The offset in bytes of the array. 9457 * 9458 * @type { number } 9459 * @readonly 9460 * @syscap SystemCapability.Utils.Lang 9461 * @crossplatform 9462 * @atomicservice 9463 * @since 18 9464 */ 9465 readonly byteOffset: number; 9466 /** 9467 * The length of the array. 9468 * 9469 * @type { number } 9470 * @readonly 9471 * @syscap SystemCapability.Utils.Lang 9472 * @atomicservice 9473 * @since 12 9474 */ 9475 /** 9476 * The length of the array. 9477 * 9478 * @type { number } 9479 * @readonly 9480 * @syscap SystemCapability.Utils.Lang 9481 * @crossplatform 9482 * @atomicservice 9483 * @since 18 9484 */ 9485 readonly length: number; 9486 /** 9487 * A constructor used to create an Uint32Array. 9488 * 9489 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9490 * @syscap SystemCapability.Utils.Lang 9491 * @atomicservice 9492 * @since 12 9493 */ 9494 /** 9495 * A constructor used to create an Uint32Array. 9496 * 9497 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9498 * @syscap SystemCapability.Utils.Lang 9499 * @crossplatform 9500 * @atomicservice 9501 * @since 18 9502 */ 9503 constructor(); 9504 /** 9505 * A constructor used to create an Uint32Array. 9506 * 9507 * @param { number } length - The length of the array 9508 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9509 * @throws { BusinessError } 401 - Parameter error. 9510 * @syscap SystemCapability.Utils.Lang 9511 * @atomicservice 9512 * @since 12 9513 */ 9514 /** 9515 * A constructor used to create an Uint32Array. 9516 * 9517 * @param { number } length - The length of the array 9518 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9519 * @throws { BusinessError } 401 - Parameter error. 9520 * @syscap SystemCapability.Utils.Lang 9521 * @crossplatform 9522 * @atomicservice 9523 * @since 18 9524 */ 9525 constructor(length: number); 9526 /** 9527 * A constructor used to create an Uint32Array. 9528 * 9529 * @param { Iterable<number> } elements - An iterable object to convert to an Uint32Array. 9530 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9531 * @throws { BusinessError } 401 - Parameter error. 9532 * @syscap SystemCapability.Utils.Lang 9533 * @atomicservice 9534 * @since 12 9535 */ 9536 /** 9537 * A constructor used to create an Uint32Array. 9538 * 9539 * @param { Iterable<number> } elements - An iterable object to convert to an Uint32Array. 9540 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9541 * @throws { BusinessError } 401 - Parameter error. 9542 * @syscap SystemCapability.Utils.Lang 9543 * @crossplatform 9544 * @atomicservice 9545 * @since 18 9546 */ 9547 constructor(elements: Iterable<number>); 9548 /** 9549 * A constructor used to create an Uint32Array. 9550 * 9551 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 9552 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9553 * @throws { BusinessError } 401 - Parameter error. 9554 * @syscap SystemCapability.Utils.Lang 9555 * @atomicservice 9556 * @since 12 9557 */ 9558 /** 9559 * A constructor used to create an Uint32Array. 9560 * 9561 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 9562 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9563 * @throws { BusinessError } 401 - Parameter error. 9564 * @syscap SystemCapability.Utils.Lang 9565 * @crossplatform 9566 * @atomicservice 9567 * @since 18 9568 */ 9569 constructor(array: ArrayLike<number> | ArrayBuffer); 9570 /** 9571 * A constructor used to create an Uint32Array. 9572 * 9573 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 9574 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 9575 * that will be exposed by the typed array view. 9576 * @param { number } [length] - The length parameter specifies the memory range 9577 * that will be exposed by the typed array view. 9578 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9579 * @throws { BusinessError } 401 - Parameter error. 9580 * @syscap SystemCapability.Utils.Lang 9581 * @atomicservice 9582 * @since 12 9583 */ 9584 /** 9585 * A constructor used to create an Uint32Array. 9586 * 9587 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 9588 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 9589 * that will be exposed by the typed array view. 9590 * @param { number } [length] - The length parameter specifies the memory range 9591 * that will be exposed by the typed array view. 9592 * @throws { BusinessError } 10200012 - The Uint32Array's constructor cannot be directly invoked. 9593 * @throws { BusinessError } 401 - Parameter error. 9594 * @syscap SystemCapability.Utils.Lang 9595 * @crossplatform 9596 * @atomicservice 9597 * @since 18 9598 */ 9599 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 9600 /** 9601 * Creates an Uint32Array from an array-like object. 9602 * 9603 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint32Array. 9604 * @returns { Uint32Array } A new Uint32Array instance 9605 * @throws { BusinessError } 401 - Parameter error. 9606 * @static 9607 * @syscap SystemCapability.Utils.Lang 9608 * @atomicservice 9609 * @since 12 9610 */ 9611 /** 9612 * Creates an Uint32Array from an array-like object. 9613 * 9614 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Uint32Array. 9615 * @returns { Uint32Array } A new Uint32Array instance 9616 * @throws { BusinessError } 401 - Parameter error. 9617 * @static 9618 * @syscap SystemCapability.Utils.Lang 9619 * @crossplatform 9620 * @atomicservice 9621 * @since 18 9622 */ 9623 static from(arrayLike: ArrayLike<number>): Uint32Array; 9624 /** 9625 * Creates an Uint32Array from an array-like object. 9626 * 9627 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint32Array. 9628 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 9629 * @returns { Uint32Array } A new Uint32Array instance 9630 * @throws { BusinessError } 401 - Parameter error. 9631 * @static 9632 * @syscap SystemCapability.Utils.Lang 9633 * @atomicservice 9634 * @since 12 9635 */ 9636 /** 9637 * Creates an Uint32Array from an array-like object. 9638 * 9639 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Uint32Array. 9640 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 9641 * @returns { Uint32Array } A new Uint32Array instance 9642 * @throws { BusinessError } 401 - Parameter error. 9643 * @static 9644 * @syscap SystemCapability.Utils.Lang 9645 * @crossplatform 9646 * @atomicservice 9647 * @since 18 9648 */ 9649 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Uint32Array; 9650 /** 9651 * Creates an Uint32Array from an iterable object. 9652 * 9653 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint32Array. 9654 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 9655 * call on every element of the array. 9656 * @returns { Uint32Array } A new Uint32Array instance 9657 * @throws { BusinessError } 401 - Parameter error. 9658 * @static 9659 * @syscap SystemCapability.Utils.Lang 9660 * @atomicservice 9661 * @since 12 9662 */ 9663 /** 9664 * Creates an Uint32Array from an iterable object. 9665 * 9666 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Uint32Array. 9667 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 9668 * call on every element of the array. 9669 * @returns { Uint32Array } A new Uint32Array instance 9670 * @throws { BusinessError } 401 - Parameter error. 9671 * @static 9672 * @syscap SystemCapability.Utils.Lang 9673 * @crossplatform 9674 * @atomicservice 9675 * @since 18 9676 */ 9677 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Uint32Array; 9678 /** 9679 * Returns the this object after copying a section of the array identified by start and end 9680 * to the same array starting at position target. 9681 * 9682 * @param { number } target - If target is negative, it is treated as length+target where length is the 9683 * length of the array. 9684 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 9685 * is treated as length+end. 9686 * @param { number } [end] - If not specified, length of the this object is used as its default value. 9687 * @returns { Uint32Array } The array itself. 9688 * @throws { BusinessError } 401 - Parameter error. 9689 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 9690 * @throws { BusinessError } 10200201 - Concurrent modification error. 9691 * @syscap SystemCapability.Utils.Lang 9692 * @atomicservice 9693 * @since 12 9694 */ 9695 /** 9696 * Returns the this object after copying a section of the array identified by start and end 9697 * to the same array starting at position target. 9698 * 9699 * @param { number } target - If target is negative, it is treated as length+target where length is the 9700 * length of the array. 9701 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 9702 * is treated as length+end. 9703 * @param { number } [end] - If not specified, length of the this object is used as its default value. 9704 * @returns { Uint32Array } The array itself. 9705 * @throws { BusinessError } 401 - Parameter error. 9706 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 9707 * @throws { BusinessError } 10200201 - Concurrent modification error. 9708 * @syscap SystemCapability.Utils.Lang 9709 * @crossplatform 9710 * @atomicservice 9711 * @since 18 9712 */ 9713 copyWithin(target: number, start: number, end?: number): Uint32Array; 9714 /** 9715 * Determines whether all the members of an array satisfy the specified test. 9716 * 9717 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 9718 * The every method calls the predicate function for each element in the array until 9719 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 9720 * @returns { boolean } true unless predicate returns a false value for a typed array element, 9721 * in which case false is immediately returned. 9722 * @throws { BusinessError } 401 - Parameter error. 9723 * @throws { BusinessError } 10200011 - The every method cannot be bound. 9724 * @throws { BusinessError } 10200201 - Concurrent modification error. 9725 * @syscap SystemCapability.Utils.Lang 9726 * @atomicservice 9727 * @since 12 9728 */ 9729 /** 9730 * Determines whether all the members of an array satisfy the specified test. 9731 * 9732 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 9733 * The every method calls the predicate function for each element in the array until 9734 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 9735 * @returns { boolean } true unless predicate returns a false value for a typed array element, 9736 * in which case false is immediately returned. 9737 * @throws { BusinessError } 401 - Parameter error. 9738 * @throws { BusinessError } 10200011 - The every method cannot be bound. 9739 * @throws { BusinessError } 10200201 - Concurrent modification error. 9740 * @syscap SystemCapability.Utils.Lang 9741 * @crossplatform 9742 * @atomicservice 9743 * @since 18 9744 */ 9745 every(predicate: TypedArrayPredicateFn<number, Uint32Array>): boolean; 9746 /** 9747 * Returns the this object after filling the section identified by start and end with value. 9748 * 9749 * @param { number } value - value to fill array section with. 9750 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 9751 * length+start where length is the length of the array. 9752 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 9753 * length+end. 9754 * @returns { Uint32Array } The array itself. 9755 * @throws { BusinessError } 401 - Parameter error. 9756 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 9757 * @throws { BusinessError } 10200201 - Concurrent modification error. 9758 * @syscap SystemCapability.Utils.Lang 9759 * @atomicservice 9760 * @since 12 9761 */ 9762 /** 9763 * Returns the this object after filling the section identified by start and end with value. 9764 * 9765 * @param { number } value - value to fill array section with. 9766 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 9767 * length+start where length is the length of the array. 9768 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 9769 * length+end. 9770 * @returns { Uint32Array } The array itself. 9771 * @throws { BusinessError } 401 - Parameter error. 9772 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 9773 * @throws { BusinessError } 10200201 - Concurrent modification error. 9774 * @syscap SystemCapability.Utils.Lang 9775 * @crossplatform 9776 * @atomicservice 9777 * @since 18 9778 */ 9779 fill(value: number, start?: number, end?: number): Uint32Array; 9780 /** 9781 * Returns the elements of an array that meet the condition specified in a callback function. 9782 * 9783 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 9784 * The filter method calls the predicate function one time for each element in the array. 9785 * @returns { Uint32Array } The array itself. 9786 * @throws { BusinessError } 401 - Parameter error. 9787 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 9788 * @throws { BusinessError } 10200201 - Concurrent modification error. 9789 * @syscap SystemCapability.Utils.Lang 9790 * @atomicservice 9791 * @since 12 9792 */ 9793 /** 9794 * Returns the elements of an array that meet the condition specified in a callback function. 9795 * 9796 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 9797 * The filter method calls the predicate function one time for each element in the array. 9798 * @returns { Uint32Array } The array itself. 9799 * @throws { BusinessError } 401 - Parameter error. 9800 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 9801 * @throws { BusinessError } 10200201 - Concurrent modification error. 9802 * @syscap SystemCapability.Utils.Lang 9803 * @crossplatform 9804 * @atomicservice 9805 * @since 18 9806 */ 9807 filter(predicate: TypedArrayPredicateFn<number, Uint32Array>): Uint32Array; 9808 /** 9809 * Returns the value of the first element in the array where predicate is true, and undefined 9810 * otherwise. 9811 * 9812 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - find calls predicate once for each element of 9813 * the array, in ascending order, until it finds one where predicate returns true. 9814 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 9815 * @returns { number | undefined } The first element in the typed array 9816 * that satisfies the provided testing function. Otherwise, undefined is returned. 9817 * @throws { BusinessError } 401 - Parameter error. 9818 * @throws { BusinessError } 10200011 - The find method cannot be bound. 9819 * @throws { BusinessError } 10200201 - Concurrent modification error. 9820 * @syscap SystemCapability.Utils.Lang 9821 * @atomicservice 9822 * @since 12 9823 */ 9824 /** 9825 * Returns the value of the first element in the array where predicate is true, and undefined 9826 * otherwise. 9827 * 9828 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - find calls predicate once for each element of 9829 * the array, in ascending order, until it finds one where predicate returns true. 9830 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 9831 * @returns { number | undefined } The first element in the typed array 9832 * that satisfies the provided testing function. Otherwise, undefined is returned. 9833 * @throws { BusinessError } 401 - Parameter error. 9834 * @throws { BusinessError } 10200011 - The find method cannot be bound. 9835 * @throws { BusinessError } 10200201 - Concurrent modification error. 9836 * @syscap SystemCapability.Utils.Lang 9837 * @crossplatform 9838 * @atomicservice 9839 * @since 18 9840 */ 9841 find(predicate: TypedArrayPredicateFn<number, Uint32Array>): number | undefined; 9842 /** 9843 * Returns the index of the first element in the array where predicate is true, and -1 9844 * otherwise. 9845 * 9846 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - find calls predicate once for each element of 9847 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 9848 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 9849 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 9850 * @throws { BusinessError } 401 - Parameter error. 9851 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 9852 * @throws { BusinessError } 10200201 - Concurrent modification error. 9853 * @syscap SystemCapability.Utils.Lang 9854 * @atomicservice 9855 * @since 12 9856 */ 9857 /** 9858 * Returns the index of the first element in the array where predicate is true, and -1 9859 * otherwise. 9860 * 9861 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - find calls predicate once for each element of 9862 * the array, in ascending order, until it finds one where predicate returns true. If such an element is found, 9863 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 9864 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 9865 * @throws { BusinessError } 401 - Parameter error. 9866 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 9867 * @throws { BusinessError } 10200201 - Concurrent modification error. 9868 * @syscap SystemCapability.Utils.Lang 9869 * @crossplatform 9870 * @atomicservice 9871 * @since 18 9872 */ 9873 findIndex(predicate: TypedArrayPredicateFn<number, Uint32Array>): number; 9874 /** 9875 * Performs the specified action for each element in an array. 9876 * 9877 * @param { TypedArrayForEachCallback<number, Uint32Array> } callbackFn - A function that 9878 * accepts up to three arguments. 9879 * forEach calls the callbackfn function one time for each element in the array. 9880 * @throws { BusinessError } 401 - Parameter error. 9881 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 9882 * @throws { BusinessError } 10200201 - Concurrent modification error. 9883 * @syscap SystemCapability.Utils.Lang 9884 * @atomicservice 9885 * @since 12 9886 */ 9887 /** 9888 * Performs the specified action for each element in an array. 9889 * 9890 * @param { TypedArrayForEachCallback<number, Uint32Array> } callbackFn - A function that 9891 * accepts up to three arguments. 9892 * forEach calls the callbackfn function one time for each element in the array. 9893 * @throws { BusinessError } 401 - Parameter error. 9894 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 9895 * @throws { BusinessError } 10200201 - Concurrent modification error. 9896 * @syscap SystemCapability.Utils.Lang 9897 * @crossplatform 9898 * @atomicservice 9899 * @since 18 9900 */ 9901 forEach(callbackFn: TypedArrayForEachCallback<number, Uint32Array>): void; 9902 /** 9903 * Returns the index of the first occurrence of a value in an array. 9904 * 9905 * @param { number } searchElement - The value to locate in the array. 9906 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 9907 * search starts at index 0. 9908 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 9909 * @throws { BusinessError } 401 - Parameter error. 9910 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 9911 * @throws { BusinessError } 10200201 - Concurrent modification error. 9912 * @syscap SystemCapability.Utils.Lang 9913 * @atomicservice 9914 * @since 12 9915 */ 9916 /** 9917 * Returns the index of the first occurrence of a value in an array. 9918 * 9919 * @param { number } searchElement - The value to locate in the array. 9920 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 9921 * search starts at index 0. 9922 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 9923 * @throws { BusinessError } 401 - Parameter error. 9924 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 9925 * @throws { BusinessError } 10200201 - Concurrent modification error. 9926 * @syscap SystemCapability.Utils.Lang 9927 * @crossplatform 9928 * @atomicservice 9929 * @since 18 9930 */ 9931 indexOf(searchElement: number, fromIndex?: number): number; 9932 /** 9933 * Adds all the elements of an array separated by the specified separator string. 9934 * @param { string } [separator] - A string used to separate one element of an array from the next in the 9935 * resulting String. If omitted, the array elements are separated with a comma. 9936 * @returns { string } A string with all typed array elements joined. 9937 * If array.length is 0, the empty string is returned. 9938 * @throws { BusinessError } 401 - Parameter error. 9939 * @throws { BusinessError } 10200011 - The join method cannot be bound. 9940 * @throws { BusinessError } 10200201 - Concurrent modification error. 9941 * @syscap SystemCapability.Utils.Lang 9942 * @atomicservice 9943 * @since 12 9944 */ 9945 /** 9946 * Adds all the elements of an array separated by the specified separator string. 9947 * @param { string } [separator] - A string used to separate one element of an array from the next in the 9948 * resulting String. If omitted, the array elements are separated with a comma. 9949 * @returns { string } A string with all typed array elements joined. 9950 * If array.length is 0, the empty string is returned. 9951 * @throws { BusinessError } 401 - Parameter error. 9952 * @throws { BusinessError } 10200011 - The join method cannot be bound. 9953 * @throws { BusinessError } 10200201 - Concurrent modification error. 9954 * @syscap SystemCapability.Utils.Lang 9955 * @crossplatform 9956 * @atomicservice 9957 * @since 18 9958 */ 9959 join(separator?: string): string; 9960 /** 9961 * Calls a defined callback function on each element of an array, and returns an array that 9962 * contains the results. 9963 * 9964 * @param { TypedArrayMapCallback<number, Uint32Array> } callbackFn - A function that accepts up to 9965 * three arguments. The map method calls the callbackfn function one time for each element in the array. 9966 * @returns { Uint32Array } The array itself. 9967 * @throws { BusinessError } 401 - Parameter error. 9968 * @throws { BusinessError } 10200011 - The map method cannot be bound. 9969 * @throws { BusinessError } 10200201 - Concurrent modification error. 9970 * @syscap SystemCapability.Utils.Lang 9971 * @atomicservice 9972 * @since 12 9973 */ 9974 /** 9975 * Calls a defined callback function on each element of an array, and returns an array that 9976 * contains the results. 9977 * 9978 * @param { TypedArrayMapCallback<number, Uint32Array> } callbackFn - A function that accepts up to 9979 * three arguments. The map method calls the callbackfn function one time for each element in the array. 9980 * @returns { Uint32Array } The array itself. 9981 * @throws { BusinessError } 401 - Parameter error. 9982 * @throws { BusinessError } 10200011 - The map method cannot be bound. 9983 * @throws { BusinessError } 10200201 - Concurrent modification error. 9984 * @syscap SystemCapability.Utils.Lang 9985 * @crossplatform 9986 * @atomicservice 9987 * @since 18 9988 */ 9989 map(callbackFn: TypedArrayMapCallback<number, Uint32Array>): Uint32Array; 9990 /** 9991 * Calls the specified callback function for all the elements in an array. The return value of 9992 * the callback function is the accumulated result, and is provided as an argument in the next 9993 * call to the callback function. 9994 * 9995 * @param { TypedArrayReduceCallback<number, number, Uint32Array> } callbackFn - A function that 9996 * accepts up to four arguments. 9997 * The reduce method calls the callbackfn function one time for each element in the array. 9998 * @returns { number } The value that results from running the "reducer" callback function to 9999 * completion over the entire typed array. 10000 * @throws { BusinessError } 401 - Parameter error. 10001 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10002 * @throws { BusinessError } 10200201 - Concurrent modification error. 10003 * @syscap SystemCapability.Utils.Lang 10004 * @atomicservice 10005 * @since 12 10006 */ 10007 /** 10008 * Calls the specified callback function for all the elements in an array. The return value of 10009 * the callback function is the accumulated result, and is provided as an argument in the next 10010 * call to the callback function. 10011 * 10012 * @param { TypedArrayReduceCallback<number, number, Uint32Array> } callbackFn - A function that 10013 * accepts up to four arguments. 10014 * The reduce method calls the callbackfn function one time for each element in the array. 10015 * @returns { number } The value that results from running the "reducer" callback function to 10016 * completion over the entire typed array. 10017 * @throws { BusinessError } 401 - Parameter error. 10018 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10019 * @throws { BusinessError } 10200201 - Concurrent modification error. 10020 * @syscap SystemCapability.Utils.Lang 10021 * @crossplatform 10022 * @atomicservice 10023 * @since 18 10024 */ 10025 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint32Array>): number; 10026 /** 10027 * Calls the specified callback function for all the elements in an array. The return value of 10028 * the callback function is the accumulated result, and is provided as an argument in the next 10029 * call to the callback function. 10030 * 10031 * @param { TypedArrayReduceCallback<number, number, Uint32Array> } callbackFn - A function that 10032 * accepts up to four arguments. 10033 * The reduce method calls the callbackfn function one time for each element in the array. 10034 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 10035 * the accumulation. The first call to the callbackfn function provides this value as an argument 10036 * instead of an array value. 10037 * @returns { number } The value that results from running the "reducer" callback function to 10038 * completion over the entire typed array. 10039 * @throws { BusinessError } 401 - Parameter error. 10040 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10041 * @throws { BusinessError } 10200201 - Concurrent modification error. 10042 * @syscap SystemCapability.Utils.Lang 10043 * @atomicservice 10044 * @since 12 10045 */ 10046 /** 10047 * Calls the specified callback function for all the elements in an array. The return value of 10048 * the callback function is the accumulated result, and is provided as an argument in the next 10049 * call to the callback function. 10050 * 10051 * @param { TypedArrayReduceCallback<number, number, Uint32Array> } callbackFn - A function that 10052 * accepts up to four arguments. 10053 * The reduce method calls the callbackfn function one time for each element in the array. 10054 * @param { number } initialValue - If initialValue is specified, it is used as the initial value to start 10055 * the accumulation. The first call to the callbackfn function provides this value as an argument 10056 * instead of an array value. 10057 * @returns { number } The value that results from running the "reducer" callback function to 10058 * completion over the entire typed array. 10059 * @throws { BusinessError } 401 - Parameter error. 10060 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10061 * @throws { BusinessError } 10200201 - Concurrent modification error. 10062 * @syscap SystemCapability.Utils.Lang 10063 * @crossplatform 10064 * @atomicservice 10065 * @since 18 10066 */ 10067 reduce(callbackFn: TypedArrayReduceCallback<number, number, Uint32Array>, initialValue: number): number; 10068 /** 10069 * Calls the specified callback function for all the elements in an array. The return value of 10070 * the callback function is the accumulated result, and is provided as an argument in the next 10071 * call to the callback function. 10072 * 10073 * @param { TypedArrayReduceCallback<U, number, Uint32Array> } callbackFn - A function that 10074 * accepts up to four arguments. 10075 * The reduce method calls the callbackfn function one time for each element in the array. 10076 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 10077 * the accumulation. The first call to the callbackfn function provides this value as an argument 10078 * instead of an array value. 10079 * @returns { U } The value that results from running the "reducer" callback function to 10080 * completion over the entire typed array. 10081 * @throws { BusinessError } 401 - Parameter error. 10082 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10083 * @throws { BusinessError } 10200201 - Concurrent modification error. 10084 * @syscap SystemCapability.Utils.Lang 10085 * @atomicservice 10086 * @since 12 10087 */ 10088 /** 10089 * Calls the specified callback function for all the elements in an array. The return value of 10090 * the callback function is the accumulated result, and is provided as an argument in the next 10091 * call to the callback function. 10092 * 10093 * @param { TypedArrayReduceCallback<U, number, Uint32Array> } callbackFn - A function that 10094 * accepts up to four arguments. 10095 * The reduce method calls the callbackfn function one time for each element in the array. 10096 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 10097 * the accumulation. The first call to the callbackfn function provides this value as an argument 10098 * instead of an array value. 10099 * @returns { U } The value that results from running the "reducer" callback function to 10100 * completion over the entire typed array. 10101 * @throws { BusinessError } 401 - Parameter error. 10102 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 10103 * @throws { BusinessError } 10200201 - Concurrent modification error. 10104 * @syscap SystemCapability.Utils.Lang 10105 * @crossplatform 10106 * @atomicservice 10107 * @since 18 10108 */ 10109 reduce<U>(callbackFn: TypedArrayReduceCallback<U, number, Uint32Array>, initialValue: U): U; 10110 /** 10111 * Reverses the elements in an Array. 10112 * 10113 * @returns { Uint32Array } The reference to the original typed array, now reversed. 10114 * <br>Note that the typed array is reversed in place, and no copy is made. 10115 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 10116 * @throws { BusinessError } 10200201 - Concurrent modification error. 10117 * @syscap SystemCapability.Utils.Lang 10118 * @atomicservice 10119 * @since 12 10120 */ 10121 /** 10122 * Reverses the elements in an Array. 10123 * 10124 * @returns { Uint32Array } The reference to the original typed array, now reversed. 10125 * <br>Note that the typed array is reversed in place, and no copy is made. 10126 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 10127 * @throws { BusinessError } 10200201 - Concurrent modification error. 10128 * @syscap SystemCapability.Utils.Lang 10129 * @crossplatform 10130 * @atomicservice 10131 * @since 18 10132 */ 10133 reverse(): Uint32Array; 10134 /** 10135 * Sets a value or an array of values. 10136 * 10137 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 10138 * @param { number } [offset] - The index in the current array at which the values are to be written. 10139 * @throws { BusinessError } 401 - Parameter error. 10140 * @throws { BusinessError } 10200011 - The set method cannot be bound. 10141 * @throws { BusinessError } 10200201 - Concurrent modification error. 10142 * @syscap SystemCapability.Utils.Lang 10143 * @atomicservice 10144 * @since 12 10145 */ 10146 /** 10147 * Sets a value or an array of values. 10148 * 10149 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 10150 * @param { number } [offset] - The index in the current array at which the values are to be written. 10151 * @throws { BusinessError } 401 - Parameter error. 10152 * @throws { BusinessError } 10200011 - The set method cannot be bound. 10153 * @throws { BusinessError } 10200201 - Concurrent modification error. 10154 * @syscap SystemCapability.Utils.Lang 10155 * @crossplatform 10156 * @atomicservice 10157 * @since 18 10158 */ 10159 set(array: ArrayLike<number>, offset?: number): void; 10160 /** 10161 * Returns a section of an array. 10162 * 10163 * @param { number } [start] - The beginning of the specified portion of the array. 10164 * @param { number } [end] - The end of the specified portion of the array. 10165 * This is exclusive of the element at the index 'end'. 10166 * @returns { Uint32Array } A new typed array containing the extracted elements. 10167 * @throws { BusinessError } 401 - Parameter error. 10168 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 10169 * @throws { BusinessError } 10200201 - Concurrent modification error. 10170 * @syscap SystemCapability.Utils.Lang 10171 * @atomicservice 10172 * @since 12 10173 */ 10174 /** 10175 * Returns a section of an array. 10176 * 10177 * @param { number } [start] - The beginning of the specified portion of the array. 10178 * @param { number } [end] - The end of the specified portion of the array. 10179 * This is exclusive of the element at the index 'end'. 10180 * @returns { Uint32Array } A new typed array containing the extracted elements. 10181 * @throws { BusinessError } 401 - Parameter error. 10182 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 10183 * @throws { BusinessError } 10200201 - Concurrent modification error. 10184 * @syscap SystemCapability.Utils.Lang 10185 * @crossplatform 10186 * @atomicservice 10187 * @since 18 10188 */ 10189 slice(start?: number, end?: number): Uint32Array; 10190 /** 10191 * Determines whether the specified callback function returns true for any element of an array. 10192 * 10193 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 10194 * The some method calls the predicate function for each element in the array until 10195 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 10196 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 10197 * in which case true is immediately returned. 10198 * @throws { BusinessError } 401 - Parameter error. 10199 * @throws { BusinessError } 10200011 - The some method cannot be bound. 10200 * @throws { BusinessError } 10200201 - Concurrent modification error. 10201 * @syscap SystemCapability.Utils.Lang 10202 * @atomicservice 10203 * @since 12 10204 */ 10205 /** 10206 * Determines whether the specified callback function returns true for any element of an array. 10207 * 10208 * @param { TypedArrayPredicateFn<number, Uint32Array> } predicate - A function that accepts up to three arguments. 10209 * The some method calls the predicate function for each element in the array until 10210 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 10211 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 10212 * in which case true is immediately returned. 10213 * @throws { BusinessError } 401 - Parameter error. 10214 * @throws { BusinessError } 10200011 - The some method cannot be bound. 10215 * @throws { BusinessError } 10200201 - Concurrent modification error. 10216 * @syscap SystemCapability.Utils.Lang 10217 * @crossplatform 10218 * @atomicservice 10219 * @since 18 10220 */ 10221 some(predicate: TypedArrayPredicateFn<number, Uint32Array>): boolean; 10222 /** 10223 * Sorts an array. 10224 * 10225 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 10226 * It is expected to return a negative value if first argument is less than second argument, 10227 * zero if they're equal and a positive value otherwise. 10228 * If omitted, the elements are sorted in ascending, ASCII character order. 10229 * @returns { Uint32Array } The reference to the original typed array, now sorted. 10230 * Note that the typed array is sorted in place and no copy is made. 10231 * @throws { BusinessError } 401 - Parameter error. 10232 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 10233 * @throws { BusinessError } 10200201 - Concurrent modification error. 10234 * @syscap SystemCapability.Utils.Lang 10235 * @atomicservice 10236 * @since 12 10237 */ 10238 /** 10239 * Sorts an array. 10240 * 10241 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 10242 * It is expected to return a negative value if first argument is less than second argument, 10243 * zero if they're equal and a positive value otherwise. 10244 * If omitted, the elements are sorted in ascending, ASCII character order. 10245 * @returns { Uint32Array } The reference to the original typed array, now sorted. 10246 * Note that the typed array is sorted in place and no copy is made. 10247 * @throws { BusinessError } 401 - Parameter error. 10248 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 10249 * @throws { BusinessError } 10200201 - Concurrent modification error. 10250 * @syscap SystemCapability.Utils.Lang 10251 * @crossplatform 10252 * @atomicservice 10253 * @since 18 10254 */ 10255 sort(compareFn?: TypedArrayCompareFn<number>): Uint32Array; 10256 /** 10257 * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements 10258 * at begin, inclusive, up to end, exclusive. 10259 * 10260 * @param { number } [begin] - The index of the beginning of the array. 10261 * @param { number } [end] - The index of the end of the array. 10262 * @returns { Uint32Array } A new Uint32Array object. 10263 * @throws { BusinessError } 401 - Parameter error. 10264 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 10265 * @throws { BusinessError } 10200201 - Concurrent modification error. 10266 * @syscap SystemCapability.Utils.Lang 10267 * @atomicservice 10268 * @since 12 10269 */ 10270 /** 10271 * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements 10272 * at begin, inclusive, up to end, exclusive. 10273 * 10274 * @param { number } [begin] - The index of the beginning of the array. 10275 * @param { number } [end] - The index of the end of the array. 10276 * @returns { Uint32Array } A new Uint32Array object. 10277 * @throws { BusinessError } 401 - Parameter error. 10278 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 10279 * @throws { BusinessError } 10200201 - Concurrent modification error. 10280 * @syscap SystemCapability.Utils.Lang 10281 * @crossplatform 10282 * @atomicservice 10283 * @since 18 10284 */ 10285 subarray(begin?: number, end?: number): Uint32Array; 10286 /** 10287 * Returns the item located at the specified index. 10288 * 10289 * @param { number } index - The zero-based index of the desired code unit.<br/> 10290 * A negative index will count back from the last item. 10291 * @returns { number | undefined } The element in the array matching the given index.<br/> 10292 * Always returns undefined if index < -array.length or 10293 * index >= array.length without attempting to access the corresponding property. 10294 * @throws { BusinessError } 401 - Parameter error. 10295 * @throws { BusinessError } 10200011 - The at method cannot be bound. 10296 * @throws { BusinessError } 10200201 - Concurrent modification error. 10297 * @syscap SystemCapability.Utils.Lang 10298 * @atomicservice 10299 * @since 12 10300 */ 10301 /** 10302 * Returns the item located at the specified index. 10303 * 10304 * @param { number } index - The zero-based index of the desired code unit.<br/> 10305 * A negative index will count back from the last item. 10306 * @returns { number | undefined } The element in the array matching the given index.<br/> 10307 * Always returns undefined if index < -array.length or 10308 * index >= array.length without attempting to access the corresponding property. 10309 * @throws { BusinessError } 401 - Parameter error. 10310 * @throws { BusinessError } 10200011 - The at method cannot be bound. 10311 * @throws { BusinessError } 10200201 - Concurrent modification error. 10312 * @syscap SystemCapability.Utils.Lang 10313 * @crossplatform 10314 * @atomicservice 10315 * @since 18 10316 */ 10317 at(index: number): number | undefined; 10318 /** 10319 * Returns an iterator that iterates over numbers. 10320 * 10321 * @returns { IterableIterator<number> } Iterator object that yields numbers. 10322 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 10323 * @syscap SystemCapability.Utils.Lang 10324 * @atomicservice 10325 * @since 12 10326 */ 10327 /** 10328 * Returns an iterator that iterates over numbers. 10329 * 10330 * @returns { IterableIterator<number> } Iterator object that yields numbers. 10331 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 10332 * @syscap SystemCapability.Utils.Lang 10333 * @crossplatform 10334 * @atomicservice 10335 * @since 18 10336 */ 10337 [Symbol.iterator](): IterableIterator<number>; 10338 /** 10339 * Returns an iterable of key, value pairs for every entry in the array 10340 * 10341 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 10342 * @throws { BusinessError } 10200011 - The method cannot be bound. 10343 * @throws { BusinessError } 10200201 - Concurrent modification error. 10344 * @syscap SystemCapability.Utils.Lang 10345 * @atomicservice 10346 * @since 12 10347 */ 10348 /** 10349 * Returns an iterable of key, value pairs for every entry in the array 10350 * 10351 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 10352 * @throws { BusinessError } 10200011 - The method cannot be bound. 10353 * @throws { BusinessError } 10200201 - Concurrent modification error. 10354 * @syscap SystemCapability.Utils.Lang 10355 * @crossplatform 10356 * @atomicservice 10357 * @since 18 10358 */ 10359 entries(): IterableIterator<[number, number]>; 10360 /** 10361 * Returns an iterable of keys in the array 10362 * 10363 * @returns { IterableIterator<number> } A new iterable iterator object. 10364 * @throws { BusinessError } 10200011 - The method cannot be bound. 10365 * @throws { BusinessError } 10200201 - Concurrent modification error. 10366 * @syscap SystemCapability.Utils.Lang 10367 * @atomicservice 10368 * @since 12 10369 */ 10370 /** 10371 * Returns an iterable of keys in the array 10372 * 10373 * @returns { IterableIterator<number> } A new iterable iterator object. 10374 * @throws { BusinessError } 10200011 - The method cannot be bound. 10375 * @throws { BusinessError } 10200201 - Concurrent modification error. 10376 * @syscap SystemCapability.Utils.Lang 10377 * @crossplatform 10378 * @atomicservice 10379 * @since 18 10380 */ 10381 keys(): IterableIterator<number>; 10382 /** 10383 * Returns an iterable of values in the array 10384 * 10385 * @returns { IterableIterator<number> } A new iterable iterator object. 10386 * @throws { BusinessError } 10200011 - The method cannot be bound. 10387 * @throws { BusinessError } 10200201 - Concurrent modification error. 10388 * @syscap SystemCapability.Utils.Lang 10389 * @atomicservice 10390 * @since 12 10391 */ 10392 /** 10393 * Returns an iterable of values in the array 10394 * 10395 * @returns { IterableIterator<number> } A new iterable iterator object. 10396 * @throws { BusinessError } 10200011 - The method cannot be bound. 10397 * @throws { BusinessError } 10200201 - Concurrent modification error. 10398 * @syscap SystemCapability.Utils.Lang 10399 * @crossplatform 10400 * @atomicservice 10401 * @since 18 10402 */ 10403 values(): IterableIterator<number>; 10404 /** 10405 * Determines whether an array includes a certain element, returning true or false as appropriate. 10406 * 10407 * @param { number } searchElement - The element to search for. 10408 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 10409 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 10410 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 10411 * @throws { BusinessError } 401 - Parameter error. 10412 * @throws { BusinessError } 10200011 - The at method cannot be bound. 10413 * @throws { BusinessError } 10200201 - Concurrent modification error. 10414 * @syscap SystemCapability.Utils.Lang 10415 * @atomicservice 10416 * @since 12 10417 */ 10418 /** 10419 * Determines whether an array includes a certain element, returning true or false as appropriate. 10420 * 10421 * @param { number } searchElement - The element to search for. 10422 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 10423 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 10424 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 10425 * @throws { BusinessError } 401 - Parameter error. 10426 * @throws { BusinessError } 10200011 - The at method cannot be bound. 10427 * @throws { BusinessError } 10200201 - Concurrent modification error. 10428 * @syscap SystemCapability.Utils.Lang 10429 * @crossplatform 10430 * @atomicservice 10431 * @since 18 10432 */ 10433 includes(searchElement: number, fromIndex?: number): boolean; 10434 /** 10435 * Returns the item at that index. 10436 * 10437 * @syscap SystemCapability.Utils.Lang 10438 * @atomicservice 10439 * @since 12 10440 */ 10441 /** 10442 * Returns the item at that index. 10443 * 10444 * @syscap SystemCapability.Utils.Lang 10445 * @crossplatform 10446 * @atomicservice 10447 * @since 18 10448 */ 10449 [index: number]: number; 10450 /** 10451 * Find the last occurrence of a specified element in an Uint32Array. 10452 * 10453 * @param { number } searchElement - Element to search for in the Uint32Array.. 10454 * @param { number } fromIndex - The index at which to start the search. If provided: 10455 * <br>If this index is negative, it is treated as Uint32Array.length + fromIndex. 10456 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 10457 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 10458 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 10459 * @syscap SystemCapability.Utils.Lang 10460 * @atomicservice 10461 * @since 18 10462 */ 10463 lastIndexOf(searchElement: number, fromIndex?: number): number; 10464 /** 10465 * Reduce elements in an Uint32Array from right to left. 10466 * 10467 * @param { TypedArrayReduceCallback<U, number, Uint32Array> } callbackFn - A function that is called for 10468 * each element in the Uint32Array. 10469 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 10470 * <br>If no initial value is provided, the last element of the Uint32Array will be used, 10471 * <br>and the callback will start with the second-to-last element. 10472 * @returns { U } Returns the single value that results from the reduction. 10473 * @throws { BusinessError } 401 - Parameter error. Possible causes: 10474 * 1.Mandatory parameters are left unspecified. 10475 * 2.Incorrect parameter types. 10476 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 10477 * @throws { BusinessError } 10200201 - Concurrent modification error. 10478 * @syscap SystemCapability.Utils.Lang 10479 * @atomicservice 10480 * @since 18 10481 */ 10482 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Uint32Array>, initialValue: U): U; 10483 /** 10484 * Reduce elements in an Uint32Array from right to left. 10485 * 10486 * @param { TypedArrayReduceCallback<number, number, Uint32Array> } callbackFn - A function that is called for 10487 * each element in the Uint32Array. 10488 * @returns { number } Returns the single value that results from the reduction. 10489 * @throws { BusinessError } 401 - Parameter error. Possible causes: 10490 * 1.Mandatory parameters are left unspecified. 10491 * 2.Incorrect parameter types. 10492 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 10493 * @throws { BusinessError } 10200201 - Concurrent modification error. 10494 * @syscap SystemCapability.Utils.Lang 10495 * @atomicservice 10496 * @since 18 10497 */ 10498 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Uint32Array>): number; 10499 /** 10500 * Convert an Uint32Array to a string. 10501 * 10502 * @returns { string } Returns a string representing the specified Uint32Array and its elements, 10503 * separated by commas. 10504 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 10505 * @throws { BusinessError } 10200201 - Concurrent modification error. 10506 * @syscap SystemCapability.Utils.Lang 10507 * @atomicservice 10508 * @since 18 10509 */ 10510 toString(): string; 10511 /** 10512 * Convert an Uint32Array to a string, The elements are converted to string using their toLocaleString methods. 10513 * 10514 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 10515 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 10516 * @throws { BusinessError } 10200201 - Concurrent modification error. 10517 * @syscap SystemCapability.Utils.Lang 10518 * @atomicservice 10519 * @since 18 10520 */ 10521 toLocaleString(): string; 10522 /** 10523 * Create an Uint32Array containing these parameters. 10524 * 10525 * @param { number[] } items - A variable number of arguments that will be used as the elements of the Uint32Array. 10526 * @returns { Uint32Array } Returns a new Uint32Array instance containing the specified elements. 10527 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 10528 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 10529 * @static 10530 * @syscap SystemCapability.Utils.Lang 10531 * @atomicservice 10532 * @since 18 10533 */ 10534 static of(...items: number[]): Uint32Array; 10535 } 10536 10537 /** 10538 * The Float32Array typed array represents an array of 32-bit float numbers. 10539 * The contents are initialized to 0. 10540 * If multiple threads access a Float32Array instance concurrently, 10541 * and at least one of the threads modifies the array structurally, 10542 * it must be synchronized externally. 10543 * 10544 * @syscap SystemCapability.Utils.Lang 10545 * @atomicservice 10546 * @since 12 10547 */ 10548 /** 10549 * The Float32Array typed array represents an array of 32-bit float numbers. 10550 * The contents are initialized to 0. 10551 * If multiple threads access a Float32Array instance concurrently, 10552 * and at least one of the threads modifies the array structurally, 10553 * it must be synchronized externally. 10554 * 10555 * @syscap SystemCapability.Utils.Lang 10556 * @crossplatform 10557 * @atomicservice 10558 * @since 18 10559 */ 10560 @Sendable 10561 class Float32Array { 10562 /** 10563 * The size in bytes of each element in the array. 10564 * 10565 * @type { number } 10566 * @readonly 10567 * @static 10568 * @syscap SystemCapability.Utils.Lang 10569 * @atomicservice 10570 * @since 12 10571 */ 10572 /** 10573 * The size in bytes of each element in the array. 10574 * 10575 * @type { number } 10576 * @readonly 10577 * @static 10578 * @syscap SystemCapability.Utils.Lang 10579 * @crossplatform 10580 * @atomicservice 10581 * @since 18 10582 */ 10583 static readonly BYTES_PER_ELEMENT: number; 10584 /** 10585 * The ArrayBuffer instance referenced by the array. 10586 * 10587 * @type { ArrayBuffer } 10588 * @readonly 10589 * @syscap SystemCapability.Utils.Lang 10590 * @atomicservice 10591 * @since 12 10592 */ 10593 /** 10594 * The ArrayBuffer instance referenced by the array. 10595 * 10596 * @type { ArrayBuffer } 10597 * @readonly 10598 * @syscap SystemCapability.Utils.Lang 10599 * @crossplatform 10600 * @atomicservice 10601 * @since 18 10602 */ 10603 readonly buffer: ArrayBuffer; 10604 /** 10605 * The length in bytes of the array. 10606 * 10607 * @type { number } 10608 * @readonly 10609 * @syscap SystemCapability.Utils.Lang 10610 * @atomicservice 10611 * @since 12 10612 */ 10613 /** 10614 * The length in bytes of the array. 10615 * 10616 * @type { number } 10617 * @readonly 10618 * @syscap SystemCapability.Utils.Lang 10619 * @crossplatform 10620 * @atomicservice 10621 * @since 18 10622 */ 10623 readonly byteLength: number; 10624 /** 10625 * The offset in bytes of the array. 10626 * 10627 * @type { number } 10628 * @readonly 10629 * @syscap SystemCapability.Utils.Lang 10630 * @atomicservice 10631 * @since 12 10632 */ 10633 /** 10634 * The offset in bytes of the array. 10635 * 10636 * @type { number } 10637 * @readonly 10638 * @syscap SystemCapability.Utils.Lang 10639 * @crossplatform 10640 * @atomicservice 10641 * @since 18 10642 */ 10643 readonly byteOffset: number; 10644 /** 10645 * The length of the array. 10646 * 10647 * @type { number } 10648 * @readonly 10649 * @syscap SystemCapability.Utils.Lang 10650 * @atomicservice 10651 * @since 12 10652 */ 10653 /** 10654 * The length of the array. 10655 * 10656 * @type { number } 10657 * @readonly 10658 * @syscap SystemCapability.Utils.Lang 10659 * @crossplatform 10660 * @atomicservice 10661 * @since 18 10662 */ 10663 readonly length: number; 10664 /** 10665 * A constructor used to create an Float32Array. 10666 * 10667 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10668 * @syscap SystemCapability.Utils.Lang 10669 * @atomicservice 10670 * @since 12 10671 */ 10672 /** 10673 * A constructor used to create an Float32Array. 10674 * 10675 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10676 * @syscap SystemCapability.Utils.Lang 10677 * @crossplatform 10678 * @atomicservice 10679 * @since 18 10680 */ 10681 constructor(); 10682 /** 10683 * A constructor used to create an Float32Array. 10684 * 10685 * @param { number } length - The length of the array 10686 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10687 * @throws { BusinessError } 401 - Parameter error. 10688 * @syscap SystemCapability.Utils.Lang 10689 * @atomicservice 10690 * @since 12 10691 */ 10692 /** 10693 * A constructor used to create an Float32Array. 10694 * 10695 * @param { number } length - The length of the array 10696 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10697 * @throws { BusinessError } 401 - Parameter error. 10698 * @syscap SystemCapability.Utils.Lang 10699 * @crossplatform 10700 * @atomicservice 10701 * @since 18 10702 */ 10703 constructor(length: number); 10704 /** 10705 * A constructor used to create an Float32Array. 10706 * 10707 * @param { Iterable<number> } elements - An iterable object to convert to an Float32Array. 10708 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10709 * @throws { BusinessError } 401 - Parameter error. 10710 * @syscap SystemCapability.Utils.Lang 10711 * @atomicservice 10712 * @since 12 10713 */ 10714 /** 10715 * A constructor used to create an Float32Array. 10716 * 10717 * @param { Iterable<number> } elements - An iterable object to convert to an Float32Array. 10718 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10719 * @throws { BusinessError } 401 - Parameter error. 10720 * @syscap SystemCapability.Utils.Lang 10721 * @crossplatform 10722 * @atomicservice 10723 * @since 18 10724 */ 10725 constructor(elements: Iterable<number>); 10726 /** 10727 * A constructor used to create an Float32Array. 10728 * 10729 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 10730 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10731 * @throws { BusinessError } 401 - Parameter error. 10732 * @syscap SystemCapability.Utils.Lang 10733 * @atomicservice 10734 * @since 12 10735 */ 10736 /** 10737 * A constructor used to create an Float32Array. 10738 * 10739 * @param { ArrayLike<number> | ArrayBuffer } array - An array is initialized with the given elements 10740 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10741 * @throws { BusinessError } 401 - Parameter error. 10742 * @syscap SystemCapability.Utils.Lang 10743 * @crossplatform 10744 * @atomicservice 10745 * @since 18 10746 */ 10747 constructor(array: ArrayLike<number> | ArrayBuffer); 10748 /** 10749 * A constructor used to create an Float32Array. 10750 * 10751 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 10752 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 10753 * that will be exposed by the typed array view. 10754 * @param { number } [length] - The length parameter specifies the memory range 10755 * that will be exposed by the typed array view. 10756 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10757 * @throws { BusinessError } 401 - Parameter error. 10758 * @syscap SystemCapability.Utils.Lang 10759 * @atomicservice 10760 * @since 12 10761 */ 10762 /** 10763 * A constructor used to create an Float32Array. 10764 * 10765 * @param { ArrayBuffer } buffer - An array is initialized with the given elements 10766 * @param { number } [byteOffset] - The byteOffset (in bytes) parameter specifies the memory range 10767 * that will be exposed by the typed array view. 10768 * @param { number } [length] - The length parameter specifies the memory range 10769 * that will be exposed by the typed array view. 10770 * @throws { BusinessError } 10200012 - The Float32Array's constructor cannot be directly invoked. 10771 * @throws { BusinessError } 401 - Parameter error. 10772 * @syscap SystemCapability.Utils.Lang 10773 * @crossplatform 10774 * @atomicservice 10775 * @since 18 10776 */ 10777 constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number); 10778 /** 10779 * Creates an Float32Array from an array-like object. 10780 * 10781 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Float32Array. 10782 * @returns { Float32Array } A new Float32Array instance 10783 * @throws { BusinessError } 401 - Parameter error. 10784 * @static 10785 * @syscap SystemCapability.Utils.Lang 10786 * @atomicservice 10787 * @since 12 10788 */ 10789 /** 10790 * Creates an Float32Array from an array-like object. 10791 * 10792 * @param { ArrayLike<number> } arrayLike - An array-like object to convert to an Float32Array. 10793 * @returns { Float32Array } A new Float32Array instance 10794 * @throws { BusinessError } 401 - Parameter error. 10795 * @static 10796 * @syscap SystemCapability.Utils.Lang 10797 * @crossplatform 10798 * @atomicservice 10799 * @since 18 10800 */ 10801 static from(arrayLike: ArrayLike<number>): Float32Array; 10802 /** 10803 * Creates an Float32Array from an array-like object. 10804 * 10805 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Float32Array. 10806 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 10807 * @returns { Float32Array } A new Float32Array instance 10808 * @throws { BusinessError } 401 - Parameter error. 10809 * @static 10810 * @syscap SystemCapability.Utils.Lang 10811 * @atomicservice 10812 * @since 12 10813 */ 10814 /** 10815 * Creates an Float32Array from an array-like object. 10816 * 10817 * @param { ArrayLike<T> } arrayLike - An array-like object to convert to an Float32Array. 10818 * @param { TypedArrayFromMapFn<T, number> } mapFn - A mapping function to call on every element of the array. 10819 * @returns { Float32Array } A new Float32Array instance 10820 * @throws { BusinessError } 401 - Parameter error. 10821 * @static 10822 * @syscap SystemCapability.Utils.Lang 10823 * @crossplatform 10824 * @atomicservice 10825 * @since 18 10826 */ 10827 static from<T>(arrayLike: ArrayLike<T>, mapFn: TypedArrayFromMapFn<T, number>): Float32Array; 10828 /** 10829 * Creates an Float32Array from an iterable object. 10830 * 10831 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Float32Array. 10832 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 10833 * call on every element of the array. 10834 * @returns { Float32Array } A new Float32Array instance 10835 * @throws { BusinessError } 401 - Parameter error. 10836 * @static 10837 * @syscap SystemCapability.Utils.Lang 10838 * @atomicservice 10839 * @since 12 10840 */ 10841 /** 10842 * Creates an Float32Array from an iterable object. 10843 * 10844 * @param { Iterable<number> } arrayLike - An iterable object to convert to an Float32Array. 10845 * @param { TypedArrayFromMapFn<number, number> } [mapFn] - A mapping function to 10846 * call on every element of the array. 10847 * @returns { Float32Array } A new Float32Array instance 10848 * @throws { BusinessError } 401 - Parameter error. 10849 * @static 10850 * @syscap SystemCapability.Utils.Lang 10851 * @crossplatform 10852 * @atomicservice 10853 * @since 18 10854 */ 10855 static from(arrayLike: Iterable<number>, mapFn?: TypedArrayFromMapFn<number, number>): Float32Array; 10856 /** 10857 * Returns the this object after copying a section of the array identified by start and end 10858 * to the same array starting at position target. 10859 * 10860 * @param { number } target - If target is negative, it is treated as length+target where length is the 10861 * length of the array. 10862 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 10863 * is treated as length+end. 10864 * @param { number } [end] - If not specified, length of the this object is used as its default value. 10865 * @returns { Float32Array } The array itself. 10866 * @throws { BusinessError } 401 - Parameter error. 10867 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 10868 * @throws { BusinessError } 10200201 - Concurrent modification error. 10869 * @syscap SystemCapability.Utils.Lang 10870 * @atomicservice 10871 * @since 12 10872 */ 10873 /** 10874 * Returns the this object after copying a section of the array identified by start and end 10875 * to the same array starting at position target. 10876 * 10877 * @param { number } target - If target is negative, it is treated as length+target where length is the 10878 * length of the array. 10879 * @param { number } start - If start is negative, it is treated as length+start. If end is negative, it 10880 * is treated as length+end. 10881 * @param { number } [end] - If not specified, length of the this object is used as its default value. 10882 * @returns { Float32Array } The array itself. 10883 * @throws { BusinessError } 401 - Parameter error. 10884 * @throws { BusinessError } 10200011 - The copyWithin method cannot be bound. 10885 * @throws { BusinessError } 10200201 - Concurrent modification error. 10886 * @syscap SystemCapability.Utils.Lang 10887 * @crossplatform 10888 * @atomicservice 10889 * @since 18 10890 */ 10891 copyWithin(target: number, start: number, end?: number): Float32Array; 10892 /** 10893 * Determines whether all the members of an array satisfy the specified test. 10894 * 10895 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 10896 * that accepts up to three arguments. 10897 * The every method calls the predicate function for each element in the array until 10898 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 10899 * @returns { boolean } true unless predicate returns a false value for a typed array element, 10900 * in which case false is immediately returned. 10901 * @throws { BusinessError } 401 - Parameter error. 10902 * @throws { BusinessError } 10200011 - The every method cannot be bound. 10903 * @throws { BusinessError } 10200201 - Concurrent modification error. 10904 * @syscap SystemCapability.Utils.Lang 10905 * @atomicservice 10906 * @since 12 10907 */ 10908 /** 10909 * Determines whether all the members of an array satisfy the specified test. 10910 * 10911 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 10912 * that accepts up to three arguments. 10913 * The every method calls the predicate function for each element in the array until 10914 * the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. 10915 * @returns { boolean } true unless predicate returns a false value for a typed array element, 10916 * in which case false is immediately returned. 10917 * @throws { BusinessError } 401 - Parameter error. 10918 * @throws { BusinessError } 10200011 - The every method cannot be bound. 10919 * @throws { BusinessError } 10200201 - Concurrent modification error. 10920 * @syscap SystemCapability.Utils.Lang 10921 * @crossplatform 10922 * @atomicservice 10923 * @since 18 10924 */ 10925 every(predicate: TypedArrayPredicateFn<number, Float32Array>): boolean; 10926 /** 10927 * Returns the this object after filling the section identified by start and end with value. 10928 * 10929 * @param { number } value - value to fill array section with. 10930 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 10931 * length+start where length is the length of the array. 10932 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 10933 * length+end. 10934 * @returns { Float32Array } The array itself. 10935 * @throws { BusinessError } 401 - Parameter error. 10936 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 10937 * @throws { BusinessError } 10200201 - Concurrent modification error. 10938 * @syscap SystemCapability.Utils.Lang 10939 * @atomicservice 10940 * @since 12 10941 */ 10942 /** 10943 * Returns the this object after filling the section identified by start and end with value. 10944 * 10945 * @param { number } value - value to fill array section with. 10946 * @param { number } [start] - index to start filling the array at. If start is negative, it is treated as 10947 * length+start where length is the length of the array. 10948 * @param { number } [end] - index to stop filling the array at. If end is negative, it is treated as 10949 * length+end. 10950 * @returns { Float32Array } The array itself. 10951 * @throws { BusinessError } 401 - Parameter error. 10952 * @throws { BusinessError } 10200011 - The fill method cannot be bound. 10953 * @throws { BusinessError } 10200201 - Concurrent modification error. 10954 * @syscap SystemCapability.Utils.Lang 10955 * @crossplatform 10956 * @atomicservice 10957 * @since 18 10958 */ 10959 fill(value: number, start?: number, end?: number): Float32Array; 10960 /** 10961 * Returns the elements of an array that meet the condition specified in a callback function. 10962 * 10963 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 10964 * that accepts up to three arguments. 10965 * The filter method calls the predicate function one time for each element in the array. 10966 * @returns { Float32Array } The array itself. 10967 * @throws { BusinessError } 401 - Parameter error. 10968 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 10969 * @throws { BusinessError } 10200201 - Concurrent modification error. 10970 * @syscap SystemCapability.Utils.Lang 10971 * @atomicservice 10972 * @since 12 10973 */ 10974 /** 10975 * Returns the elements of an array that meet the condition specified in a callback function. 10976 * 10977 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 10978 * that accepts up to three arguments. 10979 * The filter method calls the predicate function one time for each element in the array. 10980 * @returns { Float32Array } The array itself. 10981 * @throws { BusinessError } 401 - Parameter error. 10982 * @throws { BusinessError } 10200011 - The filter method cannot be bound. 10983 * @throws { BusinessError } 10200201 - Concurrent modification error. 10984 * @syscap SystemCapability.Utils.Lang 10985 * @crossplatform 10986 * @atomicservice 10987 * @since 18 10988 */ 10989 filter(predicate: TypedArrayPredicateFn<number, Float32Array>): Float32Array; 10990 /** 10991 * Returns the value of the first element in the array where predicate is true, and undefined 10992 * otherwise. 10993 * 10994 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - find calls predicate once for 10995 * each element of the array, in ascending order, until it finds one where predicate returns true. 10996 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 10997 * @returns { number | undefined } The first element in the typed array 10998 * that satisfies the provided testing function. Otherwise, undefined is returned. 10999 * @throws { BusinessError } 401 - Parameter error. 11000 * @throws { BusinessError } 10200011 - The find method cannot be bound. 11001 * @throws { BusinessError } 10200201 - Concurrent modification error. 11002 * @syscap SystemCapability.Utils.Lang 11003 * @atomicservice 11004 * @since 12 11005 */ 11006 /** 11007 * Returns the value of the first element in the array where predicate is true, and undefined 11008 * otherwise. 11009 * 11010 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - find calls predicate once for 11011 * each element of the array, in ascending order, until it finds one where predicate returns true. 11012 * If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. 11013 * @returns { number | undefined } The first element in the typed array 11014 * that satisfies the provided testing function. Otherwise, undefined is returned. 11015 * @throws { BusinessError } 401 - Parameter error. 11016 * @throws { BusinessError } 10200011 - The find method cannot be bound. 11017 * @throws { BusinessError } 10200201 - Concurrent modification error. 11018 * @syscap SystemCapability.Utils.Lang 11019 * @crossplatform 11020 * @atomicservice 11021 * @since 18 11022 */ 11023 find(predicate: TypedArrayPredicateFn<number, Float32Array>): number | undefined; 11024 /** 11025 * Returns the index of the first element in the array where predicate is true, and -1 11026 * otherwise. 11027 * 11028 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - find calls predicate once for 11029 * each element of the array, in ascending order, until it finds one where predicate returns true. 11030 * If such an element is found, findIndex immediately returns that element index. 11031 * Otherwise, findIndex returns -1. 11032 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 11033 * @throws { BusinessError } 401 - Parameter error. 11034 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 11035 * @throws { BusinessError } 10200201 - Concurrent modification error. 11036 * @syscap SystemCapability.Utils.Lang 11037 * @atomicservice 11038 * @since 12 11039 */ 11040 /** 11041 * Returns the index of the first element in the array where predicate is true, and -1 11042 * otherwise. 11043 * 11044 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - find calls predicate once for 11045 * each element of the array, in ascending order, until it finds one where predicate returns true. 11046 * If such an element is found, findIndex immediately returns that element index. 11047 * Otherwise, findIndex returns -1. 11048 * @returns { number } The index of the first element in the typed array that passes the test. Otherwise, -1. 11049 * @throws { BusinessError } 401 - Parameter error. 11050 * @throws { BusinessError } 10200011 - The findIndex method cannot be bound. 11051 * @throws { BusinessError } 10200201 - Concurrent modification error. 11052 * @syscap SystemCapability.Utils.Lang 11053 * @crossplatform 11054 * @atomicservice 11055 * @since 18 11056 */ 11057 findIndex(predicate: TypedArrayPredicateFn<number, Float32Array>): number; 11058 /** 11059 * Performs the specified action for each element in an array. 11060 * 11061 * @param { TypedArrayForEachCallback<number, Float32Array> } callbackFn - A function that 11062 * accepts up to three arguments. 11063 * forEach calls the callbackfn function one time for each element in the array. 11064 * @throws { BusinessError } 401 - Parameter error. 11065 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 11066 * @throws { BusinessError } 10200201 - Concurrent modification error. 11067 * @syscap SystemCapability.Utils.Lang 11068 * @atomicservice 11069 * @since 12 11070 */ 11071 /** 11072 * Performs the specified action for each element in an array. 11073 * 11074 * @param { TypedArrayForEachCallback<number, Float32Array> } callbackFn - A function that 11075 * accepts up to three arguments. 11076 * forEach calls the callbackfn function one time for each element in the array. 11077 * @throws { BusinessError } 401 - Parameter error. 11078 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 11079 * @throws { BusinessError } 10200201 - Concurrent modification error. 11080 * @syscap SystemCapability.Utils.Lang 11081 * @crossplatform 11082 * @atomicservice 11083 * @since 18 11084 */ 11085 forEach(callbackFn: TypedArrayForEachCallback<number, Float32Array>): void; 11086 /** 11087 * Returns the index of the first occurrence of a value in an array. 11088 * 11089 * @param { number } searchElement - The value to locate in the array. 11090 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 11091 * search starts at index 0. 11092 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 11093 * @throws { BusinessError } 401 - Parameter error. 11094 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 11095 * @throws { BusinessError } 10200201 - Concurrent modification error. 11096 * @syscap SystemCapability.Utils.Lang 11097 * @atomicservice 11098 * @since 12 11099 */ 11100 /** 11101 * Returns the index of the first occurrence of a value in an array. 11102 * 11103 * @param { number } searchElement - The value to locate in the array. 11104 * @param { number } [fromIndex] - The array index at which to begin the search. If fromIndex is omitted, the 11105 * search starts at index 0. 11106 * @returns { number } The first index of searchElement in the typed array; -1 if not found. 11107 * @throws { BusinessError } 401 - Parameter error. 11108 * @throws { BusinessError } 10200011 - The indexOf method cannot be bound. 11109 * @throws { BusinessError } 10200201 - Concurrent modification error. 11110 * @syscap SystemCapability.Utils.Lang 11111 * @crossplatform 11112 * @atomicservice 11113 * @since 18 11114 */ 11115 indexOf(searchElement: number, fromIndex?: number): number; 11116 /** 11117 * Adds all the elements of an array separated by the specified separator string. 11118 * @param { string } [separator] - A string used to separate one element of an array from the next in the 11119 * resulting String. If omitted, the array elements are separated with a comma. 11120 * @returns { string } A string with all typed array elements joined. 11121 * If array.length is 0, the empty string is returned. 11122 * @throws { BusinessError } 401 - Parameter error. 11123 * @throws { BusinessError } 10200011 - The join method cannot be bound. 11124 * @throws { BusinessError } 10200201 - Concurrent modification error. 11125 * @syscap SystemCapability.Utils.Lang 11126 * @atomicservice 11127 * @since 12 11128 */ 11129 /** 11130 * Adds all the elements of an array separated by the specified separator string. 11131 * @param { string } [separator] - A string used to separate one element of an array from the next in the 11132 * resulting String. If omitted, the array elements are separated with a comma. 11133 * @returns { string } A string with all typed array elements joined. 11134 * If array.length is 0, the empty string is returned. 11135 * @throws { BusinessError } 401 - Parameter error. 11136 * @throws { BusinessError } 10200011 - The join method cannot be bound. 11137 * @throws { BusinessError } 10200201 - Concurrent modification error. 11138 * @syscap SystemCapability.Utils.Lang 11139 * @crossplatform 11140 * @atomicservice 11141 * @since 18 11142 */ 11143 join(separator?: string): string; 11144 /** 11145 * Calls a defined callback function on each element of an array, and returns an array that 11146 * contains the results. 11147 * 11148 * @param { TypedArrayMapCallback<number, Float32Array> } callbackFn - A function that 11149 * accepts up to three arguments. 11150 * The map method calls the callbackfn function one time for each element in the array. 11151 * @returns { Float32Array } The array itself. 11152 * @throws { BusinessError } 401 - Parameter error. 11153 * @throws { BusinessError } 10200011 - The map method cannot be bound. 11154 * @throws { BusinessError } 10200201 - Concurrent modification error. 11155 * @syscap SystemCapability.Utils.Lang 11156 * @atomicservice 11157 * @since 12 11158 */ 11159 /** 11160 * Calls a defined callback function on each element of an array, and returns an array that 11161 * contains the results. 11162 * 11163 * @param { TypedArrayMapCallback<number, Float32Array> } callbackFn - A function that 11164 * accepts up to three arguments. 11165 * The map method calls the callbackfn function one time for each element in the array. 11166 * @returns { Float32Array } The array itself. 11167 * @throws { BusinessError } 401 - Parameter error. 11168 * @throws { BusinessError } 10200011 - The map method cannot be bound. 11169 * @throws { BusinessError } 10200201 - Concurrent modification error. 11170 * @syscap SystemCapability.Utils.Lang 11171 * @crossplatform 11172 * @atomicservice 11173 * @since 18 11174 */ 11175 map(callbackFn: TypedArrayMapCallback<number, Float32Array>): Float32Array; 11176 /** 11177 * Calls the specified callback function for all the elements in an array. The return value of 11178 * the callback function is the accumulated result, and is provided as an argument in the next 11179 * call to the callback function. 11180 * 11181 * @param { TypedArrayReduceCallback<number, number, Float32Array> } callbackFn - A function that 11182 * accepts up to four arguments. 11183 * The reduce method calls the callbackfn function one time for each element in the array. 11184 * @returns { number } The value that results from running the "reducer" callback function to 11185 * completion over the entire typed array. 11186 * @throws { BusinessError } 401 - Parameter error. 11187 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 11188 * @throws { BusinessError } 10200201 - Concurrent modification error. 11189 * @syscap SystemCapability.Utils.Lang 11190 * @atomicservice 11191 * @since 12 11192 */ 11193 /** 11194 * Calls the specified callback function for all the elements in an array. The return value of 11195 * the callback function is the accumulated result, and is provided as an argument in the next 11196 * call to the callback function. 11197 * 11198 * @param { TypedArrayReduceCallback<number, number, Float32Array> } callbackFn - A function that 11199 * accepts up to four arguments. 11200 * The reduce method calls the callbackfn function one time for each element in the array. 11201 * @returns { number } The value that results from running the "reducer" callback function to 11202 * completion over the entire typed array. 11203 * @throws { BusinessError } 401 - Parameter error. 11204 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 11205 * @throws { BusinessError } 10200201 - Concurrent modification error. 11206 * @syscap SystemCapability.Utils.Lang 11207 * @crossplatform 11208 * @atomicservice 11209 * @since 18 11210 */ 11211 reduce(callbackFn: TypedArrayReduceCallback<number, number, Float32Array>): number; 11212 /** 11213 * Calls the specified callback function for all the elements in an array. The return value of 11214 * the callback function is the accumulated result, and is provided as an argument in the next 11215 * call to the callback function. 11216 * 11217 * @param { TypedArrayReduceCallback<U, number, Float32Array> } callbackFn - A function that 11218 * accepts up to four arguments. 11219 * The reduce method calls the callbackfn function one time for each element in the array. 11220 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 11221 * the accumulation. The first call to the callbackfn function provides this value as an argument 11222 * instead of an array value. 11223 * @returns { U } The value that results from running the "reducer" callback function to 11224 * completion over the entire typed array. 11225 * @throws { BusinessError } 401 - Parameter error. 11226 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 11227 * @throws { BusinessError } 10200201 - Concurrent modification error. 11228 * @syscap SystemCapability.Utils.Lang 11229 * @atomicservice 11230 * @since 12 11231 */ 11232 /** 11233 * Calls the specified callback function for all the elements in an array. The return value of 11234 * the callback function is the accumulated result, and is provided as an argument in the next 11235 * call to the callback function. 11236 * 11237 * @param { TypedArrayReduceCallback<U, number, Float32Array> } callbackFn - A function that 11238 * accepts up to four arguments. 11239 * The reduce method calls the callbackfn function one time for each element in the array. 11240 * @param { U } initialValue - If initialValue is specified, it is used as the initial value to start 11241 * the accumulation. The first call to the callbackfn function provides this value as an argument 11242 * instead of an array value. 11243 * @returns { U } The value that results from running the "reducer" callback function to 11244 * completion over the entire typed array. 11245 * @throws { BusinessError } 401 - Parameter error. 11246 * @throws { BusinessError } 10200011 - The reduce method cannot be bound. 11247 * @throws { BusinessError } 10200201 - Concurrent modification error. 11248 * @syscap SystemCapability.Utils.Lang 11249 * @crossplatform 11250 * @atomicservice 11251 * @since 18 11252 */ 11253 reduce<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Float32Array>, initialValue: U): U; 11254 /** 11255 * Reverses the elements in an Array. 11256 * 11257 * @returns { Float32Array } The reference to the original typed array, now reversed. 11258 * <br>Note that the typed array is reversed in place, and no copy is made. 11259 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 11260 * @throws { BusinessError } 10200201 - Concurrent modification error. 11261 * @syscap SystemCapability.Utils.Lang 11262 * @atomicservice 11263 * @since 12 11264 */ 11265 /** 11266 * Reverses the elements in an Array. 11267 * 11268 * @returns { Float32Array } The reference to the original typed array, now reversed. 11269 * <br>Note that the typed array is reversed in place, and no copy is made. 11270 * @throws { BusinessError } 10200011 - The reverse method cannot be bound. 11271 * @throws { BusinessError } 10200201 - Concurrent modification error. 11272 * @syscap SystemCapability.Utils.Lang 11273 * @crossplatform 11274 * @atomicservice 11275 * @since 18 11276 */ 11277 reverse(): Float32Array; 11278 /** 11279 * Sets a value or an array of values. 11280 * 11281 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 11282 * @param { number } [offset] - The index in the current array at which the values are to be written. 11283 * @throws { BusinessError } 401 - Parameter error. 11284 * @throws { BusinessError } 10200011 - The set method cannot be bound. 11285 * @throws { BusinessError } 10200201 - Concurrent modification error. 11286 * @syscap SystemCapability.Utils.Lang 11287 * @atomicservice 11288 * @since 12 11289 */ 11290 /** 11291 * Sets a value or an array of values. 11292 * 11293 * @param { ArrayLike<number> } array - A typed or untyped array of values to set. 11294 * @param { number } [offset] - The index in the current array at which the values are to be written. 11295 * @throws { BusinessError } 401 - Parameter error. 11296 * @throws { BusinessError } 10200011 - The set method cannot be bound. 11297 * @throws { BusinessError } 10200201 - Concurrent modification error. 11298 * @syscap SystemCapability.Utils.Lang 11299 * @crossplatform 11300 * @atomicservice 11301 * @since 18 11302 */ 11303 set(array: ArrayLike<number>, offset?: number): void; 11304 /** 11305 * Returns a section of an array. 11306 * 11307 * @param { number } [start] - The beginning of the specified portion of the array. 11308 * @param { number } [end] - The end of the specified portion of the array. 11309 * This is exclusive of the element at the index 'end'. 11310 * @returns { Float32Array } A new typed array containing the extracted elements. 11311 * @throws { BusinessError } 401 - Parameter error. 11312 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 11313 * @throws { BusinessError } 10200201 - Concurrent modification error. 11314 * @syscap SystemCapability.Utils.Lang 11315 * @atomicservice 11316 * @since 12 11317 */ 11318 /** 11319 * Returns a section of an array. 11320 * 11321 * @param { number } [start] - The beginning of the specified portion of the array. 11322 * @param { number } [end] - The end of the specified portion of the array. 11323 * This is exclusive of the element at the index 'end'. 11324 * @returns { Float32Array } A new typed array containing the extracted elements. 11325 * @throws { BusinessError } 401 - Parameter error. 11326 * @throws { BusinessError } 10200011 - The slice method cannot be bound. 11327 * @throws { BusinessError } 10200201 - Concurrent modification error. 11328 * @syscap SystemCapability.Utils.Lang 11329 * @crossplatform 11330 * @atomicservice 11331 * @since 18 11332 */ 11333 slice(start?: number, end?: number): Float32Array; 11334 /** 11335 * Determines whether the specified callback function returns true for any element of an array. 11336 * 11337 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 11338 * that accepts up to three arguments. 11339 * The some method calls the predicate function for each element in the array until 11340 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 11341 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 11342 * in which case true is immediately returned. 11343 * @throws { BusinessError } 401 - Parameter error. 11344 * @throws { BusinessError } 10200011 - The some method cannot be bound. 11345 * @throws { BusinessError } 10200201 - Concurrent modification error. 11346 * @syscap SystemCapability.Utils.Lang 11347 * @atomicservice 11348 * @since 12 11349 */ 11350 /** 11351 * Determines whether the specified callback function returns true for any element of an array. 11352 * 11353 * @param { TypedArrayPredicateFn<number, Float32Array> } predicate - A function 11354 * that accepts up to three arguments. 11355 * The some method calls the predicate function for each element in the array until 11356 * the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. 11357 * @returns { boolean } false unless predicate returns a truthy value for a typed array element, 11358 * in which case true is immediately returned. 11359 * @throws { BusinessError } 401 - Parameter error. 11360 * @throws { BusinessError } 10200011 - The some method cannot be bound. 11361 * @throws { BusinessError } 10200201 - Concurrent modification error. 11362 * @syscap SystemCapability.Utils.Lang 11363 * @crossplatform 11364 * @atomicservice 11365 * @since 18 11366 */ 11367 some(predicate: TypedArrayPredicateFn<number, Float32Array>): boolean; 11368 /** 11369 * Sorts an array. 11370 * 11371 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 11372 * It is expected to return a negative value if first argument is less than second argument, 11373 * zero if they're equal and a positive value otherwise. 11374 * If omitted, the elements are sorted in ascending, ASCII character order. 11375 * @returns { Float32Array } The reference to the original typed array, now sorted. 11376 * Note that the typed array is sorted in place and no copy is made. 11377 * @throws { BusinessError } 401 - Parameter error. 11378 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 11379 * @throws { BusinessError } 10200201 - Concurrent modification error. 11380 * @syscap SystemCapability.Utils.Lang 11381 * @atomicservice 11382 * @since 12 11383 */ 11384 /** 11385 * Sorts an array. 11386 * 11387 * @param { TypedArrayCompareFn<number> } [compareFn] - Function used to determine the order of the elements. 11388 * It is expected to return a negative value if first argument is less than second argument, 11389 * zero if they're equal and a positive value otherwise. 11390 * If omitted, the elements are sorted in ascending, ASCII character order. 11391 * @returns { Float32Array } The reference to the original typed array, now sorted. 11392 * Note that the typed array is sorted in place and no copy is made. 11393 * @throws { BusinessError } 401 - Parameter error. 11394 * @throws { BusinessError } 10200011 - The sort method cannot be bound. 11395 * @throws { BusinessError } 10200201 - Concurrent modification error. 11396 * @syscap SystemCapability.Utils.Lang 11397 * @crossplatform 11398 * @atomicservice 11399 * @since 18 11400 */ 11401 sort(compareFn?: TypedArrayCompareFn<number>): Float32Array; 11402 /** 11403 * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements 11404 * at begin, inclusive, up to end, exclusive. 11405 * 11406 * @param { number } [begin] - The index of the beginning of the array. 11407 * @param { number } [end] - The index of the end of the array. 11408 * @returns { Float32Array } A new Float32Array object. 11409 * @throws { BusinessError } 401 - Parameter error. 11410 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 11411 * @throws { BusinessError } 10200201 - Concurrent modification error. 11412 * @syscap SystemCapability.Utils.Lang 11413 * @atomicservice 11414 * @since 12 11415 */ 11416 /** 11417 * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements 11418 * at begin, inclusive, up to end, exclusive. 11419 * 11420 * @param { number } [begin] - The index of the beginning of the array. 11421 * @param { number } [end] - The index of the end of the array. 11422 * @returns { Float32Array } A new Float32Array object. 11423 * @throws { BusinessError } 401 - Parameter error. 11424 * @throws { BusinessError } 10200011 - The subarray method cannot be bound. 11425 * @throws { BusinessError } 10200201 - Concurrent modification error. 11426 * @syscap SystemCapability.Utils.Lang 11427 * @crossplatform 11428 * @atomicservice 11429 * @since 18 11430 */ 11431 subarray(begin?: number, end?: number): Float32Array; 11432 /** 11433 * Returns the item located at the specified index. 11434 * 11435 * @param { number } index - The zero-based index of the desired code unit.<br/> 11436 * A negative index will count back from the last item. 11437 * @returns { number | undefined } The element in the array matching the given index.<br/> 11438 * Always returns undefined if index < -array.length or 11439 * index >= array.length without attempting to access the corresponding property. 11440 * @throws { BusinessError } 401 - Parameter error. 11441 * @throws { BusinessError } 10200011 - The at method cannot be bound. 11442 * @throws { BusinessError } 10200201 - Concurrent modification error. 11443 * @syscap SystemCapability.Utils.Lang 11444 * @atomicservice 11445 * @since 12 11446 */ 11447 /** 11448 * Returns the item located at the specified index. 11449 * 11450 * @param { number } index - The zero-based index of the desired code unit.<br/> 11451 * A negative index will count back from the last item. 11452 * @returns { number | undefined } The element in the array matching the given index.<br/> 11453 * Always returns undefined if index < -array.length or 11454 * index >= array.length without attempting to access the corresponding property. 11455 * @throws { BusinessError } 401 - Parameter error. 11456 * @throws { BusinessError } 10200011 - The at method cannot be bound. 11457 * @throws { BusinessError } 10200201 - Concurrent modification error. 11458 * @syscap SystemCapability.Utils.Lang 11459 * @crossplatform 11460 * @atomicservice 11461 * @since 18 11462 */ 11463 at(index: number): number | undefined; 11464 /** 11465 * Returns an iterator that iterates over numbers. 11466 * 11467 * @returns { IterableIterator<number> } Iterator object that yields numbers. 11468 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 11469 * @syscap SystemCapability.Utils.Lang 11470 * @atomicservice 11471 * @since 12 11472 */ 11473 /** 11474 * Returns an iterator that iterates over numbers. 11475 * 11476 * @returns { IterableIterator<number> } Iterator object that yields numbers. 11477 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 11478 * @syscap SystemCapability.Utils.Lang 11479 * @crossplatform 11480 * @atomicservice 11481 * @since 18 11482 */ 11483 [Symbol.iterator](): IterableIterator<number>; 11484 /** 11485 * Returns an iterable of key, value pairs for every entry in the array 11486 * 11487 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 11488 * @throws { BusinessError } 10200011 - The method cannot be bound. 11489 * @throws { BusinessError } 10200201 - Concurrent modification error. 11490 * @syscap SystemCapability.Utils.Lang 11491 * @atomicservice 11492 * @since 12 11493 */ 11494 /** 11495 * Returns an iterable of key, value pairs for every entry in the array 11496 * 11497 * @returns { IterableIterator<[number, number]> } A new iterable iterator object. 11498 * @throws { BusinessError } 10200011 - The method cannot be bound. 11499 * @throws { BusinessError } 10200201 - Concurrent modification error. 11500 * @syscap SystemCapability.Utils.Lang 11501 * @crossplatform 11502 * @atomicservice 11503 * @since 18 11504 */ 11505 entries(): IterableIterator<[number, number]>; 11506 /** 11507 * Returns an iterable of keys in the array 11508 * 11509 * @returns { IterableIterator<number> } A new iterable iterator object. 11510 * @throws { BusinessError } 10200011 - The method cannot be bound. 11511 * @throws { BusinessError } 10200201 - Concurrent modification error. 11512 * @syscap SystemCapability.Utils.Lang 11513 * @atomicservice 11514 * @since 12 11515 */ 11516 /** 11517 * Returns an iterable of keys in the array 11518 * 11519 * @returns { IterableIterator<number> } A new iterable iterator object. 11520 * @throws { BusinessError } 10200011 - The method cannot be bound. 11521 * @throws { BusinessError } 10200201 - Concurrent modification error. 11522 * @syscap SystemCapability.Utils.Lang 11523 * @crossplatform 11524 * @atomicservice 11525 * @since 18 11526 */ 11527 keys(): IterableIterator<number>; 11528 /** 11529 * Returns an iterable of values in the array 11530 * 11531 * @returns { IterableIterator<number> } A new iterable iterator object. 11532 * @throws { BusinessError } 10200011 - The method cannot be bound. 11533 * @throws { BusinessError } 10200201 - Concurrent modification error. 11534 * @syscap SystemCapability.Utils.Lang 11535 * @atomicservice 11536 * @since 12 11537 */ 11538 /** 11539 * Returns an iterable of values in the array 11540 * 11541 * @returns { IterableIterator<number> } A new iterable iterator object. 11542 * @throws { BusinessError } 10200011 - The method cannot be bound. 11543 * @throws { BusinessError } 10200201 - Concurrent modification error. 11544 * @syscap SystemCapability.Utils.Lang 11545 * @crossplatform 11546 * @atomicservice 11547 * @since 18 11548 */ 11549 values(): IterableIterator<number>; 11550 /** 11551 * Determines whether an array includes a certain element, returning true or false as appropriate. 11552 * 11553 * @param { number } searchElement - The element to search for. 11554 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 11555 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 11556 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 11557 * @throws { BusinessError } 401 - Parameter error. 11558 * @throws { BusinessError } 10200011 - The at method cannot be bound. 11559 * @throws { BusinessError } 10200201 - Concurrent modification error. 11560 * @syscap SystemCapability.Utils.Lang 11561 * @atomicservice 11562 * @since 12 11563 */ 11564 /** 11565 * Determines whether an array includes a certain element, returning true or false as appropriate. 11566 * 11567 * @param { number } searchElement - The element to search for. 11568 * @param { number } [fromIndex] - The position in this array at which to begin searching for searchElement. 11569 * @returns { boolean } A boolean value which is true if the value searchElement is found <br/> 11570 * within the typed array (or the part of the typed array indicated by the index fromIndex, if specified). 11571 * @throws { BusinessError } 401 - Parameter error. 11572 * @throws { BusinessError } 10200011 - The at method cannot be bound. 11573 * @throws { BusinessError } 10200201 - Concurrent modification error. 11574 * @syscap SystemCapability.Utils.Lang 11575 * @crossplatform 11576 * @atomicservice 11577 * @since 18 11578 */ 11579 includes(searchElement: number, fromIndex?: number): boolean; 11580 /** 11581 * Returns the item at that index. 11582 * 11583 * @syscap SystemCapability.Utils.Lang 11584 * @atomicservice 11585 * @since 12 11586 */ 11587 /** 11588 * Returns the item at that index. 11589 * 11590 * @syscap SystemCapability.Utils.Lang 11591 * @crossplatform 11592 * @atomicservice 11593 * @since 18 11594 */ 11595 [index: number]: number; 11596 /** 11597 * Find the last occurrence of a specified element in an Float32Array. 11598 * 11599 * @param { number } searchElement - Element to search for in the Float32Array.. 11600 * @param { number } fromIndex - The index at which to start the search. If provided: 11601 * <br>If this index is negative, it is treated as Float32Array.length + fromIndex. 11602 * @returns { number } Returns the last index of the specified element if found; otherwise, returns -1. 11603 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11604 * @throws { BusinessError } 10200011 - The lastIndexOf method cannot be bound. 11605 * @syscap SystemCapability.Utils.Lang 11606 * @atomicservice 11607 * @since 18 11608 */ 11609 lastIndexOf(searchElement: number, fromIndex?: number): number; 11610 /** 11611 * Reduce elements in an Float32Array from right to left. 11612 * 11613 * @param { TypedArrayReduceCallback<U, number, Float32Array> } callbackFn - A function that is called 11614 * for each element in the Float32Array. 11615 * @param { U } initialValue - A value to use as the first argument to the first call of the callback. 11616 * <br>If no initial value is provided, the last element of the Float32Array will be used, 11617 * <br>and the callback will start with the second-to-last element. 11618 * @returns { U } Returns the single value that results from the reduction. 11619 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11620 * 1.Mandatory parameters are left unspecified. 11621 * 2.Incorrect parameter types. 11622 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 11623 * @throws { BusinessError } 10200201 - Concurrent modification error. 11624 * @syscap SystemCapability.Utils.Lang 11625 * @atomicservice 11626 * @since 18 11627 */ 11628 reduceRight<U = number>(callbackFn: TypedArrayReduceCallback<U, number, Float32Array>, initialValue: U): U; 11629 /** 11630 * Reduce elements in an Float32Array from right to left. 11631 * 11632 * @param { TypedArrayReduceCallback<number, number, Float32Array> } callbackFn - A function that is called 11633 * for each element in the Float32Array. 11634 * @returns { number } Returns the single value that results from the reduction. 11635 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11636 * 1.Mandatory parameters are left unspecified. 11637 * 2.Incorrect parameter types. 11638 * @throws { BusinessError } 10200011 - The reduceRight method cannot be bound. 11639 * @throws { BusinessError } 10200201 - Concurrent modification error. 11640 * @syscap SystemCapability.Utils.Lang 11641 * @atomicservice 11642 * @since 18 11643 */ 11644 reduceRight(callbackFn: TypedArrayReduceCallback<number, number, Float32Array>): number; 11645 /** 11646 * Convert an Float32Array to a string. 11647 * 11648 * @returns { string } Returns a string representing the specified Float32Array and its elements, 11649 * separated by commas. 11650 * @throws { BusinessError } 10200011 - The toString method cannot be bound. 11651 * @throws { BusinessError } 10200201 - Concurrent modification error. 11652 * @syscap SystemCapability.Utils.Lang 11653 * @atomicservice 11654 * @since 18 11655 */ 11656 toString(): string; 11657 /** 11658 * Convert an Float32Array to a string, The elements are converted to string using their toLocaleString methods. 11659 * 11660 * @returns { string } Returns a string representing the specified array and its elements, separated by commas. 11661 * @throws { BusinessError } 10200011 - The toLocaleString method cannot be bound. 11662 * @throws { BusinessError } 10200201 - Concurrent modification error. 11663 * @syscap SystemCapability.Utils.Lang 11664 * @atomicservice 11665 * @since 18 11666 */ 11667 toLocaleString(): string; 11668 /** 11669 * Create an Float32Array containing these parameters. 11670 * 11671 * @param { number[] } items - A variable number of arguments that will be used as the elements of 11672 * the Float32Array. 11673 * @returns { Float32Array } Returns a new Float32Array instance containing the specified elements. 11674 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 11675 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 11676 * @static 11677 * @syscap SystemCapability.Utils.Lang 11678 * @atomicservice 11679 * @since 18 11680 */ 11681 static of(...items: number[]): Float32Array; 11682 } 11683 11684 /** 11685 * An ordered collections of bit values, which are either 0 or 1. 11686 * If multiple threads access a BitVector instance concurrently, 11687 * and at least one of the threads modifies the array structurally, 11688 * it must be synchronized externally. 11689 * 11690 * @syscap SystemCapability.Utils.Lang 11691 * @atomicservice 11692 * @since 12 11693 */ 11694 /** 11695 * An ordered collections of bit values, which are either 0 or 1. 11696 * If multiple threads access a BitVector instance concurrently, 11697 * and at least one of the threads modifies the array structurally, 11698 * it must be synchronized externally. 11699 * 11700 * @syscap SystemCapability.Utils.Lang 11701 * @crossplatform 11702 * @atomicservice 11703 * @since 18 11704 */ 11705 @Sendable 11706 class BitVector { 11707 /** 11708 * A constructor used to create a BitVector object. 11709 * 11710 * @param { number } length - The length of BitVector object. 11711 * @syscap SystemCapability.Utils.Lang 11712 * @atomicservice 11713 * @since 12 11714 */ 11715 /** 11716 * A constructor used to create a BitVector object. 11717 * 11718 * @param { number } length - The length of BitVector object. 11719 * @syscap SystemCapability.Utils.Lang 11720 * @crossplatform 11721 * @atomicservice 11722 * @since 18 11723 */ 11724 constructor(length: number); 11725 /** 11726 * Gets the element number of the BitVector. This is a number one higher than the highest index in the bit vector. 11727 * It can be changed by resize(). 11728 * 11729 * @readonly 11730 * @syscap SystemCapability.Utils.Lang 11731 * @atomicservice 11732 * @since 12 11733 */ 11734 /** 11735 * Gets the element number of the BitVector. This is a number one higher than the highest index in the bit vector. 11736 * It can be changed by resize(). 11737 * 11738 * @readonly 11739 * @syscap SystemCapability.Utils.Lang 11740 * @crossplatform 11741 * @atomicservice 11742 * @since 18 11743 */ 11744 readonly length: number; 11745 /** 11746 * Appends the bit element to the end of this bit vector. 11747 * 11748 * @param { number } element - Element to be appended to this bit vector (0 means 0, else means 1). 11749 * @returns { boolean } The boolean type, returns true if the addition is successful, and returns false if it fails. 11750 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11751 * 1.Mandatory parameters are left unspecified. 11752 * 2.Incorrect parameter types. 11753 * @throws { BusinessError } 10200011 - The push method cannot be bound. 11754 * @throws { BusinessError } 10200201 - Concurrent modification error. 11755 * @syscap SystemCapability.Utils.Lang 11756 * @atomicservice 11757 * @since 12 11758 */ 11759 /** 11760 * Appends the bit element to the end of this bit vector. 11761 * 11762 * @param { number } element - Element to be appended to this bit vector (0 means 0, else means 1). 11763 * @returns { boolean } The boolean type, returns true if the addition is successful, and returns false if it fails. 11764 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11765 * 1.Mandatory parameters are left unspecified. 11766 * 2.Incorrect parameter types. 11767 * @throws { BusinessError } 10200011 - The push method cannot be bound. 11768 * @throws { BusinessError } 10200201 - Concurrent modification error. 11769 * @syscap SystemCapability.Utils.Lang 11770 * @crossplatform 11771 * @atomicservice 11772 * @since 18 11773 */ 11774 push(element: number): boolean; 11775 /** 11776 * Retrieves and removes the bit element to the end of this bit vector. 11777 * 11778 * @returns { number } The boolean type, if the bit push successfully, return true, else return false. 11779 * @throws { BusinessError } 10200011 - The pop method cannot be bound. 11780 * @throws { BusinessError } 10200201 - Concurrent modification error. 11781 * @syscap SystemCapability.Utils.Lang 11782 * @atomicservice 11783 * @since 12 11784 */ 11785 /** 11786 * Retrieves and removes the bit element to the end of this bit vector. 11787 * 11788 * @returns { number } The boolean type, if the bit push successfully, return true, else return false. 11789 * @throws { BusinessError } 10200011 - The pop method cannot be bound. 11790 * @throws { BusinessError } 10200201 - Concurrent modification error. 11791 * @syscap SystemCapability.Utils.Lang 11792 * @crossplatform 11793 * @atomicservice 11794 * @since 18 11795 */ 11796 pop(): number; 11797 /** 11798 * Check if bit vector contains a particular bit element. 11799 * 11800 * @param { number } element - Element to be contained (0 means 0, else means 1). 11801 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11802 * @param { number } toIndex - The end of the index, containing the value at that index. 11803 * @returns { boolean } The boolean type, if bit vector contains the specified element, return true, 11804 else return false. 11805 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11806 * 1.Mandatory parameters are left unspecified. 11807 * 2.Incorrect parameter types. 11808 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11809 * @throws { BusinessError } 10200011 - The has method cannot be bound. 11810 * @throws { BusinessError } 10200201 - Concurrent modification error. 11811 * @syscap SystemCapability.Utils.Lang 11812 * @atomicservice 11813 * @since 12 11814 */ 11815 /** 11816 * Check if bit vector contains a particular bit element. 11817 * 11818 * @param { number } element - Element to be contained (0 means 0, else means 1). 11819 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11820 * @param { number } toIndex - The end of the index, containing the value at that index. 11821 * @returns { boolean } The boolean type, if bit vector contains the specified element, return true, 11822 else return false. 11823 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11824 * @throws { BusinessError } 10200011 - The has method cannot be bound. 11825 * @throws { BusinessError } 10200201 - Concurrent modification error. 11826 * @syscap SystemCapability.Utils.Lang 11827 * @crossplatform 11828 * @atomicservice 11829 * @since 18 11830 */ 11831 has(element: number, fromIndex: number, toIndex: number): boolean; 11832 /** 11833 * Sets a range of bits in a bit vector to a particular element. 11834 * 11835 * @param { number } element - Element to be set (0 means 0, else means 1). 11836 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11837 * @param { number } toIndex - The end of the index, excluding the value at that index. 11838 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11839 * 1.Mandatory parameters are left unspecified. 11840 * 2.Incorrect parameter types. 11841 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11842 * @throws { BusinessError } 10200011 - The setBitsByRange method cannot be bound. 11843 * @throws { BusinessError } 10200201 - Concurrent modification error. 11844 * @syscap SystemCapability.Utils.Lang 11845 * @atomicservice 11846 * @since 12 11847 */ 11848 /** 11849 * Sets a range of bits in a bit vector to a particular element. 11850 * 11851 * @param { number } element - Element to be set (0 means 0, else means 1). 11852 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11853 * @param { number } toIndex - The end of the index, excluding the value at that index. 11854 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11855 * 1.Mandatory parameters are left unspecified. 11856 * 2.Incorrect parameter types. 11857 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11858 * @throws { BusinessError } 10200011 - The setBitsByRange method cannot be bound. 11859 * @throws { BusinessError } 10200201 - Concurrent modification error. 11860 * @syscap SystemCapability.Utils.Lang 11861 * @crossplatform 11862 * @atomicservice 11863 * @since 18 11864 */ 11865 setBitsByRange(element: number, fromIndex: number, toIndex: number): void; 11866 /** 11867 * Sets all of bits in a bit vector to a particular element. 11868 * 11869 * @param { number } element - Element to be set (0 means 0, else means 1). 11870 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11871 * 1.Mandatory parameters are left unspecified. 11872 * 2.Incorrect parameter types. 11873 * @throws { BusinessError } 10200011 - The setAllBits method cannot be bound. 11874 * @throws { BusinessError } 10200201 - Concurrent modification error. 11875 * @syscap SystemCapability.Utils.Lang 11876 * @atomicservice 11877 * @since 12 11878 */ 11879 /** 11880 * Sets all of bits in a bit vector to a particular element. 11881 * 11882 * @param { number } element - Element to be set (0 means 0, else means 1). 11883 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11884 * 1.Mandatory parameters are left unspecified. 11885 * 2.Incorrect parameter types. 11886 * @throws { BusinessError } 10200011 - The setAllBits method cannot be bound. 11887 * @throws { BusinessError } 10200201 - Concurrent modification error. 11888 * @syscap SystemCapability.Utils.Lang 11889 * @crossplatform 11890 * @atomicservice 11891 * @since 18 11892 */ 11893 setAllBits(element: number): void; 11894 /** 11895 * Returns the bit values in a range of indices in a bit vector. 11896 * 11897 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11898 * @param { number } toIndex - The end of the index, excluding the value at that index. 11899 * @returns { BitVector } The BitVector type, returns the bit values in a range of indices in a bit vector. 11900 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11901 * 1.Mandatory parameters are left unspecified. 11902 * 2.Incorrect parameter types. 11903 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11904 * @throws { BusinessError } 10200011 - The getBitsByRange method cannot be bound. 11905 * @throws { BusinessError } 10200201 - Concurrent modification error. 11906 * @syscap SystemCapability.Utils.Lang 11907 * @atomicservice 11908 * @since 12 11909 */ 11910 /** 11911 * Returns the bit values in a range of indices in a bit vector. 11912 * 11913 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11914 * @param { number } toIndex - The end of the index, excluding the value at that index. 11915 * @returns { BitVector } The BitVector type, returns the bit values in a range of indices in a bit vector. 11916 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11917 * 1.Mandatory parameters are left unspecified. 11918 * 2.Incorrect parameter types. 11919 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11920 * @throws { BusinessError } 10200011 - The getBitsByRange method cannot be bound. 11921 * @throws { BusinessError } 10200201 - Concurrent modification error. 11922 * @syscap SystemCapability.Utils.Lang 11923 * @crossplatform 11924 * @atomicservice 11925 * @since 18 11926 */ 11927 getBitsByRange(fromIndex: number, toIndex: number): BitVector; 11928 /** 11929 * Resize the bitVector's length. 11930 * 11931 * @param { number } size - The new size for bitVector. If count is greater than the current size of bitVector, 11932 * the additional bit elements are set to 0. 11933 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11934 * 1.Mandatory parameters are left unspecified. 11935 * 2.Incorrect parameter types. 11936 * @throws { BusinessError } 10200011 - The resize method cannot be bound. 11937 * @throws { BusinessError } 10200201 - Concurrent modification error. 11938 * @syscap SystemCapability.Utils.Lang 11939 * @atomicservice 11940 * @since 12 11941 */ 11942 /** 11943 * Resize the bitVector's length. 11944 * 11945 * @param { number } size - The new size for bitVector. If count is greater than the current size of bitVector, 11946 * the additional bit elements are set to 0. 11947 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11948 * 1.Mandatory parameters are left unspecified. 11949 * 2.Incorrect parameter types. 11950 * @throws { BusinessError } 10200011 - The resize method cannot be bound. 11951 * @throws { BusinessError } 10200201 - Concurrent modification error. 11952 * @syscap SystemCapability.Utils.Lang 11953 * @crossplatform 11954 * @atomicservice 11955 * @since 18 11956 */ 11957 resize(size: number): void; 11958 /** 11959 * Counts the number of times a certain bit element occurs within a range of bits in a bit vector. 11960 * 11961 * @param { number } element - Element to be counted (0 means 0, else means 1). 11962 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11963 * @param { number } toIndex - The end of the index, excluding the value at that index. 11964 * @returns { number } The number type, return the number of times a certain bit element 11965 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11966 * 1.Mandatory parameters are left unspecified. 11967 * 2.Incorrect parameter types. 11968 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11969 * @throws { BusinessError } 10200011 - The getBitCountByRange method cannot be bound. 11970 * @throws { BusinessError } 10200201 - Concurrent modification error. 11971 * @syscap SystemCapability.Utils.Lang 11972 * @atomicservice 11973 * @since 12 11974 */ 11975 /** 11976 * Counts the number of times a certain bit element occurs within a range of bits in a bit vector. 11977 * 11978 * @param { number } element - Element to be counted (0 means 0, else means 1). 11979 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11980 * @param { number } toIndex - The end of the index, excluding the value at that index. 11981 * @returns { number } The number type, return the number of times a certain bit element 11982 * @throws { BusinessError } 401 - Parameter error. Possible causes: 11983 * 1.Mandatory parameters are left unspecified. 11984 * 2.Incorrect parameter types. 11985 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 11986 * @throws { BusinessError } 10200011 - The getBitCountByRange method cannot be bound. 11987 * @throws { BusinessError } 10200201 - Concurrent modification error. 11988 * @syscap SystemCapability.Utils.Lang 11989 * @crossplatform 11990 * @atomicservice 11991 * @since 18 11992 */ 11993 getBitCountByRange(element: number, fromIndex: number, toIndex: number): number; 11994 /** 11995 * Locates the first occurrence of a certain bit value within a range of bits in a bit vector. 11996 * 11997 * @param { number } element - Element to be Located (0 means 0, else means 1). 11998 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 11999 * @param { number } toIndex - The end of the index, excluding the value at that index. 12000 * @returns { number } The number type, return the first index of specified bit within a range, 12001 * or -1 if this range of the bitVector does not contain the element. 12002 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12003 * 1.Mandatory parameters are left unspecified. 12004 * 2.Incorrect parameter types. 12005 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12006 * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 12007 * @throws { BusinessError } 10200201 - Concurrent modification error. 12008 * @syscap SystemCapability.Utils.Lang 12009 * @atomicservice 12010 * @since 12 12011 */ 12012 /** 12013 * Locates the first occurrence of a certain bit value within a range of bits in a bit vector. 12014 * 12015 * @param { number } element - Element to be Located (0 means 0, else means 1). 12016 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 12017 * @param { number } toIndex - The end of the index, excluding the value at that index. 12018 * @returns { number } The number type, return the first index of specified bit within a range, 12019 * or -1 if this range of the bitVector does not contain the element. 12020 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12021 * 1.Mandatory parameters are left unspecified. 12022 * 2.Incorrect parameter types. 12023 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12024 * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 12025 * @throws { BusinessError } 10200201 - Concurrent modification error. 12026 * @syscap SystemCapability.Utils.Lang 12027 * @crossplatform 12028 * @atomicservice 12029 * @since 18 12030 */ 12031 getIndexOf(element: number, fromIndex: number, toIndex: number): number; 12032 /** 12033 * Locates the last occurrence of a certain bit value within a range of bits in a bit vector. 12034 * 12035 * @param { number } element - Element to be Located (0 means 0, else means 1). 12036 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 12037 * @param { number } toIndex - The end of the index, excluding the value at that index. 12038 * @returns { number } The number type, return the last index of specified bit within a range, 12039 * or -1 if this range of the bitVector does not contain the element. 12040 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12041 * 1.Mandatory parameters are left unspecified. 12042 * 2.Incorrect parameter types. 12043 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12044 * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. 12045 * @throws { BusinessError } 10200201 - Concurrent modification error. 12046 * @syscap SystemCapability.Utils.Lang 12047 * @atomicservice 12048 * @since 12 12049 */ 12050 /** 12051 * Locates the last occurrence of a certain bit value within a range of bits in a bit vector. 12052 * 12053 * @param { number } element - Element to be Located (0 means 0, else means 1). 12054 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 12055 * @param { number } toIndex - The end of the index, excluding the value at that index. 12056 * @returns { number } The number type, return the last index of specified bit within a range, 12057 * or -1 if this range of the bitVector does not contain the element. 12058 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12059 * 1.Mandatory parameters are left unspecified. 12060 * 2.Incorrect parameter types. 12061 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12062 * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. 12063 * @throws { BusinessError } 10200201 - Concurrent modification error. 12064 * @syscap SystemCapability.Utils.Lang 12065 * @crossplatform 12066 * @atomicservice 12067 * @since 18 12068 */ 12069 getLastIndexOf(element: number, fromIndex: number, toIndex: number): number; 12070 /** 12071 * Flips the bit value by index in a bit vector.(Flip 0 to 1, flip 1 to 0) 12072 * 12073 * @param { number } index - The index in the bit vector. 12074 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12075 * 1.Mandatory parameters are left unspecified. 12076 * 2.Incorrect parameter types. 12077 * @throws { BusinessError } 10200001 - The value of index is out of range. 12078 * @throws { BusinessError } 10200011 - The flipBitByIndex method cannot be bound. 12079 * @throws { BusinessError } 10200201 - Concurrent modification error. 12080 * @syscap SystemCapability.Utils.Lang 12081 * @atomicservice 12082 * @since 12 12083 */ 12084 /** 12085 * Flips the bit value by index in a bit vector.(Flip 0 to 1, flip 1 to 0) 12086 * 12087 * @param { number } index - The index in the bit vector. 12088 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12089 * 1.Mandatory parameters are left unspecified. 12090 * 2.Incorrect parameter types. 12091 * @throws { BusinessError } 10200001 - The value of index is out of range. 12092 * @throws { BusinessError } 10200011 - The flipBitByIndex method cannot be bound. 12093 * @throws { BusinessError } 10200201 - Concurrent modification error. 12094 * @syscap SystemCapability.Utils.Lang 12095 * @crossplatform 12096 * @atomicservice 12097 * @since 18 12098 */ 12099 flipBitByIndex(index: number): void; 12100 /** 12101 * Flips a range of bit values in a bit vector.(Flip 0 to 1, flip 1 to 0). 12102 * 12103 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 12104 * @param { number } toIndex - The end of the index, excluding the value at that index. 12105 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12106 * 1.Mandatory parameters are left unspecified. 12107 * 2.Incorrect parameter types. 12108 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12109 * @throws { BusinessError } 10200011 - The flipBitsByRange method cannot be bound. 12110 * @throws { BusinessError } 10200201 - Concurrent modification error. 12111 * @syscap SystemCapability.Utils.Lang 12112 * @atomicservice 12113 * @since 12 12114 */ 12115 /** 12116 * Flips a range of bit values in a bit vector.(Flip 0 to 1, flip 1 to 0). 12117 * 12118 * @param { number } fromIndex - The starting position of the index, containing the value at that index position. 12119 * @param { number } toIndex - The end of the index, excluding the value at that index. 12120 * @throws { BusinessError } 401 - Parameter error. Possible causes: 12121 * 1.Mandatory parameters are left unspecified. 12122 * 2.Incorrect parameter types. 12123 * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range. 12124 * @throws { BusinessError } 10200011 - The flipBitsByRange method cannot be bound. 12125 * @throws { BusinessError } 10200201 - Concurrent modification error. 12126 * @syscap SystemCapability.Utils.Lang 12127 * @crossplatform 12128 * @atomicservice 12129 * @since 18 12130 */ 12131 flipBitsByRange(fromIndex: number, toIndex: number): void; 12132 /** 12133 * Returns an iterator that iterates over bit vector. 12134 * 12135 * @returns { IterableIterator<number> } A new iterable iterator object. 12136 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 12137 * @syscap SystemCapability.Utils.Lang 12138 * @atomicservice 12139 * @since 12 12140 */ 12141 /** 12142 * Returns an iterator that iterates over bit vector. 12143 * 12144 * @returns { IterableIterator<number> } A new iterable iterator object. 12145 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 12146 * @syscap SystemCapability.Utils.Lang 12147 * @crossplatform 12148 * @atomicservice 12149 * @since 18 12150 */ 12151 [Symbol.iterator](): IterableIterator<number>; 12152 /** 12153 * Returns an iterable of values in the bit vector 12154 * 12155 * @returns { IterableIterator<number> } A new iterable iterator object. 12156 * @throws { BusinessError } 10200011 - The values method cannot be bound. 12157 * @throws { BusinessError } 10200201 - Concurrent modification error. 12158 * @syscap SystemCapability.Utils.Lang 12159 * @atomicservice 12160 * @since 12 12161 */ 12162 /** 12163 * Returns an iterable of values in the bit vector 12164 * 12165 * @returns { IterableIterator<number> } A new iterable iterator object. 12166 * @throws { BusinessError } 10200011 - The values method cannot be bound. 12167 * @throws { BusinessError } 10200201 - Concurrent modification error. 12168 * @syscap SystemCapability.Utils.Lang 12169 * @crossplatform 12170 * @atomicservice 12171 * @since 18 12172 */ 12173 values(): IterableIterator<number>; 12174 /** 12175 * Returns the item at that index. 12176 * 12177 * @syscap SystemCapability.Utils.Lang 12178 * @atomicservice 12179 * @since 12 12180 */ 12181 /** 12182 * Returns the item at that index. 12183 * 12184 * @syscap SystemCapability.Utils.Lang 12185 * @crossplatform 12186 * @atomicservice 12187 * @since 18 12188 */ 12189 [index: number]: number; 12190 } 12191} 12192 12193export default collections;