1/* 2 * Copyright (c) 2021-2023 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 ArkUI 19 */ 20 21 22/** 23 * Defines the console info. 24 * 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Defines the console info. 30 * 31 * @syscap SystemCapability.ArkUI.ArkUI.Full 32 * @form 33 * @since 9 34 */ 35/** 36 * Defines the console info. 37 * 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @crossplatform 40 * @form 41 * @since 10 42 */ 43/** 44 * Defines the console info. 45 * 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @crossplatform 48 * @form 49 * @atomicservice 50 * @since 11 51 */ 52export declare class console { 53 /** 54 * Prints "debug" logs. 55 * 56 * @param { string } message - Text to print. 57 * @param { any[] } arguments 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @since 7 60 */ 61 /** 62 * Prints "debug" logs. 63 * 64 * @param { string } message - Text to print. 65 * @param { any[] } arguments 66 * @syscap SystemCapability.ArkUI.ArkUI.Full 67 * @form 68 * @since 9 69 */ 70 /** 71 * Prints "debug" logs. 72 * 73 * @param { string } message - Text to print. 74 * @param { any[] } arguments 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @form 78 * @since 10 79 */ 80 /** 81 * Prints debugging information in formatted output mode. 82 * 83 * @param { string } message - Text to print. 84 * @param { any[] } arguments - Arguments in the message or other information to be printed. 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @form 88 * @atomicservice 89 * @since 11 90 */ 91 static debug(message: string, ...arguments: any[]): void; 92 93 /** 94 * Prints "log" logs. 95 * 96 * @param { string } message - Text to print. 97 * @param { any[] } arguments 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @since 7 100 */ 101 /** 102 * Prints "log" logs. 103 * 104 * @param { string } message - Text to print. 105 * @param { any[] } arguments 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @form 108 * @since 9 109 */ 110 /** 111 * Prints "log" logs. 112 * 113 * @param { string } message - Text to print. 114 * @param { any[] } arguments 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @crossplatform 117 * @form 118 * @since 10 119 */ 120 /** 121 * Prints log information in formatted output mode. 122 * 123 * @param { string } message - Text to print. 124 * @param { any[] } arguments - Arguments in the message or other information to be printed. 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @crossplatform 127 * @form 128 * @atomicservice 129 * @since 11 130 */ 131 static log(message: string, ...arguments: any[]): void; 132 133 /** 134 * Prints "info" logs. 135 * 136 * @param { string } message - Text to print. 137 * @param { any[] } arguments 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 7 140 */ 141 /** 142 * Prints "info" logs. 143 * 144 * @param { string } message - Text to print. 145 * @param { any[] } arguments 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @form 148 * @since 9 149 */ 150 /** 151 * Prints "info" logs. 152 * 153 * @param { string } message - Text to print. 154 * @param { any[] } arguments 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @form 158 * @since 10 159 */ 160 /** 161 * Prints log information in formatted output mode. This API is the alias of console.log (). 162 * 163 * @param { string } message - Text to print. 164 * @param { any[] } arguments - Arguments in the message or other information to be printed. 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @crossplatform 167 * @form 168 * @atomicservice 169 * @since 11 170 */ 171 static info(message: string, ...arguments: any[]): void; 172 173 /** 174 * Prints "warn" logs. 175 * 176 * @param { string } message - Text to print. 177 * @param { any[] } arguments 178 * @syscap SystemCapability.ArkUI.ArkUI.Full 179 * @since 7 180 */ 181 /** 182 * Prints "warn" logs. 183 * 184 * @param { string } message - Text to print. 185 * @param { any[] } arguments 186 * @syscap SystemCapability.ArkUI.ArkUI.Full 187 * @form 188 * @since 9 189 */ 190 /** 191 * Prints "warn" logs. 192 * 193 * @param { string } message - Text to print. 194 * @param { any[] } arguments 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @form 198 * @since 10 199 */ 200 /** 201 * Prints warning information in formatted output mode. 202 * 203 * @param { string } message - Warning information to be printed. 204 * @param { any[] } arguments - Arguments in the message or other information to be printed. 205 * @syscap SystemCapability.ArkUI.ArkUI.Full 206 * @crossplatform 207 * @form 208 * @atomicservice 209 * @since 11 210 */ 211 static warn(message: string, ...arguments: any[]): void; 212 213 /** 214 * Prints "error" logs. 215 * 216 * @param { string } message - Text to print. 217 * @param { any[] } arguments 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @since 7 220 */ 221 /** 222 * Prints "error" logs. 223 * 224 * @param { string } message - Text to print. 225 * @param { any[] } arguments 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @form 228 * @since 9 229 */ 230 /** 231 * Prints "error" logs. 232 * 233 * @param { string } message - Text to print. 234 * @param { any[] } arguments 235 * @syscap SystemCapability.ArkUI.ArkUI.Full 236 * @crossplatform 237 * @form 238 * @since 10 239 */ 240 /** 241 * Prints error information in formatted output mode. 242 * 243 * @param { string } message - Error information to be printed. 244 * @param { any[] } arguments - Arguments in the message or other information to be printed. 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @crossplatform 247 * @form 248 * @atomicservice 249 * @since 11 250 */ 251 static error(message: string, ...arguments: any[]): void; 252 253 /** 254 * Prints a message if value is false or omitted. 255 * 256 * @param { Object } [value] - The value tested for being truthy. 257 * @param { Object[] } arguments - Used as error message to print. 258 * @throws { BusinessError } 401 - The parameter check failed. 259 * @static 260 * @syscap SystemCapability.Utils.Lang 261 * @crossplatform 262 * @since 10 263 */ 264 /** 265 * Prints assertion information. 266 * 267 * @param { Object } [value] - Result value. If value is false or left blank, the output starting with "Assertion failed" is printed. If value is true, no information is printed. 268 * @param { Object[] } arguments - Other information to be printed when value is false. If this parameter is left blank, other information is not printed. 269 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 270 * <br> 1. Mandatory parameters are left unspecified. 271 * <br> 2. Incorrect parameters types. 272 * <br> 3. Parameter verification failed. 273 * @static 274 * @syscap SystemCapability.Utils.Lang 275 * @crossplatform 276 * @atomicservice 277 * @since 12 278 */ 279 static assert(value?: Object, ...arguments: Object[]): void; 280 281 /** 282 * Maintains an internal counter specific to label and print the number of times 283 * console.count() has been called with the given label. 284 * 285 * @param { string } [label] - Counter name. Default: "default". 286 * @throws { BusinessError } 401 - The parameter check failed. 287 * @static 288 * @syscap SystemCapability.Utils.Lang 289 * @crossplatform 290 * @since 10 291 */ 292 /** 293 * Maintains an internal counter. When this counter is invoked, 294 * its label name and the corresponding call count are printed. 295 * 296 * @param { string } [label] - Counter label name. The default value is default. 297 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 298 * <br> 1. Mandatory parameters are left unspecified. 299 * <br> 2. Incorrect parameters types. 300 * <br> 3. Parameter verification failed. 301 * @static 302 * @syscap SystemCapability.Utils.Lang 303 * @crossplatform 304 * @atomicservice 305 * @since 12 306 */ 307 static count(label?: string): void; 308 309 /** 310 * Reset the internal counter specific to label. 311 * 312 * @param { string } [label] - Counter name. Default: "default". 313 * @throws { BusinessError } 401 - The parameter check failed. 314 * @static 315 * @syscap SystemCapability.Utils.Lang 316 * @crossplatform 317 * @since 10 318 */ 319 /** 320 * Resets a counter based on the specified label name. 321 * 322 * @param { string } [label] - Counter label name. The default value is default. 323 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 324 * <br> 1. Mandatory parameters are left unspecified. 325 * <br> 2. Incorrect parameters types. 326 * <br> 3. Parameter verification failed. 327 * @static 328 * @syscap SystemCapability.Utils.Lang 329 * @crossplatform 330 * @atomicservice 331 * @since 12 332 */ 333 static countReset(label?: string): void; 334 335 /** 336 * Prints properties of the specified JavaScript object. 337 * 338 * @param { Object } [dir] - A JavaScript object whose properties should be output. 339 * @static 340 * @syscap SystemCapability.Utils.Lang 341 * @crossplatform 342 * @since 10 343 */ 344 /** 345 * Prints content of the specified object. 346 * 347 * @param { Object } [dir] - Object whose content needs to be printed. 348 * If this parameter is left blank, no information is printed. 349 * @static 350 * @syscap SystemCapability.Utils.Lang 351 * @crossplatform 352 * @atomicservice 353 * @since 12 354 */ 355 static dir(dir?: Object): void; 356 357 /** 358 * This method calls console.log() passing it the arguments received. 359 * This method does not produce any XML formatting. 360 * 361 * @param { Object[] } arguments - Text to print. 362 * @static 363 * @syscap SystemCapability.Utils.Lang 364 * @crossplatform 365 * @since 10 366 */ 367 /** 368 * Displays an interactive tree of the descendant elements of the specified XML element. 369 * This API is implemented by calling console.log() internally. 370 * It does not produce any XML elements. The usage method is the same as that of console.log(). 371 * 372 * @param { Object[] } arguments - Information to be printed. 373 * @static 374 * @syscap SystemCapability.Utils.Lang 375 * @crossplatform 376 * @atomicservice 377 * @since 12 378 */ 379 static dirxml(...arguments: Object[]): void; 380 381 /** 382 * Creates a new inline group, causing any subsequent console messages to be indented by an additional level. 383 * 384 * @param { Object[] } arguments - messages to print first. 385 * @static 386 * @syscap SystemCapability.Utils.Lang 387 * @crossplatform 388 * @since 10 389 */ 390 /** 391 * Increases the indentation of subsequent lines by two spaces. 392 * If the information to be printed is provided, the information is printed without extra indentation. 393 * 394 * @param { Object[] } arguments - Information to be printed. 395 * @static 396 * @syscap SystemCapability.Utils.Lang 397 * @crossplatform 398 * @atomicservice 399 * @since 12 400 */ 401 static group(...arguments: Object[]): void; 402 403 /** 404 * Same as console.group() 405 * 406 * @param { Object[] } arguments - messages to print first. 407 * @static 408 * @syscap SystemCapability.Utils.Lang 409 * @crossplatform 410 * @since 10 411 */ 412 /** 413 * Creates a new inline group in collapsed mode. 414 * The usage and function of this API are the same as those of console.group(). 415 * 416 * @param { Object[] } arguments - Information to be printed. 417 * @static 418 * @syscap SystemCapability.Utils.Lang 419 * @crossplatform 420 * @atomicservice 421 * @since 12 422 */ 423 static groupCollapsed(...arguments: Object[]): void; 424 425 /** 426 * Exit current inline group. 427 * 428 * @static 429 * @syscap SystemCapability.Utils.Lang 430 * @crossplatform 431 * @since 10 432 */ 433 /** 434 * Reduces the indentation of subsequent lines by two spaces. 435 * 436 * @static 437 * @syscap SystemCapability.Utils.Lang 438 * @crossplatform 439 * @atomicservice 440 * @since 12 441 */ 442 static groupEnd(): void; 443 444 /** 445 * Prints tabular data as a table. 446 * 447 * @param { Object } [tableData] - tabular data. 448 * @static 449 * @syscap SystemCapability.Utils.Lang 450 * @crossplatform 451 * @since 10 452 */ 453 /** 454 * Prints data in a table. 455 * 456 * @param { Object } [tableData] - Data to be printed in a table. 457 * If this parameter is left blank, no information is printed. 458 * @static 459 * @syscap SystemCapability.Utils.Lang 460 * @crossplatform 461 * @atomicservice 462 * @since 12 463 */ 464 static table(tableData?: Object): void; 465 466 /** 467 * Start a timer. 468 * 469 * @param { string } [label] - Timer name. Default: "default". 470 * @throws { BusinessError } 401 - The parameter check failed. 471 * @static 472 * @syscap SystemCapability.Utils.Lang 473 * @crossplatform 474 * @since 10 475 */ 476 /** 477 * Starts a timer to track the duration of an operation. 478 * You can use console.timeEnd() to close the timer and print the elapsed time (in ms). 479 * 480 * @param { string } [label] - Timer label. The default value is default. 481 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 482 * <br> 1. Mandatory parameters are left unspecified. 483 * <br> 2. Incorrect parameters types. 484 * <br> 3. Parameter verification failed. 485 * @static 486 * @syscap SystemCapability.Utils.Lang 487 * @crossplatform 488 * @atomicservice 489 * @since 12 490 */ 491 static time(label?: string): void; 492 493 /** 494 * End a timer and print time duration. 495 * 496 * @param { string } [label] - Timer name. Default: "default". 497 * @throws { BusinessError } 401 - The parameter check failed. 498 * @static 499 * @syscap SystemCapability.Utils.Lang 500 * @crossplatform 501 * @since 10 502 */ 503 /** 504 * Stops the timer started by calling console.time() and prints the elapsed time (in ms). 505 * 506 * @param { string } [label] - Timer label. The default value is default. 507 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 508 * <br> 1. Mandatory parameters are left unspecified. 509 * <br> 2. Incorrect parameters types. 510 * <br> 3. Parameter verification failed. 511 * @static 512 * @syscap SystemCapability.Utils.Lang 513 * @crossplatform 514 * @atomicservice 515 * @since 12 516 */ 517 static timeEnd(label?: string): void; 518 519 /** 520 * Print the elapsed time and other data arguments. 521 * 522 * @param { string } [label] - Timer name. Default: "default". 523 * @param { Object[] } arguments - Text to print. 524 * @throws { BusinessError } 401 - The parameter check failed. 525 * @static 526 * @syscap SystemCapability.Utils.Lang 527 * @crossplatform 528 * @since 10 529 */ 530 /** 531 * Prints the elapsed time and other data parameters for the timer started by console.time(). 532 * 533 * @param { string } [label] - Timer label. The default value is default. 534 * @param { Object[] } arguments - Logs to be printed. 535 * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 536 * <br> 1. Mandatory parameters are left unspecified. 537 * <br> 2. Incorrect parameters types. 538 * <br> 3. Parameter verification failed. 539 * @static 540 * @syscap SystemCapability.Utils.Lang 541 * @crossplatform 542 * @atomicservice 543 * @since 12 544 */ 545 static timeLog(label?: string, ...arguments: Object[]): void; 546 547 /** 548 * Prints stack information for the current code location. 549 * 550 * @param { Object[] } arguments - message to print. 551 * @static 552 * @syscap SystemCapability.Utils.Lang 553 * @crossplatform 554 * @since 10 555 */ 556 /** 557 * Creates a stack trace. 558 * 559 * @param { Object[] } arguments - Logs to be printed. If this parameter is left blank, 560 * only stack information is printed. 561 * @static 562 * @syscap SystemCapability.Utils.Lang 563 * @crossplatform 564 * @atomicservice 565 * @since 12 566 */ 567 static trace(...arguments: Object[]): void; 568 569 /** 570 * Prints information about the current hybrid stack of the calling thread in the main thread or worker thread. 571 * 572 * @static 573 * @syscap SystemCapability.Utils.Lang 574 * @crossplatform 575 * @atomicservice 576 * @since 12 577 */ 578 static traceHybridStack(): void; 579} 580 581/** 582 * Sets the interval for repeatedly calling a function. 583 * 584 * @param { Function | string } handler - Indicates the function to be called after the timer goes off. 585 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 586 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 587 * @param { number } delay - Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. 588 * @param { any[] } arguments - Indicates additional arguments to pass to "handler" when the timer goes off. 589 * @returns { number } Returns the timer ID. 590 * @syscap SystemCapability.ArkUI.ArkUI.Full 591 * @since 7 592 */ 593/** 594 * Sets the interval for repeatedly calling a function. 595 * 596 * @param { Function | string } handler - Indicates the function to be called after the timer goes off. 597 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 598 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 599 * @param { number } delay - Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. 600 * @param { any[] } arguments - Indicates additional arguments to pass to "handler" when the timer goes off. 601 * @returns { number } Returns the timer ID. 602 * @syscap SystemCapability.ArkUI.ArkUI.Full 603 * @crossplatform 604 * @since 10 605 */ 606/** 607 * Sets a repeating timer for the system to repeatedly call a function at a fixed interval. 608 * The timer can only be manually deleted by calling the clearInterval API. 609 * 610 * @param { Function | string } handler - Function to be called repeatedly. If the type is string, error information is printed and no other processing is performed. 611 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 612 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 613 * @param { number } delay - Number of milliseconds delayed before the execution. 614 * @param { any[] } arguments - Additional parameters to pass to the handler after the timer goes off. 615 * @returns { number } ID of the timer. The timer ID is shared by processes and is an integer starting from 0 in ascending order. 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @crossplatform 618 * @atomicservice 619 * @since 11 620 */ 621export declare function setInterval(handler: Function | string, delay: number, ...arguments: any[]): number; 622 623/** 624 * Sets a timer after which a function will be executed. 625 * 626 * @param { Function | string } handler - Indicates the function to be called after the timer goes off. 627 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 628 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 629 * @param { number } [delay] - Indicates the delay (in milliseconds) after which the function will be called. 630 * If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. 631 * @param { any[] } arguments - Indicates additional arguments to pass to "handler" when the timer goes off. 632 * @returns { number } Returns the timer ID. 633 * @syscap SystemCapability.ArkUI.ArkUI.Full 634 * @since 7 635 */ 636/** 637 * Sets a timer after which a function will be executed. 638 * 639 * @param { Function | string } handler - Indicates the function to be called after the timer goes off. 640 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 641 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 642 * @param { number } [delay] - Indicates the delay (in milliseconds) after which the function will be called. 643 * If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. 644 * @param { any[] } [arguments] - Indicates additional arguments to pass to "handler" when the timer goes off. 645 * @returns { number } Returns the timer ID. 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @since 10 649 */ 650/** 651 * Sets a timer for the system to call a function after the timer goes off. 652 * The timer is automatically deleted after the callback is executed, and can be manually deleted by calling the clearTimeout API. 653 * 654 * @param { Function | string } handler - Function to be called after the timer goes off. If the type is string, error information is printed and no other processing is performed. 655 * For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. 656 * For devices of "lite wearable" and "smartVision" types, this parameter must be a function. 657 * @param { number } [delay] - Number of milliseconds delayed before the execution. It is recommended that an integer be passed in. A decimal will be rounded down. 658 * If this parameter is not specified, the default value 0 is used, indicating that the function is executed immediately (in the next event loop). 659 * NOTE 660 * 1. In either case, the actual delay may be longer than expected. 661 * 2. If a value less than 1 is passed, the default value 0 is used. 662 * @param { any[] } [arguments] - Additional parameters to pass to the handler after the timer goes off. 663 * @returns { number } ID of the timer. The timer ID is shared by processes and is an integer starting from 0 in ascending order. 664 * @syscap SystemCapability.ArkUI.ArkUI.Full 665 * @crossplatform 666 * @atomicservice 667 * @since 11 668 */ 669export declare function setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): number; 670 671/** 672 * Cancel the interval set by " setInterval()". 673 * 674 * @param { number } [intervalID] - Indicates the timer ID returned by "setInterval()". 675 * @syscap SystemCapability.ArkUI.ArkUI.Full 676 * @since 7 677 */ 678/** 679 * Cancel the interval set by " setInterval()". 680 * 681 * @param { number } [intervalID] - Indicates the timer ID returned by "setInterval()". 682 * @syscap SystemCapability.ArkUI.ArkUI.Full 683 * @crossplatform 684 * @since 10 685 */ 686/** 687 * Cancels the repeating timer set via setInterval(). 688 * The timer object is stored in the thread that creates the timer and must be deleted in that thread. 689 * 690 * @param { number } [intervalID] - ID of the repeating timer to cancel, which is returned by setInterval(). If this parameter is omitted, no timer is canceled. 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @crossplatform 693 * @atomicservice 694 * @since 11 695 */ 696export declare function clearInterval(intervalID?: number): void; 697 698/** 699 * Cancel the timer set by "setTimeout()". 700 * 701 * @param { number } [timeoutID] - Indicates the timer ID returned by "setTimeout()". 702 * @syscap SystemCapability.ArkUI.ArkUI.Full 703 * @since 7 704 */ 705/** 706 * Cancel the timer set by "setTimeout()". 707 * 708 * @param { number } [timeoutID] - Indicates the timer ID returned by "setTimeout()". 709 * @syscap SystemCapability.ArkUI.ArkUI.Full 710 * @crossplatform 711 * @since 10 712 */ 713/** 714 * Cancels a timer set via setTimeout(). 715 * The timer object is stored in the thread that creates the timer and must be deleted in that thread. 716 * 717 * @param { number } [timeoutID] - ID of the timer to cancel, which is returned by setTimeout() If this parameter is omitted, no timer is canceled. 718 * @syscap SystemCapability.ArkUI.ArkUI.Full 719 * @crossplatform 720 * @atomicservice 721 * @since 11 722 */ 723export declare function clearTimeout(timeoutID?: number): void; 724 725/** 726 * Defining syscap function. 727 * 728 * @param { string } syscap 729 * @returns { boolean } 730 * @syscap SystemCapability.ArkUI.ArkUI.Full 731 * @since 8 732 */ 733/** 734 * Defining syscap function. 735 * 736 * @param { string } syscap 737 * @returns { boolean } 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @since 10 741 */ 742/** 743 * Defining syscap function. 744 * 745 * @param { string } syscap 746 * @returns { boolean } 747 * @syscap SystemCapability.ArkUI.ArkUI.Full 748 * @crossplatform 749 * @atomicservice 750 * @since 11 751 */ 752export declare function canIUse(syscap: string): boolean; 753 754/** 755 * Obtains all attributes of the component with the specified ID. 756 * 757 * @param { string } id - ID of the component whose attributes are to be obtained. 758 * @returns { string } 759 * @syscap SystemCapability.ArkUI.ArkUI.Full 760 * @since 9 761 * @test 762 */ 763/** 764 * Obtains all attributes of the component with the specified ID. 765 * 766 * @param { string } id - ID of the component whose attributes are to be obtained. 767 * @returns { string } 768 * @syscap SystemCapability.ArkUI.ArkUI.Full 769 * @crossplatform 770 * @since 10 771 * @test 772 */ 773/** 774 * Obtains all attributes of the component with the specified ID. 775 * 776 * @param { string } id - ID of the component whose attributes are to be obtained. 777 * @returns { string } 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @crossplatform 780 * @atomicservice 781 * @since 11 782 * @test 783 */ 784export declare function getInspectorByKey(id: string): string; 785 786/** 787 * Get components tree. 788 * 789 * @returns { Object } 790 * @syscap SystemCapability.ArkUI.ArkUI.Full 791 * @since 9 792 * @test 793 */ 794/** 795 * Get components tree. 796 * 797 * @returns { Object } 798 * @syscap SystemCapability.ArkUI.ArkUI.Full 799 * @crossplatform 800 * @since 10 801 * @test 802 */ 803/** 804 * Get components tree. 805 * 806 * @returns { Object } 807 * @syscap SystemCapability.ArkUI.ArkUI.Full 808 * @crossplatform 809 * @atomicservice 810 * @since 11 811 * @test 812 */ 813export declare function getInspectorTree(): Object; 814 815/** 816 * Sends an event to the component with the specified ID. 817 * 818 * @param { string } id - ID of the component for which the event is to be sent. 819 * @param { number } action - Type of the event to be sent. The options are as follows: Click event: 10 LongClick: 11. 820 * @param { string } params - Event parameters. If there is no parameter, pass an empty string "". 821 * @returns { boolean } 822 * @syscap SystemCapability.ArkUI.ArkUI.Full 823 * @since 9 824 * @test 825 */ 826/** 827 * Sends an event to the component with the specified ID. 828 * 829 * @param { string } id - ID of the component for which the event is to be sent. 830 * @param { number } action - Type of the event to be sent. The options are as follows: Click event: 10 LongClick: 11. 831 * @param { string } params - Event parameters. If there is no parameter, pass an empty string "". 832 * @returns { boolean } 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @crossplatform 835 * @since 10 836 * @test 837 */ 838/** 839 * Sends an event to the component with the specified ID. 840 * 841 * @param { string } id - ID of the component for which the event is to be sent. 842 * @param { number } action - Type of the event to be sent. The options are as follows: Click event: 10 LongClick: 11. 843 * @param { string } params - Event parameters. If there is no parameter, pass an empty string "". 844 * @returns { boolean } 845 * @syscap SystemCapability.ArkUI.ArkUI.Full 846 * @crossplatform 847 * @atomicservice 848 * @since 11 849 * @test 850 */ 851export declare function sendEventByKey(id: string, action: number, params: string): boolean; 852 853/** 854 * Send touch event. 855 * 856 * @param { TouchObject } event - TouchObject to be sent. 857 * @returns { boolean } 858 * @syscap SystemCapability.ArkUI.ArkUI.Full 859 * @since 9 860 * @test 861 */ 862/** 863 * Send touch event. 864 * 865 * @param { TouchObject } event - TouchObject to be sent. 866 * @returns { boolean } 867 * @syscap SystemCapability.ArkUI.ArkUI.Full 868 * @crossplatform 869 * @since 10 870 * @test 871 */ 872/** 873 * Send touch event. 874 * 875 * @param { TouchObject } event - TouchObject to be sent. 876 * @returns { boolean } 877 * @syscap SystemCapability.ArkUI.ArkUI.Full 878 * @crossplatform 879 * @atomicservice 880 * @since 11 881 * @test 882 */ 883export declare function sendTouchEvent(event: TouchObject): boolean; 884 885/** 886 * Send key event. 887 * 888 * @param { KeyEvent } event - KeyEvent to be sent. 889 * @returns { boolean } 890 * @syscap SystemCapability.ArkUI.ArkUI.Full 891 * @since 9 892 * @test 893 */ 894/** 895 * Send key event. 896 * 897 * @param { KeyEvent } event - KeyEvent to be sent. 898 * @returns { boolean } 899 * @syscap SystemCapability.ArkUI.ArkUI.Full 900 * @crossplatform 901 * @since 10 902 * @test 903 */ 904/** 905 * Send key event. 906 * 907 * @param { KeyEvent } event - KeyEvent to be sent. 908 * @returns { boolean } 909 * @syscap SystemCapability.ArkUI.ArkUI.Full 910 * @crossplatform 911 * @atomicservice 912 * @since 11 913 * @test 914 */ 915export declare function sendKeyEvent(event: KeyEvent): boolean; 916 917/** 918 * Send mouse event. 919 * 920 * @param { MouseEvent } event - MouseEvent to be sent. 921 * @returns { boolean } 922 * @syscap SystemCapability.ArkUI.ArkUI.Full 923 * @since 9 924 * @test 925 */ 926/** 927 * Send mouse event. 928 * 929 * @param { MouseEvent } event - MouseEvent to be sent. 930 * @returns { boolean } 931 * @syscap SystemCapability.ArkUI.ArkUI.Full 932 * @crossplatform 933 * @since 10 934 * @test 935 */ 936/** 937 * Send mouse event. 938 * 939 * @param { MouseEvent } event - MouseEvent to be sent. 940 * @returns { boolean } 941 * @syscap SystemCapability.ArkUI.ArkUI.Full 942 * @crossplatform 943 * @atomicservice 944 * @since 11 945 * @test 946 */ 947export declare function sendMouseEvent(event: MouseEvent): boolean; 948 949 /** 950 * Mark moduleNamespace which loaded by dynamic-import is collectable. 951 * 952 * @param { Object } namespace - moduleNamespace to be marked. 953 * @throws { BusinessError } 401 - if type of object is not moduleNameSpace. 954 * @syscap SystemCapability.Utils.Lang 955 * @systemapi 956 * @stagemodelonly 957 * @since 10 958 */ 959export declare function markModuleCollectable(namespace: Object): void; 960 961/** 962 * Support loading native module during the runtime phase. 963 * 964 * @param { string } moduleName - Indicates the native module name. 965 * @returns { Object } Returns the default export from the native module. 966 * @throws { BusinessError } 401 - The parameter check failed. 967 * @throws { BusinessError } 10200301 - Loading native module failed. 968 * @syscap SystemCapability.Utils.Lang 969 * @stagemodelonly 970 * @atomicservice 971 * @since 12 972 */ 973export declare function loadNativeModule(moduleName: string): Object;