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 * TextDecoder support full encoding in ICU data utf-8 utf-16 iso8859 must support in all device, TextEncoder takes a 23 * stream of code points as input and emits a stream of UTF-8 bytes, and system help function. 24 * 25 * @namespace util 26 * @syscap SystemCapability.Utils.Lang 27 * @since 7 28 */ 29/** 30 * TextDecoder support full encoding in ICU data utf-8 utf-16 iso8859 must support in all device, TextEncoder takes a 31 * stream of code points as input and emits a stream of UTF-8 bytes, and system help function. 32 * 33 * @namespace util 34 * @syscap SystemCapability.Utils.Lang 35 * @crossplatform 36 * @since 10 37 */ 38/** 39 * TextDecoder support full encoding in ICU data utf-8 utf-16 iso8859 must support in all device, TextEncoder takes a 40 * stream of code points as input and emits a stream of UTF-8 bytes, and system help function. 41 * 42 * @namespace util 43 * @syscap SystemCapability.Utils.Lang 44 * @crossplatform 45 * @atomicservice 46 * @since 11 47 */ 48declare namespace util { 49 /** 50 * %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented 51 * with an n and Objects that have no user defined toString function are inspected using util.inspect() with 52 * options { depth: 0, colors: false, compact: 3 }. 53 * %d: Number will be used to convert all values except BigInt and Symbol. 54 * %i: parseInt(value, 10) is used for all values except BigInt and Symbol. 55 * %f: parseFloat(value) is used for all values except Bigint and Symbol. 56 * %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references. 57 * %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to 58 * util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including 59 * non-enumerable properties and proxies. 60 * %O: Object. A string representation of an object with generic JavaScript object formatting. 61 * %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to 62 * util.inspect() without options. This will show the full object not including non-enumerable properties and 63 * proxies. 64 * %c: CSS. This specifier is ignored and will skip any CSS passed in. 65 * %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string. 66 * 67 * @param { string } format - Styled string 68 * @param { Object[] } args - Data to be formatted 69 * @returns { string } Return the character string formatted in a specific format 70 * @syscap SystemCapability.Utils.Lang 71 * @since 7 72 * @deprecated since 9 73 * @useinstead ohos.util.format 74 */ 75 function printf(format: string, ...args: Object[]): string; 76 77 /** 78 * %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented 79 * with an n and Objects that have no user defined toString function are inspected using util.inspect() with 80 * options { depth: 0, colors: false, compact: 3 }. 81 * %d: Number will be used to convert all values except BigInt and Symbol. 82 * %i: parseInt(value, 10) is used for all values except BigInt and Symbol. 83 * %f: parseFloat(value) is used for all values except Bigint and Symbol. 84 * %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references. 85 * %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to 86 * util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including 87 * non-enumerable properties and proxies. 88 * %O: Object. A string representation of an object with generic JavaScript object formatting. 89 * %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to 90 * util.inspect() without options. This will show the full object not including non-enumerable properties and 91 * proxies. 92 * %c: CSS. This specifier is ignored and will skip any CSS passed in. 93 * %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string. 94 * 95 * @param { string } format - Styled string 96 * @param { Object[] } args - Data to be formatted 97 * @returns { string } Return the character string formatted in a specific format 98 * @throws { BusinessError } 401 - Parameter error. Possible causes: 99 * 1.Mandatory parameters are left unspecified; 100 * 2.Incorrect parameter types. 101 * @syscap SystemCapability.Utils.Lang 102 * @since 9 103 */ 104 /** 105 * %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented 106 * with an n and Objects that have no user defined toString function are inspected using util.inspect() with 107 * options { depth: 0, colors: false, compact: 3 }. 108 * %d: Number will be used to convert all values except BigInt and Symbol. 109 * %i: parseInt(value, 10) is used for all values except BigInt and Symbol. 110 * %f: parseFloat(value) is used for all values except Bigint and Symbol. 111 * %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references. 112 * %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to 113 * util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including 114 * non-enumerable properties and proxies. 115 * %O: Object. A string representation of an object with generic JavaScript object formatting. 116 * %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to 117 * util.inspect() without options. This will show the full object not including non-enumerable properties and 118 * proxies. 119 * %c: CSS. This specifier is ignored and will skip any CSS passed in. 120 * %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string. 121 * 122 * @param { string } format - Styled string 123 * @param { Object[] } args - Data to be formatted 124 * @returns { string } a string formatted in a specific format. 125 * @throws { BusinessError } 401 - Parameter error. Possible causes: 126 * 1.Mandatory parameters are left unspecified; 127 * 2.Incorrect parameter types. 128 * @syscap SystemCapability.Utils.Lang 129 * @crossplatform 130 * @since 10 131 */ 132 /** 133 * %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented 134 * with an n and Objects that have no user defined toString function are inspected using util.inspect() with 135 * options { depth: 0, colors: false, compact: 3 }. 136 * %d: Number will be used to convert all values except BigInt and Symbol. 137 * %i: parseInt(value, 10) is used for all values except BigInt and Symbol. 138 * %f: parseFloat(value) is used for all values except Bigint and Symbol. 139 * %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references. 140 * %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to 141 * util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including 142 * non-enumerable properties and proxies. 143 * %O: Object. A string representation of an object with generic JavaScript object formatting. 144 * %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to 145 * util.inspect() without options. This will show the full object not including non-enumerable properties and 146 * proxies. 147 * %c: CSS. This specifier is ignored and will skip any CSS passed in. 148 * %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string. 149 * 150 * @param { string } format - Styled string 151 * @param { Object[] } args - Data to be formatted 152 * @returns { string } a string formatted in a specific format. 153 * @throws { BusinessError } 401 - Parameter error. Possible causes: 154 * 1.Mandatory parameters are left unspecified; 155 * 2.Incorrect parameter types. 156 * @syscap SystemCapability.Utils.Lang 157 * @crossplatform 158 * @atomicservice 159 * @since 12 160 */ 161 function format(format: string, ...args: Object[]): string; 162 163 /** 164 * Get the string name of the system errno. 165 * 166 * @param { number } errno - The error code generated by an error in the system 167 * @returns { string } Return the string name of a system errno 168 * @syscap SystemCapability.Utils.Lang 169 * @since 7 170 * @deprecated since 9 171 * @useinstead ohos.util.errnoToString 172 */ 173 function getErrorString(errno: number): string; 174 175 /** 176 * Get the string name of the system errno. 177 * 178 * @param { number } errno - The error code generated by an error in the system 179 * @returns { string } Return the string name of a system errno 180 * @throws { BusinessError } 401 - Parameter error. Possible causes: 181 * 1.Mandatory parameters are left unspecified; 182 * 2.Incorrect parameter types. 183 * @syscap SystemCapability.Utils.Lang 184 * @since 9 185 */ 186 /** 187 * Get the string name of the system errno. 188 * 189 * @param { number } errno - The error code generated by an error in the system 190 * @returns { string } Return the string name of a system errno 191 * @throws { BusinessError } 401 - Parameter error. Possible causes: 192 * 1.Mandatory parameters are left unspecified; 193 * 2.Incorrect parameter types. 194 * @syscap SystemCapability.Utils.Lang 195 * @crossplatform 196 * @since 10 197 */ 198 /** 199 * Get the string name of the system errno. 200 * 201 * @param { number } errno - The error code generated by an error in the system 202 * @returns { string } Return the string name of a system errno 203 * @throws { BusinessError } 401 - Parameter error. Possible causes: 204 * 1.Mandatory parameters are left unspecified; 205 * 2.Incorrect parameter types. 206 * @syscap SystemCapability.Utils.Lang 207 * @crossplatform 208 * @atomicservice 209 * @since 12 210 */ 211 function errnoToString(errno: number): string; 212 213 /** 214 * Takes an async function (or a function that returns a Promise) and returns a function following the 215 * error-first callback style. 216 * 217 * @param { Function } original - Asynchronous function 218 * @returns { function } Return a Asynchronous function 219 * @throws { BusinessError } 401 - Parameter error. Possible causes: 220 * 1.Mandatory parameters are left unspecified; 221 * 2.Incorrect parameter types. 222 * @syscap SystemCapability.Utils.Lang 223 * @since 7 224 */ 225 /** 226 * Takes an async function (or a function that returns a Promise) and returns a function following the 227 * error-first callback style. 228 * 229 * @param { Function } original - Asynchronous function 230 * @returns { function } Return a Asynchronous function 231 * @throws { BusinessError } 401 - Parameter error. Possible causes: 232 * 1.Mandatory parameters are left unspecified; 233 * 2.Incorrect parameter types. 234 * @syscap SystemCapability.Utils.Lang 235 * @crossplatform 236 * @since 10 237 */ 238 /** 239 * Takes an async function (or a function that returns a Promise) and returns a function following the 240 * error-first callback style. 241 * 242 * @param { Function } original - Asynchronous function 243 * @returns { function } Return a Asynchronous function 244 * @throws { BusinessError } 401 - Parameter error. Possible causes: 245 * 1.Mandatory parameters are left unspecified; 246 * 2.Incorrect parameter types. 247 * @syscap SystemCapability.Utils.Lang 248 * @crossplatform 249 * @atomicservice 250 * @since 12 251 */ 252 function callbackWrapper(original: Function): (err: Object, value: Object) => void; 253 254 /** 255 * Takes a function following the common error-first callback style, i.e taking an (err, value) => 256 * callback as the last argument, and return a function that returns promises. 257 * 258 * @param { function } original - Asynchronous function 259 * @returns { function } Return a function that returns promises 260 * @throws { BusinessError } 401 - Parameter error. Possible causes: 261 * 1.Mandatory parameters are left unspecified; 262 * 2.Incorrect parameter types. 263 * @syscap SystemCapability.Utils.Lang 264 * @since 9 265 */ 266 /** 267 * Takes a function following the common error-first callback style, i.e taking an (err, value) => 268 * callback as the last argument, and return a function that returns promises. 269 * 270 * @param { function } original - Asynchronous function 271 * @returns { Function } Return a function that returns promises 272 * @throws { BusinessError } 401 - Parameter error. Possible causes: 273 * 1.Mandatory parameters are left unspecified; 274 * 2.Incorrect parameter types. 275 * @syscap SystemCapability.Utils.Lang 276 * @crossplatform 277 * @since 10 278 */ 279 /** 280 * Takes a function following the common error-first callback style, i.e taking an (err, value) => 281 * callback as the last argument, and return a function that returns promises. 282 * 283 * @param { function } original - Asynchronous function 284 * @returns { Function } Return a function that returns promises 285 * @throws { BusinessError } 401 - Parameter error. Possible causes: 286 * 1.Mandatory parameters are left unspecified; 287 * 2.Incorrect parameter types. 288 * @syscap SystemCapability.Utils.Lang 289 * @crossplatform 290 * @atomicservice 291 * @since 12 292 */ 293 function promisify(original: (err: Object, value: Object) => void): Function; 294 295 /** 296 * Takes a function following the common error-first callback style, i.e taking an (err, value) => 297 * callback as the last argument, and return a version that returns promises. 298 * 299 * @param { function } original - Asynchronous function 300 * @returns { Object } Return a version that returns promises 301 * @syscap SystemCapability.Utils.Lang 302 * @since 7 303 * @deprecated since 9 304 * @useinstead ohos.util.promisify 305 */ 306 function promiseWrapper(original: (err: Object, value: Object) => void): Object; 307 308 /** 309 * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. 310 * 311 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 312 * @returns { string } Return a string representing this UUID. 313 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 314 * @syscap SystemCapability.Utils.Lang 315 * @since 9 316 */ 317 /** 318 * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. 319 * 320 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 321 * @returns { string } Return a string representing this UUID. 322 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 323 * @syscap SystemCapability.Utils.Lang 324 * @crossplatform 325 * @since 10 326 */ 327 /** 328 * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. 329 * 330 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 331 * @returns { string } Return a string representing this UUID. 332 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 333 * @syscap SystemCapability.Utils.Lang 334 * @crossplatform 335 * @atomicservice 336 * @since 12 337 */ 338 function generateRandomUUID(entropyCache?: boolean): string; 339 340 /** 341 * Generate a random RFC 4122 version 4 binary UUID using a cryptographically secure random number generator. 342 * 343 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 344 * @returns { Uint8Array } Return a Uint8Array representing this UUID. 345 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 346 * @syscap SystemCapability.Utils.Lang 347 * @since 9 348 */ 349 /** 350 * Generate a random RFC 4122 version 4 binary UUID using a cryptographically secure random number generator. 351 * 352 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 353 * @returns { Uint8Array } Return a Uint8Array representing this UUID. 354 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 355 * @syscap SystemCapability.Utils.Lang 356 * @crossplatform 357 * @since 10 358 */ 359 /** 360 * Generate a random RFC 4122 version 4 binary UUID using a cryptographically secure random number generator. 361 * 362 * @param { boolean } [entropyCache] - Whether to generate the UUID with using the cache. Default: true. 363 * @returns { Uint8Array } Return a Uint8Array representing this UUID. 364 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 365 * @syscap SystemCapability.Utils.Lang 366 * @crossplatform 367 * @atomicservice 368 * @since 12 369 */ 370 function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array; 371 372 /** 373 * Parse a UUID from the string standard representation as described in the RFC 4122 version 4. 374 * 375 * @param { string } uuid - String that specifies a UUID 376 * @returns { Uint8Array } Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. 377 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 378 * @syscap SystemCapability.Utils.Lang 379 * @since 9 380 */ 381 /** 382 * Parse a UUID from the string standard representation as described in the RFC 4122 version 4. 383 * 384 * @param { string } uuid - String that specifies a UUID 385 * @returns { Uint8Array } Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. 386 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 387 * @syscap SystemCapability.Utils.Lang 388 * @crossplatform 389 * @since 10 390 */ 391 /** 392 * Parse a UUID from the string standard representation as described in the RFC 4122 version 4. 393 * 394 * @param { string } uuid - String that specifies a UUID 395 * @returns { Uint8Array } Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. 396 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 397 * @throws { BusinessError } 10200002 - Invalid uuid string. 398 * @syscap SystemCapability.Utils.Lang 399 * @crossplatform 400 * @atomicservice 401 * @since 12 402 */ 403 function parseUUID(uuid: string): Uint8Array; 404 405 /** 406 * Get the hash code of an object. 407 * 408 * @param { object } [object] - The object that need to get hash code. 409 * @returns { number } Return a hash code of an object. 410 * @throws { BusinessError } 401 - Parameter error. Possible causes: 411 * 1.Mandatory parameters are left unspecified; 412 * 2.Incorrect parameter types. 413 * @syscap SystemCapability.Utils.Lang 414 * @crossplatform 415 * @atomicservice 416 * @since 12 417 */ 418 function getHash(object: object): number; 419 420 /** 421 * Defines the TextDecoder related options parameters. 422 * 423 * @interface TextDecoderOptions 424 * @syscap SystemCapability.Utils.Lang 425 * @crossplatform 426 * @atomicservice 427 * @since 11 428 */ 429 interface TextDecoderOptions { 430 /** 431 * Is a fatal error displayed? The default value is false. 432 * @type { ?boolean } 433 * @syscap SystemCapability.Utils.Lang 434 * @crossplatform 435 * @atomicservice 436 * @since 11 437 */ 438 fatal?: boolean; 439 /** 440 * Do you want to ignore BOM tags? The default value is false. 441 * @type { ?boolean } 442 * @syscap SystemCapability.Utils.Lang 443 * @crossplatform 444 * @atomicservice 445 * @since 11 446 */ 447 ignoreBOM?: boolean; 448 } 449 450 /** 451 * Defines the decode with stream related options parameters. 452 * 453 * @interface DecodeWithStreamOptions 454 * @syscap SystemCapability.Utils.Lang 455 * @crossplatform 456 * @atomicservice 457 * @since 11 458 */ 459 interface DecodeWithStreamOptions { 460 /** 461 * Does the call follow additional data blocks. The default value is false. 462 * @type { ?boolean } 463 * @syscap SystemCapability.Utils.Lang 464 * @crossplatform 465 * @atomicservice 466 * @since 11 467 */ 468 stream?: boolean; 469 } 470 471 /** 472 * Defines the decode with stream related options parameters. 473 * 474 * @interface DecodeToStringOptions 475 * @syscap SystemCapability.Utils.Lang 476 * @crossplatform 477 * @atomicservice 478 * @since 12 479 */ 480 interface DecodeToStringOptions { 481 /** 482 * Stream option controls stream processing in decoding. The default value is false. 483 * @type { ?boolean } 484 * @syscap SystemCapability.Utils.Lang 485 * @crossplatform 486 * @atomicservice 487 * @since 12 488 */ 489 stream?: boolean; 490 } 491 492 /** 493 * The TextDecoder represents a text decoder that accepts a string as input, 494 * decodes it in UTF-8 format, and outputs UTF-8 byte stream. 495 * 496 * @syscap SystemCapability.Utils.Lang 497 * @since 7 498 */ 499 /** 500 * The TextDecoder represents a text decoder that accepts a string as input, 501 * decodes it in UTF-8 format, and outputs UTF-8 byte stream. 502 * 503 * @syscap SystemCapability.Utils.Lang 504 * @crossplatform 505 * @since 10 506 */ 507 /** 508 * The TextDecoder represents a text decoder that accepts a string as input, 509 * decodes it in UTF-8 format, and outputs UTF-8 byte stream. 510 * 511 * @syscap SystemCapability.Utils.Lang 512 * @crossplatform 513 * @atomicservice 514 * @since 11 515 */ 516 class TextDecoder { 517 /** 518 * The textDecoder constructor. 519 * 520 * @syscap SystemCapability.Utils.Lang 521 * @since 9 522 */ 523 /** 524 * The textDecoder constructor. 525 * 526 * @syscap SystemCapability.Utils.Lang 527 * @crossplatform 528 * @since 10 529 */ 530 /** 531 * The textDecoder constructor. 532 * 533 * @syscap SystemCapability.Utils.Lang 534 * @crossplatform 535 * @atomicservice 536 * @since 12 537 */ 538 constructor(); 539 540 /** 541 * The source encoding's name, lowercased. 542 * 543 * @syscap SystemCapability.Utils.Lang 544 * @since 7 545 */ 546 /** 547 * The source encoding's name, lowercased. 548 * 549 * @syscap SystemCapability.Utils.Lang 550 * @crossplatform 551 * @since 10 552 */ 553 /** 554 * The source encoding's name, lowercased. 555 * 556 * @syscap SystemCapability.Utils.Lang 557 * @crossplatform 558 * @atomicservice 559 * @since 12 560 */ 561 readonly encoding: string; 562 563 /** 564 * Returns `true` if error mode is "fatal", and `false` otherwise. 565 * 566 * @syscap SystemCapability.Utils.Lang 567 * @since 7 568 */ 569 /** 570 * Returns `true` if error mode is "fatal", and `false` otherwise. 571 * 572 * @syscap SystemCapability.Utils.Lang 573 * @crossplatform 574 * @since 10 575 */ 576 /** 577 * Returns `true` if error mode is "fatal", and `false` otherwise. 578 * 579 * @syscap SystemCapability.Utils.Lang 580 * @crossplatform 581 * @atomicservice 582 * @since 12 583 */ 584 readonly fatal: boolean; 585 586 /** 587 * Returns `true` if ignore BOM flag is set, and `false` otherwise. 588 * 589 * @syscap SystemCapability.Utils.Lang 590 * @since 7 591 */ 592 /** 593 * Returns `true` if ignore BOM flag is set, and `false` otherwise. 594 * 595 * @syscap SystemCapability.Utils.Lang 596 * @crossplatform 597 * @since 10 598 */ 599 /** 600 * Returns `true` if ignore BOM flag is set, and `false` otherwise. 601 * 602 * @syscap SystemCapability.Utils.Lang 603 * @crossplatform 604 * @atomicservice 605 * @since 12 606 */ 607 readonly ignoreBOM = false; 608 609 /** 610 * The textDecoder constructor. 611 * 612 * @param { string } encoding - Decoding format 613 * @param { object } options - Options 614 * @syscap SystemCapability.Utils.Lang 615 * @since 7 616 * @deprecated since 9 617 * @useinstead ohos.util.TextDecoder.create 618 */ 619 constructor(encoding?: string, options?: { fatal?: boolean; ignoreBOM?: boolean }); 620 621 /** 622 * Replaces the original constructor to process arguments and return a textDecoder object. 623 * 624 * @param { string } encoding - Decoding format 625 * @param { object } options - Options 626 * @returns { TextDecoder } 627 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 628 * @syscap SystemCapability.Utils.Lang 629 * @since 9 630 */ 631 /** 632 * Replaces the original constructor to process arguments and return a textDecoder object. 633 * 634 * @param { string } encoding - Decoding format 635 * @param { object } options - Options 636 * @returns { TextDecoder } 637 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 638 * @syscap SystemCapability.Utils.Lang 639 * @crossplatform 640 * @since 10 641 */ 642 /** 643 * Replaces the original constructor to process arguments and return a textDecoder object. 644 * 645 * @param { string } [encoding] - Decoding format 646 * @param { TextDecoderOptions } [options] - Options 647 * @returns { TextDecoder } 648 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 649 * @syscap SystemCapability.Utils.Lang 650 * @crossplatform 651 * @atomicservice 652 * @since 11 653 */ 654 static create(encoding?: string, options?: TextDecoderOptions): TextDecoder; 655 656 /** 657 * Returns the result of running encoding's decoder. 658 * 659 * @param { Uint8Array } input - Decoded numbers in accordance with the format 660 * @param { object } options - Options 661 * @returns { string } Return decoded text 662 * @syscap SystemCapability.Utils.Lang 663 * @since 7 664 * @deprecated since 9 665 * @useinstead ohos.util.decodeWithStream 666 */ 667 decode(input: Uint8Array, options?: { stream?: false }): string; 668 669 /** 670 * Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring 671 * at the end of the input are buffered internally and emitted after the next call to textDecoder.decode(). 672 * If textDecoder.fatal is true, decoding errors that occur will result in a TypeError being thrown. 673 * 674 * @param { Uint8Array } input - Decoded numbers in accordance with the format 675 * @param { object } options - Options 676 * @returns { string } Return decoded text 677 * @throws { BusinessError } 401 - Parameter error. Possible causes: 678 * 1.Mandatory parameters are left unspecified; 679 * 2.Incorrect parameter types. 680 * @syscap SystemCapability.Utils.Lang 681 * @since 9 682 */ 683 /** 684 * Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring 685 * at the end of the input are buffered internally and emitted after the next call to textDecoder.decode(). 686 * If textDecoder.fatal is true, decoding errors that occur will result in a TypeError being thrown. 687 * 688 * @param { Uint8Array } input - Decoded numbers in accordance with the format 689 * @param { object } options - Options 690 * @returns { string } Return decoded text 691 * @throws { BusinessError } 401 - Parameter error. Possible causes: 692 * 1.Mandatory parameters are left unspecified; 693 * 2.Incorrect parameter types. 694 * @syscap SystemCapability.Utils.Lang 695 * @crossplatform 696 * @since 10 697 */ 698 /** 699 * Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring 700 * at the end of the input are buffered internally and emitted after the next call to textDecoder.decode(). 701 * If textDecoder.fatal is true, decoding errors that occur will result in a TypeError being thrown. 702 * 703 * @param { Uint8Array } input - Decoded numbers in accordance with the format 704 * @param { DecodeWithStreamOptions } [options] - Options 705 * @returns { string } Return decoded text 706 * @throws { BusinessError } 401 - Parameter error. Possible causes: 707 * 1.Mandatory parameters are left unspecified; 708 * 2.Incorrect parameter types. 709 * @syscap SystemCapability.Utils.Lang 710 * @crossplatform 711 * @atomicservice 712 * @since 11 713 * @deprecated since 12 714 * @useinstead ohos.util.decodeToString 715 */ 716 decodeWithStream(input: Uint8Array, options?: DecodeWithStreamOptions): string; 717 /** 718 * The input is decoded and a string is returned. 719 * If options.stream is set to true, any incomplete byte sequences found at the end of the input are internally 720 * buffered and will be emitted after the next call to textDecoder.decodeToString(). 721 * If textDecoder.fatal is set to true, any decoding errors that occur will result in a TypeError being thrown. 722 * 723 * @param { Uint8Array } input - Decoded numbers in accordance with the format. 724 * @param { DecodeToStringOptions } [options] - The default option is set to false. 725 * @returns { string } Return decoded text 726 * @throws { BusinessError } 401 - Parameter error. Possible causes: 727 * 1.Mandatory parameters are left unspecified; 728 * 2.Incorrect parameter types. 729 * @syscap SystemCapability.Utils.Lang 730 * @crossplatform 731 * @atomicservice 732 * @since 12 733 */ 734 decodeToString(input: Uint8Array, options?: DecodeToStringOptions): string; 735 } 736 737 /** 738 * Return encoded text. 739 * 740 * @interface EncodeIntoUint8ArrayInfo 741 * @syscap SystemCapability.Utils.Lang 742 * @crossplatform 743 * @atomicservice 744 * @since 11 745 */ 746 interface EncodeIntoUint8ArrayInfo { 747 /** 748 * The read represents the number of characters that have been encoded. 749 * @type { number } 750 * @syscap SystemCapability.Utils.Lang 751 * @crossplatform 752 * @atomicservice 753 * @since 11 754 */ 755 read: number; 756 /** 757 * The written represents the number of bytes occupied by the encoded characters. 758 * @type { number } 759 * @syscap SystemCapability.Utils.Lang 760 * @crossplatform 761 * @atomicservice 762 * @since 11 763 */ 764 written: number; 765 } 766 767 /** 768 * The TextEncoder interface represents a text encoder. 769 * The encoder takes the byte stream as the input and outputs the String string. 770 * 771 * @syscap SystemCapability.Utils.Lang 772 * @since 7 773 */ 774 /** 775 * The TextEncoder interface represents a text encoder. 776 * The encoder takes the byte stream as the input and outputs the String string. 777 * 778 * @syscap SystemCapability.Utils.Lang 779 * @crossplatform 780 * @since 10 781 */ 782 /** 783 * The TextEncoder interface represents a text encoder. 784 * The encoder takes the byte stream as the input and outputs the String string. 785 * 786 * @syscap SystemCapability.Utils.Lang 787 * @crossplatform 788 * @atomicservice 789 * @since 11 790 */ 791 class TextEncoder { 792 /** 793 * Encoding format. 794 * 795 * @syscap SystemCapability.Utils.Lang 796 * @since 7 797 */ 798 /** 799 * Encoding format. 800 * 801 * @syscap SystemCapability.Utils.Lang 802 * @crossplatform 803 * @since 10 804 */ 805 /** 806 * Encoding format. 807 * 808 * @syscap SystemCapability.Utils.Lang 809 * @crossplatform 810 * @atomicservice 811 * @since 12 812 */ 813 readonly encoding = 'utf-8'; 814 815 /** 816 * The textEncoder constructor. 817 * 818 * @syscap SystemCapability.Utils.Lang 819 * @since 7 820 */ 821 /** 822 * The textEncoder constructor. 823 * 824 * @syscap SystemCapability.Utils.Lang 825 * @crossplatform 826 * @since 10 827 */ 828 /** 829 * The textEncoder constructor. 830 * 831 * @syscap SystemCapability.Utils.Lang 832 * @crossplatform 833 * @atomicservice 834 * @since 11 835 */ 836 constructor(); 837 838 /** 839 * The textEncoder constructor. 840 * 841 * @param { string } [encoding] - The string for encoding format. 842 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 843 * @syscap SystemCapability.Utils.Lang 844 * @since 9 845 */ 846 /** 847 * The textEncoder constructor. 848 * 849 * @param { string } [encoding] - The string for encoding format. 850 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 851 * @syscap SystemCapability.Utils.Lang 852 * @crossplatform 853 * @since 10 854 */ 855 /** 856 * The textEncoder constructor. 857 * 858 * @param { string } [encoding] - The string for encoding format. 859 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 860 * @syscap SystemCapability.Utils.Lang 861 * @crossplatform 862 * @atomicservice 863 * @since 11 864 */ 865 constructor(encoding?: string); 866 867 /** 868 * Create a TextEncoder object. 869 * 870 * @param { string } [encoding] - The string for encoding format. 871 * @returns { TextEncoder } 872 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 873 * @syscap SystemCapability.Utils.Lang 874 * @crossplatform 875 * @atomicservice 876 * @since 12 877 */ 878 static create(encoding?: string): TextEncoder; 879 880 /** 881 * Returns the result of encoder. 882 * 883 * @param { string } [input] - The string to be encoded. 884 * @returns { Uint8Array } Returns the encoded text. 885 * @syscap SystemCapability.Utils.Lang 886 * @since 7 887 * @deprecated since 9 888 * @useinstead ohos.util.encodeInto 889 */ 890 encode(input?: string): Uint8Array; 891 892 /** 893 * UTF-8 encodes the input string and returns a Uint8Array containing the encoded bytes. 894 * 895 * @param { string } [input] - The string to be encoded. 896 * @returns { Uint8Array } Returns the encoded text. 897 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 898 * @syscap SystemCapability.Utils.Lang 899 * @since 9 900 */ 901 /** 902 * UTF-8 encodes the input string and returns a Uint8Array containing the encoded bytes. 903 * 904 * @param { string } [input] - The string to be encoded. 905 * @returns { Uint8Array } Returns the encoded text. 906 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 907 * @syscap SystemCapability.Utils.Lang 908 * @crossplatform 909 * @since 10 910 */ 911 /** 912 * UTF-8 encodes the input string and returns a Uint8Array containing the encoded bytes. 913 * 914 * @param { string } [input] - The string to be encoded. 915 * @returns { Uint8Array } Returns the encoded text. 916 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 917 * @syscap SystemCapability.Utils.Lang 918 * @crossplatform 919 * @atomicservice 920 * @since 11 921 */ 922 encodeInto(input?: string): Uint8Array; 923 924 /** 925 * Encode string, write the result to dest array. 926 * 927 * @param { string } input - The string to be encoded. 928 * @param { Uint8Array } dest - Encoded numbers in accordance with the format 929 * @returns { object } Return the object, where read represents 930 * the number of characters that have been encoded, and written 931 * represents the number of bytes occupied by the encoded characters. 932 * @syscap SystemCapability.Utils.Lang 933 * @since 7 934 * @deprecated since 9 935 * @useinstead ohos.util.encodeIntoUint8Array 936 */ 937 encodeInto(input: string, dest: Uint8Array): { read: number; written: number }; 938 939 /** 940 * Encode string, write the result to dest array. 941 * 942 * @param { string } input - The string to be encoded. 943 * @param { Uint8Array } dest - Encoded numbers in accordance with the format 944 * @returns { object } Return the object, where read represents 945 * the number of characters that have been encoded, and written 946 * represents the number of bytes occupied by the encoded characters. 947 * @throws { BusinessError } 401 - Parameter error. Possible causes: 948 * 1.Mandatory parameters are left unspecified; 949 * 2.Incorrect parameter types. 950 * @syscap SystemCapability.Utils.Lang 951 * @since 9 952 */ 953 /** 954 * Encode string, write the result to dest array. 955 * 956 * @param { string } input - The string to be encoded. 957 * @param { Uint8Array } dest - Encoded numbers in accordance with the format 958 * @returns { object } Return the object, where read represents 959 * the number of characters that have been encoded, and written 960 * represents the number of bytes occupied by the encoded characters. 961 * @throws { BusinessError } 401 - Parameter error. Possible causes: 962 * 1.Mandatory parameters are left unspecified; 963 * 2.Incorrect parameter types. 964 * @syscap SystemCapability.Utils.Lang 965 * @crossplatform 966 * @since 10 967 */ 968 /** 969 * Encode string, write the result to dest array. 970 * 971 * @param { string } input - The string to be encoded. 972 * @param { Uint8Array } dest - Encoded numbers in accordance with the format 973 * @returns { EncodeIntoUint8ArrayInfo } Return the object, where read represents 974 * the number of characters that have been encoded, and written 975 * represents the number of bytes occupied by the encoded characters. 976 * @throws { BusinessError } 401 - Parameter error. Possible causes: 977 * 1.Mandatory parameters are left unspecified; 978 * 2.Incorrect parameter types. 979 * @syscap SystemCapability.Utils.Lang 980 * @crossplatform 981 * @atomicservice 982 * @since 11 983 */ 984 encodeIntoUint8Array(input: string, dest: Uint8Array): EncodeIntoUint8ArrayInfo; 985 } 986 987 /** 988 * The rational number is mainly to compare rational numbers and obtain the numerator and denominator. 989 * 990 * @syscap SystemCapability.Utils.Lang 991 * @since 8 992 */ 993 /** 994 * The rational number is mainly to compare rational numbers and obtain the numerator and denominator. 995 * 996 * @syscap SystemCapability.Utils.Lang 997 * @crossplatform 998 * @since 10 999 */ 1000 /** 1001 * The rational number is mainly to compare rational numbers and obtain the numerator and denominator. 1002 * 1003 * @syscap SystemCapability.Utils.Lang 1004 * @crossplatform 1005 * @atomicservice 1006 * @since 12 1007 */ 1008 class RationalNumber { 1009 /** 1010 * A constructor used to create a RationalNumber instance with a given numerator and denominator. 1011 * 1012 * @param { number } numerator - An integer number 1013 * @param { number } denominator - An integer number 1014 * @syscap SystemCapability.Utils.Lang 1015 * @since 8 1016 * @deprecated since 9 1017 * @useinstead ohos.util.RationalNumber.parseRationalNumber 1018 */ 1019 constructor(numerator: number, denominator: number); 1020 1021 /** 1022 * A constructor used to create a RationalNumber instance with a given numerator and denominator. 1023 * 1024 * @syscap SystemCapability.Utils.Lang 1025 * @since 9 1026 */ 1027 /** 1028 * A constructor used to create a RationalNumber instance with a given numerator and denominator. 1029 * 1030 * @syscap SystemCapability.Utils.Lang 1031 * @crossplatform 1032 * @since 10 1033 */ 1034 /** 1035 * A constructor used to create a RationalNumber instance with a given numerator and denominator. 1036 * 1037 * @syscap SystemCapability.Utils.Lang 1038 * @crossplatform 1039 * @atomicservice 1040 * @since 12 1041 */ 1042 constructor(); 1043 1044 /** 1045 * Used to create a RationalNumber instance with a given numerator and denominator. 1046 * 1047 * @param { number } numerator - An integer number 1048 * @param { number } denominator - An integer number 1049 * @returns { RationalNumber } 1050 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1051 * 1.Mandatory parameters are left unspecified; 1052 * 2.Incorrect parameter types. 1053 * @syscap SystemCapability.Utils.Lang 1054 * @since 9 1055 */ 1056 /** 1057 * Used to create a RationalNumber instance with a given numerator and denominator. 1058 * 1059 * @param { number } numerator - An integer number 1060 * @param { number } denominator - An integer number 1061 * @returns { RationalNumber } 1062 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1063 * 1.Mandatory parameters are left unspecified; 1064 * 2.Incorrect parameter types. 1065 * @syscap SystemCapability.Utils.Lang 1066 * @crossplatform 1067 * @since 10 1068 */ 1069 /** 1070 * Used to create a RationalNumber instance with a given numerator and denominator. 1071 * 1072 * @param { number } numerator - An integer number 1073 * @param { number } denominator - An integer number 1074 * @returns { RationalNumber } 1075 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1076 * 1.Mandatory parameters are left unspecified; 1077 * 2.Incorrect parameter types. 1078 * @syscap SystemCapability.Utils.Lang 1079 * @crossplatform 1080 * @atomicservice 1081 * @since 12 1082 */ 1083 static parseRationalNumber(numerator: number, denominator: number): RationalNumber; 1084 1085 /** 1086 * Creates a RationalNumber object based on a given string. 1087 * 1088 * @param { string } rationalString - String Expression of Rational Numbers 1089 * @returns { RationalNumber } Returns a RationalNumber object generated based on the given string. 1090 * @throws { BusinessError } 401 - The type of rationalString must be string. 1091 * @syscap SystemCapability.Utils.Lang 1092 * @since 8 1093 */ 1094 /** 1095 * Creates a RationalNumber object based on a given string. 1096 * 1097 * @param { string } rationalString - String Expression of Rational Numbers 1098 * @returns { RationalNumber } Returns a RationalNumber object generated based on the given string. 1099 * @throws { BusinessError } 401 - The type of rationalString must be string. 1100 * @syscap SystemCapability.Utils.Lang 1101 * @crossplatform 1102 * @since 10 1103 */ 1104 /** 1105 * Creates a RationalNumber object based on a given string. 1106 * 1107 * @param { string } rationalString - String Expression of Rational Numbers 1108 * @returns { RationalNumber } Returns a RationalNumber object generated based on the given string. 1109 * @throws { BusinessError } 401 - The type of rationalString must be string. 1110 * @syscap SystemCapability.Utils.Lang 1111 * @crossplatform 1112 * @atomicservice 1113 * @since 12 1114 */ 1115 static createRationalFromString(rationalString: string): RationalNumber; 1116 1117 /** 1118 * Compares the current RationalNumber object to the given object. 1119 * 1120 * @param { RationalNumber } another - An object of other rational numbers 1121 * @returns { number } Returns 0 or 1, or -1, depending on the comparison. 1122 * @syscap SystemCapability.Utils.Lang 1123 * @since 8 1124 * @deprecated since 9 1125 * @useinstead ohos.util.compare 1126 */ 1127 compareTo(another: RationalNumber): number; 1128 1129 /** 1130 * Compares the current RationalNumber object to the given object. 1131 * 1132 * @param { RationalNumber } another - An object of other rational numbers 1133 * @returns { number } Returns 0 or 1, or -1, depending on the comparison. 1134 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1135 * 1.Mandatory parameters are left unspecified; 1136 * 2.Incorrect parameter types. 1137 * @syscap SystemCapability.Utils.Lang 1138 * @since 9 1139 */ 1140 /** 1141 * Compares the current RationalNumber object to the given object. 1142 * 1143 * @param { RationalNumber } another - An object of other rational numbers 1144 * @returns { number } Returns 0 or 1, or -1, depending on the comparison. 1145 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1146 * 1.Mandatory parameters are left unspecified; 1147 * 2.Incorrect parameter types. 1148 * @syscap SystemCapability.Utils.Lang 1149 * @crossplatform 1150 * @since 10 1151 */ 1152 /** 1153 * Compares the current RationalNumber object to the given object. 1154 * 1155 * @param { RationalNumber } another - An object of other rational numbers 1156 * @returns { number } Returns 0 or 1, or -1, depending on the comparison. 1157 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1158 * 1.Mandatory parameters are left unspecified; 1159 * 2.Incorrect parameter types. 1160 * @syscap SystemCapability.Utils.Lang 1161 * @crossplatform 1162 * @atomicservice 1163 * @since 12 1164 */ 1165 compare(another: RationalNumber): number; 1166 1167 /** 1168 * Compares two objects for equality. 1169 * 1170 * @param { Object } obj - An object 1171 * @returns { boolean } Returns true if the given object is the same as the current object; Otherwise, false is returned. 1172 * @syscap SystemCapability.Utils.Lang 1173 * @since 8 1174 */ 1175 /** 1176 * Compares two objects for equality. 1177 * 1178 * @param { Object } obj - An object 1179 * @returns { boolean } Returns true if the given object is the same as the current object; Otherwise, false is returned. 1180 * @syscap SystemCapability.Utils.Lang 1181 * @crossplatform 1182 * @since 10 1183 */ 1184 /** 1185 * Compares two objects for equality. 1186 * 1187 * @param { Object } obj - An object 1188 * @returns { boolean } Returns true if the given object is the same as the current object; Otherwise, false is returned. 1189 * @syscap SystemCapability.Utils.Lang 1190 * @crossplatform 1191 * @atomicservice 1192 * @since 12 1193 */ 1194 equals(obj: Object): boolean; 1195 1196 /** 1197 * Gets integer and floating-point values of a rational number object. 1198 * 1199 * @returns { number } Returns the integer and floating-point values of a rational number object. 1200 * @syscap SystemCapability.Utils.Lang 1201 * @since 8 1202 */ 1203 /** 1204 * Gets integer and floating-point values of a rational number object. 1205 * 1206 * @returns { number } Returns the integer and floating-point values of a rational number object. 1207 * @syscap SystemCapability.Utils.Lang 1208 * @crossplatform 1209 * @since 10 1210 */ 1211 /** 1212 * Gets integer and floating-point values of a rational number object. 1213 * 1214 * @returns { number } Returns the integer and floating-point values of a rational number object. 1215 * @syscap SystemCapability.Utils.Lang 1216 * @crossplatform 1217 * @atomicservice 1218 * @since 12 1219 */ 1220 valueOf(): number; 1221 1222 /** 1223 * Get the greatest common divisor of two integers. 1224 * 1225 * @param { number } number1 - Is an integer. 1226 * @param { number } number2 - Is an integer. 1227 * @returns { number } Returns the greatest common divisor of two integers, integer type. 1228 * @syscap SystemCapability.Utils.Lang 1229 * @since 8 1230 * @deprecated since 9 1231 * @useinstead ohos.util.getCommonFactor 1232 */ 1233 static getCommonDivisor(number1: number, number2: number): number; 1234 1235 /** 1236 * Get the greatest common factor of two integers. 1237 * 1238 * @param { number } number1 - Is an integer. 1239 * @param { number } number2 - Is an integer. 1240 * @returns { number } Returns the greatest common factor of two integers, integer type. 1241 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1242 * 1.Mandatory parameters are left unspecified; 1243 * 2.Incorrect parameter types. 1244 * @syscap SystemCapability.Utils.Lang 1245 * @since 9 1246 */ 1247 /** 1248 * Get the greatest common factor of two integers. 1249 * 1250 * @param { number } number1 - Is an integer. 1251 * @param { number } number2 - Is an integer. 1252 * @returns { number } Returns the greatest common factor of two integers, integer type. 1253 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1254 * 1.Mandatory parameters are left unspecified; 1255 * 2.Incorrect parameter types. 1256 * @syscap SystemCapability.Utils.Lang 1257 * @crossplatform 1258 * @since 10 1259 */ 1260 /** 1261 * Get the greatest common factor of two integers. 1262 * 1263 * @param { number } number1 - Is an integer. 1264 * @param { number } number2 - Is an integer. 1265 * @returns { number } Returns the greatest common factor of two integers, integer type. 1266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1267 * 1.Mandatory parameters are left unspecified; 1268 * 2.Incorrect parameter types. 1269 * @syscap SystemCapability.Utils.Lang 1270 * @crossplatform 1271 * @atomicservice 1272 * @since 12 1273 */ 1274 static getCommonFactor(number1: number, number2: number): number; 1275 1276 /** 1277 * Gets the denominator of the current object. 1278 * 1279 * @returns { number } Returns the denominator of the current object. 1280 * @syscap SystemCapability.Utils.Lang 1281 * @since 8 1282 */ 1283 /** 1284 * Gets the denominator of the current object. 1285 * 1286 * @returns { number } Returns the denominator of the current object. 1287 * @syscap SystemCapability.Utils.Lang 1288 * @crossplatform 1289 * @since 10 1290 */ 1291 /** 1292 * Gets the denominator of the current object. 1293 * 1294 * @returns { number } Returns the denominator of the current object. 1295 * @syscap SystemCapability.Utils.Lang 1296 * @crossplatform 1297 * @atomicservice 1298 * @since 12 1299 */ 1300 getDenominator(): number; 1301 1302 /** 1303 * Gets the numerator of the current object. 1304 * 1305 * @returns { number } Returns the numerator of the current object. 1306 * @syscap SystemCapability.Utils.Lang 1307 * @since 8 1308 */ 1309 /** 1310 * Gets the numerator of the current object. 1311 * 1312 * @returns { number } Returns the numerator of the current object. 1313 * @syscap SystemCapability.Utils.Lang 1314 * @crossplatform 1315 * @since 10 1316 */ 1317 /** 1318 * Gets the numerator of the current object. 1319 * 1320 * @returns { number } Returns the numerator of the current object. 1321 * @syscap SystemCapability.Utils.Lang 1322 * @crossplatform 1323 * @atomicservice 1324 * @since 12 1325 */ 1326 getNumerator(): number; 1327 1328 /** 1329 * Checks whether the current RationalNumber object represents an infinite value. 1330 * 1331 * @returns { boolean } If the denominator is not 0, true is returned. Otherwise, false is returned. 1332 * @syscap SystemCapability.Utils.Lang 1333 * @since 8 1334 */ 1335 /** 1336 * Checks whether the current RationalNumber object represents an infinite value. 1337 * 1338 * @returns { boolean } If the denominator is not 0, true is returned. Otherwise, false is returned. 1339 * @syscap SystemCapability.Utils.Lang 1340 * @crossplatform 1341 * @since 10 1342 */ 1343 /** 1344 * Checks whether the current RationalNumber object represents an infinite value. 1345 * 1346 * @returns { boolean } If the denominator is not 0, true is returned. Otherwise, false is returned. 1347 * @syscap SystemCapability.Utils.Lang 1348 * @crossplatform 1349 * @atomicservice 1350 * @since 12 1351 */ 1352 isFinite(): boolean; 1353 1354 /** 1355 * Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. 1356 * 1357 * @returns { boolean } If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. 1358 * @syscap SystemCapability.Utils.Lang 1359 * @since 8 1360 */ 1361 /** 1362 * Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. 1363 * 1364 * @returns { boolean } If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. 1365 * @syscap SystemCapability.Utils.Lang 1366 * @crossplatform 1367 * @since 10 1368 */ 1369 /** 1370 * Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. 1371 * 1372 * @returns { boolean } If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. 1373 * @syscap SystemCapability.Utils.Lang 1374 * @crossplatform 1375 * @atomicservice 1376 * @since 12 1377 */ 1378 isNaN(): boolean; 1379 1380 /** 1381 * Checks whether the current RationalNumber object represents the value 0. 1382 * 1383 * @returns { boolean } If the value represented by the current object is 0, true is returned. Otherwise, false is returned. 1384 * @syscap SystemCapability.Utils.Lang 1385 * @since 8 1386 */ 1387 /** 1388 * Checks whether the current RationalNumber object represents the value 0. 1389 * 1390 * @returns { boolean } If the value represented by the current object is 0, true is returned. Otherwise, false is returned. 1391 * @syscap SystemCapability.Utils.Lang 1392 * @crossplatform 1393 * @since 10 1394 */ 1395 /** 1396 * Checks whether the current RationalNumber object represents the value 0. 1397 * 1398 * @returns { boolean } If the value represented by the current object is 0, true is returned. Otherwise, false is returned. 1399 * @syscap SystemCapability.Utils.Lang 1400 * @crossplatform 1401 * @atomicservice 1402 * @since 12 1403 */ 1404 isZero(): boolean; 1405 1406 /** 1407 * Obtains a string representation of the current RationalNumber object. 1408 * 1409 * @returns { string } Returns a string representation of the current RationalNumber object. 1410 * @syscap SystemCapability.Utils.Lang 1411 * @since 8 1412 */ 1413 /** 1414 * Obtains a string representation of the current RationalNumber object. 1415 * 1416 * @returns { string } Returns a string representation of the current RationalNumber object. 1417 * @syscap SystemCapability.Utils.Lang 1418 * @crossplatform 1419 * @since 10 1420 */ 1421 /** 1422 * Obtains a string representation of the current RationalNumber object. 1423 * 1424 * @returns { string } Returns a string representation of the current RationalNumber object. 1425 * @syscap SystemCapability.Utils.Lang 1426 * @crossplatform 1427 * @atomicservice 1428 * @since 12 1429 */ 1430 toString(): string; 1431 } 1432 1433 /** 1434 * The LruBuffer algorithm replaces the least used data with new data when the buffer space is insufficient. 1435 * 1436 * @syscap SystemCapability.Utils.Lang 1437 * @since 8 1438 * @deprecated since 9 1439 * @useinstead ohos.util.LRUCache 1440 */ 1441 class LruBuffer<K, V> { 1442 /** 1443 * Default constructor used to create a new LruBuffer instance with the default capacity of 64. 1444 * 1445 * @param { number } capacity - Indicates the capacity to customize for the buffer. 1446 * @syscap SystemCapability.Utils.Lang 1447 * @since 8 1448 * @deprecated since 9 1449 * @useinstead ohos.util.LRUCache.constructor 1450 */ 1451 constructor(capacity?: number); 1452 1453 /** 1454 * Updates the buffer capacity to a specified capacity. 1455 * 1456 * @param { number } newCapacity - Indicates the new capacity to set. 1457 * @syscap SystemCapability.Utils.Lang 1458 * @since 8 1459 * @deprecated since 9 1460 * @useinstead ohos.util.LRUCache.updateCapacity 1461 */ 1462 updateCapacity(newCapacity: number): void; 1463 1464 /** 1465 * Returns a string representation of the object. 1466 * 1467 * @returns { string } Returns the string representation of the object and outputs the string representation of the object. 1468 * @syscap SystemCapability.Utils.Lang 1469 * @since 8 1470 * @deprecated since 9 1471 * @useinstead ohos.util.LRUCache.toString 1472 */ 1473 toString(): string; 1474 1475 /** 1476 * Obtains a list of all values in the current buffer. 1477 * 1478 * @syscap SystemCapability.Utils.Lang 1479 * @since 8 1480 * @deprecated since 9 1481 * @useinstead ohos.util.LRUCache.length 1482 */ 1483 length: number; 1484 1485 /** 1486 * Obtains the capacity of the current buffer. 1487 * 1488 * @returns { number } Returns the capacity of the current buffer. 1489 * @syscap SystemCapability.Utils.Lang 1490 * @since 8 1491 * @deprecated since 9 1492 * @useinstead ohos.util.LRUCache.getCapacity 1493 */ 1494 getCapacity(): number; 1495 1496 /** 1497 * Clears key-value pairs from the current buffer. 1498 * 1499 * @syscap SystemCapability.Utils.Lang 1500 * @since 8 1501 * @deprecated since 9 1502 * @useinstead ohos.util.LRUCache.clear 1503 */ 1504 clear(): void; 1505 1506 /** 1507 * Obtains the number of times createDefault(Object) returned a value. 1508 * 1509 * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. 1510 * @syscap SystemCapability.Utils.Lang 1511 * @since 8 1512 * @deprecated since 9 1513 * @useinstead ohos.util.LRUCache.getCreateCount 1514 */ 1515 getCreateCount(): number; 1516 1517 /** 1518 * Obtains the number of times that the queried values are not matched. 1519 * 1520 * @returns { number } Returns the number of times that the queried values are not matched. 1521 * @syscap SystemCapability.Utils.Lang 1522 * @since 8 1523 * @deprecated since 9 1524 * @useinstead ohos.util.LRUCache.getMissCount 1525 */ 1526 getMissCount(): number; 1527 1528 /** 1529 * Obtains the number of times that values are evicted from the buffer. 1530 * 1531 * @returns { number } Returns the number of times that values are evicted from the buffer. 1532 * @syscap SystemCapability.Utils.Lang 1533 * @since 8 1534 * @deprecated since 9 1535 * @useinstead ohos.util.LRUCache.getRemovalCount 1536 */ 1537 getRemovalCount(): number; 1538 1539 /** 1540 * Obtains the number of times that the queried values are successfully matched. 1541 * 1542 * @returns { number } Returns the number of times that the queried values are successfully matched. 1543 * @syscap SystemCapability.Utils.Lang 1544 * @since 8 1545 * @deprecated since 9 1546 * @useinstead ohos.util.LRUCache.getMatchCount 1547 */ 1548 getMatchCount(): number; 1549 1550 /** 1551 * Obtains the number of times that values are added to the buffer. 1552 * 1553 * @returns { number } Returns the number of times that values are added to the buffer. 1554 * @syscap SystemCapability.Utils.Lang 1555 * @since 8 1556 * @deprecated since 9 1557 * @useinstead ohos.util.LRUCache.getPutCount 1558 */ 1559 getPutCount(): number; 1560 1561 /** 1562 * Checks whether the current buffer is empty. 1563 * 1564 * @returns { boolean } Returns true if the current buffer contains no value. 1565 * @syscap SystemCapability.Utils.Lang 1566 * @since 8 1567 * @deprecated since 9 1568 * @useinstead ohos.util.LRUCache.isEmpty 1569 */ 1570 isEmpty(): boolean; 1571 1572 /** 1573 * Obtains the value associated with a specified key. 1574 * 1575 * @param { K } key - Indicates the key to query. 1576 * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. 1577 * @syscap SystemCapability.Utils.Lang 1578 * @since 8 1579 * @deprecated since 9 1580 * @useinstead ohos.util.LRUCache.get 1581 */ 1582 get(key: K): V | undefined; 1583 1584 /** 1585 * Adds a key-value pair to the buffer. 1586 * 1587 * @param { K } key - Indicates the key to add. 1588 * @param { V } value - Indicates the value associated with the key to add. 1589 * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. 1590 * @syscap SystemCapability.Utils.Lang 1591 * @since 8 1592 * @deprecated since 9 1593 * @useinstead ohos.util.LRUCache.put 1594 */ 1595 put(key: K, value: V): V; 1596 1597 /** 1598 * Obtains a list of all values in the current buffer. 1599 * 1600 * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. 1601 * @syscap SystemCapability.Utils.Lang 1602 * @since 8 1603 * @deprecated since 9 1604 * @useinstead ohos.util.LRUCache.values 1605 */ 1606 values(): V[]; 1607 1608 /** 1609 * Obtains a list of keys for the values in the current buffer. 1610 * 1611 * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. 1612 * @syscap SystemCapability.Utils.Lang 1613 * @since 8 1614 * @deprecated since 9 1615 * @useinstead ohos.util.LRUCache.keys 1616 */ 1617 keys(): K[]; 1618 1619 /** 1620 * Deletes a specified key and its associated value from the current buffer. 1621 * 1622 * @param { K } key - Indicates the key to delete. 1623 * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. 1624 * @syscap SystemCapability.Utils.Lang 1625 * @since 8 1626 * @deprecated since 9 1627 * @useinstead ohos.util.LRUCache.remove 1628 */ 1629 remove(key: K): V | undefined; 1630 1631 /** 1632 * Executes subsequent operations after a value is deleted. 1633 * 1634 * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, 1635 * and the parameter value is false in other cases. 1636 * @param { K } key - Indicates the deleted key. 1637 * @param { V } value - Indicates the deleted value. 1638 * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) 1639 * method is called and the key to add already exists. The parameter value is null in other cases. 1640 * @syscap SystemCapability.Utils.Lang 1641 * @since 8 1642 * @deprecated since 9 1643 * @useinstead ohos.util.LRUCache.afterRemoval 1644 */ 1645 afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; 1646 1647 /** 1648 * Checks whether the current buffer contains a specified key. 1649 * 1650 * @param { K } key - Indicates the key to check. 1651 * @returns { boolean } Returns true if the buffer contains the specified key. 1652 * @syscap SystemCapability.Utils.Lang 1653 * @since 8 1654 * @deprecated since 9 1655 * @useinstead ohos.util.LRUCache.contains 1656 */ 1657 contains(key: K): boolean; 1658 1659 /** 1660 * Called after a cache miss to compute a value for the corresponding key. 1661 * 1662 * @param { K } key - Indicates the missed key. 1663 * @returns { V } Returns the value associated with the key. 1664 * @syscap SystemCapability.Utils.Lang 1665 * @since 8 1666 * @deprecated since 9 1667 * @useinstead ohos.util.LRUCache.createDefault 1668 */ 1669 createDefault(key: K): V; 1670 1671 /** 1672 * Returns an array of key-value pairs of enumeratable properties of a given object. 1673 * 1674 * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. 1675 * @syscap SystemCapability.Utils.Lang 1676 * @since 8 1677 * @deprecated since 9 1678 * @useinstead ohos.util.LRUCache.entries 1679 */ 1680 entries(): IterableIterator<[K, V]>; 1681 1682 /** 1683 * Specifies the default iterator for an object. 1684 * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. 1685 * @syscap SystemCapability.Utils.Lang 1686 * @since 8 1687 * @deprecated since 9 1688 * @useinstead ohos.util.LRUCache.[Symbol.iterator] 1689 */ 1690 [Symbol.iterator](): IterableIterator<[K, V]>; 1691 } 1692 1693 /** 1694 * The LRUCache algorithm replaces the least used data with new data when the buffer space is insufficient. 1695 * 1696 * @syscap SystemCapability.Utils.Lang 1697 * @since 9 1698 */ 1699 /** 1700 * The LRUCache algorithm replaces the least used data with new data when the buffer space is insufficient. 1701 * 1702 * @syscap SystemCapability.Utils.Lang 1703 * @crossplatform 1704 * @since 10 1705 */ 1706 /** 1707 * The LRUCache algorithm replaces the least used data with new data when the buffer space is insufficient. 1708 * 1709 * @syscap SystemCapability.Utils.Lang 1710 * @crossplatform 1711 * @atomicservice 1712 * @since 12 1713 */ 1714 class LRUCache<K, V> { 1715 /** 1716 * Default constructor used to create a new LruBuffer instance with the default capacity of 64. 1717 * 1718 * @param { number } [capacity] - Indicates the capacity to customize for the buffer. 1719 * @syscap SystemCapability.Utils.Lang 1720 * @since 9 1721 */ 1722 /** 1723 * Default constructor used to create a new LruBuffer instance with the default capacity of 64. 1724 * 1725 * @param { number } [capacity] - Indicates the capacity to customize for the buffer. 1726 * @syscap SystemCapability.Utils.Lang 1727 * @crossplatform 1728 * @since 10 1729 */ 1730 /** 1731 * Default constructor used to create a new LruBuffer instance with the default capacity of 64. 1732 * 1733 * @param { number } [capacity] - Indicates the capacity to customize for the buffer. 1734 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. 1735 * @syscap SystemCapability.Utils.Lang 1736 * @crossplatform 1737 * @atomicservice 1738 * @since 12 1739 */ 1740 constructor(capacity?: number); 1741 1742 /** 1743 * Updates the buffer capacity to a specified capacity. 1744 * 1745 * @param { number } newCapacity - Indicates the new capacity to set. 1746 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 1747 * @syscap SystemCapability.Utils.Lang 1748 * @since 9 1749 */ 1750 /** 1751 * Updates the buffer capacity to a specified capacity. 1752 * 1753 * @param { number } newCapacity - Indicates the new capacity to set. 1754 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 1755 * @syscap SystemCapability.Utils.Lang 1756 * @crossplatform 1757 * @since 10 1758 */ 1759 /** 1760 * Updates the buffer capacity to a specified capacity. 1761 * 1762 * @param { number } newCapacity - Indicates the new capacity to set. 1763 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 1764 * @syscap SystemCapability.Utils.Lang 1765 * @crossplatform 1766 * @atomicservice 1767 * @since 12 1768 */ 1769 updateCapacity(newCapacity: number): void; 1770 1771 /** 1772 * Returns a string representation of the object. 1773 * 1774 * @returns { string } Returns the string representation of the object and outputs the string representation of the object. 1775 * @syscap SystemCapability.Utils.Lang 1776 * @since 9 1777 */ 1778 /** 1779 * Returns a string representation of the object. 1780 * 1781 * @returns { string } Returns the string representation of the object and outputs the string representation of the object. 1782 * @syscap SystemCapability.Utils.Lang 1783 * @crossplatform 1784 * @since 10 1785 */ 1786 /** 1787 * Returns a string representation of the object. 1788 * 1789 * @returns { string } Returns the string representation of the object and outputs the string representation of the object. 1790 * @syscap SystemCapability.Utils.Lang 1791 * @crossplatform 1792 * @atomicservice 1793 * @since 12 1794 */ 1795 toString(): string; 1796 1797 /** 1798 * Obtains a list of all values in the current buffer. 1799 * 1800 * @syscap SystemCapability.Utils.Lang 1801 * @since 9 1802 */ 1803 /** 1804 * Obtains a list of all values in the current buffer. 1805 * 1806 * @syscap SystemCapability.Utils.Lang 1807 * @crossplatform 1808 * @since 10 1809 */ 1810 /** 1811 * Obtains a list of all values in the current buffer. 1812 * 1813 * @syscap SystemCapability.Utils.Lang 1814 * @crossplatform 1815 * @atomicservice 1816 * @since 12 1817 */ 1818 length: number; 1819 1820 /** 1821 * Obtains the capacity of the current buffer. 1822 * 1823 * @returns { number } Returns the capacity of the current buffer. 1824 * @syscap SystemCapability.Utils.Lang 1825 * @since 9 1826 */ 1827 /** 1828 * Obtains the capacity of the current buffer. 1829 * 1830 * @returns { number } Returns the capacity of the current buffer. 1831 * @syscap SystemCapability.Utils.Lang 1832 * @crossplatform 1833 * @since 10 1834 */ 1835 /** 1836 * Obtains the capacity of the current buffer. 1837 * 1838 * @returns { number } Returns the capacity of the current buffer. 1839 * @syscap SystemCapability.Utils.Lang 1840 * @crossplatform 1841 * @atomicservice 1842 * @since 12 1843 */ 1844 getCapacity(): number; 1845 1846 /** 1847 * Clears key-value pairs from the current buffer. 1848 * 1849 * @syscap SystemCapability.Utils.Lang 1850 * @since 9 1851 */ 1852 /** 1853 * Clears key-value pairs from the current buffer. 1854 * 1855 * @syscap SystemCapability.Utils.Lang 1856 * @crossplatform 1857 * @since 10 1858 */ 1859 /** 1860 * Clears key-value pairs from the current buffer. 1861 * 1862 * @syscap SystemCapability.Utils.Lang 1863 * @crossplatform 1864 * @atomicservice 1865 * @since 12 1866 */ 1867 clear(): void; 1868 1869 /** 1870 * Obtains the number of times createDefault(Object) returned a value. 1871 * 1872 * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. 1873 * @syscap SystemCapability.Utils.Lang 1874 * @since 9 1875 */ 1876 /** 1877 * Obtains the number of times createDefault(Object) returned a value. 1878 * 1879 * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. 1880 * @syscap SystemCapability.Utils.Lang 1881 * @crossplatform 1882 * @since 10 1883 */ 1884 /** 1885 * Obtains the number of times createDefault(Object) returned a value. 1886 * 1887 * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. 1888 * @syscap SystemCapability.Utils.Lang 1889 * @crossplatform 1890 * @atomicservice 1891 * @since 12 1892 */ 1893 getCreateCount(): number; 1894 1895 /** 1896 * Obtains the number of times that the queried values are not matched. 1897 * 1898 * @returns { number } Returns the number of times that the queried values are not matched. 1899 * @syscap SystemCapability.Utils.Lang 1900 * @since 9 1901 */ 1902 /** 1903 * Obtains the number of times that the queried values are not matched. 1904 * 1905 * @returns { number } Returns the number of times that the queried values are not matched. 1906 * @syscap SystemCapability.Utils.Lang 1907 * @crossplatform 1908 * @since 10 1909 */ 1910 /** 1911 * Obtains the number of times that the queried values are not matched. 1912 * 1913 * @returns { number } Returns the number of times that the queried values are not matched. 1914 * @syscap SystemCapability.Utils.Lang 1915 * @crossplatform 1916 * @atomicservice 1917 * @since 12 1918 */ 1919 getMissCount(): number; 1920 1921 /** 1922 * Obtains the number of times that values are evicted from the buffer. 1923 * 1924 * @returns { number } Returns the number of times that values are evicted from the buffer. 1925 * @syscap SystemCapability.Utils.Lang 1926 * @since 9 1927 */ 1928 /** 1929 * Obtains the number of times that values are evicted from the buffer. 1930 * 1931 * @returns { number } Returns the number of times that values are evicted from the buffer. 1932 * @syscap SystemCapability.Utils.Lang 1933 * @crossplatform 1934 * @since 10 1935 */ 1936 /** 1937 * Obtains the number of times that values are evicted from the buffer. 1938 * 1939 * @returns { number } Returns the number of times that values are evicted from the buffer. 1940 * @syscap SystemCapability.Utils.Lang 1941 * @crossplatform 1942 * @atomicservice 1943 * @since 12 1944 */ 1945 getRemovalCount(): number; 1946 1947 /** 1948 * Obtains the number of times that the queried values are successfully matched. 1949 * 1950 * @returns { number } Returns the number of times that the queried values are successfully matched. 1951 * @syscap SystemCapability.Utils.Lang 1952 * @since 9 1953 */ 1954 /** 1955 * Obtains the number of times that the queried values are successfully matched. 1956 * 1957 * @returns { number } Returns the number of times that the queried values are successfully matched. 1958 * @syscap SystemCapability.Utils.Lang 1959 * @crossplatform 1960 * @since 10 1961 */ 1962 /** 1963 * Obtains the number of times that the queried values are successfully matched. 1964 * 1965 * @returns { number } Returns the number of times that the queried values are successfully matched. 1966 * @syscap SystemCapability.Utils.Lang 1967 * @crossplatform 1968 * @atomicservice 1969 * @since 12 1970 */ 1971 getMatchCount(): number; 1972 1973 /** 1974 * Obtains the number of times that values are added to the buffer. 1975 * 1976 * @returns { number } Returns the number of times that values are added to the buffer. 1977 * @syscap SystemCapability.Utils.Lang 1978 * @since 9 1979 */ 1980 /** 1981 * Obtains the number of times that values are added to the buffer. 1982 * 1983 * @returns { number } Returns the number of times that values are added to the buffer. 1984 * @syscap SystemCapability.Utils.Lang 1985 * @crossplatform 1986 * @since 10 1987 */ 1988 /** 1989 * Obtains the number of times that values are added to the buffer. 1990 * 1991 * @returns { number } Returns the number of times that values are added to the buffer. 1992 * @syscap SystemCapability.Utils.Lang 1993 * @crossplatform 1994 * @atomicservice 1995 * @since 12 1996 */ 1997 getPutCount(): number; 1998 1999 /** 2000 * Checks whether the current buffer is empty. 2001 * 2002 * @returns { boolean } Returns true if the current buffer contains no value. 2003 * @syscap SystemCapability.Utils.Lang 2004 * @since 9 2005 */ 2006 /** 2007 * Checks whether the current buffer is empty. 2008 * 2009 * @returns { boolean } Returns true if the current buffer contains no value. 2010 * @syscap SystemCapability.Utils.Lang 2011 * @crossplatform 2012 * @since 10 2013 */ 2014 /** 2015 * Checks whether the current buffer is empty. 2016 * 2017 * @returns { boolean } Returns true if the current buffer contains no value. 2018 * @syscap SystemCapability.Utils.Lang 2019 * @crossplatform 2020 * @atomicservice 2021 * @since 12 2022 */ 2023 isEmpty(): boolean; 2024 2025 /** 2026 * Obtains the value associated with a specified key. 2027 * 2028 * @param { K } key - Indicates the key to query. 2029 * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. 2030 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2031 * 1.Mandatory parameters are left unspecified; 2032 * 2.Incorrect parameter types. 2033 * @syscap SystemCapability.Utils.Lang 2034 * @since 9 2035 */ 2036 /** 2037 * Obtains the value associated with a specified key. 2038 * 2039 * @param { K } key - Indicates the key to query. 2040 * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. 2041 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2042 * 1.Mandatory parameters are left unspecified; 2043 * 2.Incorrect parameter types. 2044 * @syscap SystemCapability.Utils.Lang 2045 * @crossplatform 2046 * @since 10 2047 */ 2048 /** 2049 * Obtains the value associated with a specified key. 2050 * 2051 * @param { K } key - Indicates the key to query. 2052 * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. 2053 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2054 * 1.Mandatory parameters are left unspecified; 2055 * 2.Incorrect parameter types. 2056 * @syscap SystemCapability.Utils.Lang 2057 * @crossplatform 2058 * @atomicservice 2059 * @since 12 2060 */ 2061 get(key: K): V | undefined; 2062 2063 /** 2064 * Adds a key-value pair to the buffer. 2065 * 2066 * @param { K } key - Indicates the key to add. 2067 * @param { V } value - Indicates the value associated with the key to add. 2068 * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. 2069 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2070 * 1.Mandatory parameters are left unspecified; 2071 * 2.Incorrect parameter types. 2072 * @syscap SystemCapability.Utils.Lang 2073 * @since 9 2074 */ 2075 /** 2076 * Adds a key-value pair to the buffer. 2077 * 2078 * @param { K } key - Indicates the key to add. 2079 * @param { V } value - Indicates the value associated with the key to add. 2080 * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. 2081 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2082 * 1.Mandatory parameters are left unspecified; 2083 * 2.Incorrect parameter types. 2084 * @syscap SystemCapability.Utils.Lang 2085 * @crossplatform 2086 * @since 10 2087 */ 2088 /** 2089 * Adds a key-value pair to the buffer. 2090 * 2091 * @param { K } key - Indicates the key to add. 2092 * @param { V } value - Indicates the value associated with the key to add. 2093 * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. 2094 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2095 * 1.Mandatory parameters are left unspecified; 2096 * 2.Incorrect parameter types. 2097 * @syscap SystemCapability.Utils.Lang 2098 * @crossplatform 2099 * @atomicservice 2100 * @since 12 2101 */ 2102 put(key: K, value: V): V; 2103 2104 /** 2105 * Obtains a list of all values in the current buffer. 2106 * 2107 * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. 2108 * @syscap SystemCapability.Utils.Lang 2109 * @since 9 2110 */ 2111 /** 2112 * Obtains a list of all values in the current buffer. 2113 * 2114 * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. 2115 * @syscap SystemCapability.Utils.Lang 2116 * @crossplatform 2117 * @since 10 2118 */ 2119 /** 2120 * Obtains a list of all values in the current buffer. 2121 * 2122 * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. 2123 * @syscap SystemCapability.Utils.Lang 2124 * @crossplatform 2125 * @atomicservice 2126 * @since 12 2127 */ 2128 values(): V[]; 2129 2130 /** 2131 * Obtains a list of keys for the values in the current buffer. 2132 * since 9 2133 * 2134 * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. 2135 * @syscap SystemCapability.Utils.Lang 2136 * @since 9 2137 */ 2138 /** 2139 * Obtains a list of keys for the values in the current buffer. 2140 * since 9 2141 * 2142 * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. 2143 * @syscap SystemCapability.Utils.Lang 2144 * @crossplatform 2145 * @since 10 2146 */ 2147 /** 2148 * Obtains a list of keys for the values in the current buffer. 2149 * since 9 2150 * 2151 * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. 2152 * @syscap SystemCapability.Utils.Lang 2153 * @crossplatform 2154 * @atomicservice 2155 * @since 12 2156 */ 2157 keys(): K[]; 2158 2159 /** 2160 * Deletes a specified key and its associated value from the current buffer. 2161 * 2162 * @param { K } key - Indicates the key to delete. 2163 * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. 2164 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2165 * 1.Mandatory parameters are left unspecified; 2166 * 2.Incorrect parameter types. 2167 * @syscap SystemCapability.Utils.Lang 2168 * @since 9 2169 */ 2170 /** 2171 * Deletes a specified key and its associated value from the current buffer. 2172 * 2173 * @param { K } key - Indicates the key to delete. 2174 * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. 2175 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2176 * 1.Mandatory parameters are left unspecified; 2177 * 2.Incorrect parameter types. 2178 * @syscap SystemCapability.Utils.Lang 2179 * @crossplatform 2180 * @since 10 2181 */ 2182 /** 2183 * Deletes a specified key and its associated value from the current buffer. 2184 * 2185 * @param { K } key - Indicates the key to delete. 2186 * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. 2187 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2188 * 1.Mandatory parameters are left unspecified; 2189 * 2.Incorrect parameter types. 2190 * @syscap SystemCapability.Utils.Lang 2191 * @crossplatform 2192 * @atomicservice 2193 * @since 12 2194 */ 2195 remove(key: K): V | undefined; 2196 2197 /** 2198 * Executes subsequent operations after a value is deleted. 2199 * 2200 * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, 2201 * and the parameter value is false in other cases. 2202 * @param { K } key - Indicates the deleted key. 2203 * @param { V } value - Indicates the deleted value. 2204 * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) 2205 * method is called and the key to add already exists. The parameter value is null in other cases. 2206 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2207 * 1.Mandatory parameters are left unspecified; 2208 * 2.Incorrect parameter types. 2209 * @syscap SystemCapability.Utils.Lang 2210 * @since 9 2211 */ 2212 /** 2213 * Executes subsequent operations after a value is deleted. 2214 * 2215 * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, 2216 * and the parameter value is false in other cases. 2217 * @param { K } key - Indicates the deleted key. 2218 * @param { V } value - Indicates the deleted value. 2219 * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) 2220 * method is called and the key to add already exists. The parameter value is null in other cases. 2221 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2222 * 1.Mandatory parameters are left unspecified; 2223 * 2.Incorrect parameter types. 2224 * @syscap SystemCapability.Utils.Lang 2225 * @crossplatform 2226 * @since 10 2227 */ 2228 /** 2229 * Executes subsequent operations after a value is deleted. 2230 * 2231 * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, 2232 * and the parameter value is false in other cases. 2233 * @param { K } key - Indicates the deleted key. 2234 * @param { V } value - Indicates the deleted value. 2235 * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) 2236 * method is called and the key to add already exists. The parameter value is null in other cases. 2237 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2238 * 1.Mandatory parameters are left unspecified; 2239 * 2.Incorrect parameter types. 2240 * @syscap SystemCapability.Utils.Lang 2241 * @crossplatform 2242 * @atomicservice 2243 * @since 12 2244 */ 2245 afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; 2246 2247 /** 2248 * Checks whether the current buffer contains a specified key. 2249 * 2250 * @param { K } key - Indicates the key to check. 2251 * @returns { boolean } Returns true if the buffer contains the specified key. 2252 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2253 * 1.Mandatory parameters are left unspecified; 2254 * 2.Incorrect parameter types. 2255 * @syscap SystemCapability.Utils.Lang 2256 * @since 9 2257 */ 2258 /** 2259 * Checks whether the current buffer contains a specified key. 2260 * 2261 * @param { K } key - Indicates the key to check. 2262 * @returns { boolean } Returns true if the buffer contains the specified key. 2263 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2264 * 1.Mandatory parameters are left unspecified; 2265 * 2.Incorrect parameter types. 2266 * @syscap SystemCapability.Utils.Lang 2267 * @crossplatform 2268 * @since 10 2269 */ 2270 /** 2271 * Checks whether the current buffer contains a specified key. 2272 * 2273 * @param { K } key - Indicates the key to check. 2274 * @returns { boolean } Returns true if the buffer contains the specified key. 2275 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2276 * 1.Mandatory parameters are left unspecified; 2277 * 2.Incorrect parameter types. 2278 * @syscap SystemCapability.Utils.Lang 2279 * @crossplatform 2280 * @atomicservice 2281 * @since 12 2282 */ 2283 contains(key: K): boolean; 2284 2285 /** 2286 * Executes subsequent operations if miss to compute a value for the specific key. 2287 * 2288 * @param { K } key - Indicates the missed key. 2289 * @returns { V } Returns the value associated with the key. 2290 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2291 * 1.Mandatory parameters are left unspecified; 2292 * 2.Incorrect parameter types. 2293 * @syscap SystemCapability.Utils.Lang 2294 * @since 9 2295 */ 2296 /** 2297 * Executes subsequent operations if miss to compute a value for the specific key. 2298 * 2299 * @param { K } key - Indicates the missed key. 2300 * @returns { V } Returns the value associated with the key. 2301 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2302 * 1.Mandatory parameters are left unspecified; 2303 * 2.Incorrect parameter types. 2304 * @syscap SystemCapability.Utils.Lang 2305 * @crossplatform 2306 * @since 10 2307 */ 2308 /** 2309 * Executes subsequent operations if miss to compute a value for the specific key. 2310 * 2311 * @param { K } key - Indicates the missed key. 2312 * @returns { V } Returns the value associated with the key. 2313 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2314 * 1.Mandatory parameters are left unspecified; 2315 * 2.Incorrect parameter types. 2316 * @syscap SystemCapability.Utils.Lang 2317 * @crossplatform 2318 * @atomicservice 2319 * @since 12 2320 */ 2321 createDefault(key: K): V; 2322 2323 /** 2324 * Returns an array of key-value pairs of enumeratable properties of a given object. 2325 * 2326 * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. 2327 * @syscap SystemCapability.Utils.Lang 2328 * @since 9 2329 */ 2330 /** 2331 * Returns an array of key-value pairs of enumeratable properties of a given object. 2332 * 2333 * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. 2334 * @syscap SystemCapability.Utils.Lang 2335 * @crossplatform 2336 * @since 10 2337 */ 2338 /** 2339 * Returns an array of key-value pairs of enumeratable properties of a given object. 2340 * 2341 * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. 2342 * @syscap SystemCapability.Utils.Lang 2343 * @crossplatform 2344 * @atomicservice 2345 * @since 12 2346 */ 2347 entries(): IterableIterator<[K, V]>; 2348 2349 /** 2350 * Specifies the default iterator for an object. 2351 * 2352 * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. 2353 * @syscap SystemCapability.Utils.Lang 2354 * @since 9 2355 */ 2356 /** 2357 * Specifies the default iterator for an object. 2358 * 2359 * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. 2360 * @syscap SystemCapability.Utils.Lang 2361 * @crossplatform 2362 * @since 10 2363 */ 2364 /** 2365 * Specifies the default iterator for an object. 2366 * 2367 * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. 2368 * @syscap SystemCapability.Utils.Lang 2369 * @crossplatform 2370 * @atomicservice 2371 * @since 12 2372 */ 2373 [Symbol.iterator](): IterableIterator<[K, V]>; 2374 } 2375 2376 /** 2377 * The ScopeComparable contains comparison methods. 2378 * 2379 * @interface ScopeComparable 2380 * @syscap SystemCapability.Utils.Lang 2381 * @since 7 2382 */ 2383 /** 2384 * The ScopeComparable contains comparison methods. 2385 * 2386 * @interface ScopeComparable 2387 * @syscap SystemCapability.Utils.Lang 2388 * @crossplatform 2389 * @since 10 2390 */ 2391 /** 2392 * The ScopeComparable contains comparison methods. 2393 * 2394 * @interface ScopeComparable 2395 * @syscap SystemCapability.Utils.Lang 2396 * @crossplatform 2397 * @atomicservice 2398 * @since 12 2399 */ 2400 interface ScopeComparable { 2401 /** 2402 * The comparison function is used by the scope. 2403 * 2404 * @param { ScopeComparable } other - Other 2405 * @returns { boolean } Returns whether the current object is greater than or equal to the input object. 2406 * @syscap SystemCapability.Utils.Lang 2407 * @since 8 2408 */ 2409 /** 2410 * The comparison function is used by the scope. 2411 * 2412 * @param { ScopeComparable } other - Other 2413 * @returns { boolean } Returns whether the current object is greater than or equal to the input object. 2414 * @syscap SystemCapability.Utils.Lang 2415 * @crossplatform 2416 * @since 10 2417 */ 2418 /** 2419 * The comparison function is used by the scope. 2420 * 2421 * @param { ScopeComparable } other - Other 2422 * @returns { boolean } Returns whether the current object is greater than or equal to the input object. 2423 * @syscap SystemCapability.Utils.Lang 2424 * @crossplatform 2425 * @atomicservice 2426 * @since 12 2427 */ 2428 compareTo(other: ScopeComparable): boolean; 2429 } 2430 2431 /** 2432 * A type used to denote ScopeComparable or number. 2433 * 2434 * @syscap SystemCapability.Utils.Lang 2435 * @since 8 2436 */ 2437 /** 2438 * A type used to denote ScopeComparable or number. 2439 * 2440 * @syscap SystemCapability.Utils.Lang 2441 * @crossplatform 2442 * @since 10 2443 */ 2444 /** 2445 * A type used to denote ScopeComparable or number. 2446 * 2447 * @typedef { ScopeComparable | number } 2448 * @syscap SystemCapability.Utils.Lang 2449 * @crossplatform 2450 * @atomicservice 2451 * @since 12 2452 */ 2453 type ScopeType = ScopeComparable | number; 2454 2455 /** 2456 * The Scope interface is used to describe the valid range of a field. 2457 * 2458 * @syscap SystemCapability.Utils.Lang 2459 * @since 8 2460 * @deprecated since 9 2461 * @useinstead ohos.util.ScopeHelper 2462 */ 2463 class Scope { 2464 /** 2465 * A constructor used to create a Scope instance with the lower and upper bounds specified. 2466 * 2467 * @param { ScopeType } lowerObj - A ScopeType value 2468 * @param { ScopeType } upperObj - A ScopeType value 2469 * @syscap SystemCapability.Utils.Lang 2470 * @since 8 2471 * @deprecated since 9 2472 * @useinstead ohos.util.ScopeHelper.constructor 2473 */ 2474 constructor(lowerObj: ScopeType, upperObj: ScopeType); 2475 2476 /** 2477 * Obtains a string representation of the current range. 2478 * 2479 * @returns { string } Returns a string representation of the current range object. 2480 * @syscap SystemCapability.Utils.Lang 2481 * @since 8 2482 * @deprecated since 9 2483 * @useinstead ohos.util.ScopeHelper.toString 2484 */ 2485 toString(): string; 2486 2487 /** 2488 * Returns the intersection of a given range and the current range. 2489 * 2490 * @param { Scope } range - A Scope range object 2491 * @returns { Scope } Returns the intersection of a given range and the current range. 2492 * @syscap SystemCapability.Utils.Lang 2493 * @since 8 2494 * @deprecated since 9 2495 * @useinstead ohos.util.ScopeHelper.intersect 2496 */ 2497 intersect(range: Scope): Scope; 2498 2499 /** 2500 * Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2501 * 2502 * @param { ScopeType } lowerObj - A ScopeType value 2503 * @param { ScopeType } upperObj - A ScopeType value 2504 * @returns { Scope } Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2505 * @syscap SystemCapability.Utils.Lang 2506 * @since 8 2507 * @deprecated since 9 2508 * @useinstead ohos.util.ScopeHelper.intersect 2509 */ 2510 intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope; 2511 2512 /** 2513 * Obtains the upper bound of the current range. 2514 * 2515 * @returns { ScopeType } Returns the upper bound of the current range. 2516 * @syscap SystemCapability.Utils.Lang 2517 * @since 8 2518 * @deprecated since 9 2519 * @useinstead ohos.util.ScopeHelper.getUpper 2520 */ 2521 getUpper(): ScopeType; 2522 2523 /** 2524 * Obtains the lower bound of the current range. 2525 * 2526 * @returns { ScopeType } Returns the lower bound of the current range. 2527 * @syscap SystemCapability.Utils.Lang 2528 * @since 8 2529 * @deprecated since 9 2530 * @useinstead ohos.util.ScopeHelper.getLower 2531 */ 2532 getLower(): ScopeType; 2533 2534 /** 2535 * Creates the smallest range that includes the current range and the given lower and upper bounds. 2536 * 2537 * @param { ScopeType } lowerObj - A ScopeType value 2538 * @param { ScopeType } upperObj - A ScopeType value 2539 * @returns { Scope } Returns the smallest range that includes the current range and the given lower and upper bounds. 2540 * @syscap SystemCapability.Utils.Lang 2541 * @since 8 2542 * @deprecated since 9 2543 * @useinstead ohos.util.ScopeHelper.expand 2544 */ 2545 expand(lowerObj: ScopeType, upperObj: ScopeType): Scope; 2546 2547 /** 2548 * Creates the smallest range that includes the current range and a given range. 2549 * 2550 * @param { Scope } range - A Scope range object 2551 * @returns { Scope } Returns the smallest range that includes the current range and a given range. 2552 * @syscap SystemCapability.Utils.Lang 2553 * @since 8 2554 * @deprecated since 9 2555 * @useinstead ohos.util.ScopeHelper.expand 2556 */ 2557 expand(range: Scope): Scope; 2558 2559 /** 2560 * Creates the smallest range that includes the current range and a given value. 2561 * 2562 * @param { ScopeType } value - A ScopeType value 2563 * @returns { Scope } Returns the smallest range that includes the current range and a given value. 2564 * @syscap SystemCapability.Utils.Lang 2565 * @since 8 2566 * @deprecated since 9 2567 * @useinstead ohos.util.ScopeHelper.expand 2568 */ 2569 expand(value: ScopeType): Scope; 2570 2571 /** 2572 * Checks whether a given value is within the current range. 2573 * 2574 * @param { ScopeType } value - A ScopeType value 2575 * @returns { boolean } If the value is within the current range return true,otherwise return false. 2576 * @syscap SystemCapability.Utils.Lang 2577 * @since 8 2578 * @deprecated since 9 2579 * @useinstead ohos.util.ScopeHelper.contains 2580 */ 2581 contains(value: ScopeType): boolean; 2582 2583 /** 2584 * Checks whether a given range is within the current range. 2585 * 2586 * @param { Scope } range - A Scope range 2587 * @returns { boolean } If the current range is within the given range return true,otherwise return false. 2588 * @syscap SystemCapability.Utils.Lang 2589 * @since 8 2590 * @deprecated since 9 2591 * @useinstead ohos.util.ScopeHelper.contains 2592 */ 2593 contains(range: Scope): boolean; 2594 2595 /** 2596 * Clamps a given value to the current range. 2597 * 2598 * @param { ScopeType } value - A ScopeType value 2599 * @returns { ScopeType } Returns a ScopeType object that a given value is clamped to the current range.. 2600 * @syscap SystemCapability.Utils.Lang 2601 * @since 8 2602 * @deprecated since 9 2603 * @useinstead ohos.util.ScopeHelper.clamp 2604 */ 2605 clamp(value: ScopeType): ScopeType; 2606 } 2607 2608 /** 2609 * The ScopeHelper interface is used to describe the valid range of a field. 2610 * 2611 * @syscap SystemCapability.Utils.Lang 2612 * @since 9 2613 */ 2614 /** 2615 * The ScopeHelper interface is used to describe the valid range of a field. 2616 * 2617 * @syscap SystemCapability.Utils.Lang 2618 * @crossplatform 2619 * @since 10 2620 */ 2621 /** 2622 * The ScopeHelper interface is used to describe the valid range of a field. 2623 * 2624 * @syscap SystemCapability.Utils.Lang 2625 * @crossplatform 2626 * @atomicservice 2627 * @since 12 2628 */ 2629 class ScopeHelper { 2630 /** 2631 * A constructor used to create a Scope instance with the lower and upper bounds specified. 2632 * 2633 * @param { ScopeType } lowerObj - A ScopeType value 2634 * @param { ScopeType } upperObj - A ScopeType value 2635 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2636 * 1.Mandatory parameters are left unspecified; 2637 * 2.Incorrect parameter types. 2638 * @syscap SystemCapability.Utils.Lang 2639 * @since 9 2640 */ 2641 /** 2642 * A constructor used to create a Scope instance with the lower and upper bounds specified. 2643 * 2644 * @param { ScopeType } lowerObj - A ScopeType value 2645 * @param { ScopeType } upperObj - A ScopeType value 2646 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2647 * 1.Mandatory parameters are left unspecified; 2648 * 2.Incorrect parameter types. 2649 * @syscap SystemCapability.Utils.Lang 2650 * @crossplatform 2651 * @since 10 2652 */ 2653 /** 2654 * A constructor used to create a Scope instance with the lower and upper bounds specified. 2655 * 2656 * @param { ScopeType } lowerObj - A ScopeType value 2657 * @param { ScopeType } upperObj - A ScopeType value 2658 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2659 * 1.Mandatory parameters are left unspecified; 2660 * 2.Incorrect parameter types. 2661 * @syscap SystemCapability.Utils.Lang 2662 * @crossplatform 2663 * @atomicservice 2664 * @since 12 2665 */ 2666 constructor(lowerObj: ScopeType, upperObj: ScopeType); 2667 2668 /** 2669 * Obtains a string representation of the current range. 2670 * 2671 * @returns { string } Returns a string representation of the current range object. 2672 * @syscap SystemCapability.Utils.Lang 2673 * @since 9 2674 */ 2675 /** 2676 * Obtains a string representation of the current range. 2677 * 2678 * @returns { string } Returns a string representation of the current range object. 2679 * @syscap SystemCapability.Utils.Lang 2680 * @crossplatform 2681 * @since 10 2682 */ 2683 /** 2684 * Obtains a string representation of the current range. 2685 * 2686 * @returns { string } Returns a string representation of the current range object. 2687 * @syscap SystemCapability.Utils.Lang 2688 * @crossplatform 2689 * @atomicservice 2690 * @since 12 2691 */ 2692 toString(): string; 2693 2694 /** 2695 * Returns the intersection of a given range and the current range. 2696 * 2697 * @param { ScopeHelper } range - A Scope range object 2698 * @returns { ScopeHelper } Returns the intersection of a given range and the current range. 2699 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2700 * 1.Mandatory parameters are left unspecified; 2701 * 2.Incorrect parameter types. 2702 * @syscap SystemCapability.Utils.Lang 2703 * @since 9 2704 */ 2705 /** 2706 * Returns the intersection of a given range and the current range. 2707 * 2708 * @param { ScopeHelper } range - A Scope range object 2709 * @returns { ScopeHelper } Returns the intersection of a given range and the current range. 2710 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2711 * 1.Mandatory parameters are left unspecified; 2712 * 2.Incorrect parameter types. 2713 * @syscap SystemCapability.Utils.Lang 2714 * @crossplatform 2715 * @since 10 2716 */ 2717 /** 2718 * Returns the intersection of a given range and the current range. 2719 * 2720 * @param { ScopeHelper } range - A Scope range object 2721 * @returns { ScopeHelper } Returns the intersection of a given range and the current range. 2722 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2723 * 1.Mandatory parameters are left unspecified; 2724 * 2.Incorrect parameter types. 2725 * @syscap SystemCapability.Utils.Lang 2726 * @crossplatform 2727 * @atomicservice 2728 * @since 12 2729 */ 2730 intersect(range: ScopeHelper): ScopeHelper; 2731 2732 /** 2733 * Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2734 * 2735 * @param { ScopeType } lowerObj - A ScopeType value 2736 * @param { ScopeType } upperObj - A ScopeType value 2737 * @returns { ScopeHelper } Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2738 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2739 * 1.Mandatory parameters are left unspecified; 2740 * 2.Incorrect parameter types. 2741 * @syscap SystemCapability.Utils.Lang 2742 * @since 9 2743 */ 2744 /** 2745 * Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2746 * 2747 * @param { ScopeType } lowerObj - A ScopeType value 2748 * @param { ScopeType } upperObj - A ScopeType value 2749 * @returns { ScopeHelper } Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2750 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2751 * 1.Mandatory parameters are left unspecified; 2752 * 2.Incorrect parameter types. 2753 * @syscap SystemCapability.Utils.Lang 2754 * @crossplatform 2755 * @since 10 2756 */ 2757 /** 2758 * Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2759 * 2760 * @param { ScopeType } lowerObj - A ScopeType value 2761 * @param { ScopeType } upperObj - A ScopeType value 2762 * @returns { ScopeHelper } Returns the intersection of the current range and the range specified by the given lower and upper bounds. 2763 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2764 * 1.Mandatory parameters are left unspecified; 2765 * 2.Incorrect parameter types. 2766 * @syscap SystemCapability.Utils.Lang 2767 * @crossplatform 2768 * @atomicservice 2769 * @since 12 2770 */ 2771 intersect(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; 2772 2773 /** 2774 * Obtains the upper bound of the current range. 2775 * 2776 * @returns { ScopeType } Returns the upper bound of the current range. 2777 * @syscap SystemCapability.Utils.Lang 2778 * @since 9 2779 */ 2780 /** 2781 * Obtains the upper bound of the current range. 2782 * 2783 * @returns { ScopeType } Returns the upper bound of the current range. 2784 * @syscap SystemCapability.Utils.Lang 2785 * @crossplatform 2786 * @since 10 2787 */ 2788 /** 2789 * Obtains the upper bound of the current range. 2790 * 2791 * @returns { ScopeType } Returns the upper bound of the current range. 2792 * @syscap SystemCapability.Utils.Lang 2793 * @crossplatform 2794 * @atomicservice 2795 * @since 12 2796 */ 2797 getUpper(): ScopeType; 2798 2799 /** 2800 * Obtains the lower bound of the current range. 2801 * 2802 * @returns { ScopeType } Returns the lower bound of the current range. 2803 * @syscap SystemCapability.Utils.Lang 2804 * @since 9 2805 */ 2806 /** 2807 * Obtains the lower bound of the current range. 2808 * 2809 * @returns { ScopeType } Returns the lower bound of the current range. 2810 * @syscap SystemCapability.Utils.Lang 2811 * @crossplatform 2812 * @since 10 2813 */ 2814 /** 2815 * Obtains the lower bound of the current range. 2816 * 2817 * @returns { ScopeType } Returns the lower bound of the current range. 2818 * @syscap SystemCapability.Utils.Lang 2819 * @crossplatform 2820 * @atomicservice 2821 * @since 12 2822 */ 2823 getLower(): ScopeType; 2824 2825 /** 2826 * Creates the smallest range that includes the current range and the given lower and upper bounds. 2827 * 2828 * @param { ScopeType } lowerObj - A ScopeType value 2829 * @param { ScopeType } upperObj - A ScopeType value 2830 * @returns { ScopeHelper } Returns the smallest range that includes the current range and the given lower and upper bounds. 2831 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2832 * 1.Mandatory parameters are left unspecified; 2833 * 2.Incorrect parameter types. 2834 * @syscap SystemCapability.Utils.Lang 2835 * @since 9 2836 */ 2837 /** 2838 * Creates the smallest range that includes the current range and the given lower and upper bounds. 2839 * 2840 * @param { ScopeType } lowerObj - A ScopeType value 2841 * @param { ScopeType } upperObj - A ScopeType value 2842 * @returns { ScopeHelper } Returns the smallest range that includes the current range and the given lower and upper bounds. 2843 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2844 * 1.Mandatory parameters are left unspecified; 2845 * 2.Incorrect parameter types. 2846 * @syscap SystemCapability.Utils.Lang 2847 * @atomicservice 2848 * @since 12 2849 */ 2850 expand(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; 2851 2852 /** 2853 * Creates the smallest range that includes the current range and a given range. 2854 * 2855 * @param { ScopeHelper } range - A Scope range object 2856 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given range. 2857 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2858 * 1.Mandatory parameters are left unspecified; 2859 * 2.Incorrect parameter types. 2860 * @syscap SystemCapability.Utils.Lang 2861 * @since 9 2862 */ 2863 /** 2864 * Creates the smallest range that includes the current range and a given range. 2865 * 2866 * @param { ScopeHelper } range - A Scope range object 2867 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given range. 2868 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2869 * 1.Mandatory parameters are left unspecified; 2870 * 2.Incorrect parameter types. 2871 * @syscap SystemCapability.Utils.Lang 2872 * @crossplatform 2873 * @since 10 2874 */ 2875 /** 2876 * Creates the smallest range that includes the current range and a given range. 2877 * 2878 * @param { ScopeHelper } range - A Scope range object 2879 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given range. 2880 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2881 * 1.Mandatory parameters are left unspecified; 2882 * 2.Incorrect parameter types. 2883 * @syscap SystemCapability.Utils.Lang 2884 * @crossplatform 2885 * @atomicservice 2886 * @since 12 2887 */ 2888 expand(range: ScopeHelper): ScopeHelper; 2889 2890 /** 2891 * Creates the smallest range that includes the current range and a given value. 2892 * 2893 * @param { ScopeType } value - A ScopeType value 2894 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given value. 2895 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2896 * 1.Mandatory parameters are left unspecified; 2897 * 2.Incorrect parameter types. 2898 * @syscap SystemCapability.Utils.Lang 2899 * @since 9 2900 */ 2901 /** 2902 * Creates the smallest range that includes the current range and a given value. 2903 * 2904 * @param { ScopeType } value - A ScopeType value 2905 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given value. 2906 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2907 * 1.Mandatory parameters are left unspecified; 2908 * 2.Incorrect parameter types. 2909 * @syscap SystemCapability.Utils.Lang 2910 * @crossplatform 2911 * @since 10 2912 */ 2913 /** 2914 * Creates the smallest range that includes the current range and a given value. 2915 * 2916 * @param { ScopeType } value - A ScopeType value 2917 * @returns { ScopeHelper } Returns the smallest range that includes the current range and a given value. 2918 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2919 * 1.Mandatory parameters are left unspecified; 2920 * 2.Incorrect parameter types. 2921 * @syscap SystemCapability.Utils.Lang 2922 * @crossplatform 2923 * @atomicservice 2924 * @since 12 2925 */ 2926 expand(value: ScopeType): ScopeHelper; 2927 2928 /** 2929 * Checks whether a given value is within the current range. 2930 * 2931 * @param { ScopeType } value - A ScopeType value 2932 * @returns { boolean } If the value is within the current range return true,otherwise return false. 2933 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2934 * 1.Mandatory parameters are left unspecified; 2935 * 2.Incorrect parameter types. 2936 * @syscap SystemCapability.Utils.Lang 2937 * @since 9 2938 */ 2939 /** 2940 * Checks whether a given value is within the current range. 2941 * 2942 * @param { ScopeType } value - A ScopeType value 2943 * @returns { boolean } If the value is within the current range return true,otherwise return false. 2944 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2945 * 1.Mandatory parameters are left unspecified; 2946 * 2.Incorrect parameter types. 2947 * @syscap SystemCapability.Utils.Lang 2948 * @crossplatform 2949 * @since 10 2950 */ 2951 /** 2952 * Checks whether a given value is within the current range. 2953 * 2954 * @param { ScopeType } value - A ScopeType value 2955 * @returns { boolean } If the value is within the current range return true,otherwise return false. 2956 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2957 * 1.Mandatory parameters are left unspecified; 2958 * 2.Incorrect parameter types. 2959 * @syscap SystemCapability.Utils.Lang 2960 * @crossplatform 2961 * @atomicservice 2962 * @since 12 2963 */ 2964 contains(value: ScopeType): boolean; 2965 2966 /** 2967 * Checks whether a given range is within the current range. 2968 * 2969 * @param { ScopeHelper } range - A Scope range 2970 * @returns { boolean } If the current range is within the given range return true,otherwise return false. 2971 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2972 * 1.Mandatory parameters are left unspecified; 2973 * 2.Incorrect parameter types. 2974 * @syscap SystemCapability.Utils.Lang 2975 * @since 9 2976 */ 2977 /** 2978 * Checks whether a given range is within the current range. 2979 * 2980 * @param { ScopeHelper } range - A Scope range 2981 * @returns { boolean } If the current range is within the given range return true,otherwise return false. 2982 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2983 * 1.Mandatory parameters are left unspecified; 2984 * 2.Incorrect parameter types. 2985 * @syscap SystemCapability.Utils.Lang 2986 * @crossplatform 2987 * @since 10 2988 */ 2989 /** 2990 * Checks whether a given range is within the current range. 2991 * 2992 * @param { ScopeHelper } range - A Scope range 2993 * @returns { boolean } If the current range is within the given range return true,otherwise return false. 2994 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2995 * 1.Mandatory parameters are left unspecified; 2996 * 2.Incorrect parameter types. 2997 * @syscap SystemCapability.Utils.Lang 2998 * @crossplatform 2999 * @atomicservice 3000 * @since 12 3001 */ 3002 contains(range: ScopeHelper): boolean; 3003 3004 /** 3005 * Clamps a given value to the current range. 3006 * 3007 * @param { ScopeType } value - A ScopeType value 3008 * @returns { ScopeType } Returns a ScopeType object that a given value is clamped to the current range. 3009 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3010 * 1.Mandatory parameters are left unspecified; 3011 * 2.Incorrect parameter types. 3012 * @syscap SystemCapability.Utils.Lang 3013 * @since 9 3014 */ 3015 /** 3016 * Clamps a given value to the current range. 3017 * 3018 * @param { ScopeType } value - A ScopeType value 3019 * @returns { ScopeType } Returns a ScopeType object that a given value is clamped to the current range. 3020 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3021 * 1.Mandatory parameters are left unspecified; 3022 * 2.Incorrect parameter types. 3023 * @syscap SystemCapability.Utils.Lang 3024 * @crossplatform 3025 * @since 10 3026 */ 3027 /** 3028 * Clamps a given value to the current range. 3029 * 3030 * @param { ScopeType } value - A ScopeType value 3031 * @returns { ScopeType } Returns a ScopeType object that a given value is clamped to the current range. 3032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3033 * 1.Mandatory parameters are left unspecified; 3034 * 2.Incorrect parameter types. 3035 * @syscap SystemCapability.Utils.Lang 3036 * @crossplatform 3037 * @atomicservice 3038 * @since 12 3039 */ 3040 clamp(value: ScopeType): ScopeType; 3041 } 3042 3043 /** 3044 * Decodes a Base64 encoded String or input u8 array into a newly-allocated 3045 * u8 array using the Base64 encoding scheme. 3046 * 3047 * @syscap SystemCapability.Utils.Lang 3048 * @since 8 3049 * @deprecated since 9 3050 * @useinstead ohos.util.Base64Helper 3051 */ 3052 class Base64 { 3053 /** 3054 * Constructor for creating base64 encoding and decoding 3055 * 3056 * @syscap SystemCapability.Utils.Lang 3057 * @since 8 3058 * @deprecated since 9 3059 * @useinstead ohos.util.Base64Helper.constructor 3060 */ 3061 constructor(); 3062 3063 /** 3064 * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3065 * 3066 * @param { Uint8Array } src - A Uint8Array value 3067 * @returns { Uint8Array } Return the encoded new Uint8Array. 3068 * @syscap SystemCapability.Utils.Lang 3069 * @since 8 3070 * @deprecated since 9 3071 * @useinstead ohos.util.Base64Helper.encodeSync 3072 */ 3073 encodeSync(src: Uint8Array): Uint8Array; 3074 3075 /** 3076 * Encodes the specified byte array into a String using the Base64 encoding scheme. 3077 * 3078 * @param { Uint8Array } src - A Uint8Array value 3079 * @returns { string } Return the encoded string. 3080 * @syscap SystemCapability.Utils.Lang 3081 * @since 8 3082 * @deprecated since 9 3083 * @useinstead ohos.util.Base64Helper.encodeToStringSync 3084 */ 3085 encodeToStringSync(src: Uint8Array): string; 3086 3087 /** 3088 * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3089 * 3090 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3091 * @returns { Uint8Array } Return the decoded Uint8Array. 3092 * @syscap SystemCapability.Utils.Lang 3093 * @since 8 3094 * @deprecated since 9 3095 * @useinstead ohos.util.Base64Helper.decodeSync 3096 */ 3097 decodeSync(src: Uint8Array | string): Uint8Array; 3098 3099 /** 3100 * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. 3101 * 3102 * @param { Uint8Array } src - A Uint8Array value 3103 * @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array. 3104 * @syscap SystemCapability.Utils.Lang 3105 * @since 8 3106 * @deprecated since 9 3107 * @useinstead ohos.util.Base64Helper.encode 3108 */ 3109 encode(src: Uint8Array): Promise<Uint8Array>; 3110 3111 /** 3112 * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. 3113 * 3114 * @param { Uint8Array } src - A Uint8Array value 3115 * @returns { Promise<string> } Returns the encoded asynchronous string. 3116 * @syscap SystemCapability.Utils.Lang 3117 * @since 8 3118 * @deprecated since 9 3119 * @useinstead ohos.util.Base64Helper.encodeToString 3120 */ 3121 encodeToString(src: Uint8Array): Promise<string>; 3122 3123 /** 3124 * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. 3125 * 3126 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3127 * @returns { Promise<Uint8Array> } Return the decoded asynchronous Uint8Array. 3128 * @syscap SystemCapability.Utils.Lang 3129 * @since 8 3130 * @deprecated since 9 3131 * @useinstead ohos.util.Base64Helper.decode 3132 */ 3133 decode(src: Uint8Array | string): Promise<Uint8Array>; 3134 } 3135 3136 /** 3137 * The Type represents two different encoding formats for base64 3138 * 3139 * @enum { number } Type 3140 * @syscap SystemCapability.Utils.Lang 3141 * @crossplatform 3142 * @since 10 3143 */ 3144 /** 3145 * The Type represents two different encoding formats for base64 3146 * 3147 * @enum { number } Type 3148 * @syscap SystemCapability.Utils.Lang 3149 * @crossplatform 3150 * @atomicservice 3151 * @since 11 3152 */ 3153 /** 3154 * The Type represents four different encoding formats for base64 3155 * 3156 * @enum { number } Type 3157 * @syscap SystemCapability.Utils.Lang 3158 * @crossplatform 3159 * @atomicservice 3160 * @since 12 3161 */ 3162 enum Type { 3163 /** 3164 * The value indicates that the encoding format of base64 is BASIC 3165 * @syscap SystemCapability.Utils.Lang 3166 * @crossplatform 3167 * @since 10 3168 */ 3169 /** 3170 * The value indicates that the encoding format of base64 is BASIC 3171 * @syscap SystemCapability.Utils.Lang 3172 * @crossplatform 3173 * @atomicservice 3174 * @since 11 3175 */ 3176 BASIC, 3177 /** 3178 * The value indicates that the encoding format of base64 is MIME 3179 * @syscap SystemCapability.Utils.Lang 3180 * @crossplatform 3181 * @since 10 3182 */ 3183 /** 3184 * The value indicates that the encoding format of base64 is MIME 3185 * @syscap SystemCapability.Utils.Lang 3186 * @crossplatform 3187 * @atomicservice 3188 * @since 11 3189 */ 3190 MIME, 3191 /** 3192 * The value indicates that the encoding format of base64 is BASIC_URL_SAFE 3193 * @syscap SystemCapability.Utils.Lang 3194 * @crossplatform 3195 * @atomicservice 3196 * @since 12 3197 */ 3198 BASIC_URL_SAFE, 3199 /** 3200 * The value indicates that the encoding format of base64 is MIME_URL_SAFE 3201 * @syscap SystemCapability.Utils.Lang 3202 * @crossplatform 3203 * @atomicservice 3204 * @since 12 3205 */ 3206 MIME_URL_SAFE 3207 } 3208 3209 /** 3210 * Decodes a Base64 encoded String or input u8 array into a newly-allocated 3211 * u8 array using the Base64 encoding scheme. 3212 * 3213 * @syscap SystemCapability.Utils.Lang 3214 * @since 9 3215 */ 3216 /** 3217 * Decodes a Base64 encoded String or input u8 array into a newly-allocated 3218 * u8 array using the Base64 encoding scheme. 3219 * 3220 * @syscap SystemCapability.Utils.Lang 3221 * @crossplatform 3222 * @since 10 3223 */ 3224 /** 3225 * Decodes a Base64 encoded String or input u8 array into a newly-allocated 3226 * u8 array using the Base64 encoding scheme. 3227 * 3228 * @syscap SystemCapability.Utils.Lang 3229 * @crossplatform 3230 * @atomicservice 3231 * @since 11 3232 */ 3233 class Base64Helper { 3234 /** 3235 * Constructor for creating base64 encoding and decoding 3236 * 3237 * @syscap SystemCapability.Utils.Lang 3238 * @since 9 3239 */ 3240 /** 3241 * Constructor for creating base64 encoding and decoding 3242 * 3243 * @syscap SystemCapability.Utils.Lang 3244 * @crossplatform 3245 * @since 10 3246 */ 3247 /** 3248 * Constructor for creating base64 encoding and decoding 3249 * 3250 * @syscap SystemCapability.Utils.Lang 3251 * @crossplatform 3252 * @atomicservice 3253 * @since 11 3254 */ 3255 constructor(); 3256 3257 /** 3258 * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3259 * 3260 * @param { Uint8Array } src - A Uint8Array value 3261 * @returns { Uint8Array } Return the encoded new Uint8Array. 3262 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3263 * 1.Mandatory parameters are left unspecified; 3264 * 2.Incorrect parameter types. 3265 * @syscap SystemCapability.Utils.Lang 3266 * @since 9 3267 */ 3268 /** 3269 * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3270 * 3271 * @param { Uint8Array } src - A Uint8Array value 3272 * @returns { Uint8Array } Return the encoded new Uint8Array. 3273 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3274 * 1.Mandatory parameters are left unspecified; 3275 * 2.Incorrect parameter types. 3276 * @syscap SystemCapability.Utils.Lang 3277 * @crossplatform 3278 * @since 10 3279 */ 3280 /** 3281 * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3282 * 3283 * @param { Uint8Array } src - A Uint8Array value 3284 * @returns { Uint8Array } Return the encoded new Uint8Array. 3285 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3286 * 1.Mandatory parameters are left unspecified; 3287 * 2.Incorrect parameter types. 3288 * @syscap SystemCapability.Utils.Lang 3289 * @crossplatform 3290 * @atomicservice 3291 * @since 11 3292 */ 3293 /** 3294 * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3295 * 3296 * @param { Uint8Array } src - A Uint8Array value 3297 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and BASIC_URL_SAFE 3298 * @returns { Uint8Array } Return the encoded new Uint8Array. 3299 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3300 * 1.Mandatory parameters are left unspecified; 3301 * 2.Incorrect parameter types. 3302 * @syscap SystemCapability.Utils.Lang 3303 * @crossplatform 3304 * @atomicservice 3305 * @since 12 3306 */ 3307 encodeSync(src: Uint8Array, options?: Type): Uint8Array; 3308 3309 /** 3310 * Encodes the specified byte array into a String using the Base64 encoding scheme. 3311 * 3312 * @param { Uint8Array } src - A Uint8Array value 3313 * @returns { string } Return the encoded string. 3314 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3315 * 1.Mandatory parameters are left unspecified; 3316 * 2.Incorrect parameter types. 3317 * @syscap SystemCapability.Utils.Lang 3318 * @since 9 3319 */ 3320 /** 3321 * Encodes the specified byte array into a String using the Base64 encoding scheme. 3322 * 3323 * @param { Uint8Array } src - A Uint8Array value 3324 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3325 * @returns { string } Return the encoded string. 3326 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3327 * 1.Mandatory parameters are left unspecified; 3328 * 2.Incorrect parameter types. 3329 * @syscap SystemCapability.Utils.Lang 3330 * @crossplatform 3331 * @since 10 3332 */ 3333 /** 3334 * Encodes the specified byte array into a String using the Base64 encoding scheme. 3335 * 3336 * @param { Uint8Array } src - A Uint8Array value 3337 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3338 * @returns { string } Return the encoded string. 3339 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3340 * 1.Mandatory parameters are left unspecified; 3341 * 2.Incorrect parameter types. 3342 * @syscap SystemCapability.Utils.Lang 3343 * @crossplatform 3344 * @atomicservice 3345 * @since 11 3346 */ 3347 /** 3348 * Encodes the specified byte array into a String using the Base64 encoding scheme. 3349 * 3350 * @param { Uint8Array } src - A Uint8Array value 3351 * @param { Type } options - one of the Type enumeration 3352 * @returns { string } Return the encoded string. 3353 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3354 * 1.Mandatory parameters are left unspecified; 3355 * 2.Incorrect parameter types. 3356 * @syscap SystemCapability.Utils.Lang 3357 * @crossplatform 3358 * @atomicservice 3359 * @since 12 3360 */ 3361 encodeToStringSync(src: Uint8Array, options?: Type): string; 3362 3363 /** 3364 * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3365 * 3366 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3367 * @returns { Uint8Array } Return the decoded Uint8Array. 3368 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3369 * 1.Mandatory parameters are left unspecified; 3370 * 2.Incorrect parameter types. 3371 * @syscap SystemCapability.Utils.Lang 3372 * @since 9 3373 */ 3374 /** 3375 * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3376 * 3377 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3378 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3379 * @returns { Uint8Array } Return the decoded Uint8Array. 3380 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3381 * 1.Mandatory parameters are left unspecified; 3382 * 2.Incorrect parameter types. 3383 * @syscap SystemCapability.Utils.Lang 3384 * @crossplatform 3385 * @since 10 3386 */ 3387 /** 3388 * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3389 * 3390 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3391 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3392 * @returns { Uint8Array } Return the decoded Uint8Array. 3393 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3394 * 1.Mandatory parameters are left unspecified; 3395 * 2.Incorrect parameter types. 3396 * @syscap SystemCapability.Utils.Lang 3397 * @crossplatform 3398 * @atomicservice 3399 * @since 11 3400 */ 3401 /** 3402 * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. 3403 * 3404 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3405 * @param { Type } [options] - one of the Type enumeration 3406 * @returns { Uint8Array } Return the decoded Uint8Array. 3407 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3408 * 1.Mandatory parameters are left unspecified; 3409 * 2.Incorrect parameter types. 3410 * @syscap SystemCapability.Utils.Lang 3411 * @crossplatform 3412 * @atomicservice 3413 * @since 12 3414 */ 3415 decodeSync(src: Uint8Array | string, options?: Type): Uint8Array; 3416 3417 /** 3418 * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. 3419 * 3420 * @param { Uint8Array } src - A Uint8Array value 3421 * @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array. 3422 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3423 * 1.Mandatory parameters are left unspecified; 3424 * 2.Incorrect parameter types. 3425 * @syscap SystemCapability.Utils.Lang 3426 * @since 9 3427 */ 3428 /** 3429 * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. 3430 * 3431 * @param { Uint8Array } src - A Uint8Array value 3432 * @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array. 3433 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3434 * 1.Mandatory parameters are left unspecified; 3435 * 2.Incorrect parameter types. 3436 * @syscap SystemCapability.Utils.Lang 3437 * @crossplatform 3438 * @since 10 3439 */ 3440 /** 3441 * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. 3442 * 3443 * @param { Uint8Array } src - A Uint8Array value 3444 * @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array. 3445 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3446 * 1.Mandatory parameters are left unspecified; 3447 * 2.Incorrect parameter types. 3448 * @syscap SystemCapability.Utils.Lang 3449 * @crossplatform 3450 * @atomicservice 3451 * @since 11 3452 */ 3453 /** 3454 * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. 3455 * 3456 * @param { Uint8Array } src - A Uint8Array value 3457 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and BASIC_URL_SAFE 3458 * @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array. 3459 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3460 * 1.Mandatory parameters are left unspecified; 3461 * 2.Incorrect parameter types. 3462 * @syscap SystemCapability.Utils.Lang 3463 * @crossplatform 3464 * @atomicservice 3465 * @since 12 3466 */ 3467 encode(src: Uint8Array, options?: Type): Promise<Uint8Array>; 3468 3469 /** 3470 * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. 3471 * 3472 * @param { Uint8Array } src - A Uint8Array value 3473 * @returns { Promise<string> } Returns the encoded asynchronous string. 3474 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3475 * 1.Mandatory parameters are left unspecified; 3476 * 2.Incorrect parameter types. 3477 * @syscap SystemCapability.Utils.Lang 3478 * @since 9 3479 */ 3480 /** 3481 * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. 3482 * 3483 * @param { Uint8Array } src - A Uint8Array value 3484 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3485 * @returns { Promise<string> } Returns the encoded asynchronous string. 3486 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3487 * 1.Mandatory parameters are left unspecified; 3488 * 2.Incorrect parameter types. 3489 * @syscap SystemCapability.Utils.Lang 3490 * @crossplatform 3491 * @since 10 3492 */ 3493 /** 3494 * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. 3495 * 3496 * @param { Uint8Array } src - A Uint8Array value 3497 * @param { Type } [options] - one of the Type enumeration 3498 * @returns { Promise<string> } Returns the encoded asynchronous string. 3499 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3500 * 1.Mandatory parameters are left unspecified; 3501 * 2.Incorrect parameter types. 3502 * @syscap SystemCapability.Utils.Lang 3503 * @crossplatform 3504 * @atomicservice 3505 * @since 12 3506 */ 3507 encodeToString(src: Uint8Array, options?: Type): Promise<string>; 3508 3509 /** 3510 * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or 3511 * input u8 array into a newly allocated u8 array. 3512 * 3513 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3514 * @returns { Promise<Uint8Array> } Return the decoded asynchronous Uint8Array. 3515 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3516 * 1.Mandatory parameters are left unspecified; 3517 * 2.Incorrect parameter types. 3518 * @syscap SystemCapability.Utils.Lang 3519 * @since 9 3520 */ 3521 /** 3522 * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or 3523 * input u8 array into a newly allocated u8 array. 3524 * 3525 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3526 * @param { Type } [options] - Enumerating input parameters includes two encoding formats: BASIC and MIME 3527 * @returns { Promise<Uint8Array> } Return the decoded asynchronous Uint8Array. 3528 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3529 * 1.Mandatory parameters are left unspecified; 3530 * 2.Incorrect parameter types. 3531 * @syscap SystemCapability.Utils.Lang 3532 * @crossplatform 3533 * @since 10 3534 */ 3535 /** 3536 * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or 3537 * input u8 array into a newly allocated u8 array. 3538 * 3539 * @param { Uint8Array | string } src - A Uint8Array value or value A string value 3540 * @param { Type } [options] - one of the Type enumeration 3541 * @returns { Promise<Uint8Array> } Return the decoded asynchronous Uint8Array. 3542 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3543 * 1.Mandatory parameters are left unspecified; 3544 * 2.Incorrect parameter types. 3545 * @syscap SystemCapability.Utils.Lang 3546 * @crossplatform 3547 * @atomicservice 3548 * @since 12 3549 */ 3550 decode(src: Uint8Array | string, options?: Type): Promise<Uint8Array>; 3551 } 3552 3553 /** 3554 * Check the type of parameter. 3555 * 3556 * @syscap SystemCapability.Utils.Lang 3557 * @since 8 3558 */ 3559 /** 3560 * Check the type of parameter. 3561 * 3562 * @syscap SystemCapability.Utils.Lang 3563 * @crossplatform 3564 * @since 10 3565 */ 3566 /** 3567 * Check the type of parameter. 3568 * 3569 * @syscap SystemCapability.Utils.Lang 3570 * @crossplatform 3571 * @atomicservice 3572 * @since 12 3573 */ 3574 class types { 3575 /** 3576 * The types constructor 3577 * 3578 * @syscap SystemCapability.Utils.Lang 3579 * @since 8 3580 */ 3581 /** 3582 * The types constructor 3583 * 3584 * @syscap SystemCapability.Utils.Lang 3585 * @crossplatform 3586 * @since 10 3587 */ 3588 /** 3589 * The types constructor 3590 * 3591 * @syscap SystemCapability.Utils.Lang 3592 * @crossplatform 3593 * @atomicservice 3594 * @since 12 3595 */ 3596 constructor(); 3597 /** 3598 * Check whether the entered value is of arraybuffer or sharedarraybuffer type. 3599 * 3600 * @param { Object } value - A ArrayBuffer or SharedArrayBuffer value 3601 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance. 3602 * @syscap SystemCapability.Utils.Lang 3603 * @since 8 3604 */ 3605 /** 3606 * Check whether the entered value is of arraybuffer or sharedarraybuffer type. 3607 * 3608 * @param { Object } value - A ArrayBuffer or SharedArrayBuffer value 3609 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance. 3610 * @syscap SystemCapability.Utils.Lang 3611 * @crossplatform 3612 * @since 10 3613 */ 3614 /** 3615 * Check whether the entered value is of arraybuffer or sharedarraybuffer type. 3616 * 3617 * @param { Object } value - A ArrayBuffer or SharedArrayBuffer value 3618 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance. 3619 * @syscap SystemCapability.Utils.Lang 3620 * @crossplatform 3621 * @atomicservice 3622 * @since 12 3623 */ 3624 isAnyArrayBuffer(value: Object): boolean; 3625 /** 3626 * Check whether the type is included in the isAnyArrayBuffer. 3627 * 3628 * @param { Object } value - A included in the isAnyArrayBuffer value 3629 * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, 3630 * such as typed array objects or DataView. 3631 * @syscap SystemCapability.Utils.Lang 3632 * @since 8 3633 */ 3634 /** 3635 * Check whether the type is included in the isAnyArrayBuffer. 3636 * 3637 * @param { Object } value - A included in the isAnyArrayBuffer value 3638 * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, 3639 * such as typed array objects or DataView. 3640 * @syscap SystemCapability.Utils.Lang 3641 * @crossplatform 3642 * @since 10 3643 */ 3644 /** 3645 * Check whether the type is included in the isAnyArrayBuffer. 3646 * 3647 * @param { Object } value - A included in the isAnyArrayBuffer value 3648 * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, 3649 * such as typed array objects or DataView. 3650 * @syscap SystemCapability.Utils.Lang 3651 * @crossplatform 3652 * @atomicservice 3653 * @since 12 3654 */ 3655 isArrayBufferView(value: Object): boolean; 3656 /** 3657 * Check whether the entered value is an arguments object type. 3658 * 3659 * @param { Object } value - A arguments value 3660 * @returns { boolean } Returns true if the value is an arguments object. 3661 * @syscap SystemCapability.Utils.Lang 3662 * @since 8 3663 */ 3664 /** 3665 * Check whether the entered value is an arguments object type. 3666 * 3667 * @param { Object } value - A arguments value 3668 * @returns { boolean } Returns true if the value is an arguments object. 3669 * @syscap SystemCapability.Utils.Lang 3670 * @crossplatform 3671 * @since 10 3672 */ 3673 /** 3674 * Check whether the entered value is an arguments object type. 3675 * 3676 * @param { Object } value - A arguments value 3677 * @returns { boolean } Returns true if the value is an arguments object. 3678 * @syscap SystemCapability.Utils.Lang 3679 * @crossplatform 3680 * @atomicservice 3681 * @since 12 3682 */ 3683 isArgumentsObject(value: Object): boolean; 3684 /** 3685 * Check whether the entered value is of arraybuffer type. 3686 * 3687 * @param { Object } value - A arraybuffer value 3688 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. 3689 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 3690 * @syscap SystemCapability.Utils.Lang 3691 * @since 8 3692 */ 3693 /** 3694 * Check whether the entered value is of arraybuffer type. 3695 * 3696 * @param { Object } value - A arraybuffer value 3697 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. 3698 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 3699 * @syscap SystemCapability.Utils.Lang 3700 * @crossplatform 3701 * @since 10 3702 */ 3703 /** 3704 * Check whether the entered value is of arraybuffer type. 3705 * 3706 * @param { Object } value - A arraybuffer value 3707 * @returns { boolean } Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. 3708 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 3709 * @syscap SystemCapability.Utils.Lang 3710 * @crossplatform 3711 * @atomicservice 3712 * @since 12 3713 */ 3714 isArrayBuffer(value: Object): boolean; 3715 /** 3716 * Check whether the value entered is an asynchronous function type. 3717 * 3718 * @param { Object } value - A async function value 3719 * @returns { boolean } Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; 3720 * in particular, the return value may not match the original source code if a transpilation tool was used. 3721 * @syscap SystemCapability.Utils.Lang 3722 * @since 8 3723 */ 3724 /** 3725 * Check whether the value entered is an asynchronous function type. 3726 * 3727 * @param { Object } value - A async function value 3728 * @returns { boolean } Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; 3729 * in particular, the return value may not match the original source code if a transpilation tool was used. 3730 * @syscap SystemCapability.Utils.Lang 3731 * @crossplatform 3732 * @since 10 3733 */ 3734 /** 3735 * Check whether the value entered is an asynchronous function type. 3736 * 3737 * @param { Object } value - A async function value 3738 * @returns { boolean } Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; 3739 * in particular, the return value may not match the original source code if a transpilation tool was used. 3740 * @syscap SystemCapability.Utils.Lang 3741 * @crossplatform 3742 * @atomicservice 3743 * @since 12 3744 */ 3745 isAsyncFunction(value: Object): boolean; 3746 /** 3747 * Check whether the entered value is of bigint64array array type. 3748 * 3749 * @param { Object } value - A BigInt64Array value 3750 * @returns { boolean } Returns true if the value is a BigInt64Array instance. 3751 * @syscap SystemCapability.Utils.Lang 3752 * @since 8 3753 */ 3754 /** 3755 * Check whether the entered value is of bigint64array array type. 3756 * 3757 * @param { Object } value - A BigInt64Array value 3758 * @returns { boolean } Returns true if the value is a BigInt64Array instance. 3759 * @syscap SystemCapability.Utils.Lang 3760 * @crossplatform 3761 * @since 10 3762 */ 3763 /** 3764 * Check whether the entered value is of bigint64array array type. 3765 * 3766 * @param { Object } value - A BigInt64Array value 3767 * @returns { boolean } Returns true if the value is a BigInt64Array instance. 3768 * @syscap SystemCapability.Utils.Lang 3769 * @crossplatform 3770 * @atomicservice 3771 * @since 12 3772 */ 3773 isBigInt64Array(value: Object): boolean; 3774 /** 3775 * Check whether the entered value is of biguint64array array array type. 3776 * 3777 * @param { Object } value - A BigUint64Array value 3778 * @returns { boolean } Returns true if the value is a BigUint64Array instance. 3779 * @syscap SystemCapability.Utils.Lang 3780 * @since 8 3781 */ 3782 /** 3783 * Check whether the entered value is of biguint64array array array type. 3784 * 3785 * @param { Object } value - A BigUint64Array value 3786 * @returns { boolean } Returns true if the value is a BigUint64Array instance. 3787 * @syscap SystemCapability.Utils.Lang 3788 * @crossplatform 3789 * @since 10 3790 */ 3791 /** 3792 * Check whether the entered value is of biguint64array array array type. 3793 * 3794 * @param { Object } value - A BigUint64Array value 3795 * @returns { boolean } Returns true if the value is a BigUint64Array instance. 3796 * @syscap SystemCapability.Utils.Lang 3797 * @crossplatform 3798 * @atomicservice 3799 * @since 12 3800 */ 3801 isBigUint64Array(value: Object): boolean; 3802 /** 3803 * Check whether the entered value is a Boolean object type. 3804 * 3805 * @param { Object } value - A boolean object value 3806 * @returns { boolean } Returns true if the value is a boolean object, e.g. created by new Boolean(). 3807 * @syscap SystemCapability.Utils.Lang 3808 * @since 8 3809 */ 3810 /** 3811 * Check whether the entered value is a Boolean object type. 3812 * 3813 * @param { Object } value - A boolean object value 3814 * @returns { boolean } Returns true if the value is a boolean object, e.g. created by new Boolean(). 3815 * @syscap SystemCapability.Utils.Lang 3816 * @crossplatform 3817 * @since 10 3818 */ 3819 /** 3820 * Check whether the entered value is a Boolean object type. 3821 * 3822 * @param { Object } value - A boolean object value 3823 * @returns { boolean } Returns true if the value is a boolean object, e.g. created by new Boolean(). 3824 * @syscap SystemCapability.Utils.Lang 3825 * @crossplatform 3826 * @atomicservice 3827 * @since 12 3828 */ 3829 isBooleanObject(value: Object): boolean; 3830 /** 3831 * Check whether the entered value is a Boolean or number or string or symbol object type. 3832 * 3833 * @param { Object } value - A boxed primitive object value 3834 * @returns { boolean } Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()). 3835 * @syscap SystemCapability.Utils.Lang 3836 * @since 8 3837 */ 3838 /** 3839 * Check whether the entered value is a Boolean or number or string or symbol object type. 3840 * 3841 * @param { Object } value - A boxed primitive object value 3842 * @returns { boolean } Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()). 3843 * @syscap SystemCapability.Utils.Lang 3844 * @crossplatform 3845 * @since 10 3846 */ 3847 /** 3848 * Check whether the entered value is a Boolean or number or string or symbol object type. 3849 * 3850 * @param { Object } value - A boxed primitive object value 3851 * @returns { boolean } Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()). 3852 * @syscap SystemCapability.Utils.Lang 3853 * @crossplatform 3854 * @atomicservice 3855 * @since 12 3856 */ 3857 isBoxedPrimitive(value: Object): boolean; 3858 /** 3859 * Check whether the entered value is of DataView type. 3860 * 3861 * @param { Object } value - A DataView value 3862 * @returns { boolean } Returns true if the value is a built-in DataView instance. 3863 * @syscap SystemCapability.Utils.Lang 3864 * @since 8 3865 */ 3866 /** 3867 * Check whether the entered value is of DataView type. 3868 * 3869 * @param { Object } value - A DataView value 3870 * @returns { boolean } Returns true if the value is a built-in DataView instance. 3871 * @syscap SystemCapability.Utils.Lang 3872 * @crossplatform 3873 * @since 10 3874 */ 3875 /** 3876 * Check whether the entered value is of DataView type. 3877 * 3878 * @param { Object } value - A DataView value 3879 * @returns { boolean } Returns true if the value is a built-in DataView instance. 3880 * @syscap SystemCapability.Utils.Lang 3881 * @crossplatform 3882 * @atomicservice 3883 * @since 12 3884 */ 3885 isDataView(value: Object): boolean; 3886 /** 3887 * Check whether the entered value is of type date. 3888 * 3889 * @param { Object } value - A Date value 3890 * @returns { boolean } Returns true if the value is a built-in Date instance. 3891 * @syscap SystemCapability.Utils.Lang 3892 * @since 8 3893 */ 3894 /** 3895 * Check whether the entered value is of type date. 3896 * 3897 * @param { Object } value - A Date value 3898 * @returns { boolean } Returns true if the value is a built-in Date instance. 3899 * @syscap SystemCapability.Utils.Lang 3900 * @crossplatform 3901 * @since 10 3902 */ 3903 /** 3904 * Check whether the entered value is of type date. 3905 * 3906 * @param { Object } value - A Date value 3907 * @returns { boolean } Returns true if the value is a built-in Date instance. 3908 * @syscap SystemCapability.Utils.Lang 3909 * @crossplatform 3910 * @atomicservice 3911 * @since 12 3912 */ 3913 isDate(value: Object): boolean; 3914 /** 3915 * Check whether the entered value is a native external value type. 3916 * 3917 * @param { Object } value - A External value 3918 * @returns { boolean } Returns true if the value is a native External value. 3919 * @syscap SystemCapability.Utils.Lang 3920 * @since 8 3921 */ 3922 /** 3923 * Check whether the entered value is a native external value type. 3924 * 3925 * @param { Object } value - A External value 3926 * @returns { boolean } Returns true if the value is a native External value. 3927 * @syscap SystemCapability.Utils.Lang 3928 * @crossplatform 3929 * @since 10 3930 */ 3931 /** 3932 * Check whether the entered value is a native external value type. 3933 * 3934 * @param { Object } value - A External value 3935 * @returns { boolean } Returns true if the value is a native External value. 3936 * @syscap SystemCapability.Utils.Lang 3937 * @crossplatform 3938 * @atomicservice 3939 * @since 12 3940 */ 3941 isExternal(value: Object): boolean; 3942 /** 3943 * Check whether the entered value is of float32array array type. 3944 * 3945 * @param { Object } value - A Float32Array value 3946 * @returns { boolean } Returns true if the value is a built-in Float32Array instance. 3947 * @syscap SystemCapability.Utils.Lang 3948 * @since 8 3949 */ 3950 /** 3951 * Check whether the entered value is of float32array array type. 3952 * 3953 * @param { Object } value - A Float32Array value 3954 * @returns { boolean } Returns true if the value is a built-in Float32Array instance. 3955 * @syscap SystemCapability.Utils.Lang 3956 * @crossplatform 3957 * @since 10 3958 */ 3959 /** 3960 * Check whether the entered value is of float32array array type. 3961 * 3962 * @param { Object } value - A Float32Array value 3963 * @returns { boolean } Returns true if the value is a built-in Float32Array instance. 3964 * @syscap SystemCapability.Utils.Lang 3965 * @crossplatform 3966 * @atomicservice 3967 * @since 12 3968 */ 3969 isFloat32Array(value: Object): boolean; 3970 /** 3971 * Check whether the entered value is of float64array array type. 3972 * 3973 * @param { Object } value - A Float64Array value 3974 * @returns { boolean } Returns true if the value is a built-in Float64Array instance. 3975 * @syscap SystemCapability.Utils.Lang 3976 * @since 8 3977 */ 3978 /** 3979 * Check whether the entered value is of float64array array type. 3980 * 3981 * @param { Object } value - A Float64Array value 3982 * @returns { boolean } Returns true if the value is a built-in Float64Array instance. 3983 * @syscap SystemCapability.Utils.Lang 3984 * @crossplatform 3985 * @since 10 3986 */ 3987 /** 3988 * Check whether the entered value is of float64array array type. 3989 * 3990 * @param { Object } value - A Float64Array value 3991 * @returns { boolean } Returns true if the value is a built-in Float64Array instance. 3992 * @syscap SystemCapability.Utils.Lang 3993 * @crossplatform 3994 * @atomicservice 3995 * @since 12 3996 */ 3997 isFloat64Array(value: Object): boolean; 3998 /** 3999 * Check whether the input value is a generator function type. 4000 * 4001 * @param { Object } value - A generator function value 4002 * @returns { boolean } Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, 4003 * the return value may not match the original source code if a transpilation tool was used. 4004 * @syscap SystemCapability.Utils.Lang 4005 * @since 8 4006 */ 4007 /** 4008 * Check whether the input value is a generator function type. 4009 * 4010 * @param { Object } value - A generator function value 4011 * @returns { boolean } Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, 4012 * the return value may not match the original source code if a transpilation tool was used. 4013 * @syscap SystemCapability.Utils.Lang 4014 * @crossplatform 4015 * @since 10 4016 */ 4017 /** 4018 * Check whether the input value is a generator function type. 4019 * 4020 * @param { Object } value - A generator function value 4021 * @returns { boolean } Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, 4022 * the return value may not match the original source code if a transpilation tool was used. 4023 * @syscap SystemCapability.Utils.Lang 4024 * @crossplatform 4025 * @atomicservice 4026 * @since 12 4027 */ 4028 isGeneratorFunction(value: Object): boolean; 4029 /** 4030 * Check whether the entered value is a generator object type. 4031 * 4032 * @param { Object } value - A generator object value 4033 * @returns { boolean } Returns true if the value is a generator object as returned from a built-in generator function. 4034 * This only reports back what the JavaScript engine is seeing; in particular, 4035 *the return value may not match the original source code if a transpilation tool was used. 4036 * @syscap SystemCapability.Utils.Lang 4037 * @since 8 4038 */ 4039 /** 4040 * Check whether the entered value is a generator object type. 4041 * 4042 * @param { Object } value - A generator object value 4043 * @returns { boolean } Returns true if the value is a generator object as returned from a built-in generator function. 4044 * This only reports back what the JavaScript engine is seeing; in particular, 4045 *the return value may not match the original source code if a transpilation tool was used. 4046 * @syscap SystemCapability.Utils.Lang 4047 * @crossplatform 4048 * @since 10 4049 */ 4050 /** 4051 * Check whether the entered value is a generator object type. 4052 * 4053 * @param { Object } value - A generator object value 4054 * @returns { boolean } Returns true if the value is a generator object as returned from a built-in generator function. 4055 * This only reports back what the JavaScript engine is seeing; in particular, 4056 *the return value may not match the original source code if a transpilation tool was used. 4057 * @syscap SystemCapability.Utils.Lang 4058 * @crossplatform 4059 * @atomicservice 4060 * @since 12 4061 */ 4062 isGeneratorObject(value: Object): boolean; 4063 /** 4064 * Check whether the entered value is of int8array array type. 4065 * 4066 * @param { Object } value - A Int8Array value 4067 * @returns { boolean } Returns true if the value is a built-in Int8Array instance. 4068 * @syscap SystemCapability.Utils.Lang 4069 * @since 8 4070 */ 4071 /** 4072 * Check whether the entered value is of int8array array type. 4073 * 4074 * @param { Object } value - A Int8Array value 4075 * @returns { boolean } Returns true if the value is a built-in Int8Array instance. 4076 * @syscap SystemCapability.Utils.Lang 4077 * @crossplatform 4078 * @since 10 4079 */ 4080 /** 4081 * Check whether the entered value is of int8array array type. 4082 * 4083 * @param { Object } value - A Int8Array value 4084 * @returns { boolean } Returns true if the value is a built-in Int8Array instance. 4085 * @syscap SystemCapability.Utils.Lang 4086 * @crossplatform 4087 * @atomicservice 4088 * @since 12 4089 */ 4090 isInt8Array(value: Object): boolean; 4091 /** 4092 * Check whether the entered value is the int16array type. 4093 * 4094 * @param { Object } value - A Int16Array value 4095 * @returns { boolean } Returns true if the value is a built-in Int16Array instance. 4096 * @syscap SystemCapability.Utils.Lang 4097 * @since 8 4098 */ 4099 /** 4100 * Check whether the entered value is the int16array type. 4101 * 4102 * @param { Object } value - A Int16Array value 4103 * @returns { boolean } Returns true if the value is a built-in Int16Array instance. 4104 * @syscap SystemCapability.Utils.Lang 4105 * @crossplatform 4106 * @since 10 4107 */ 4108 /** 4109 * Check whether the entered value is the int16array type. 4110 * 4111 * @param { Object } value - A Int16Array value 4112 * @returns { boolean } Returns true if the value is a built-in Int16Array instance. 4113 * @syscap SystemCapability.Utils.Lang 4114 * @crossplatform 4115 * @atomicservice 4116 * @since 12 4117 */ 4118 isInt16Array(value: Object): boolean; 4119 /** 4120 * Check whether the entered value is the int32array array type. 4121 * 4122 * @param { Object } value - A Int32Array value 4123 * @returns { boolean } Returns true if the value is a built-in Int32Array instance. 4124 * @syscap SystemCapability.Utils.Lang 4125 * @since 8 4126 */ 4127 /** 4128 * Check whether the entered value is the int32array array type. 4129 * 4130 * @param { Object } value - A Int32Array value 4131 * @returns { boolean } Returns true if the value is a built-in Int32Array instance. 4132 * @syscap SystemCapability.Utils.Lang 4133 * @crossplatform 4134 * @since 10 4135 */ 4136 /** 4137 * Check whether the entered value is the int32array array type. 4138 * 4139 * @param { Object } value - A Int32Array value 4140 * @returns { boolean } Returns true if the value is a built-in Int32Array instance. 4141 * @syscap SystemCapability.Utils.Lang 4142 * @crossplatform 4143 * @atomicservice 4144 * @since 12 4145 */ 4146 isInt32Array(value: Object): boolean; 4147 /** 4148 * Check whether the entered value is of map type. 4149 * 4150 * @param { Object } value - A Map value 4151 * @returns { boolean } Returns true if the value is a built-in Map instance. 4152 * @syscap SystemCapability.Utils.Lang 4153 * @since 8 4154 */ 4155 /** 4156 * Check whether the entered value is of map type. 4157 * 4158 * @param { Object } value - A Map value 4159 * @returns { boolean } Returns true if the value is a built-in Map instance. 4160 * @syscap SystemCapability.Utils.Lang 4161 * @crossplatform 4162 * @since 10 4163 */ 4164 /** 4165 * Check whether the entered value is of map type. 4166 * 4167 * @param { Object } value - A Map value 4168 * @returns { boolean } Returns true if the value is a built-in Map instance. 4169 * @syscap SystemCapability.Utils.Lang 4170 * @crossplatform 4171 * @atomicservice 4172 * @since 12 4173 */ 4174 isMap(value: Object): boolean; 4175 /** 4176 * Check whether the entered value is the iterator type of map. 4177 * 4178 * @param { Object } value - A Map iterator value 4179 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Map instance. 4180 * @syscap SystemCapability.Utils.Lang 4181 * @since 8 4182 */ 4183 /** 4184 * Check whether the entered value is the iterator type of map. 4185 * 4186 * @param { Object } value - A Map iterator value 4187 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Map instance. 4188 * @syscap SystemCapability.Utils.Lang 4189 * @crossplatform 4190 * @since 10 4191 */ 4192 /** 4193 * Check whether the entered value is the iterator type of map. 4194 * 4195 * @param { Object } value - A Map iterator value 4196 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Map instance. 4197 * @syscap SystemCapability.Utils.Lang 4198 * @crossplatform 4199 * @atomicservice 4200 * @since 12 4201 */ 4202 isMapIterator(value: Object): boolean; 4203 /** 4204 * Check whether the entered value is the module namespace object object type. 4205 * 4206 * @param { Object } value - A Module Namespace Object value 4207 * @returns { boolean } Returns true if the value is an instance of a Module Namespace Object. 4208 * @syscap SystemCapability.Utils.Lang 4209 * @since 8 4210 */ 4211 /** 4212 * Check whether the entered value is the module namespace object object type. 4213 * 4214 * @param { Object } value - A Module Namespace Object value 4215 * @returns { boolean } Returns true if the value is an instance of a Module Namespace Object. 4216 * @syscap SystemCapability.Utils.Lang 4217 * @crossplatform 4218 * @since 10 4219 */ 4220 /** 4221 * Check whether the entered value is the module namespace object object type. 4222 * 4223 * @param { Object } value - A Module Namespace Object value 4224 * @returns { boolean } Returns true if the value is an instance of a Module Namespace Object. 4225 * @syscap SystemCapability.Utils.Lang 4226 * @crossplatform 4227 * @atomicservice 4228 * @since 12 4229 */ 4230 isModuleNamespaceObject(value: Object): boolean; 4231 /** 4232 * Check whether the value entered is of type error. 4233 * 4234 * @param { Object } value - A Error value 4235 * @returns { boolean } Returns true if the value is an instance of a built-in Error type. 4236 * @syscap SystemCapability.Utils.Lang 4237 * @since 8 4238 */ 4239 /** 4240 * Check whether the value entered is of type error. 4241 * 4242 * @param { Object } value - A Error value 4243 * @returns { boolean } Returns true if the value is an instance of a built-in Error type. 4244 * @syscap SystemCapability.Utils.Lang 4245 * @crossplatform 4246 * @since 10 4247 */ 4248 /** 4249 * Check whether the value entered is of type error. 4250 * 4251 * @param { Object } value - A Error value 4252 * @returns { boolean } Returns true if the value is an instance of a built-in Error type. 4253 * @syscap SystemCapability.Utils.Lang 4254 * @crossplatform 4255 * @atomicservice 4256 * @since 12 4257 */ 4258 isNativeError(value: Object): boolean; 4259 /** 4260 * Check whether the entered value is of the number object type. 4261 * 4262 * @param { Object } value - A number object value 4263 * @returns { boolean } Returns true if the value is a number object, e.g. created by new Number(). 4264 * @syscap SystemCapability.Utils.Lang 4265 * @since 8 4266 */ 4267 /** 4268 * Check whether the entered value is of the number object type. 4269 * 4270 * @param { Object } value - A number object value 4271 * @returns { boolean } Returns true if the value is a number object, e.g. created by new Number(). 4272 * @syscap SystemCapability.Utils.Lang 4273 * @crossplatform 4274 * @since 10 4275 */ 4276 /** 4277 * Check whether the entered value is of the number object type. 4278 * 4279 * @param { Object } value - A number object value 4280 * @returns { boolean } Returns true if the value is a number object, e.g. created by new Number(). 4281 * @syscap SystemCapability.Utils.Lang 4282 * @crossplatform 4283 * @atomicservice 4284 * @since 12 4285 */ 4286 isNumberObject(value: Object): boolean; 4287 /** 4288 * Check whether the entered value is of promise type. 4289 * 4290 * @param { Object } value - A Promise value 4291 * @returns { boolean } Returns true if the value is a built-in Promise. 4292 * @syscap SystemCapability.Utils.Lang 4293 * @since 8 4294 */ 4295 /** 4296 * Check whether the entered value is of promise type. 4297 * 4298 * @param { Object } value - A Promise value 4299 * @returns { boolean } Returns true if the value is a built-in Promise. 4300 * @syscap SystemCapability.Utils.Lang 4301 * @crossplatform 4302 * @since 10 4303 */ 4304 /** 4305 * Check whether the entered value is of promise type. 4306 * 4307 * @param { Object } value - A Promise value 4308 * @returns { boolean } Returns true if the value is a built-in Promise. 4309 * @syscap SystemCapability.Utils.Lang 4310 * @crossplatform 4311 * @atomicservice 4312 * @since 12 4313 */ 4314 isPromise(value: Object): boolean; 4315 /** 4316 * Check whether the value entered is of proxy type. 4317 * 4318 * @param { Object } value - A Proxy value 4319 * @returns { boolean } Returns true if the value is a Proxy instance. 4320 * @syscap SystemCapability.Utils.Lang 4321 * @since 8 4322 */ 4323 /** 4324 * Check whether the value entered is of proxy type. 4325 * 4326 * @param { Object } value - A Proxy value 4327 * @returns { boolean } Returns true if the value is a Proxy instance. 4328 * @syscap SystemCapability.Utils.Lang 4329 * @crossplatform 4330 * @since 10 4331 */ 4332 /** 4333 * Check whether the value entered is of proxy type. 4334 * 4335 * @param { Object } value - A Proxy value 4336 * @returns { boolean } Returns true if the value is a Proxy instance. 4337 * @syscap SystemCapability.Utils.Lang 4338 * @crossplatform 4339 * @atomicservice 4340 * @since 12 4341 */ 4342 isProxy(value: Object): boolean; 4343 /** 4344 * Check whether the entered value is of type regexp. 4345 * 4346 * @param { Object } value - A regular expression object value 4347 * @returns { boolean } Returns true if the value is a regular expression object. 4348 * @syscap SystemCapability.Utils.Lang 4349 * @since 8 4350 */ 4351 /** 4352 * Check whether the entered value is of type regexp. 4353 * 4354 * @param { Object } value - A regular expression object value 4355 * @returns { boolean } Returns true if the value is a regular expression object. 4356 * @syscap SystemCapability.Utils.Lang 4357 * @crossplatform 4358 * @since 10 4359 */ 4360 /** 4361 * Check whether the entered value is of type regexp. 4362 * 4363 * @param { Object } value - A regular expression object value 4364 * @returns { boolean } Returns true if the value is a regular expression object. 4365 * @syscap SystemCapability.Utils.Lang 4366 * @crossplatform 4367 * @atomicservice 4368 * @since 12 4369 */ 4370 isRegExp(value: Object): boolean; 4371 /** 4372 * Check whether the entered value is of type set. 4373 * 4374 * @param { Object } value - A Set instance value 4375 * @returns { boolean } Returns true if the value is a built-in Set instance. 4376 * @syscap SystemCapability.Utils.Lang 4377 * @since 8 4378 */ 4379 /** 4380 * Check whether the entered value is of type set. 4381 * 4382 * @param { Object } value - A Set instance value 4383 * @returns { boolean } Returns true if the value is a built-in Set instance. 4384 * @syscap SystemCapability.Utils.Lang 4385 * @crossplatform 4386 * @since 10 4387 */ 4388 /** 4389 * Check whether the entered value is of type set. 4390 * 4391 * @param { Object } value - A Set instance value 4392 * @returns { boolean } Returns true if the value is a built-in Set instance. 4393 * @syscap SystemCapability.Utils.Lang 4394 * @crossplatform 4395 * @atomicservice 4396 * @since 12 4397 */ 4398 isSet(value: Object): boolean; 4399 /** 4400 * Check whether the entered value is the iterator type of set. 4401 * 4402 * @param { Object } value - A Set iterator value 4403 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Set instance. 4404 * @syscap SystemCapability.Utils.Lang 4405 * @since 8 4406 */ 4407 /** 4408 * Check whether the entered value is the iterator type of set. 4409 * 4410 * @param { Object } value - A Set iterator value 4411 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Set instance. 4412 * @syscap SystemCapability.Utils.Lang 4413 * @crossplatform 4414 * @since 10 4415 */ 4416 /** 4417 * Check whether the entered value is the iterator type of set. 4418 * 4419 * @param { Object } value - A Set iterator value 4420 * @returns { boolean } Returns true if the value is an iterator returned for a built-in Set instance. 4421 * @syscap SystemCapability.Utils.Lang 4422 * @crossplatform 4423 * @atomicservice 4424 * @since 12 4425 */ 4426 isSetIterator(value: Object): boolean; 4427 /** 4428 * Check whether the entered value is of type sharedarraybuffer. 4429 * 4430 * @param { Object } value - A SharedArrayBuffer instance value 4431 * @returns { boolean } Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. 4432 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 4433 * @syscap SystemCapability.Utils.Lang 4434 * @since 8 4435 */ 4436 /** 4437 * Check whether the entered value is of type sharedarraybuffer. 4438 * 4439 * @param { Object } value - A SharedArrayBuffer instance value 4440 * @returns { boolean } Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. 4441 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 4442 * @syscap SystemCapability.Utils.Lang 4443 * @crossplatform 4444 * @since 10 4445 */ 4446 /** 4447 * Check whether the entered value is of type sharedarraybuffer. 4448 * 4449 * @param { Object } value - A SharedArrayBuffer instance value 4450 * @returns { boolean } Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. 4451 * Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. 4452 * @syscap SystemCapability.Utils.Lang 4453 * @crossplatform 4454 * @atomicservice 4455 * @since 12 4456 */ 4457 isSharedArrayBuffer(value: Object): boolean; 4458 /** 4459 * Check whether the entered value is a string object type. 4460 * 4461 * @param { Object } value - A String object value 4462 * @returns { boolean } Returns true if the value is a string object, e.g. created by new String(). 4463 * @syscap SystemCapability.Utils.Lang 4464 * @since 8 4465 */ 4466 /** 4467 * Check whether the entered value is a string object type. 4468 * 4469 * @param { Object } value - A String object value 4470 * @returns { boolean } Returns true if the value is a string object, e.g. created by new String(). 4471 * @syscap SystemCapability.Utils.Lang 4472 * @crossplatform 4473 * @since 10 4474 */ 4475 /** 4476 * Check whether the entered value is a string object type. 4477 * 4478 * @param { Object } value - A String object value 4479 * @returns { boolean } Returns true if the value is a string object, e.g. created by new String(). 4480 * @syscap SystemCapability.Utils.Lang 4481 * @crossplatform 4482 * @atomicservice 4483 * @since 12 4484 */ 4485 isStringObject(value: Object): boolean; 4486 /** 4487 * Check whether the entered value is a symbol object type. 4488 * 4489 * @param { Object } value - A symbol object value 4490 * @returns { boolean } Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive. 4491 * @syscap SystemCapability.Utils.Lang 4492 * @since 8 4493 */ 4494 /** 4495 * Check whether the entered value is a symbol object type. 4496 * 4497 * @param { Object } value - A symbol object value 4498 * @returns { boolean } Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive. 4499 * @syscap SystemCapability.Utils.Lang 4500 * @crossplatform 4501 * @since 10 4502 */ 4503 /** 4504 * Check whether the entered value is a symbol object type. 4505 * 4506 * @param { Object } value - A symbol object value 4507 * @returns { boolean } Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive. 4508 * @syscap SystemCapability.Utils.Lang 4509 * @crossplatform 4510 * @atomicservice 4511 * @since 12 4512 */ 4513 isSymbolObject(value: Object): boolean; 4514 /** 4515 * Check whether the entered value is a type contained in typedarray. 4516 * 4517 * @param { Object } value - A TypedArray instance value 4518 * @returns { boolean } Returns true if the value is a built-in TypedArray instance. 4519 * @syscap SystemCapability.Utils.Lang 4520 * @since 8 4521 */ 4522 /** 4523 * Check whether the entered value is a type contained in typedarray. 4524 * 4525 * @param { Object } value - A TypedArray instance value 4526 * @returns { boolean } Returns true if the value is a built-in TypedArray instance. 4527 * @syscap SystemCapability.Utils.Lang 4528 * @crossplatform 4529 * @since 10 4530 */ 4531 /** 4532 * Check whether the entered value is a type contained in typedarray. 4533 * 4534 * @param { Object } value - A TypedArray instance value 4535 * @returns { boolean } Returns true if the value is a built-in TypedArray instance. 4536 * @syscap SystemCapability.Utils.Lang 4537 * @crossplatform 4538 * @atomicservice 4539 * @since 12 4540 */ 4541 isTypedArray(value: Object): boolean; 4542 /** 4543 * Check whether the entered value is the uint8array array type. 4544 * 4545 * @param { Object } value - A Uint8Array value 4546 * @returns { boolean } Returns true if the value is a built-in Uint8Array instance. 4547 * @syscap SystemCapability.Utils.Lang 4548 * @since 8 4549 */ 4550 /** 4551 * Check whether the entered value is the uint8array array type. 4552 * 4553 * @param { Object } value - A Uint8Array value 4554 * @returns { boolean } Returns true if the value is a built-in Uint8Array instance. 4555 * @syscap SystemCapability.Utils.Lang 4556 * @crossplatform 4557 * @since 10 4558 */ 4559 /** 4560 * Check whether the entered value is the uint8array array type. 4561 * 4562 * @param { Object } value - A Uint8Array value 4563 * @returns { boolean } Returns true if the value is a built-in Uint8Array instance. 4564 * @syscap SystemCapability.Utils.Lang 4565 * @crossplatform 4566 * @atomicservice 4567 * @since 12 4568 */ 4569 isUint8Array(value: Object): boolean; 4570 /** 4571 * Check whether the entered value is the uint8clapedarray array type. 4572 * 4573 * @param { Object } value - A Uint8ClampedArray value 4574 * @returns { boolean } Returns true if the value is a built-in Uint8ClampedArray instance. 4575 * @syscap SystemCapability.Utils.Lang 4576 * @since 8 4577 */ 4578 /** 4579 * Check whether the entered value is the uint8clapedarray array type. 4580 * 4581 * @param { Object } value - A Uint8ClampedArray value 4582 * @returns { boolean } Returns true if the value is a built-in Uint8ClampedArray instance. 4583 * @syscap SystemCapability.Utils.Lang 4584 * @crossplatform 4585 * @since 10 4586 */ 4587 /** 4588 * Check whether the entered value is the uint8clapedarray array type. 4589 * 4590 * @param { Object } value - A Uint8ClampedArray value 4591 * @returns { boolean } Returns true if the value is a built-in Uint8ClampedArray instance. 4592 * @syscap SystemCapability.Utils.Lang 4593 * @crossplatform 4594 * @atomicservice 4595 * @since 12 4596 */ 4597 isUint8ClampedArray(value: Object): boolean; 4598 /** 4599 * Check whether the entered value is the uint16array array array type. 4600 * 4601 * @param { Object } value - A Uint16Array value 4602 * @returns { boolean } Returns true if the value is a built-in Uint16Array instance. 4603 * @syscap SystemCapability.Utils.Lang 4604 * @since 8 4605 */ 4606 /** 4607 * Check whether the entered value is the uint16array array array type. 4608 * 4609 * @param { Object } value - A Uint16Array value 4610 * @returns { boolean } Returns true if the value is a built-in Uint16Array instance. 4611 * @syscap SystemCapability.Utils.Lang 4612 * @crossplatform 4613 * @since 10 4614 */ 4615 /** 4616 * Check whether the entered value is the uint16array array array type. 4617 * 4618 * @param { Object } value - A Uint16Array value 4619 * @returns { boolean } Returns true if the value is a built-in Uint16Array instance. 4620 * @syscap SystemCapability.Utils.Lang 4621 * @crossplatform 4622 * @atomicservice 4623 * @since 12 4624 */ 4625 isUint16Array(value: Object): boolean; 4626 /** 4627 * Check whether the entered value is the uint32array array type. 4628 * 4629 * @param { Object } value - A Uint32Array value 4630 * @returns { boolean } Returns true if the value is a built-in Uint32Array instance. 4631 * @syscap SystemCapability.Utils.Lang 4632 * @since 8 4633 */ 4634 /** 4635 * Check whether the entered value is the uint32array array type. 4636 * 4637 * @param { Object } value - A Uint32Array value 4638 * @returns { boolean } Returns true if the value is a built-in Uint32Array instance. 4639 * @syscap SystemCapability.Utils.Lang 4640 * @crossplatform 4641 * @since 10 4642 */ 4643 /** 4644 * Check whether the entered value is the uint32array array type. 4645 * 4646 * @param { Object } value - A Uint32Array value 4647 * @returns { boolean } Returns true if the value is a built-in Uint32Array instance. 4648 * @syscap SystemCapability.Utils.Lang 4649 * @crossplatform 4650 * @atomicservice 4651 * @since 12 4652 */ 4653 isUint32Array(value: Object): boolean; 4654 /** 4655 * Check whether the entered value is of type weakmap. 4656 * 4657 * @param { Object } value - A WeakMap value 4658 * @returns { boolean } Returns true if the value is a built-in WeakMap instance. 4659 * @syscap SystemCapability.Utils.Lang 4660 * @since 8 4661 */ 4662 /** 4663 * Check whether the entered value is of type weakmap. 4664 * 4665 * @param { Object } value - A WeakMap value 4666 * @returns { boolean } Returns true if the value is a built-in WeakMap instance. 4667 * @syscap SystemCapability.Utils.Lang 4668 * @crossplatform 4669 * @since 10 4670 */ 4671 /** 4672 * Check whether the entered value is of type weakmap. 4673 * 4674 * @param { Object } value - A WeakMap value 4675 * @returns { boolean } Returns true if the value is a built-in WeakMap instance. 4676 * @syscap SystemCapability.Utils.Lang 4677 * @crossplatform 4678 * @atomicservice 4679 * @since 12 4680 */ 4681 isWeakMap(value: Object): boolean; 4682 /** 4683 * Check whether the entered value is of type weakset. 4684 * 4685 * @param { Object } value - A WeakSet value 4686 * @returns { boolean } Returns true if the value is a built-in WeakSet instance. 4687 * @syscap SystemCapability.Utils.Lang 4688 * @since 8 4689 */ 4690 /** 4691 * Check whether the entered value is of type weakset. 4692 * 4693 * @param { Object } value - A WeakSet value 4694 * @returns { boolean } Returns true if the value is a built-in WeakSet instance. 4695 * @syscap SystemCapability.Utils.Lang 4696 * @crossplatform 4697 * @since 10 4698 */ 4699 /** 4700 * Check whether the entered value is of type weakset. 4701 * 4702 * @param { Object } value - A WeakSet value 4703 * @returns { boolean } Returns true if the value is a built-in WeakSet instance. 4704 * @syscap SystemCapability.Utils.Lang 4705 * @crossplatform 4706 * @atomicservice 4707 * @since 12 4708 */ 4709 isWeakSet(value: Object): boolean; 4710 } 4711 /** 4712 * Insert before/after logic into a class method or replace implementation for a class method. 4713 * 4714 * @syscap SystemCapability.Utils.Lang 4715 * @crossplatform 4716 * @since 11 4717 */ 4718 /** 4719 * Insert before/after logic into a class method or replace implementation for a class method. 4720 * 4721 * @syscap SystemCapability.Utils.Lang 4722 * @crossplatform 4723 * @atomicservice 4724 * @since 12 4725 */ 4726 class Aspect { 4727 /** 4728 * Insert some logic before the method. In implementation the method will be replaced with a new function, 4729 * which will execute 'before' with the args 'this' and the args of the original method, and then execute 4730 * the original method. The return value of the new function is returned by the original method. 4731 * 4732 * @param { Object } targetClass - The operated class. 4733 * @param { string } methodName - The name of the operated method. 4734 * @param { boolean } isStatic - The flag whether the method is static. 4735 * @param { Function } before - The logic inserted before the method. 4736 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4737 * 1.Mandatory parameters are left unspecified; 4738 * 2.Incorrect parameter types. 4739 * @syscap SystemCapability.Utils.Lang 4740 * @crossplatform 4741 * @since 11 4742 */ 4743 /** 4744 * Insert some logic before the method. In implementation the method will be replaced with a new function, 4745 * which will execute 'before' with the args 'this' and the args of the original method, and then execute 4746 * the original method. The return value of the new function is returned by the original method. 4747 * 4748 * @param { Object } targetClass - The operated class. 4749 * @param { string } methodName - The name of the operated method. 4750 * @param { boolean } isStatic - The flag whether the method is static. 4751 * @param { Function } before - The logic inserted before the method. 4752 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4753 * 1.Mandatory parameters are left unspecified; 4754 * 2.Incorrect parameter types. 4755 * @syscap SystemCapability.Utils.Lang 4756 * @crossplatform 4757 * @atomicservice 4758 * @since 12 4759 */ 4760 static addBefore(targetClass: Object, methodName: string, isStatic: boolean, before: Function): void; 4761 /** 4762 * Insert some logic after the method. In implementation the method will be replaced with a new function, 4763 * which will execute the original method, and then execute 'after' with the args 'this' and the return value of 4764 * the original method, and the args of the original method. The return value of the new function is returned by 'after'. 4765 * 4766 * @param { Object } targetClass - The operated class. 4767 * @param { string } methodName - The name of the operated method. 4768 * @param { boolean } isStatic - The flag whether the method is static. 4769 * @param { Function } after - The logic inserted after the method. 4770 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4771 * 1.Mandatory parameters are left unspecified; 4772 * 2.Incorrect parameter types. 4773 * @syscap SystemCapability.Utils.Lang 4774 * @crossplatform 4775 * @since 11 4776 */ 4777 /** 4778 * Insert some logic after the method. In implementation the method will be replaced with a new function, 4779 * which will execute the original method, and then execute 'after' with the args 'this' and the return value of 4780 * the original method, and the args of the original method. The return value of the new function is returned by 'after'. 4781 * 4782 * @param { Object } targetClass - The operated class. 4783 * @param { string } methodName - The name of the operated method. 4784 * @param { boolean } isStatic - The flag whether the method is static. 4785 * @param { Function } after - The logic inserted after the method. 4786 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4787 * 1.Mandatory parameters are left unspecified; 4788 * 2.Incorrect parameter types. 4789 * @syscap SystemCapability.Utils.Lang 4790 * @crossplatform 4791 * @atomicservice 4792 * @since 12 4793 */ 4794 static addAfter(targetClass: Object, methodName: string, isStatic: boolean, after: Function): void; 4795 /** 4796 * Replace the original method with a new function, which will execute 'instead' with the args 'this' and the args 4797 * of the original method. The return value of the new function is returned by 'instead'. 4798 * 4799 * @param { Object } targetClass - The operated class. 4800 * @param { string } methodName - The name of the operated method. 4801 * @param { boolean } isStatic - The flag whether the method is static. 4802 * @param { Function } instead - The logic replaced with the method. 4803 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4804 * 1.Mandatory parameters are left unspecified; 4805 * 2.Incorrect parameter types. 4806 * @syscap SystemCapability.Utils.Lang 4807 * @crossplatform 4808 * @since 11 4809 */ 4810 /** 4811 * Replace the original method with a new function, which will execute 'instead' with the args 'this' and the args 4812 * of the original method. The return value of the new function is returned by 'instead'. 4813 * 4814 * @param { Object } targetClass - The operated class. 4815 * @param { string } methodName - The name of the operated method. 4816 * @param { boolean } isStatic - The flag whether the method is static. 4817 * @param { Function } instead - The logic replaced with the method. 4818 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4819 * 1.Mandatory parameters are left unspecified; 4820 * 2.Incorrect parameter types. 4821 * @syscap SystemCapability.Utils.Lang 4822 * @crossplatform 4823 * @atomicservice 4824 * @since 12 4825 */ 4826 static replace(targetClass: Object, methodName: string, isStatic: boolean, instead: Function) : void; 4827 } 4828 /** 4829 * Provide the ability to decode binary streams into strings. The supported encoding types include: utf-8, iso-8859-2, 4830 * koi8-r, macintosh, windows-1250, windows-1251, gbk, gb18030, big5, utf-16be, utf-16 le, etc. 4831 * 4832 * @syscap SystemCapability.Utils.Lang 4833 * @crossplatform 4834 * @atomicservice 4835 * @since 12 4836 */ 4837 class StringDecoder { 4838 /** 4839 * The StringDecoder constructor. 4840 * 4841 * @param { string } [encoding] - Encoding type of the input data.Default: utf8. 4842 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4843 * 1.Mandatory parameters are left unspecified; 4844 * 2.Incorrect parameter types; 4845 * @syscap SystemCapability.Utils.Lang 4846 * @crossplatform 4847 * @atomicservice 4848 * @since 12 4849 */ 4850 constructor(encoding?: string); 4851 /** 4852 * Returns a decoded string, ensuring that any incomplete multiple byte characters at the end of the Uint8Array are 4853 * omitted from the returned string and stored in an internal buffer. 4854 * 4855 * @param { string | Uint8Array } chunk - The bytes to decode. 4856 * @returns { string } Returns a decoded string. 4857 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4858 * 1.Mandatory parameters are left unspecified; 4859 * 2.Incorrect parameter types; 4860 * @syscap SystemCapability.Utils.Lang 4861 * @crossplatform 4862 * @atomicservice 4863 * @since 12 4864 */ 4865 write(chunk: string | Uint8Array): string; 4866 /** 4867 * Returns any remaining input stored in the internal buffer as a string. After end() is called, 4868 * this object can be reused for new input. 4869 * 4870 * @param { string | Uint8Array } [chunk] - The bytes to decode. 4871 * @returns { string } Returns any remaining input stored in the internal buffer as a string. 4872 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4873 * 1.Mandatory parameters are left unspecified; 4874 * 2.Incorrect parameter types; 4875 * @syscap SystemCapability.Utils.Lang 4876 * @crossplatform 4877 * @atomicservice 4878 * @since 12 4879 */ 4880 end(chunk?: string | Uint8Array): string; 4881 } 4882} 4883export default util; 4884