1/* 2 * Copyright (c) 2021-2022 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 18 * @kit ArkTS 19 */ 20 21/** 22 * LightWeightSet stores a set of values, each of which must be unique. 23 * 24 * @syscap SystemCapability.Utils.Lang 25 * @since 8 26 */ 27/** 28 * LightWeightSet stores a set of values, each of which must be unique. 29 * 30 * @syscap SystemCapability.Utils.Lang 31 * @crossplatform 32 * @since 10 33 */ 34/** 35 * LightWeightSet stores a set of values, each of which must be unique. 36 * 37 * @syscap SystemCapability.Utils.Lang 38 * @crossplatform 39 * @atomicservice 40 * @since arkts {'1.1':'12', '1.2':'20'} 41 * @arkts 1.1&1.2 42 */ 43declare class LightWeightSet<T> { 44 /** 45 * A constructor used to create a LightWeightSet object. 46 * 47 * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 48 * @syscap SystemCapability.Utils.Lang 49 * @since 8 50 */ 51 /** 52 * A constructor used to create a LightWeightSet object. 53 * 54 * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 55 * @syscap SystemCapability.Utils.Lang 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * A constructor used to create a LightWeightSet object. 61 * 62 * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 63 * @syscap SystemCapability.Utils.Lang 64 * @crossplatform 65 * @atomicservice 66 * @since arkts {'1.1':'12', '1.2':'20'} 67 * @arkts 1.1&1.2 68 */ 69 constructor(); 70 /** 71 * Gets the element number of the LightWeightSet. 72 * 73 * @type { number } 74 * @syscap SystemCapability.Utils.Lang 75 * @since 8 76 */ 77 /** 78 * Gets the element number of the LightWeightSet. 79 * 80 * @type { number } 81 * @syscap SystemCapability.Utils.Lang 82 * @crossplatform 83 * @since 10 84 */ 85 /** 86 * Gets the element number of the LightWeightSet. 87 * 88 * @type { number } 89 * @syscap SystemCapability.Utils.Lang 90 * @crossplatform 91 * @atomicservice 92 * @since 12 93 */ 94 length: number; 95 96 /** 97 * Gets the element number of the LightWeightSet. 98 * 99 * @type { number } 100 * @syscap SystemCapability.Utils.Lang 101 * @crossplatform 102 * @atomicservice 103 * @since 20 104 * @arkts 1.2 105 */ 106 get length(): number; 107 108 /** 109 * If the set does not contain the element, the specified element is added 110 * 111 * @param { T } obj - obj obj Added element 112 * @returns { boolean } the boolean type(Is there contain this element) 113 * @throws { BusinessError } 10200011 - The add method cannot be bound. 114 * @syscap SystemCapability.Utils.Lang 115 * @since 8 116 */ 117 /** 118 * If the set does not contain the element, the specified element is added 119 * 120 * @param { T } obj - obj obj Added element 121 * @returns { boolean } the boolean type(Is there contain this element) 122 * @throws { BusinessError } 10200011 - The add method cannot be bound. 123 * @syscap SystemCapability.Utils.Lang 124 * @crossplatform 125 * @since 10 126 */ 127 /** 128 * If the set does not contain the element, the specified element is added 129 * 130 * @param { T } obj - obj obj Added element 131 * @returns { boolean } the boolean type(Is there contain this element) 132 * @throws { BusinessError } 10200011 - The add method cannot be bound. 133 * @syscap SystemCapability.Utils.Lang 134 * @crossplatform 135 * @atomicservice 136 * @since arkts {'1.1':'12', '1.2':'20'} 137 * @arkts 1.1&1.2 138 */ 139 add(obj: T): boolean; 140 /** 141 * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 142 * 143 * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 144 * @returns { boolean } the boolean type(Is there any new data added successfully) 145 * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 146 * @throws { BusinessError } 401 - Parameter error. Possible causes: 147 * 1.Mandatory parameters are left unspecified; 148 * 2.Incorrect parameter types. 149 * @syscap SystemCapability.Utils.Lang 150 * @since 8 151 */ 152 /** 153 * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 154 * 155 * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 156 * @returns { boolean } the boolean type(Is there any new data added successfully) 157 * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 158 * @throws { BusinessError } 401 - Parameter error. Possible causes: 159 * 1.Mandatory parameters are left unspecified; 160 * 2.Incorrect parameter types. 161 * @syscap SystemCapability.Utils.Lang 162 * @crossplatform 163 * @since 10 164 */ 165 /** 166 * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 167 * 168 * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 169 * @returns { boolean } the boolean type(Is there any new data added successfully) 170 * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 171 * @throws { BusinessError } 401 - Parameter error. Possible causes: 172 * 1.Mandatory parameters are left unspecified; 173 * 2.Incorrect parameter types. 174 * @syscap SystemCapability.Utils.Lang 175 * @crossplatform 176 * @atomicservice 177 * @since arkts {'1.1':'12', '1.2':'20'} 178 * @arkts 1.1&1.2 179 */ 180 addAll(set: LightWeightSet<T>): boolean; 181 /** 182 * Returns whether this set has all the object in a specified set 183 * 184 * @param { LightWeightSet<T> } set - set set the Set object to compare 185 * @returns { boolean } the boolean type 186 * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 187 * @throws { BusinessError } 401 - Parameter error. Possible causes: 188 * 1.Mandatory parameters are left unspecified; 189 * 2.Incorrect parameter types. 190 * @syscap SystemCapability.Utils.Lang 191 * @since 8 192 */ 193 /** 194 * Returns whether this set has all the object in a specified set 195 * 196 * @param { LightWeightSet<T> } set - set set the Set object to compare 197 * @returns { boolean } the boolean type 198 * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 199 * @throws { BusinessError } 401 - Parameter error. Possible causes: 200 * 1.Mandatory parameters are left unspecified; 201 * 2.Incorrect parameter types. 202 * @syscap SystemCapability.Utils.Lang 203 * @crossplatform 204 * @since 10 205 */ 206 /** 207 * Returns whether this set has all the object in a specified set 208 * 209 * @param { LightWeightSet<T> } set - set set the Set object to compare 210 * @returns { boolean } the boolean type 211 * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 212 * @throws { BusinessError } 401 - Parameter error. Possible causes: 213 * 1.Mandatory parameters are left unspecified; 214 * 2.Incorrect parameter types. 215 * @syscap SystemCapability.Utils.Lang 216 * @crossplatform 217 * @atomicservice 218 * @since arkts {'1.1':'12', '1.2':'20'} 219 * @arkts 1.1&1.2 220 */ 221 hasAll(set: LightWeightSet<T>): boolean; 222 /** 223 * Checks whether an LightWeightSet container has a specified key 224 * 225 * @param { T } key - key key need to determine whether to include the key 226 * @returns { boolean } the boolean type 227 * @throws { BusinessError } 10200011 - The has method cannot be bound. 228 * @syscap SystemCapability.Utils.Lang 229 * @since 8 230 */ 231 /** 232 * Checks whether an LightWeightSet container has a specified key 233 * 234 * @param { T } key - key key need to determine whether to include the key 235 * @returns { boolean } the boolean type 236 * @throws { BusinessError } 10200011 - The has method cannot be bound. 237 * @syscap SystemCapability.Utils.Lang 238 * @crossplatform 239 * @since 10 240 */ 241 /** 242 * Checks whether an LightWeightSet container has a specified key 243 * 244 * @param { T } key - key key need to determine whether to include the key 245 * @returns { boolean } the boolean type 246 * @throws { BusinessError } 10200011 - The has method cannot be bound. 247 * @syscap SystemCapability.Utils.Lang 248 * @crossplatform 249 * @atomicservice 250 * @since arkts {'1.1':'12', '1.2':'20'} 251 * @arkts 1.1&1.2 252 */ 253 has(key: T): boolean; 254 /** 255 * Checks whether an the objects of an LightWeighSet container are of the same type as a specified Object LightWeightSet 256 * 257 * @param { Object } obj - obj obj need to determine whether to include the obj 258 * @returns { boolean } the boolean type 259 * @throws { BusinessError } 10200011 - The equal method cannot be bound. 260 * @syscap SystemCapability.Utils.Lang 261 * @since 8 262 */ 263 /** 264 * Checks whether an the objects of an LightWeighSet container are of the same type as a specified Object LightWeightSet 265 * 266 * @param { Object } obj - obj obj need to determine whether to include the obj 267 * @returns { boolean } the boolean type 268 * @throws { BusinessError } 10200011 - The equal method cannot be bound. 269 * @syscap SystemCapability.Utils.Lang 270 * @crossplatform 271 * @since 10 272 * @deprecated since 12 273 */ 274 equal(obj: Object): boolean; 275 /** 276 * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 277 * and that the container has all the original objects after capacity expansion 278 * 279 * @param { number } minimumCapacity Minimum capacity to be reserved 280 * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 281 * @throws { BusinessError } 401 - Parameter error. Possible causes: 282 * 1.Mandatory parameters are left unspecified; 283 * 2.Incorrect parameter types; 284 * 3.Parameter verification failed. 285 * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 286 * @syscap SystemCapability.Utils.Lang 287 * @since 8 288 */ 289 /** 290 * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 291 * and that the container has all the original objects after capacity expansion 292 * 293 * @param { number } minimumCapacity Minimum capacity to be reserved 294 * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 295 * @throws { BusinessError } 401 - Parameter error. Possible causes: 296 * 1.Mandatory parameters are left unspecified; 297 * 2.Incorrect parameter types; 298 * 3.Parameter verification failed. 299 * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 300 * @syscap SystemCapability.Utils.Lang 301 * @crossplatform 302 * @since 10 303 */ 304 /** 305 * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 306 * and that the container has all the original objects after capacity expansion 307 * 308 * @param { number } minimumCapacity Minimum capacity to be reserved 309 * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 310 * @throws { BusinessError } 401 - Parameter error. Possible causes: 311 * 1.Mandatory parameters are left unspecified; 312 * 2.Incorrect parameter types; 313 * 3.Parameter verification failed. 314 * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 315 * @syscap SystemCapability.Utils.Lang 316 * @crossplatform 317 * @atomicservice 318 * @since arkts {'1.1':'12', '1.2':'20'} 319 * @arkts 1.1&1.2 320 */ 321 increaseCapacityTo(minimumCapacity: number): void; 322 /** 323 * Obtains the index of s key of a specified Object type in an LightWeightSet container 324 * 325 * @param { T } key - key key Looking for goals 326 * @returns { number } Subscript corresponding to target 327 * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 328 * @syscap SystemCapability.Utils.Lang 329 * @since 8 330 */ 331 /** 332 * Obtains the index of s key of a specified Object type in an LightWeightSet container 333 * 334 * @param { T } key - key key Looking for goals 335 * @returns { number } Subscript corresponding to target 336 * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 337 * @syscap SystemCapability.Utils.Lang 338 * @crossplatform 339 * @since 10 340 */ 341 /** 342 * Obtains the index of s key of a specified Object type in an LightWeightSet container 343 * 344 * @param { T } key - key key Looking for goals 345 * @returns { number } Subscript corresponding to target 346 * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 347 * @syscap SystemCapability.Utils.Lang 348 * @crossplatform 349 * @atomicservice 350 * @since arkts {'1.1':'12', '1.2':'20'} 351 * @arkts 1.1&1.2 352 */ 353 getIndexOf(key: T): number; 354 /** 355 * Deletes an object of a specified Object type from an LightWeightSet container 356 * 357 * @param { T } key - key key Target to be deleted 358 * @returns { T } Target element 359 * @throws { BusinessError } 10200011 - The remove method cannot be bound. 360 * @syscap SystemCapability.Utils.Lang 361 * @since 8 362 */ 363 /** 364 * Deletes an object of a specified Object type from an LightWeightSet container 365 * 366 * @param { T } key - key key Target to be deleted 367 * @returns { T } Target element 368 * @throws { BusinessError } 10200011 - The remove method cannot be bound. 369 * @syscap SystemCapability.Utils.Lang 370 * @crossplatform 371 * @since 10 372 */ 373 /** 374 * Deletes an object of a specified Object type from an LightWeightSet container 375 * 376 * @param { T } key - key key Target to be deleted 377 * @returns { T } Target element 378 * @throws { BusinessError } 10200011 - The remove method cannot be bound. 379 * @syscap SystemCapability.Utils.Lang 380 * @crossplatform 381 * @atomicservice 382 * @since 12 383 */ 384 remove(key: T): T; 385 386 /** 387 * Deletes an object of a specified Object type from an LightWeightSet container 388 * 389 * @param { T } key - key key Target to be deleted 390 * @returns { T | undefined } the removed value if it was present, undefined otherwise 391 * @syscap SystemCapability.Utils.Lang 392 * @crossplatform 393 * @atomicservice 394 * @since 20 395 * @arkts 1.2 396 */ 397 remove(key: T): T | undefined; 398 399 /** 400 * Deletes an object at the location identified by index from an LightWeightSet container 401 * 402 * @param { number } index - index index Target subscript for search 403 * @returns { boolean } the boolean type(Is there a delete value) 404 * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 405 * @throws { BusinessError } 401 - Parameter error. Possible causes: 406 * 1.Mandatory parameters are left unspecified; 407 * 2.Incorrect parameter types. 408 * @syscap SystemCapability.Utils.Lang 409 * @since 8 410 */ 411 /** 412 * Deletes an object at the location identified by index from an LightWeightSet container 413 * 414 * @param { number } index - index index Target subscript for search 415 * @returns { boolean } the boolean type(Is there a delete value) 416 * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 417 * @throws { BusinessError } 401 - Parameter error. Possible causes: 418 * 1.Mandatory parameters are left unspecified; 419 * 2.Incorrect parameter types. 420 * @syscap SystemCapability.Utils.Lang 421 * @crossplatform 422 * @since 10 423 */ 424 /** 425 * Deletes an object at the location identified by index from an LightWeightSet container 426 * 427 * @param { number } index - index index Target subscript for search 428 * @returns { boolean } the boolean type(Is there a delete value) 429 * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 430 * @throws { BusinessError } 401 - Parameter error. Possible causes: 431 * 1.Mandatory parameters are left unspecified; 432 * 2.Incorrect parameter types. 433 * @syscap SystemCapability.Utils.Lang 434 * @crossplatform 435 * @atomicservice 436 * @since arkts {'1.1':'12', '1.2':'20'} 437 * @arkts 1.1&1.2 438 */ 439 removeAt(index: number): boolean; 440 /** 441 * Removes all of the mapping from this map 442 * The map will be empty after this call returns 443 * 444 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 445 * @syscap SystemCapability.Utils.Lang 446 * @since 8 447 */ 448 /** 449 * Removes all of the mapping from this map 450 * The map will be empty after this call returns 451 * 452 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 453 * @syscap SystemCapability.Utils.Lang 454 * @crossplatform 455 * @since 10 456 */ 457 /** 458 * Removes all of the mapping from this map 459 * The map will be empty after this call returns 460 * 461 * @throws { BusinessError } 10200011 - The clear method cannot be bound. 462 * @syscap SystemCapability.Utils.Lang 463 * @crossplatform 464 * @atomicservice 465 * @since arkts {'1.1':'12', '1.2':'20'} 466 * @arkts 1.1&1.2 467 */ 468 clear(): void; 469 /** 470 * Executes the given callback function once for each real key in the map. 471 * It does not perform functions on deleted keys. 472 * 473 * @param { function } callbackFn - callbackFn 474 * callbackFn (required) A function that accepts up to three arguments. 475 * The function to be called for each element. 476 * @param { Object } [thisArg] - thisArg 477 * thisArg (Optional) The value to be used as this value for when callbackFn is called. 478 * If thisArg is omitted, undefined is used as the this value. 479 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 480 * @throws { BusinessError } 401 - Parameter error. Possible causes: 481 * 1.Mandatory parameters are left unspecified; 482 * 2.Incorrect parameter types. 483 * @syscap SystemCapability.Utils.Lang 484 * @since 8 485 */ 486 /** 487 * Executes the given callback function once for each real key in the map. 488 * It does not perform functions on deleted keys. 489 * 490 * @param { function } callbackFn - callbackFn 491 * callbackFn (required) A function that accepts up to three arguments. 492 * The function to be called for each element. 493 * @param { Object } [thisArg] - thisArg 494 * thisArg (Optional) The value to be used as this value for when callbackFn is called. 495 * If thisArg is omitted, undefined is used as the this value. 496 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 497 * @throws { BusinessError } 401 - Parameter error. Possible causes: 498 * 1.Mandatory parameters are left unspecified; 499 * 2.Incorrect parameter types. 500 * @syscap SystemCapability.Utils.Lang 501 * @crossplatform 502 * @since 10 503 */ 504 /** 505 * Executes the given callback function once for each real key in the map. 506 * It does not perform functions on deleted keys. 507 * 508 * @param { function } callbackFn - callbackFn 509 * callbackFn (required) A function that accepts up to three arguments. 510 * The function to be called for each element. 511 * @param { Object } [thisArg] - thisArg 512 * thisArg (Optional) The value to be used as this value for when callbackFn is called. 513 * If thisArg is omitted, undefined is used as the this value. 514 * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 515 * @throws { BusinessError } 401 - Parameter error. Possible causes: 516 * 1.Mandatory parameters are left unspecified; 517 * 2.Incorrect parameter types. 518 * @syscap SystemCapability.Utils.Lang 519 * @crossplatform 520 * @atomicservice 521 * @since 12 522 */ 523 forEach(callbackFn: (value?: T, key?: T, set?: LightWeightSet<T>) => void, thisArg?: Object): void; 524 525 /** 526 * Executes the given callback function once for each real key in the map. 527 * It does not perform functions on deleted keys. 528 * 529 * @param { LightWeightSetForEachCb<T> } callbackFn - A callback function to execute for each element. 530 * @syscap SystemCapability.Utils.Lang 531 * @crossplatform 532 * @atomicservice 533 * @since 20 534 * @arkts 1.2 535 */ 536 forEach(callbackFn: LightWeightSetForEachCb<T>): void; 537 538 /** 539 * returns an ES6 iterator.Each item of the iterator is a Javascript Object 540 * 541 * @returns { IterableIterator<T> } 542 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 543 * @syscap SystemCapability.Utils.Lang 544 * @since 8 545 */ 546 /** 547 * returns an ES6 iterator.Each item of the iterator is a Javascript Object 548 * 549 * @returns { IterableIterator<T> } 550 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 551 * @syscap SystemCapability.Utils.Lang 552 * @crossplatform 553 * @since 10 554 */ 555 /** 556 * returns an ES6 iterator.Each item of the iterator is a Javascript Object 557 * 558 * @returns { IterableIterator<T> } 559 * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 560 * @syscap SystemCapability.Utils.Lang 561 * @crossplatform 562 * @atomicservice 563 * @since 12 564 */ 565 [Symbol.iterator](): IterableIterator<T>; 566 567 /** 568 * returns an ES6 iterator.Each item of the iterator is a Javascript Object 569 * 570 * @returns { IterableIterator<T> } an iterator for the LightWeightSet 571 * @syscap SystemCapability.Utils.Lang 572 * @crossplatform 573 * @atomicservice 574 * @since 20 575 * @arkts 1.2 576 */ 577 $_iterator(): IterableIterator<T>; 578 579 /** 580 * Obtains a string that contains all the keys and values in an LightWeightSet container 581 * 582 * @returns { String } 583 * @syscap SystemCapability.Utils.Lang 584 * @since 8 585 */ 586 /** 587 * Obtains a string that contains all the keys and values in an LightWeightSet container 588 * 589 * @returns { String } 590 * @syscap SystemCapability.Utils.Lang 591 * @crossplatform 592 * @since 10 593 */ 594 /** 595 * Obtains a string that contains all the keys and values in an LightWeightSet container 596 * 597 * @returns { String } 598 * @syscap SystemCapability.Utils.Lang 599 * @crossplatform 600 * @atomicservice 601 * @since arkts {'1.1':'12', '1.2':'20'} 602 * @arkts 1.1&1.2 603 */ 604 toString(): String; 605 /** 606 * Obtains an Array that contains all the objects of an LightWeightSet container. 607 * 608 * @returns { Array<T> } 609 * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 610 * @syscap SystemCapability.Utils.Lang 611 * @since 8 612 */ 613 /** 614 * Obtains an Array that contains all the objects of an LightWeightSet container. 615 * 616 * @returns { Array<T> } 617 * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 618 * @syscap SystemCapability.Utils.Lang 619 * @crossplatform 620 * @since 10 621 */ 622 /** 623 * Obtains an Array that contains all the objects of an LightWeightSet container. 624 * 625 * @returns { Array<T> } 626 * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 627 * @syscap SystemCapability.Utils.Lang 628 * @crossplatform 629 * @atomicservice 630 * @since arkts {'1.1':'12', '1.2':'20'} 631 * @arkts 1.1&1.2 632 */ 633 toArray(): Array<T>; 634 /** 635 * Obtains the object at the location identified by index in an LightWeightSet container 636 * 637 * @param { number } index - index index Target subscript for search 638 * @returns { T } the value of key-value pairs 639 * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 640 * @throws { BusinessError } 401 - Parameter error. Possible causes: 641 * 1.Mandatory parameters are left unspecified; 642 * 2.Incorrect parameter types. 643 * @syscap SystemCapability.Utils.Lang 644 * @since 8 645 */ 646 /** 647 * Obtains the object at the location identified by index in an LightWeightSet container 648 * 649 * @param { number } index - index index Target subscript for search 650 * @returns { T } the value of key-value pairs 651 * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 652 * @throws { BusinessError } 401 - Parameter error. Possible causes: 653 * 1.Mandatory parameters are left unspecified; 654 * 2.Incorrect parameter types. 655 * @syscap SystemCapability.Utils.Lang 656 * @crossplatform 657 * @since 10 658 */ 659 /** 660 * Obtains the object at the location identified by index in an LightWeightSet container 661 * 662 * @param { number } index - index index Target subscript for search 663 * @returns { T } the value of key-value pairs 664 * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 665 * @throws { BusinessError } 401 - Parameter error. Possible causes: 666 * 1.Mandatory parameters are left unspecified; 667 * 2.Incorrect parameter types. 668 * @syscap SystemCapability.Utils.Lang 669 * @crossplatform 670 * @atomicservice 671 * @since 12 672 */ 673 getValueAt(index: number): T; 674 675 /** 676 * Obtains the object at the location identified by index in an LightWeightSet container 677 * 678 * @param { number } index - index index Target subscript for search 679 * @returns { T | undefined } the value at the specified index, or undefined if the index out of range 680 * @syscap SystemCapability.Utils.Lang 681 * @crossplatform 682 * @atomicservice 683 * @since 20 684 * @arkts 1.2 685 */ 686 getValueAt(index: number): T | undefined; 687 688 /** 689 * Returns a ES6 iterator of the values contained in this Set 690 * 691 * @returns { IterableIterator<T> } 692 * @throws { BusinessError } 10200011 - The values method cannot be bound. 693 * @syscap SystemCapability.Utils.Lang 694 * @since 8 695 */ 696 /** 697 * Returns a ES6 iterator of the values contained in this Set 698 * 699 * @returns { IterableIterator<T> } 700 * @throws { BusinessError } 10200011 - The values method cannot be bound. 701 * @syscap SystemCapability.Utils.Lang 702 * @crossplatform 703 * @since 10 704 */ 705 /** 706 * Returns a ES6 iterator of the values contained in this Set 707 * 708 * @returns { IterableIterator<T> } 709 * @throws { BusinessError } 10200011 - The values method cannot be bound. 710 * @syscap SystemCapability.Utils.Lang 711 * @crossplatform 712 * @atomicservice 713 * @since arkts {'1.1':'12', '1.2':'20'} 714 * @arkts 1.1&1.2 715 */ 716 values(): IterableIterator<T>; 717 /** 718 * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 719 * 720 * @returns { IterableIterator<[T, T]> } 721 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 722 * @syscap SystemCapability.Utils.Lang 723 * @since 8 724 */ 725 /** 726 * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 727 * 728 * @returns { IterableIterator<[T, T]> } 729 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 730 * @syscap SystemCapability.Utils.Lang 731 * @crossplatform 732 * @since 10 733 */ 734 /** 735 * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 736 * 737 * @returns { IterableIterator<[T, T]> } 738 * @throws { BusinessError } 10200011 - The entries method cannot be bound. 739 * @syscap SystemCapability.Utils.Lang 740 * @crossplatform 741 * @atomicservice 742 * @since arkts {'1.1':'12', '1.2':'20'} 743 * @arkts 1.1&1.2 744 */ 745 entries(): IterableIterator<[T, T]>; 746 /** 747 * Returns whether the set object contains elements 748 * 749 * @returns { boolean } 750 * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 751 * @syscap SystemCapability.Utils.Lang 752 * @since 8 753 */ 754 /** 755 * Returns whether the set object contains elements 756 * 757 * @returns { boolean } 758 * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 759 * @syscap SystemCapability.Utils.Lang 760 * @crossplatform 761 * @since 10 762 */ 763 /** 764 * Returns whether the set object contains elements 765 * 766 * @returns { boolean } 767 * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 768 * @syscap SystemCapability.Utils.Lang 769 * @crossplatform 770 * @atomicservice 771 * @since arkts {'1.1':'12', '1.2':'20'} 772 * @arkts 1.1&1.2 773 */ 774 isEmpty(): boolean; 775} 776 777/** 778 * The type of LightWeightSet callback function. 779 * 780 * @typedef { function } LightWeightSetForEachCb 781 * @param { T } value - The value of current element 782 * @param { T } key - The key of current element(same as value) 783 * @param { LightWeightSet<T> } set - The LightWeightSet instance being traversed 784 * @returns { void } This callback does not return a value 785 * @syscap SystemCapability.Utils.Lang 786 * @atomicservice 787 * @since 20 788 * @arkts 1.2 789 */ 790type LightWeightSetForEachCb<T> = (value: T, key: T, set: LightWeightSet<T>) => void 791 792export default LightWeightSet; 793