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