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 ArkWeb 19 */ 20 21/** 22 * Provides methods for controlling the web controller. 23 * 24 * @syscap SystemCapability.Web.Webview.Core 25 * @since 9 26 */ 27/** 28 * Provides methods for controlling the web controller. 29 * 30 * @syscap SystemCapability.Web.Webview.Core 31 * @crossplatform 32 * @since 10 33 */ 34/** 35 * Provides methods for controlling the web controller. 36 * 37 * @typedef { import('../api/@ohos.web.webview').default.WebviewController } 38 * @syscap SystemCapability.Web.Webview.Core 39 * @crossplatform 40 * @atomicservice 41 * @since 11 42 */ 43declare type WebviewController = import('../api/@ohos.web.webview').default.WebviewController; 44 45/** 46 * The callback of load committed. 47 * 48 * @typedef { function } OnNavigationEntryCommittedCallback 49 * @param { LoadCommittedDetails } loadCommittedDetails - callback information of onNavigationEntryCommitted. 50 * @syscap SystemCapability.Web.Webview.Core 51 * @atomicservice 52 * @since 11 53 */ 54type OnNavigationEntryCommittedCallback = (loadCommittedDetails: LoadCommittedDetails) => void; 55 56/** 57 * The callback of ssl error event. 58 * 59 * @typedef { function } OnSslErrorEventCallback 60 * @param { SslErrorEvent } sslErrorEvent - callback information of onSslErrorEvent. 61 * @syscap SystemCapability.Web.Webview.Core 62 * @atomicservice 63 * @since 12 64 */ 65type OnSslErrorEventCallback = (sslErrorEvent: SslErrorEvent) => void; 66 67/** 68 * The callback of largestContentfulPaint. 69 * 70 * @typedef { function } OnLargestContentfulPaintCallback 71 * @param { LargestContentfulPaint } largestContentfulPaint - callback information of onLargestContentfulPaint. 72 * @syscap SystemCapability.Web.Webview.Core 73 * @atomicservice 74 * @since 12 75 */ 76type OnLargestContentfulPaintCallback = (largestContentfulPaint: LargestContentfulPaint) => void; 77 78/** 79 * The callback of firstMeaningfulPaint. 80 * 81 * @typedef { function } OnFirstMeaningfulPaintCallback 82 * @param { FirstMeaningfulPaint } firstMeaningfulPaint - callback information of onFirstMeaningfulPaint. 83 * @syscap SystemCapability.Web.Webview.Core 84 * @atomicservice 85 * @since 12 86 */ 87type OnFirstMeaningfulPaintCallback = (firstMeaningfulPaint: FirstMeaningfulPaint) => void; 88 89/** 90 * The callback of onOverrideUrlLoading. 91 * Should not call WebviewController.loadUrl with the request's URL and then return true. 92 * 93 * @typedef { function } OnOverrideUrlLoadingCallback 94 * @param { WebResourceRequest } webResourceRequest - callback information of onOverrideUrlLoading. 95 * @returns { boolean } - Returning true causes the current Web to abort loading the URL, 96 * false causes the Web to continue loading the url as usual. 97 * @syscap SystemCapability.Web.Webview.Core 98 * @atomicservice 99 * @since 12 100 */ 101type OnOverrideUrlLoadingCallback = (webResourceRequest: WebResourceRequest) => boolean; 102 103/** 104 * The callback of Intelligent Tracking Prevention. 105 * 106 * @typedef { function } OnIntelligentTrackingPreventionCallback 107 * @param { IntelligentTrackingPreventionDetails } details - callback information of onIntelligentTrackingPrevention. 108 * @syscap SystemCapability.Web.Webview.Core 109 * @atomicservice 110 * @since 12 111 */ 112type OnIntelligentTrackingPreventionCallback = (details: IntelligentTrackingPreventionDetails) => void; 113 114/** 115 * The callback of onNativeEmbedVisibilityChange. 116 * 117 * @typedef { function } OnNativeEmbedVisibilityChangeCallback 118 * @param { NativeEmbedVisibilityInfo } nativeEmbedVisibilityInfo - callback information of onNativeEmbedVisibilityChange. 119 * @syscap SystemCapability.Web.Webview.Core 120 * @since 12 121 */ 122type OnNativeEmbedVisibilityChangeCallback = (nativeEmbedVisibilityInfo: NativeEmbedVisibilityInfo) => void; 123 124/** 125 * The configuration of native media player. 126 * 127 * @typedef NativeMediaPlayerConfig 128 * @syscap SystemCapability.Web.Webview.Core 129 * @atomicservice 130 * @since 12 131 */ 132declare interface NativeMediaPlayerConfig { 133 /** 134 * Should playing web media by native application instead of web player. 135 * 136 * @type { boolean } 137 * @syscap SystemCapability.Web.Webview.Core 138 * @atomicservice 139 * @since 12 140 */ 141 enable: boolean; 142 143 /** 144 * The contents painted by native media player should overlay web page. 145 * 146 * @type { boolean } 147 * @syscap SystemCapability.Web.Webview.Core 148 * @atomicservice 149 * @since 12 150 */ 151 shouldOverlay: boolean; 152} 153 154/** 155 * The callback of render process not responding. 156 * 157 * @typedef { function } OnRenderProcessNotRespondingCallback 158 * @param { RenderProcessNotRespondingData } data - details of onRenderProcessNotResponding. 159 * @syscap SystemCapability.Web.Webview.Core 160 * @since 12 161 */ 162type OnRenderProcessNotRespondingCallback = (data : RenderProcessNotRespondingData) => void; 163 164/** 165 * The callback of render process responding. 166 * 167 * @typedef { function } OnRenderProcessRespondingCallback 168 * @syscap SystemCapability.Web.Webview.Core 169 * @since 12 170 */ 171type OnRenderProcessRespondingCallback = () => void; 172 173/** 174* The callback of ViewportFit Changed. 175 * 176 * @typedef { function } OnViewportFitChangedCallback 177 * @param { ViewportFit } viewportFit - details of OnViewportFitChangedCallback. 178 * @syscap SystemCapability.Web.Webview.Core 179 * @atomicservice 180 * @since 12 181 */ 182type OnViewportFitChangedCallback = (viewportFit: ViewportFit) => void; 183 184/** 185 * The callback of ads block 186 * 187 * @typedef { function } OnAdsBlockedCallback 188 * @param { AdsBlockedDetails } details - details of OnAdsBlockedCallback. 189 * @syscap SystemCapability.Web.Webview.Core 190 * @atomicservice 191 * @since 12 192 */ 193type OnAdsBlockedCallback = (details: AdsBlockedDetails) => void; 194 195/** 196 * Defines the ads block details. 197 * 198 * @interface AdsBlockedDetails 199 * @syscap SystemCapability.Web.Webview.Core 200 * @atomicservice 201 * @since 12 202 */ 203declare interface AdsBlockedDetails { 204 /** 205 * The url of main frame. 206 * 207 * @type { string } 208 * @syscap SystemCapability.Web.Webview.Core 209 * @atomicservice 210 * @since 12 211 */ 212 url: string; 213 214 /** 215 * the url of ads. 216 * 217 * @type { Array<string> } 218 * @syscap SystemCapability.Web.Webview.Core 219 * @atomicservice 220 * @since 12 221 */ 222 adsBlocked: Array<string>; 223} 224 225/** 226 * Defines the web keyboard options when onInterceptKeyboardAttach event return. 227 * 228 * @interface WebKeyboardOptions 229 * @syscap SystemCapability.Web.Webview.Core 230 * @atomicservice 231 * @since 12 232 */ 233declare interface WebKeyboardOptions { 234 /** 235 * Whether the system keyboard is used. 236 * 237 * @type { boolean } 238 * @syscap SystemCapability.Web.Webview.Core 239 * @atomicservice 240 * @since 12 241 */ 242 useSystemKeyboard: boolean; 243 /** 244 * Set the enter key type when the system keyboard is used, the "enter" key related to the {@link inputMethodEngine}. 245 * 246 * @type { ?number } 247 * @syscap SystemCapability.Web.Webview.Core 248 * @atomicservice 249 * @since 12 250 */ 251 enterKeyType?: number; 252 /** 253 * Set the custom keyboard builder when the custom keyboard is used. 254 * 255 * @type { ?CustomBuilder } 256 * @syscap SystemCapability.Web.Webview.Core 257 * @atomicservice 258 * @since 12 259 */ 260 customKeyboard?: CustomBuilder; 261} 262 263/** 264 * Define the controller to interact with a custom keyboard, related to the {@link onInterceptKeyboardAttach} event. 265 * 266 * @syscap SystemCapability.Web.Webview.Core 267 * @atomicservice 268 * @since 12 269 */ 270declare class WebKeyboardController { 271 /** 272 * Constructor. 273 * 274 * @syscap SystemCapability.Web.Webview.Core 275 * @atomicservice 276 * @since 12 277 */ 278 constructor(); 279 280 /** 281 * Insert text into Editor. 282 * 283 * @param { string } text - text which will be inserted. 284 * @syscap SystemCapability.Web.Webview.Core 285 * @since 12 286 */ 287 insertText(text: string): void; 288 /** 289 * Delete text from back to front. 290 * 291 * @param { number } length - length of text, which will be deleted from back to front. 292 * @syscap SystemCapability.Web.Webview.Core 293 * @since 12 294 */ 295 deleteForward(length: number): void; 296 /** 297 * Delete text from front to back. 298 * 299 * @param { number } length - length of text, which will be deleted from front to back. 300 * @syscap SystemCapability.Web.Webview.Core 301 * @since 12 302 */ 303 deleteBackward(length: number): void; 304 /** 305 * Send the function of the key. 306 * 307 * @param { number } key - action indicates the "enter" key related to the {@link inputMethodEngine} 308 * @syscap SystemCapability.Web.Webview.Core 309 * @since 12 310 */ 311 sendFunctionKey(key: number): void; 312 /** 313 * Close the custom keyboard. 314 * 315 * @syscap SystemCapability.Web.Webview.Core 316 * @since 12 317 */ 318 close(): void; 319} 320 321/** 322 * Defines the web keyboard callback info related to the {@link onInterceptKeyboardAttach} event. 323 * 324 * @interface WebKeyboardCallbackInfo 325 * @syscap SystemCapability.Web.Webview.Core 326 * @atomicservice 327 * @since 12 328 */ 329declare interface WebKeyboardCallbackInfo { 330 /** 331 * The web keyboard controller. 332 * 333 * @type { WebKeyboardController } 334 * @syscap SystemCapability.Web.Webview.Core 335 * @atomicservice 336 * @since 12 337 */ 338 controller: WebKeyboardController; 339 /** 340 * The attributes of web input element. 341 * 342 * @type { Record<string, string> } 343 * @syscap SystemCapability.Web.Webview.Core 344 * @atomicservice 345 * @since 12 346 */ 347 attributes: Record<string, string>; 348} 349 350/** 351 * The callback of onInterceptKeyboardAttach event. 352 * 353 * @typedef { function } WebKeyboardCallback 354 * @param { WebKeyboardCallbackInfo } keyboardCallbackInfo - callback information of onInterceptKeyboardAttach. 355 * @returns { WebKeyboardOptions } Return the web keyboard options of this web component. 356 * @syscap SystemCapability.Web.Webview.Core 357 * @atomicservice 358 * @since 12 359 */ 360type WebKeyboardCallback = (keyboardCallbackInfo: WebKeyboardCallbackInfo) => WebKeyboardOptions; 361 362/** 363 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 364 * 365 * @enum { number } 366 * @syscap SystemCapability.Web.Webview.Core 367 * @since 8 368 */ 369/** 370 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 371 * 372 * @enum { number } 373 * @syscap SystemCapability.Web.Webview.Core 374 * @crossplatform 375 * @atomicservice 376 * @since 11 377 */ 378declare enum MessageLevel { 379 /** 380 * Debug level. 381 * 382 * @syscap SystemCapability.Web.Webview.Core 383 * @since 8 384 */ 385 /** 386 * Debug level. 387 * 388 * @syscap SystemCapability.Web.Webview.Core 389 * @crossplatform 390 * @atomicservice 391 * @since 11 392 */ 393 Debug, 394 395 /** 396 * Error level. 397 * 398 * @syscap SystemCapability.Web.Webview.Core 399 * @since 8 400 */ 401 /** 402 * Error level. 403 * 404 * @syscap SystemCapability.Web.Webview.Core 405 * @crossplatform 406 * @atomicservice 407 * @since 11 408 */ 409 Error, 410 411 /** 412 * Info level. 413 * 414 * @syscap SystemCapability.Web.Webview.Core 415 * @since 8 416 */ 417 /** 418 * Info level. 419 * 420 * @syscap SystemCapability.Web.Webview.Core 421 * @crossplatform 422 * @atomicservice 423 * @since 11 424 */ 425 Info, 426 427 /** 428 * Log level. 429 * 430 * @syscap SystemCapability.Web.Webview.Core 431 * @since 8 432 */ 433 /** 434 * Log level. 435 * 436 * @syscap SystemCapability.Web.Webview.Core 437 * @crossplatform 438 * @atomicservice 439 * @since 11 440 */ 441 Log, 442 443 /** 444 * Warn level. 445 * 446 * @syscap SystemCapability.Web.Webview.Core 447 * @since 8 448 */ 449 /** 450 * Warn level. 451 * 452 * @syscap SystemCapability.Web.Webview.Core 453 * @crossplatform 454 * @atomicservice 455 * @since 11 456 */ 457 Warn, 458} 459 460/** 461 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 462 * 463 * @enum { number } 464 * @syscap SystemCapability.Web.Webview.Core 465 * @since 8 466 */ 467/** 468 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 469 * 470 * @enum { number } 471 * @syscap SystemCapability.Web.Webview.Core 472 * @atomicservice 473 * @since 11 474 */ 475declare enum MixedMode { 476 /** 477 * Allows all sources. 478 * 479 * @syscap SystemCapability.Web.Webview.Core 480 * @since 8 481 */ 482 /** 483 * Allows all sources. 484 * 485 * @syscap SystemCapability.Web.Webview.Core 486 * @atomicservice 487 * @since 11 488 */ 489 All, 490 491 /** 492 * Allows sources Compatibly. 493 * 494 * @syscap SystemCapability.Web.Webview.Core 495 * @since 8 496 */ 497 /** 498 * Allows sources Compatibly. 499 * 500 * @syscap SystemCapability.Web.Webview.Core 501 * @atomicservice 502 * @since 11 503 */ 504 Compatible, 505 506 /** 507 * Don't allow unsecure sources from a secure origin. 508 * 509 * @syscap SystemCapability.Web.Webview.Core 510 * @since 8 511 */ 512 /** 513 * Don't allow unsecure sources from a secure origin. 514 * 515 * @syscap SystemCapability.Web.Webview.Core 516 * @atomicservice 517 * @since 11 518 */ 519 None, 520} 521 522/** 523 * The callback of safe browsing check. 524 * 525 * @typedef { function } OnSafeBrowsingCheckResultCallback 526 * @param { ThreatType } threatType - callback information of onSafeBrowsingCheckResult. 527 * @syscap SystemCapability.Web.Webview.Core 528 * @atomicservice 529 * @since 11 530 */ 531type OnSafeBrowsingCheckResultCallback = (threatType: ThreatType) => void; 532 533/** 534 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 535 * 536 * @enum { number } 537 * @syscap SystemCapability.Web.Webview.Core 538 * @since 8 539 */ 540/** 541 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 542 * 543 * @enum { number } 544 * @syscap SystemCapability.Web.Webview.Core 545 * @atomicservice 546 * @since 11 547 */ 548declare enum HitTestType { 549 /** 550 * The edit text. 551 * 552 * @syscap SystemCapability.Web.Webview.Core 553 * @since 8 554 */ 555 /** 556 * The edit text. 557 * 558 * @syscap SystemCapability.Web.Webview.Core 559 * @atomicservice 560 * @since 11 561 */ 562 EditText, 563 564 /** 565 * The email address. 566 * 567 * @syscap SystemCapability.Web.Webview.Core 568 * @since 8 569 */ 570 /** 571 * The email address. 572 * 573 * @syscap SystemCapability.Web.Webview.Core 574 * @atomicservice 575 * @since 11 576 */ 577 Email, 578 579 /** 580 * The HTML::a tag with src=http. 581 * 582 * @syscap SystemCapability.Web.Webview.Core 583 * @since 8 584 */ 585 /** 586 * The HTML::a tag with src=http. 587 * 588 * @syscap SystemCapability.Web.Webview.Core 589 * @atomicservice 590 * @since 11 591 */ 592 HttpAnchor, 593 594 /** 595 * The HTML::a tag with src=http + HTML::img. 596 * 597 * @syscap SystemCapability.Web.Webview.Core 598 * @since 8 599 */ 600 /** 601 * The HTML::a tag with src=http + HTML::img. 602 * 603 * @syscap SystemCapability.Web.Webview.Core 604 * @atomicservice 605 * @since 11 606 */ 607 HttpAnchorImg, 608 609 /** 610 * The HTML::img tag. 611 * 612 * @syscap SystemCapability.Web.Webview.Core 613 * @since 8 614 */ 615 /** 616 * The HTML::img tag. 617 * 618 * @syscap SystemCapability.Web.Webview.Core 619 * @atomicservice 620 * @since 11 621 */ 622 Img, 623 624 /** 625 * The map address. 626 * 627 * @syscap SystemCapability.Web.Webview.Core 628 * @since 8 629 */ 630 /** 631 * The map address. 632 * 633 * @syscap SystemCapability.Web.Webview.Core 634 * @atomicservice 635 * @since 11 636 */ 637 Map, 638 639 /** 640 * The phone number. 641 * 642 * @syscap SystemCapability.Web.Webview.Core 643 * @since 8 644 */ 645 /** 646 * The phone number. 647 * 648 * @syscap SystemCapability.Web.Webview.Core 649 * @atomicservice 650 * @since 11 651 */ 652 Phone, 653 654 /** 655 * Other unknown HitTest. 656 * 657 * @syscap SystemCapability.Web.Webview.Core 658 * @since 8 659 */ 660 /** 661 * Other unknown HitTest. 662 * 663 * @syscap SystemCapability.Web.Webview.Core 664 * @atomicservice 665 * @since 11 666 */ 667 Unknown, 668} 669 670/** 671 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 672 * 673 * @enum { number } 674 * @syscap SystemCapability.Web.Webview.Core 675 * @since 8 676 */ 677/** 678 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 679 * 680 * @enum { number } 681 * @syscap SystemCapability.Web.Webview.Core 682 * @atomicservice 683 * @since 11 684 */ 685declare enum CacheMode { 686 /** 687 * load cache when they are available and not expired, otherwise load online. 688 * 689 * @syscap SystemCapability.Web.Webview.Core 690 * @since 9 691 */ 692 /** 693 * load cache when they are available and not expired, otherwise load online. 694 * 695 * @syscap SystemCapability.Web.Webview.Core 696 * @atomicservice 697 * @since 11 698 */ 699 Default, 700 701 /** 702 * load cache when they are available, otherwise load online. 703 * 704 * @syscap SystemCapability.Web.Webview.Core 705 * @since 8 706 */ 707 /** 708 * load cache when they are available, otherwise load online. 709 * 710 * @syscap SystemCapability.Web.Webview.Core 711 * @atomicservice 712 * @since 11 713 */ 714 None, 715 716 /** 717 * Load online and not cache. 718 * 719 * @syscap SystemCapability.Web.Webview.Core 720 * @since 8 721 */ 722 /** 723 * Load online and not cache. 724 * 725 * @syscap SystemCapability.Web.Webview.Core 726 * @atomicservice 727 * @since 11 728 */ 729 Online, 730 731 /** 732 * load cache and not online. 733 * 734 * @syscap SystemCapability.Web.Webview.Core 735 * @since 8 736 */ 737 /** 738 * load cache and not online. 739 * 740 * @syscap SystemCapability.Web.Webview.Core 741 * @atomicservice 742 * @since 11 743 */ 744 Only, 745} 746 747/** 748 * Enum type supplied to {@link overScrollMode} for setting the web overScroll mode. 749 * 750 * @enum { number } 751 * @syscap SystemCapability.Web.Webview.Core 752 * @atomicservice 753 * @since 11 754 */ 755declare enum OverScrollMode { 756 /** 757 * Disable the web over-scroll mode. 758 * 759 * @syscap SystemCapability.Web.Webview.Core 760 * @atomicservice 761 * @since 11 762 */ 763 NEVER, 764 /** 765 * Enable the web over-scroll mode. 766 * 767 * @syscap SystemCapability.Web.Webview.Core 768 * @atomicservice 769 * @since 11 770 */ 771 ALWAYS 772} 773 774/** 775 * Enum type supplied to {@link darkMode} for setting the web dark mode. 776 * 777 * @enum { number } 778 * @syscap SystemCapability.Web.Webview.Core 779 * @since 9 780 */ 781/** 782 * Enum type supplied to {@link darkMode} for setting the web dark mode. 783 * 784 * @enum { number } 785 * @syscap SystemCapability.Web.Webview.Core 786 * @atomicservice 787 * @since 11 788 */ 789declare enum WebDarkMode { 790 /** 791 * Disable the web dark mode. 792 * 793 * @syscap SystemCapability.Web.Webview.Core 794 * @since 9 795 */ 796 /** 797 * Disable the web dark mode. 798 * 799 * @syscap SystemCapability.Web.Webview.Core 800 * @atomicservice 801 * @since 11 802 */ 803 Off, 804 805 /** 806 * Enable the web dark mode. 807 * 808 * @syscap SystemCapability.Web.Webview.Core 809 * @since 9 810 */ 811 /** 812 * Enable the web dark mode. 813 * 814 * @syscap SystemCapability.Web.Webview.Core 815 * @atomicservice 816 * @since 11 817 */ 818 On, 819 820 /** 821 * Make web dark mode follow the system. 822 * 823 * @syscap SystemCapability.Web.Webview.Core 824 * @since 9 825 */ 826 /** 827 * Make web dark mode follow the system. 828 * 829 * @syscap SystemCapability.Web.Webview.Core 830 * @atomicservice 831 * @since 11 832 */ 833 Auto, 834} 835 836/** 837 * Enum type supplied to {@link captureMode} for setting the web capture mode. 838 * 839 * @enum { number } 840 * @syscap SystemCapability.Web.Webview.Core 841 * @since 10 842 */ 843/** 844 * Enum type supplied to {@link captureMode} for setting the web capture mode. 845 * 846 * @enum { number } 847 * @syscap SystemCapability.Web.Webview.Core 848 * @atomicservice 849 * @since 11 850 */ 851declare enum WebCaptureMode { 852 /** 853 * The home screen. 854 * @syscap SystemCapability.Web.Webview.Core 855 * @since 10 856 */ 857 /** 858 * The home screen. 859 * @syscap SystemCapability.Web.Webview.Core 860 * @atomicservice 861 * @since 11 862 */ 863 HOME_SCREEN = 0, 864} 865 866/** 867 * Enum type supplied to {@link threatType} for the website's threat type. 868 * 869 * @enum { number } 870 * @syscap SystemCapability.Web.Webview.Core 871 * @atomicservice 872 * @since 11 873 */ 874declare enum ThreatType { 875 /** 876 * Illegal websites. 877 * 878 * @syscap SystemCapability.Web.Webview.Core 879 * @atomicservice 880 * @since 11 881 */ 882 THREAT_ILLEGAL = 0, 883 884 /** 885 * Fraud websites. 886 * 887 * @syscap SystemCapability.Web.Webview.Core 888 * @atomicservice 889 * @since 11 890 */ 891 THREAT_FRAUD = 1, 892 893 /** 894 * Websites with security risks. 895 * 896 * @syscap SystemCapability.Web.Webview.Core 897 * @atomicservice 898 * @since 11 899 */ 900 THREAT_RISK = 2, 901 902 /** 903 * Websites suspected of containing unhealthy content. 904 * ArkWeb will not intercept this type of website and apps could handle it themselves. 905 * 906 * @syscap SystemCapability.Web.Webview.Core 907 * @atomicservice 908 * @since 11 909 */ 910 THREAT_WARNING = 3, 911} 912 913/** 914 * Defines the Media Options. 915 * 916 * @interface WebMediaOptions 917 * @syscap SystemCapability.Web.Webview.Core 918 * @since 10 919 */ 920/** 921 * Defines the Media Options. 922 * 923 * @interface WebMediaOptions 924 * @syscap SystemCapability.Web.Webview.Core 925 * @atomicservice 926 * @since 11 927 */ 928/** 929 * Defines the Media Options. 930 * 931 * @typedef WebMediaOptions 932 * @syscap SystemCapability.Web.Webview.Core 933 * @atomicservice 934 * @since 12 935 */ 936declare interface WebMediaOptions { 937 /** 938 * The time interval for audio playback to resume. 939 * 940 * @type { ?number } 941 * @syscap SystemCapability.Web.Webview.Core 942 * @since 10 943 */ 944 /** 945 * The time interval for audio playback to resume. 946 * 947 * @type { ?number } 948 * @syscap SystemCapability.Web.Webview.Core 949 * @atomicservice 950 * @since 11 951 */ 952 resumeInterval?: number; 953 /** 954 * Whether the audio of each web is exclusive. 955 * 956 * @type { ?boolean } 957 * @syscap SystemCapability.Web.Webview.Core 958 * @since 10 959 */ 960 /** 961 * Whether the audio of each web is exclusive. 962 * 963 * @type { ?boolean } 964 * @syscap SystemCapability.Web.Webview.Core 965 * @atomicservice 966 * @since 11 967 */ 968 audioExclusive?: boolean; 969} 970 971/** 972 * Defines the screen capture configuration. 973 * 974 * @interface ScreenCaptureConfig 975 * @syscap SystemCapability.Web.Webview.Core 976 * @since 10 977 */ 978/** 979 * Defines the screen capture configuration. 980 * 981 * @interface ScreenCaptureConfig 982 * @syscap SystemCapability.Web.Webview.Core 983 * @atomicservice 984 * @since 11 985 */ 986/** 987 * Defines the screen capture configuration. 988 * 989 * @typedef ScreenCaptureConfig 990 * @syscap SystemCapability.Web.Webview.Core 991 * @atomicservice 992 * @since 12 993 */ 994declare interface ScreenCaptureConfig { 995 /** 996 * The mode for selecting the recording area. 997 * 998 * @type { WebCaptureMode } 999 * @syscap SystemCapability.Web.Webview.Core 1000 * @since 10 1001 */ 1002 /** 1003 * The mode for selecting the recording area. 1004 * 1005 * @type { WebCaptureMode } 1006 * @syscap SystemCapability.Web.Webview.Core 1007 * @atomicservice 1008 * @since 11 1009 */ 1010 captureMode: WebCaptureMode; 1011} 1012 1013/** 1014 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 1015 * 1016 * @syscap SystemCapability.Web.Webview.Core 1017 * @since 9 1018 */ 1019/** 1020 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 1021 * 1022 * @syscap SystemCapability.Web.Webview.Core 1023 * @atomicservice 1024 * @since 11 1025 */ 1026declare class FullScreenExitHandler { 1027 /** 1028 * Constructor. 1029 * 1030 * @syscap SystemCapability.Web.Webview.Core 1031 * @since 9 1032 */ 1033 /** 1034 * Constructor. 1035 * 1036 * @syscap SystemCapability.Web.Webview.Core 1037 * @atomicservice 1038 * @since 11 1039 */ 1040 constructor(); 1041 1042 /** 1043 * Exit the full screen mode. 1044 * 1045 * @syscap SystemCapability.Web.Webview.Core 1046 * @since 9 1047 */ 1048 /** 1049 * Exit the full screen mode. 1050 * 1051 * @syscap SystemCapability.Web.Webview.Core 1052 * @atomicservice 1053 * @since 11 1054 */ 1055 exitFullScreen(): void; 1056} 1057 1058/** 1059 * Defines the event details when the web component enter full screen mode. 1060 * 1061 * @typedef FullScreenEnterEvent 1062 * @syscap SystemCapability.Web.Webview.Core 1063 * @atomicservice 1064 * @since 12 1065 */ 1066declare interface FullScreenEnterEvent { 1067 /** 1068 * A function handle to exit full-screen mode. 1069 * 1070 * @type { FullScreenExitHandler } 1071 * @syscap SystemCapability.Web.Webview.Core 1072 * @atomicservice 1073 * @since 12 1074 */ 1075 handler: FullScreenExitHandler; 1076 /** 1077 * The intrinsic width of the video if the fullscreen element contains video element, expressed in CSS pixels. 1078 * 1079 * @type { ?number } 1080 * @syscap SystemCapability.Web.Webview.Core 1081 * @atomicservice 1082 * @since 12 1083 */ 1084 videoWidth?: number; 1085 /** 1086 * The intrinsic height of the video if the fullscreen element contains video element, expressed in CSS pixels. 1087 * 1088 * @type { ?number } 1089 * @syscap SystemCapability.Web.Webview.Core 1090 * @atomicservice 1091 * @since 12 1092 */ 1093 videoHeight?: number; 1094} 1095 1096/** 1097 * The callback when the web component enter full screen mode. 1098 * 1099 * @typedef { function } OnFullScreenEnterCallback 1100 * @param { FullScreenEnterEvent } event - callback information of onFullScreenEnter. 1101 * @syscap SystemCapability.Web.Webview.Core 1102 * @atomicservice 1103 * @since 12 1104 */ 1105type OnFullScreenEnterCallback = (event: FullScreenEnterEvent) => void; 1106 1107/** 1108 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 1109 * 1110 * @enum { number } 1111 * @syscap SystemCapability.Web.Webview.Core 1112 * @since 9 1113 */ 1114/** 1115 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 1116 * 1117 * @enum { number } 1118 * @syscap SystemCapability.Web.Webview.Core 1119 * @atomicservice 1120 * @since 11 1121 */ 1122declare enum RenderExitReason { 1123 /** 1124 * Render process non-zero exit status. 1125 * 1126 * @syscap SystemCapability.Web.Webview.Core 1127 * @since 9 1128 */ 1129 /** 1130 * Render process non-zero exit status. 1131 * 1132 * @syscap SystemCapability.Web.Webview.Core 1133 * @atomicservice 1134 * @since 11 1135 */ 1136 ProcessAbnormalTermination, 1137 1138 /** 1139 * SIGKILL or task manager kill. 1140 * 1141 * @syscap SystemCapability.Web.Webview.Core 1142 * @since 9 1143 */ 1144 /** 1145 * SIGKILL or task manager kill. 1146 * 1147 * @syscap SystemCapability.Web.Webview.Core 1148 * @atomicservice 1149 * @since 11 1150 */ 1151 ProcessWasKilled, 1152 1153 /** 1154 * Segmentation fault. 1155 * 1156 * @syscap SystemCapability.Web.Webview.Core 1157 * @since 9 1158 */ 1159 /** 1160 * Segmentation fault. 1161 * 1162 * @syscap SystemCapability.Web.Webview.Core 1163 * @atomicservice 1164 * @since 11 1165 */ 1166 ProcessCrashed, 1167 1168 /** 1169 * Out of memory. 1170 * 1171 * @syscap SystemCapability.Web.Webview.Core 1172 * @since 9 1173 */ 1174 /** 1175 * Out of memory. 1176 * 1177 * @syscap SystemCapability.Web.Webview.Core 1178 * @atomicservice 1179 * @since 11 1180 */ 1181 ProcessOom, 1182 1183 /** 1184 * Unknown reason. 1185 * 1186 * @syscap SystemCapability.Web.Webview.Core 1187 * @since 9 1188 */ 1189 /** 1190 * Unknown reason. 1191 * 1192 * @syscap SystemCapability.Web.Webview.Core 1193 * @atomicservice 1194 * @since 11 1195 */ 1196 ProcessExitUnknown, 1197} 1198 1199 /** 1200 * The callback of custom hide of the context menu. 1201 * 1202 * @typedef { function } OnContextMenuHideCallback 1203 * @syscap SystemCapability.Web.Webview.Core 1204 * @atomicservice 1205 * @since 11 1206 */ 1207 type OnContextMenuHideCallback = () => void; 1208 1209/** 1210 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 1211 * 1212 * @enum { number } 1213 * @syscap SystemCapability.Web.Webview.Core 1214 * @since 9 1215 */ 1216/** 1217 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 1218 * 1219 * @enum { number } 1220 * @syscap SystemCapability.Web.Webview.Core 1221 * @atomicservice 1222 * @since 11 1223 */ 1224declare enum SslError { 1225 /** 1226 * General error. 1227 * 1228 * @syscap SystemCapability.Web.Webview.Core 1229 * @since 9 1230 */ 1231 /** 1232 * General error. 1233 * 1234 * @syscap SystemCapability.Web.Webview.Core 1235 * @atomicservice 1236 * @since 11 1237 */ 1238 Invalid, 1239 1240 /** 1241 * Hostname mismatch. 1242 * 1243 * @syscap SystemCapability.Web.Webview.Core 1244 * @since 9 1245 */ 1246 /** 1247 * Hostname mismatch. 1248 * 1249 * @syscap SystemCapability.Web.Webview.Core 1250 * @atomicservice 1251 * @since 11 1252 */ 1253 HostMismatch, 1254 1255 /** 1256 * The certificate date is invalid. 1257 * 1258 * @syscap SystemCapability.Web.Webview.Core 1259 * @since 9 1260 */ 1261 /** 1262 * The certificate date is invalid. 1263 * 1264 * @syscap SystemCapability.Web.Webview.Core 1265 * @atomicservice 1266 * @since 11 1267 */ 1268 DateInvalid, 1269 1270 /** 1271 * The certificate authority is not trusted. 1272 * 1273 * @syscap SystemCapability.Web.Webview.Core 1274 * @since 9 1275 */ 1276 /** 1277 * The certificate authority is not trusted. 1278 * 1279 * @syscap SystemCapability.Web.Webview.Core 1280 * @atomicservice 1281 * @since 11 1282 */ 1283 Untrusted, 1284} 1285 1286/** 1287 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 1288 * 1289 * @enum { number } 1290 * @syscap SystemCapability.Web.Webview.Core 1291 * @since 9 1292 */ 1293/** 1294 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 1295 * 1296 * @enum { number } 1297 * @syscap SystemCapability.Web.Webview.Core 1298 * @crossplatform 1299 * @atomicservice 1300 * @since 11 1301 */ 1302declare enum FileSelectorMode { 1303 /** 1304 * Allows single file to be selected. 1305 * 1306 * @syscap SystemCapability.Web.Webview.Core 1307 * @since 9 1308 */ 1309 /** 1310 * Allows single file to be selected. 1311 * 1312 * @syscap SystemCapability.Web.Webview.Core 1313 * @crossplatform 1314 * @atomicservice 1315 * @since 11 1316 */ 1317 FileOpenMode, 1318 1319 /** 1320 * Allows multiple files to be selected. 1321 * 1322 * @syscap SystemCapability.Web.Webview.Core 1323 * @since 9 1324 */ 1325 /** 1326 * Allows multiple files to be selected. 1327 * 1328 * @syscap SystemCapability.Web.Webview.Core 1329 * @crossplatform 1330 * @atomicservice 1331 * @since 11 1332 */ 1333 FileOpenMultipleMode, 1334 1335 /** 1336 * Allows file folders to be selected. 1337 * 1338 * @syscap SystemCapability.Web.Webview.Core 1339 * @since 9 1340 */ 1341 /** 1342 * Allows file folders to be selected. 1343 * 1344 * @syscap SystemCapability.Web.Webview.Core 1345 * @crossplatform 1346 * @atomicservice 1347 * @since 11 1348 */ 1349 FileOpenFolderMode, 1350 1351 /** 1352 * Allows select files to save. 1353 * 1354 * @syscap SystemCapability.Web.Webview.Core 1355 * @since 9 1356 */ 1357 /** 1358 * Allows select files to save. 1359 * 1360 * @syscap SystemCapability.Web.Webview.Core 1361 * @crossplatform 1362 * @atomicservice 1363 * @since 11 1364 */ 1365 FileSaveMode, 1366} 1367 1368/** 1369 * Enum type supplied to {@link layoutMode} for setting the web layout mode. 1370 * 1371 * @enum { number } 1372 * @syscap SystemCapability.Web.Webview.Core 1373 * @atomicservice 1374 * @since 11 1375 */ 1376declare enum WebLayoutMode { 1377 /** 1378 * Web layout follows the system. 1379 * 1380 * @syscap SystemCapability.Web.Webview.Core 1381 * @atomicservice 1382 * @since 11 1383 */ 1384 NONE, 1385 1386 /** 1387 * Adaptive web layout based on page size. 1388 * 1389 * @syscap SystemCapability.Web.Webview.Core 1390 * @atomicservice 1391 * @since 11 1392 */ 1393 FIT_CONTENT, 1394} 1395 1396/** 1397 * Enum type supplied to {@link RenderProcessNotRespondingData} when onRenderProcessNotResponding is called. 1398 * 1399 * @enum { number } 1400 * @syscap SystemCapability.Web.Webview.Core 1401 * @since 12 1402 */ 1403declare enum RenderProcessNotRespondingReason { 1404 /** 1405 * Timeout for input sent to render process. 1406 * 1407 * @syscap SystemCapability.Web.Webview.Core 1408 * @since 12 1409 */ 1410 INPUT_TIMEOUT, 1411 1412 /** 1413 * Timeout for navigation commit. 1414 * 1415 * @syscap SystemCapability.Web.Webview.Core 1416 * @since 12 1417 */ 1418 NAVIGATION_COMMIT_TIMEOUT, 1419} 1420 1421/** 1422 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1423 * 1424 * @syscap SystemCapability.Web.Webview.Core 1425 * @since 9 1426 */ 1427/** 1428 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1429 * 1430 * @syscap SystemCapability.Web.Webview.Core 1431 * @crossplatform 1432 * @atomicservice 1433 * @since 11 1434 */ 1435declare class FileSelectorParam { 1436 /** 1437 * Constructor. 1438 * 1439 * @syscap SystemCapability.Web.Webview.Core 1440 * @since 9 1441 */ 1442 /** 1443 * Constructor. 1444 * 1445 * @syscap SystemCapability.Web.Webview.Core 1446 * @crossplatform 1447 * @atomicservice 1448 * @since 11 1449 */ 1450 constructor(); 1451 1452 /** 1453 * Gets the title of this file selector. 1454 * @returns { string } Return the title of this file selector. 1455 * @syscap SystemCapability.Web.Webview.Core 1456 * @since 9 1457 */ 1458 /** 1459 * Gets the title of this file selector. 1460 * @returns { string } Return the title of this file selector. 1461 * @syscap SystemCapability.Web.Webview.Core 1462 * @crossplatform 1463 * @atomicservice 1464 * @since 11 1465 */ 1466 getTitle(): string; 1467 1468 /** 1469 * Gets the FileSelectorMode of this file selector. 1470 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1471 * @syscap SystemCapability.Web.Webview.Core 1472 * @since 9 1473 */ 1474 /** 1475 * Gets the FileSelectorMode of this file selector. 1476 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1477 * @syscap SystemCapability.Web.Webview.Core 1478 * @crossplatform 1479 * @atomicservice 1480 * @since 11 1481 */ 1482 getMode(): FileSelectorMode; 1483 1484 /** 1485 * Gets an array of acceptable MIME type. 1486 * @returns { Array<string> } Return an array of acceptable MIME type. 1487 * @syscap SystemCapability.Web.Webview.Core 1488 * @since 9 1489 */ 1490 /** 1491 * Gets an array of acceptable MIME type. 1492 * @returns { Array<string> } Return an array of acceptable MIME type. 1493 * @syscap SystemCapability.Web.Webview.Core 1494 * @crossplatform 1495 * @atomicservice 1496 * @since 11 1497 */ 1498 getAcceptType(): Array<string>; 1499 1500 /** 1501 * Gets whether this file selector use a live media captured value. 1502 * 1503 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1504 * @syscap SystemCapability.Web.Webview.Core 1505 * @since 9 1506 */ 1507 /** 1508 * Gets whether this file selector use a live media captured value. 1509 * 1510 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1511 * @syscap SystemCapability.Web.Webview.Core 1512 * @crossplatform 1513 * @atomicservice 1514 * @since 11 1515 */ 1516 isCapture(): boolean; 1517} 1518 1519/** 1520 * Defines the js result. 1521 * 1522 * @syscap SystemCapability.Web.Webview.Core 1523 * @since 8 1524 */ 1525/** 1526 * Defines the js result. 1527 * 1528 * @syscap SystemCapability.Web.Webview.Core 1529 * @crossplatform 1530 * @atomicservice 1531 * @since 11 1532 */ 1533declare class JsResult { 1534 /** 1535 * Constructor. 1536 * 1537 * @syscap SystemCapability.Web.Webview.Core 1538 * @since 8 1539 */ 1540 /** 1541 * Constructor. 1542 * 1543 * @syscap SystemCapability.Web.Webview.Core 1544 * @crossplatform 1545 * @atomicservice 1546 * @since 11 1547 */ 1548 constructor(); 1549 1550 /** 1551 * Handle the user's JavaScript result if cancel the dialog. 1552 * 1553 * @syscap SystemCapability.Web.Webview.Core 1554 * @since 8 1555 */ 1556 /** 1557 * Handle the user's JavaScript result if cancel the dialog. 1558 * 1559 * @syscap SystemCapability.Web.Webview.Core 1560 * @crossplatform 1561 * @atomicservice 1562 * @since 11 1563 */ 1564 handleCancel(): void; 1565 1566 /** 1567 * Handle the user's JavaScript result if confirm the dialog. 1568 * 1569 * @syscap SystemCapability.Web.Webview.Core 1570 * @since 8 1571 */ 1572 /** 1573 * Handle the user's JavaScript result if confirm the dialog. 1574 * 1575 * @syscap SystemCapability.Web.Webview.Core 1576 * @crossplatform 1577 * @atomicservice 1578 * @since 11 1579 */ 1580 handleConfirm(): void; 1581 1582 /** 1583 * Handle the user's JavaScript result if confirm the prompt dialog. 1584 * 1585 * @param { string } result 1586 * @syscap SystemCapability.Web.Webview.Core 1587 * @since 9 1588 */ 1589 /** 1590 * Handle the user's JavaScript result if confirm the prompt dialog. 1591 * 1592 * @param { string } result 1593 * @syscap SystemCapability.Web.Webview.Core 1594 * @crossplatform 1595 * @atomicservice 1596 * @since 11 1597 */ 1598 handlePromptConfirm(result: string): void; 1599} 1600 1601/** 1602 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1603 * 1604 * @syscap SystemCapability.Web.Webview.Core 1605 * @since 9 1606 */ 1607/** 1608 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1609 * 1610 * @syscap SystemCapability.Web.Webview.Core 1611 * @crossplatform 1612 * @atomicservice 1613 * @since 11 1614 */ 1615declare class FileSelectorResult { 1616 /** 1617 * Constructor. 1618 * 1619 * @syscap SystemCapability.Web.Webview.Core 1620 * @since 9 1621 */ 1622 /** 1623 * Constructor. 1624 * 1625 * @syscap SystemCapability.Web.Webview.Core 1626 * @crossplatform 1627 * @atomicservice 1628 * @since 11 1629 */ 1630 constructor(); 1631 1632 /** 1633 * select a list of files. 1634 * 1635 * @param { Array<string> } fileList 1636 * @syscap SystemCapability.Web.Webview.Core 1637 * @since 9 1638 */ 1639 /** 1640 * select a list of files. 1641 * 1642 * @param { Array<string> } fileList 1643 * @syscap SystemCapability.Web.Webview.Core 1644 * @crossplatform 1645 * @atomicservice 1646 * @since 11 1647 */ 1648 handleFileList(fileList: Array<string>): void; 1649} 1650 1651/** 1652 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1653 * 1654 * @syscap SystemCapability.Web.Webview.Core 1655 * @since 9 1656 */ 1657/** 1658 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1659 * 1660 * @syscap SystemCapability.Web.Webview.Core 1661 * @crossplatform 1662 * @atomicservice 1663 * @since 11 1664 */ 1665declare class HttpAuthHandler { 1666 /** 1667 * Constructor. 1668 * 1669 * @syscap SystemCapability.Web.Webview.Core 1670 * @since 9 1671 */ 1672 /** 1673 * Constructor. 1674 * 1675 * @syscap SystemCapability.Web.Webview.Core 1676 * @crossplatform 1677 * @atomicservice 1678 * @since 11 1679 */ 1680 constructor(); 1681 1682 /** 1683 * confirm. 1684 * 1685 * @param { string } userName 1686 * @param { string } password 1687 * @returns { boolean } 1688 * @syscap SystemCapability.Web.Webview.Core 1689 * @since 9 1690 */ 1691 /** 1692 * confirm. 1693 * 1694 * @param { string } userName 1695 * @param { string } password 1696 * @returns { boolean } 1697 * @syscap SystemCapability.Web.Webview.Core 1698 * @crossplatform 1699 * @atomicservice 1700 * @since 11 1701 */ 1702 confirm(userName: string, password: string): boolean; 1703 1704 /** 1705 * cancel. 1706 * 1707 * @syscap SystemCapability.Web.Webview.Core 1708 * @since 9 1709 */ 1710 /** 1711 * cancel. 1712 * 1713 * @syscap SystemCapability.Web.Webview.Core 1714 * @crossplatform 1715 * @atomicservice 1716 * @since 11 1717 */ 1718 cancel(): void; 1719 1720 /** 1721 * isHttpAuthInfoSaved. 1722 * 1723 * @returns { boolean } 1724 * @syscap SystemCapability.Web.Webview.Core 1725 * @since 9 1726 */ 1727 /** 1728 * isHttpAuthInfoSaved. 1729 * 1730 * @returns { boolean } 1731 * @syscap SystemCapability.Web.Webview.Core 1732 * @crossplatform 1733 * @atomicservice 1734 * @since 11 1735 */ 1736 isHttpAuthInfoSaved(): boolean; 1737} 1738 1739/** 1740 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1741 * 1742 * @syscap SystemCapability.Web.Webview.Core 1743 * @since 9 1744 */ 1745/** 1746 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1747 * 1748 * @syscap SystemCapability.Web.Webview.Core 1749 * @atomicservice 1750 * @since 11 1751 */ 1752declare class SslErrorHandler { 1753 /** 1754 * Constructor. 1755 * 1756 * @syscap SystemCapability.Web.Webview.Core 1757 * @since 9 1758 */ 1759 /** 1760 * Constructor. 1761 * 1762 * @syscap SystemCapability.Web.Webview.Core 1763 * @atomicservice 1764 * @since 11 1765 */ 1766 constructor(); 1767 1768 /** 1769 * Confirm to use the SSL certificate. 1770 * 1771 * @syscap SystemCapability.Web.Webview.Core 1772 * @since 9 1773 */ 1774 /** 1775 * Confirm to use the SSL certificate. 1776 * 1777 * @syscap SystemCapability.Web.Webview.Core 1778 * @atomicservice 1779 * @since 11 1780 */ 1781 handleConfirm(): void; 1782 1783 /** 1784 * Cancel this request. 1785 * 1786 * @syscap SystemCapability.Web.Webview.Core 1787 * @since 9 1788 */ 1789 /** 1790 * Cancel this request. 1791 * 1792 * @syscap SystemCapability.Web.Webview.Core 1793 * @atomicservice 1794 * @since 11 1795 */ 1796 handleCancel(): void; 1797} 1798 1799/** 1800 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1801 * 1802 * @syscap SystemCapability.Web.Webview.Core 1803 * @since 9 1804 */ 1805/** 1806 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1807 * 1808 * @syscap SystemCapability.Web.Webview.Core 1809 * @atomicservice 1810 * @since 11 1811 */ 1812declare class ClientAuthenticationHandler { 1813 /** 1814 * Constructor. 1815 * 1816 * @syscap SystemCapability.Web.Webview.Core 1817 * @since 9 1818 */ 1819 /** 1820 * Constructor. 1821 * 1822 * @syscap SystemCapability.Web.Webview.Core 1823 * @atomicservice 1824 * @since 11 1825 */ 1826 constructor(); 1827 1828 /** 1829 * Confirm to use the specified private key and client certificate chain. 1830 * 1831 * @param { string } priKeyFile - The file that store private key. 1832 * @param { string } certChainFile - The file that store client certificate chain. 1833 * @syscap SystemCapability.Web.Webview.Core 1834 * @since 9 1835 */ 1836 /** 1837 * Confirm to use the specified private key and client certificate chain. 1838 * 1839 * @param { string } priKeyFile - The file that store private key. 1840 * @param { string } certChainFile - The file that store client certificate chain. 1841 * @syscap SystemCapability.Web.Webview.Core 1842 * @atomicservice 1843 * @since 11 1844 */ 1845 confirm(priKeyFile: string, certChainFile: string): void; 1846 1847 /** 1848 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1849 * 1850 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1851 * @syscap SystemCapability.Web.Webview.Core 1852 * @since 10 1853 */ 1854 /** 1855 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1856 * 1857 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1858 * @syscap SystemCapability.Web.Webview.Core 1859 * @atomicservice 1860 * @since 11 1861 */ 1862 confirm(authUri: string): void; 1863 1864 /** 1865 * Cancel this certificate request. 1866 * 1867 * @syscap SystemCapability.Web.Webview.Core 1868 * @since 9 1869 */ 1870 /** 1871 * Cancel this certificate request. 1872 * 1873 * @syscap SystemCapability.Web.Webview.Core 1874 * @atomicservice 1875 * @since 11 1876 */ 1877 cancel(): void; 1878 1879 /** 1880 * Ignore this certificate request temporarily. 1881 * 1882 * @syscap SystemCapability.Web.Webview.Core 1883 * @since 9 1884 */ 1885 /** 1886 * Ignore this certificate request temporarily. 1887 * 1888 * @syscap SystemCapability.Web.Webview.Core 1889 * @atomicservice 1890 * @since 11 1891 */ 1892 ignore(): void; 1893} 1894 1895/** 1896 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1897 * 1898 * @enum { string } 1899 * @syscap SystemCapability.Web.Webview.Core 1900 * @since 9 1901 */ 1902/** 1903 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1904 * 1905 * @enum { string } 1906 * @syscap SystemCapability.Web.Webview.Core 1907 * @crossplatform 1908 * @atomicservice 1909 * @since 11 1910 */ 1911declare enum ProtectedResourceType { 1912 /** 1913 * The MidiSysex resource. 1914 * 1915 * @syscap SystemCapability.Web.Webview.Core 1916 * @since 9 1917 */ 1918 /** 1919 * The MidiSysex resource. 1920 * 1921 * @syscap SystemCapability.Web.Webview.Core 1922 * @atomicservice 1923 * @since 11 1924 */ 1925 MidiSysex = 'TYPE_MIDI_SYSEX', 1926 1927 /** 1928 * The video capture resource, such as camera. 1929 * 1930 * @syscap SystemCapability.Web.Webview.Core 1931 * @since 10 1932 */ 1933 /** 1934 * The video capture resource, such as camera. 1935 * 1936 * @syscap SystemCapability.Web.Webview.Core 1937 * @crossplatform 1938 * @atomicservice 1939 * @since 11 1940 */ 1941 VIDEO_CAPTURE = 'TYPE_VIDEO_CAPTURE', 1942 1943 /** 1944 * The audio capture resource, such as microphone. 1945 * 1946 * @syscap SystemCapability.Web.Webview.Core 1947 * @since 10 1948 */ 1949 /** 1950 * The audio capture resource, such as microphone. 1951 * 1952 * @syscap SystemCapability.Web.Webview.Core 1953 * @crossplatform 1954 * @atomicservice 1955 * @since 11 1956 */ 1957 AUDIO_CAPTURE = 'TYPE_AUDIO_CAPTURE', 1958 1959 /** 1960 * The sensor resource, such as accelerometer. 1961 * 1962 * @syscap SystemCapability.Web.Webview.Core 1963 * @atomicservice 1964 * @since 12 1965 */ 1966 SENSOR = 'TYPE_SENSOR' 1967} 1968 1969/** 1970 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 1971 * 1972 * @syscap SystemCapability.Web.Webview.Core 1973 * @since 9 1974 */ 1975/** 1976 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 1977 * 1978 * @syscap SystemCapability.Web.Webview.Core 1979 * @crossplatform 1980 * @atomicservice 1981 * @since 11 1982 */ 1983declare class PermissionRequest { 1984 /** 1985 * Constructor. 1986 * 1987 * @syscap SystemCapability.Web.Webview.Core 1988 * @since 9 1989 */ 1990 /** 1991 * Constructor. 1992 * 1993 * @syscap SystemCapability.Web.Webview.Core 1994 * @crossplatform 1995 * @atomicservice 1996 * @since 11 1997 */ 1998 constructor(); 1999 2000 /** 2001 * Reject the request. 2002 * 2003 * @syscap SystemCapability.Web.Webview.Core 2004 * @since 9 2005 */ 2006 /** 2007 * Reject the request. 2008 * 2009 * @syscap SystemCapability.Web.Webview.Core 2010 * @crossplatform 2011 * @atomicservice 2012 * @since 11 2013 */ 2014 deny(): void; 2015 2016 /** 2017 * Gets the source if the webpage that attempted to access the restricted resource. 2018 * 2019 * @returns { string } 2020 * @syscap SystemCapability.Web.Webview.Core 2021 * @since 9 2022 */ 2023 /** 2024 * Gets the source if the webpage that attempted to access the restricted resource. 2025 * 2026 * @returns { string } 2027 * @syscap SystemCapability.Web.Webview.Core 2028 * @crossplatform 2029 * @atomicservice 2030 * @since 11 2031 */ 2032 getOrigin(): string; 2033 2034 /** 2035 * Gets the resource that the webpage is trying to access. 2036 * 2037 * @returns { Array<string> } 2038 * @syscap SystemCapability.Web.Webview.Core 2039 * @since 9 2040 */ 2041 /** 2042 * Gets the resource that the webpage is trying to access. 2043 * 2044 * @returns { Array<string> } 2045 * @syscap SystemCapability.Web.Webview.Core 2046 * @crossplatform 2047 * @atomicservice 2048 * @since 11 2049 */ 2050 getAccessibleResource(): Array<string>; 2051 2052 /** 2053 * Grant origin access to a given resource. 2054 * 2055 * @param { Array<string> } resources 2056 * @syscap SystemCapability.Web.Webview.Core 2057 * @since 9 2058 */ 2059 /** 2060 * Grant origin access to a given resource. 2061 * 2062 * @param { Array<string> } resources 2063 * @syscap SystemCapability.Web.Webview.Core 2064 * @crossplatform 2065 * @atomicservice 2066 * @since 11 2067 */ 2068 grant(resources: Array<string>): void; 2069} 2070 2071/** 2072 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 2073 * @syscap SystemCapability.Web.Webview.Core 2074 * @since 10 2075 */ 2076/** 2077 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 2078 * @syscap SystemCapability.Web.Webview.Core 2079 * @atomicservice 2080 * @since 11 2081 */ 2082declare class ScreenCaptureHandler { 2083 /** 2084 * Constructor. 2085 * @syscap SystemCapability.Web.Webview.Core 2086 * @since 10 2087 */ 2088 /** 2089 * Constructor. 2090 * @syscap SystemCapability.Web.Webview.Core 2091 * @atomicservice 2092 * @since 11 2093 */ 2094 constructor(); 2095 2096 /** 2097 * Gets the source of the webpage that attempted to access the restricted resource. 2098 * 2099 * @returns { string } 2100 * @syscap SystemCapability.Web.Webview.Core 2101 * @since 10 2102 */ 2103 /** 2104 * Gets the source of the webpage that attempted to access the restricted resource. 2105 * 2106 * @returns { string } 2107 * @syscap SystemCapability.Web.Webview.Core 2108 * @atomicservice 2109 * @since 11 2110 */ 2111 getOrigin(): string; 2112 2113 /** 2114 * Grant origin access to a given resource. 2115 * @param { ScreenCaptureConfig } config The screen capture configuration. 2116 * @syscap SystemCapability.Web.Webview.Core 2117 * @since 10 2118 */ 2119 /** 2120 * Grant origin access to a given resource. 2121 * @param { ScreenCaptureConfig } config The screen capture configuration. 2122 * @syscap SystemCapability.Web.Webview.Core 2123 * @atomicservice 2124 * @since 11 2125 */ 2126 grant(config: ScreenCaptureConfig): void; 2127 2128 /** 2129 * Reject the request. 2130 * @syscap SystemCapability.Web.Webview.Core 2131 * @since 10 2132 */ 2133 /** 2134 * Reject the request. 2135 * @syscap SystemCapability.Web.Webview.Core 2136 * @atomicservice 2137 * @since 11 2138 */ 2139 deny(): void; 2140} 2141 2142/** 2143 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 2144 * 2145 * @syscap SystemCapability.Web.Webview.Core 2146 * @since 9 2147 */ 2148/** 2149 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 2150 * 2151 * @syscap SystemCapability.Web.Webview.Core 2152 * @atomicservice 2153 * @since 11 2154 */ 2155declare class DataResubmissionHandler { 2156 /** 2157 * Constructor. 2158 * 2159 * @syscap SystemCapability.Web.Webview.Core 2160 * @since 9 2161 */ 2162 /** 2163 * Constructor. 2164 * 2165 * @syscap SystemCapability.Web.Webview.Core 2166 * @atomicservice 2167 * @since 11 2168 */ 2169 constructor(); 2170 2171 /** 2172 * Resend related form data. 2173 * 2174 * @syscap SystemCapability.Web.Webview.Core 2175 * @since 9 2176 */ 2177 /** 2178 * Resend related form data. 2179 * 2180 * @syscap SystemCapability.Web.Webview.Core 2181 * @atomicservice 2182 * @since 11 2183 */ 2184 resend(): void; 2185 2186 /** 2187 * Do not resend related form data. 2188 * 2189 * @syscap SystemCapability.Web.Webview.Core 2190 * @since 9 2191 */ 2192 /** 2193 * Do not resend related form data. 2194 * 2195 * @syscap SystemCapability.Web.Webview.Core 2196 * @atomicservice 2197 * @since 11 2198 */ 2199 cancel(): void; 2200} 2201 2202/** 2203 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 2204 * 2205 * @syscap SystemCapability.Web.Webview.Core 2206 * @since 9 2207 */ 2208/** 2209 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 2210 * 2211 * @syscap SystemCapability.Web.Webview.Core 2212 * @atomicservice 2213 * @since 11 2214 */ 2215declare class ControllerHandler { 2216 /** 2217 * Constructor. 2218 * 2219 * @syscap SystemCapability.Web.Webview.Core 2220 * @since 9 2221 */ 2222 /** 2223 * Constructor. 2224 * 2225 * @syscap SystemCapability.Web.Webview.Core 2226 * @atomicservice 2227 * @since 11 2228 */ 2229 constructor(); 2230 2231 /** 2232 * Set WebController object. 2233 * 2234 * @param { WebviewController } controller 2235 * @syscap SystemCapability.Web.Webview.Core 2236 * @since 9 2237 */ 2238 /** 2239 * Set WebController object. 2240 * 2241 * @param { WebviewController } controller 2242 * @syscap SystemCapability.Web.Webview.Core 2243 * @atomicservice 2244 * @since 11 2245 */ 2246 setWebController(controller: WebviewController): void; 2247} 2248 2249/** 2250 * Defines the context menu source type, related to {@link onContextMenuShow} method. 2251 * 2252 * @enum { number } 2253 * @syscap SystemCapability.Web.Webview.Core 2254 * @since 9 2255 */ 2256/** 2257 * Defines the context menu source type, related to {@link onContextMenuShow} method. 2258 * 2259 * @enum { number } 2260 * @syscap SystemCapability.Web.Webview.Core 2261 * @atomicservice 2262 * @since 11 2263 */ 2264declare enum ContextMenuSourceType { 2265 /** 2266 * Other source types. 2267 * 2268 * @syscap SystemCapability.Web.Webview.Core 2269 * @since 9 2270 */ 2271 /** 2272 * Other source types. 2273 * 2274 * @syscap SystemCapability.Web.Webview.Core 2275 * @atomicservice 2276 * @since 11 2277 */ 2278 None, 2279 2280 /** 2281 * Mouse. 2282 * 2283 * @syscap SystemCapability.Web.Webview.Core 2284 * @since 9 2285 */ 2286 /** 2287 * Mouse. 2288 * 2289 * @syscap SystemCapability.Web.Webview.Core 2290 * @atomicservice 2291 * @since 11 2292 */ 2293 Mouse, 2294 2295 /** 2296 * Long press. 2297 * 2298 * @syscap SystemCapability.Web.Webview.Core 2299 * @since 9 2300 */ 2301 /** 2302 * Long press. 2303 * 2304 * @syscap SystemCapability.Web.Webview.Core 2305 * @atomicservice 2306 * @since 11 2307 */ 2308 LongPress, 2309} 2310 2311/** 2312 * Defines the context menu media type, related to {@link onContextMenuShow} method. 2313 * 2314 * @enum { number } 2315 * @syscap SystemCapability.Web.Webview.Core 2316 * @since 9 2317 */ 2318/** 2319 * Defines the context menu media type, related to {@link onContextMenuShow} method. 2320 * 2321 * @enum { number } 2322 * @syscap SystemCapability.Web.Webview.Core 2323 * @atomicservice 2324 * @since 11 2325 */ 2326declare enum ContextMenuMediaType { 2327 /** 2328 * Not a special node or other media types. 2329 * 2330 * @syscap SystemCapability.Web.Webview.Core 2331 * @since 9 2332 */ 2333 /** 2334 * Not a special node or other media types. 2335 * 2336 * @syscap SystemCapability.Web.Webview.Core 2337 * @atomicservice 2338 * @since 11 2339 */ 2340 None, 2341 2342 /** 2343 * Image. 2344 * 2345 * @syscap SystemCapability.Web.Webview.Core 2346 * @since 9 2347 */ 2348 /** 2349 * Image. 2350 * 2351 * @syscap SystemCapability.Web.Webview.Core 2352 * @atomicservice 2353 * @since 11 2354 */ 2355 Image, 2356} 2357 2358/** 2359 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 2360 * 2361 * @enum { number } 2362 * @syscap SystemCapability.Web.Webview.Core 2363 * @since 9 2364 */ 2365/** 2366 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 2367 * 2368 * @enum { number } 2369 * @syscap SystemCapability.Web.Webview.Core 2370 * @atomicservice 2371 * @since 11 2372 */ 2373declare enum ContextMenuInputFieldType { 2374 /** 2375 * Not an input field. 2376 * 2377 * @syscap SystemCapability.Web.Webview.Core 2378 * @since 9 2379 */ 2380 /** 2381 * Not an input field. 2382 * 2383 * @syscap SystemCapability.Web.Webview.Core 2384 * @atomicservice 2385 * @since 11 2386 */ 2387 None, 2388 2389 /** 2390 * The plain text type. 2391 * 2392 * @syscap SystemCapability.Web.Webview.Core 2393 * @since 9 2394 */ 2395 /** 2396 * The plain text type. 2397 * 2398 * @syscap SystemCapability.Web.Webview.Core 2399 * @atomicservice 2400 * @since 11 2401 */ 2402 PlainText, 2403 2404 /** 2405 * The password type. 2406 * 2407 * @syscap SystemCapability.Web.Webview.Core 2408 * @since 9 2409 */ 2410 /** 2411 * The password type. 2412 * 2413 * @syscap SystemCapability.Web.Webview.Core 2414 * @atomicservice 2415 * @since 11 2416 */ 2417 Password, 2418 2419 /** 2420 * The number type. 2421 * 2422 * @syscap SystemCapability.Web.Webview.Core 2423 * @since 9 2424 */ 2425 /** 2426 * The number type. 2427 * 2428 * @syscap SystemCapability.Web.Webview.Core 2429 * @atomicservice 2430 * @since 11 2431 */ 2432 Number, 2433 2434 /** 2435 * The telephone type. 2436 * 2437 * @syscap SystemCapability.Web.Webview.Core 2438 * @since 9 2439 */ 2440 /** 2441 * The telephone type. 2442 * 2443 * @syscap SystemCapability.Web.Webview.Core 2444 * @atomicservice 2445 * @since 11 2446 */ 2447 Telephone, 2448 2449 /** 2450 * Other types. 2451 * 2452 * @syscap SystemCapability.Web.Webview.Core 2453 * @since 9 2454 */ 2455 /** 2456 * Other types. 2457 * 2458 * @syscap SystemCapability.Web.Webview.Core 2459 * @atomicservice 2460 * @since 11 2461 */ 2462 Other, 2463} 2464 2465/** 2466 * Defines the embed status, related to {@link NativeEmbedDataInfo}. 2467 * 2468 * @enum { number } 2469 * @syscap SystemCapability.Web.Webview.Core 2470 * @atomicservice 2471 * @since 11 2472 */ 2473declare enum NativeEmbedStatus { 2474 2475 /** 2476 * The embed tag create. 2477 * 2478 * @syscap SystemCapability.Web.Webview.Core 2479 * @atomicservice 2480 * @since 11 2481 */ 2482 CREATE = 0, 2483 2484 /** 2485 * The embed tag update. 2486 * 2487 * @syscap SystemCapability.Web.Webview.Core 2488 * @atomicservice 2489 * @since 11 2490 */ 2491 UPDATE = 1, 2492 2493 /** 2494 * The embed tag destroy. 2495 * 2496 * @syscap SystemCapability.Web.Webview.Core 2497 * @atomicservice 2498 * @since 11 2499 */ 2500 DESTROY = 2, 2501 2502 /** 2503 * The embed tag enter backforward cache. 2504 * 2505 * @syscap SystemCapability.Web.Webview.Core 2506 * @atomicservice 2507 * @since 12 2508 */ 2509 ENTER_BFCACHE = 3, 2510 2511 /** 2512 * The embed tag leave backforward cache. 2513 * 2514 * @syscap SystemCapability.Web.Webview.Core 2515 * @atomicservice 2516 * @since 12 2517 */ 2518 LEAVE_BFCACHE = 4, 2519} 2520 2521/** 2522 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2523 * 2524 * @enum { number } 2525 * @syscap SystemCapability.Web.Webview.Core 2526 * @since 9 2527 */ 2528/** 2529 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2530 * 2531 * @enum { number } 2532 * @syscap SystemCapability.Web.Webview.Core 2533 * @atomicservice 2534 * @since 11 2535 */ 2536declare enum ContextMenuEditStateFlags { 2537 /** 2538 * Not editable. 2539 * 2540 * @syscap SystemCapability.Web.Webview.Core 2541 * @since 9 2542 */ 2543 /** 2544 * Not editable. 2545 * 2546 * @syscap SystemCapability.Web.Webview.Core 2547 * @atomicservice 2548 * @since 11 2549 */ 2550 NONE = 0, 2551 /** 2552 * Clipping is supported. 2553 * 2554 * @syscap SystemCapability.Web.Webview.Core 2555 * @since 9 2556 */ 2557 /** 2558 * Clipping is supported. 2559 * 2560 * @syscap SystemCapability.Web.Webview.Core 2561 * @atomicservice 2562 * @since 11 2563 */ 2564 CAN_CUT = 1 << 0, 2565 /** 2566 * Copies are supported. 2567 * 2568 * @syscap SystemCapability.Web.Webview.Core 2569 * @since 9 2570 */ 2571 /** 2572 * Copies are supported. 2573 * 2574 * @syscap SystemCapability.Web.Webview.Core 2575 * @atomicservice 2576 * @since 11 2577 */ 2578 CAN_COPY = 1 << 1, 2579 /** 2580 * Support for pasting. 2581 * 2582 * @syscap SystemCapability.Web.Webview.Core 2583 * @since 9 2584 */ 2585 /** 2586 * Support for pasting. 2587 * 2588 * @syscap SystemCapability.Web.Webview.Core 2589 * @atomicservice 2590 * @since 11 2591 */ 2592 CAN_PASTE = 1 << 2, 2593 /** 2594 * Select all is supported. 2595 * 2596 * @syscap SystemCapability.Web.Webview.Core 2597 * @since 9 2598 */ 2599 /** 2600 * Select all is supported. 2601 * 2602 * @syscap SystemCapability.Web.Webview.Core 2603 * @atomicservice 2604 * @since 11 2605 */ 2606 CAN_SELECT_ALL = 1 << 3, 2607} 2608 2609/** 2610 * Enum type supplied to {@link navigationType} for the navigation's type. 2611 * 2612 * @enum { number } 2613 * @syscap SystemCapability.Web.Webview.Core 2614 * @atomicservice 2615 * @since 11 2616 */ 2617declare enum WebNavigationType { 2618 /** 2619 * Unknown type. 2620 * 2621 * @syscap SystemCapability.Web.Webview.Core 2622 * @atomicservice 2623 * @since 11 2624 */ 2625 UNKNOWN = 0, 2626 2627 /** 2628 * A new entry was created due to a navigation happened on the main frame. 2629 * Contains all situations that will generate a mainframe navigation entry, 2630 * which means that navigations to a hash on the same document or history.pushState 2631 * also belong to this type. 2632 * 2633 * @syscap SystemCapability.Web.Webview.Core 2634 * @atomicservice 2635 * @since 11 2636 */ 2637 MAIN_FRAME_NEW_ENTRY = 1, 2638 2639 /** 2640 * Navigate to an existing entry due to a navigation on the main frame. 2641 * e.g. 2642 * 1. History navigations. 2643 * 2. Reloads (contains loading the same url). 2644 * 3. Same-document navigations(history.replaceState(), location.replace()). 2645 * 2646 * @syscap SystemCapability.Web.Webview.Core 2647 * @atomicservice 2648 * @since 11 2649 */ 2650 MAIN_FRAME_EXISTING_ENTRY = 2, 2651 2652 /** 2653 * A navigation happened on subframe which was triggered by user. 2654 * 2655 * @syscap SystemCapability.Web.Webview.Core 2656 * @atomicservice 2657 * @since 11 2658 */ 2659 NAVIGATION_TYPE_NEW_SUBFRAME = 4, 2660 2661 /** 2662 * A navigation happened on the subframe automatically. 2663 * 2664 * @syscap SystemCapability.Web.Webview.Core 2665 * @atomicservice 2666 * @since 11 2667 */ 2668 NAVIGATION_TYPE_AUTO_SUBFRAME = 5, 2669} 2670 2671 2672/** 2673 * Defines the web render mode, related to {@link RenderMode}. 2674 * 2675 * @enum { number } 2676 * @syscap SystemCapability.Web.Webview.Core 2677 * @atomicservice 2678 * @since 12 2679 */ 2680declare enum RenderMode { 2681 /** 2682 * Web and arkui render asynchronously 2683 * 2684 * @syscap SystemCapability.Web.Webview.Core 2685 * @atomicservice 2686 * @since 12 2687 */ 2688 ASYNC_RENDER = 0, 2689 2690 /** 2691 * Web and arkui render synchronously 2692 * 2693 * @syscap SystemCapability.Web.Webview.Core 2694 * @atomicservice 2695 * @since 12 2696 */ 2697 SYNC_RENDER = 1, 2698} 2699 2700/** 2701 * Defines the viewport-fit type, related to {@link ViewportFit}. 2702 * 2703 * @enum { number } 2704 * @syscap SystemCapability.Web.Webview.Core 2705 * @atomicservice 2706 * @since 12 2707 */ 2708declare enum ViewportFit { 2709 /** 2710 * No effect - the whole web page is viewable(default) 2711 * 2712 * @syscap SystemCapability.Web.Webview.Core 2713 * @atomicservice 2714 * @since 12 2715 */ 2716 AUTO = 0, 2717 2718 /** 2719 * The initial layout viewport and the visual viewport are set to the 2720 * largest rectangle which is inscribe in the display of the device. 2721 * 2722 * @syscap SystemCapability.Web.Webview.Core 2723 * @atomicservice 2724 * @since 12 2725 */ 2726 CONTAINS = 1, 2727 2728 /** 2729 * The initial layout viewport and the visual viewport are set to the 2730 * circumscribe rectangle of the physical screen of the device. 2731 * 2732 * @syscap SystemCapability.Web.Webview.Core 2733 * @atomicservice 2734 * @since 12 2735 */ 2736 COVER = 2, 2737} 2738 2739/** 2740 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2741 * 2742 * @syscap SystemCapability.Web.Webview.Core 2743 * @since 9 2744 */ 2745/** 2746 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2747 * 2748 * @syscap SystemCapability.Web.Webview.Core 2749 * @atomicservice 2750 * @since 11 2751 */ 2752declare class WebContextMenuParam { 2753 /** 2754 * Constructor. 2755 * 2756 * @syscap SystemCapability.Web.Webview.Core 2757 * @since 9 2758 */ 2759 /** 2760 * Constructor. 2761 * 2762 * @syscap SystemCapability.Web.Webview.Core 2763 * @atomicservice 2764 * @since 11 2765 */ 2766 constructor(); 2767 2768 /** 2769 * Horizontal offset coordinates of the menu within the Web component. 2770 * 2771 * @returns { number } The context menu x coordinate. 2772 * @syscap SystemCapability.Web.Webview.Core 2773 * @since 9 2774 */ 2775 /** 2776 * Horizontal offset coordinates of the menu within the Web component. 2777 * 2778 * @returns { number } The context menu x coordinate. 2779 * @syscap SystemCapability.Web.Webview.Core 2780 * @atomicservice 2781 * @since 11 2782 */ 2783 x(): number; 2784 2785 /** 2786 * Vertical offset coordinates for the menu within the Web component. 2787 * 2788 * @returns { number } The context menu y coordinate. 2789 * @syscap SystemCapability.Web.Webview.Core 2790 * @since 9 2791 */ 2792 /** 2793 * Vertical offset coordinates for the menu within the Web component. 2794 * 2795 * @returns { number } The context menu y coordinate. 2796 * @syscap SystemCapability.Web.Webview.Core 2797 * @atomicservice 2798 * @since 11 2799 */ 2800 y(): number; 2801 2802 /** 2803 * If the long-press location is the link returns the link's security-checked URL. 2804 * 2805 * @returns { string } If relate to a link return link url, else return null. 2806 * @syscap SystemCapability.Web.Webview.Core 2807 * @since 9 2808 */ 2809 /** 2810 * If the long-press location is the link returns the link's security-checked URL. 2811 * 2812 * @returns { string } If relate to a link return link url, else return null. 2813 * @syscap SystemCapability.Web.Webview.Core 2814 * @atomicservice 2815 * @since 11 2816 */ 2817 getLinkUrl(): string; 2818 2819 /** 2820 * If the long-press location is the link returns the link's original URL. 2821 * 2822 * @returns { string } If relate to a link return unfiltered link url, else return null. 2823 * @syscap SystemCapability.Web.Webview.Core 2824 * @since 9 2825 */ 2826 /** 2827 * If the long-press location is the link returns the link's original URL. 2828 * 2829 * @returns { string } If relate to a link return unfiltered link url, else return null. 2830 * @syscap SystemCapability.Web.Webview.Core 2831 * @atomicservice 2832 * @since 11 2833 */ 2834 getUnfilteredLinkUrl(): string; 2835 2836 /** 2837 * Returns the SRC URL if the selected element has a SRC attribute. 2838 * 2839 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2840 * @syscap SystemCapability.Web.Webview.Core 2841 * @since 9 2842 */ 2843 /** 2844 * Returns the SRC URL if the selected element has a SRC attribute. 2845 * 2846 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2847 * @syscap SystemCapability.Web.Webview.Core 2848 * @atomicservice 2849 * @since 11 2850 */ 2851 getSourceUrl(): string; 2852 2853 /** 2854 * Long press menu location has image content. 2855 * 2856 * @returns { boolean } Return whether this context menu has image content. 2857 * @syscap SystemCapability.Web.Webview.Core 2858 * @since 9 2859 */ 2860 /** 2861 * Long press menu location has image content. 2862 * 2863 * @returns { boolean } Return whether this context menu has image content. 2864 * @syscap SystemCapability.Web.Webview.Core 2865 * @atomicservice 2866 * @since 11 2867 */ 2868 existsImageContents(): boolean; 2869 2870 /** 2871 * Returns the type of context node. 2872 * 2873 * @returns { ContextMenuMediaType } Returns the type of context node. 2874 * @syscap SystemCapability.Web.Webview.Core 2875 * @since 9 2876 */ 2877 /** 2878 * Returns the type of context node. 2879 * 2880 * @returns { ContextMenuMediaType } Returns the type of context node. 2881 * @syscap SystemCapability.Web.Webview.Core 2882 * @atomicservice 2883 * @since 11 2884 */ 2885 getMediaType(): ContextMenuMediaType; 2886 2887 /** 2888 * Returns the text of the selection. 2889 * 2890 * @returns { string } Returns the text of the selection. 2891 * @syscap SystemCapability.Web.Webview.Core 2892 * @since 9 2893 */ 2894 /** 2895 * Returns the text of the selection. 2896 * 2897 * @returns { string } Returns the text of the selection. 2898 * @syscap SystemCapability.Web.Webview.Core 2899 * @atomicservice 2900 * @since 11 2901 */ 2902 getSelectionText(): string; 2903 2904 /** 2905 * Returns the context menu source type. 2906 * 2907 * @returns { ContextMenuSourceType } 2908 * @syscap SystemCapability.Web.Webview.Core 2909 * @since 9 2910 */ 2911 /** 2912 * Returns the context menu source type. 2913 * 2914 * @returns { ContextMenuSourceType } 2915 * @syscap SystemCapability.Web.Webview.Core 2916 * @atomicservice 2917 * @since 11 2918 */ 2919 getSourceType(): ContextMenuSourceType; 2920 2921 /** 2922 * Returns input field type if the context menu was invoked on an input field. 2923 * 2924 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2925 * @syscap SystemCapability.Web.Webview.Core 2926 * @since 9 2927 */ 2928 /** 2929 * Returns input field type if the context menu was invoked on an input field. 2930 * 2931 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2932 * @syscap SystemCapability.Web.Webview.Core 2933 * @atomicservice 2934 * @since 11 2935 */ 2936 getInputFieldType(): ContextMenuInputFieldType; 2937 2938 /** 2939 * Returns whether the context is editable. 2940 * 2941 * @returns { boolean } 2942 * @syscap SystemCapability.Web.Webview.Core 2943 * @since 9 2944 */ 2945 /** 2946 * Returns whether the context is editable. 2947 * 2948 * @returns { boolean } 2949 * @syscap SystemCapability.Web.Webview.Core 2950 * @atomicservice 2951 * @since 11 2952 */ 2953 isEditable(): boolean; 2954 2955 /** 2956 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2957 * 2958 * @returns { number } 2959 * @syscap SystemCapability.Web.Webview.Core 2960 * @since 9 2961 */ 2962 /** 2963 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2964 * 2965 * @returns { number } 2966 * @syscap SystemCapability.Web.Webview.Core 2967 * @atomicservice 2968 * @since 11 2969 */ 2970 getEditStateFlags(): number; 2971 2972 /** 2973 * Returns the selection menu preview width. 2974 * 2975 * @returns { number } The preview menu width. 2976 * @syscap SystemCapability.Web.Webview.Core 2977 * @since 13 2978 */ 2979 getPreviewWidth(): number; 2980 2981 /** 2982 * Returns the selection menu preview height. 2983 * 2984 * @returns { number } The preview menu height. 2985 * @syscap SystemCapability.Web.Webview.Core 2986 * @since 13 2987 */ 2988 getPreviewHeight(): number; 2989} 2990 2991/** 2992 * Defines the context menu result, related to {@link WebContextMenuResult} method. 2993 * 2994 * @syscap SystemCapability.Web.Webview.Core 2995 * @since 9 2996 */ 2997/** 2998 * Defines the context menu result, related to {@link WebContextMenuResult} method. 2999 * 3000 * @syscap SystemCapability.Web.Webview.Core 3001 * @atomicservice 3002 * @since 11 3003 */ 3004declare class WebContextMenuResult { 3005 /** 3006 * Constructor. 3007 * 3008 * @syscap SystemCapability.Web.Webview.Core 3009 * @since 9 3010 */ 3011 /** 3012 * Constructor. 3013 * 3014 * @syscap SystemCapability.Web.Webview.Core 3015 * @atomicservice 3016 * @since 11 3017 */ 3018 constructor(); 3019 3020 /** 3021 * When close context menu without other call in WebContextMenuResult, 3022 * User should call this function to close menu 3023 * 3024 * @syscap SystemCapability.Web.Webview.Core 3025 * @since 9 3026 */ 3027 /** 3028 * When close context menu without other call in WebContextMenuResult, 3029 * User should call this function to close menu 3030 * 3031 * @syscap SystemCapability.Web.Webview.Core 3032 * @atomicservice 3033 * @since 11 3034 */ 3035 closeContextMenu(): void; 3036 3037 /** 3038 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 3039 * If WebContextMenuParam has no image content, this function will do nothing. 3040 * 3041 * @syscap SystemCapability.Web.Webview.Core 3042 * @since 9 3043 */ 3044 /** 3045 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 3046 * If WebContextMenuParam has no image content, this function will do nothing. 3047 * 3048 * @syscap SystemCapability.Web.Webview.Core 3049 * @atomicservice 3050 * @since 11 3051 */ 3052 copyImage(): void; 3053 3054 /** 3055 * Executes the copy operation related to this context menu. 3056 * 3057 * @syscap SystemCapability.Web.Webview.Core 3058 * @since 9 3059 */ 3060 /** 3061 * Executes the copy operation related to this context menu. 3062 * 3063 * @syscap SystemCapability.Web.Webview.Core 3064 * @atomicservice 3065 * @since 11 3066 */ 3067 copy(): void; 3068 3069 /** 3070 * Executes the paste operation related to this context menu. 3071 * 3072 * @syscap SystemCapability.Web.Webview.Core 3073 * @since 9 3074 */ 3075 /** 3076 * Executes the paste operation related to this context menu. 3077 * 3078 * @syscap SystemCapability.Web.Webview.Core 3079 * @atomicservice 3080 * @since 11 3081 */ 3082 paste(): void; 3083 3084 /** 3085 * Executes the cut operation related to this context menu. 3086 * 3087 * @syscap SystemCapability.Web.Webview.Core 3088 * @since 9 3089 */ 3090 /** 3091 * Executes the cut operation related to this context menu. 3092 * 3093 * @syscap SystemCapability.Web.Webview.Core 3094 * @atomicservice 3095 * @since 11 3096 */ 3097 cut(): void; 3098 3099 /** 3100 * Executes the selectAll operation related to this context menu. 3101 * 3102 * @syscap SystemCapability.Web.Webview.Core 3103 * @since 9 3104 */ 3105 /** 3106 * Executes the selectAll operation related to this context menu. 3107 * 3108 * @syscap SystemCapability.Web.Webview.Core 3109 * @atomicservice 3110 * @since 11 3111 */ 3112 selectAll(): void; 3113} 3114 3115/** 3116 * Encompassed message information as parameters to {@link onConsole} method. 3117 * 3118 * @syscap SystemCapability.Web.Webview.Core 3119 * @since 8 3120 */ 3121/** 3122 * Encompassed message information as parameters to {@link onConsole} method. 3123 * 3124 * @syscap SystemCapability.Web.Webview.Core 3125 * @crossplatform 3126 * @atomicservice 3127 * @since 11 3128 */ 3129declare class ConsoleMessage { 3130 /** 3131 * Constructor. 3132 * 3133 * @param { string } message - The console message. 3134 * @param { string } sourceId - The Web source file's path and name. 3135 * @param { number } lineNumber - The line number of the console message. 3136 * @param { MessageLevel } messageLevel - The console log level. 3137 * @syscap SystemCapability.Web.Webview.Core 3138 * @since 8 3139 * @deprecated since 9 3140 * @useinstead ohos.web.ConsoleMessage#constructor 3141 */ 3142 constructor(message: string, sourceId: string, lineNumber: number, messageLevel: MessageLevel); 3143 3144 /** 3145 * Constructor. 3146 * 3147 * @syscap SystemCapability.Web.Webview.Core 3148 * @since 9 3149 */ 3150 /** 3151 * Constructor. 3152 * 3153 * @syscap SystemCapability.Web.Webview.Core 3154 * @crossplatform 3155 * @atomicservice 3156 * @since 11 3157 */ 3158 constructor(); 3159 3160 /** 3161 * Gets the message of a console message. 3162 * 3163 * @returns { string } Return the message of a console message. 3164 * @syscap SystemCapability.Web.Webview.Core 3165 * @since 8 3166 */ 3167 /** 3168 * Gets the message of a console message. 3169 * 3170 * @returns { string } Return the message of a console message. 3171 * @syscap SystemCapability.Web.Webview.Core 3172 * @crossplatform 3173 * @atomicservice 3174 * @since 11 3175 */ 3176 getMessage(): string; 3177 3178 /** 3179 * Gets the Web source file's path and name of a console message. 3180 * 3181 * @returns { string } Return the Web source file's path and name of a console message. 3182 * @syscap SystemCapability.Web.Webview.Core 3183 * @since 8 3184 */ 3185 /** 3186 * Gets the Web source file's path and name of a console message. 3187 * 3188 * @returns { string } Return the Web source file's path and name of a console message. 3189 * @syscap SystemCapability.Web.Webview.Core 3190 * @atomicservice 3191 * @since 11 3192 */ 3193 getSourceId(): string; 3194 3195 /** 3196 * Gets the line number of a console message. 3197 * 3198 * @returns { number } Return the line number of a console message. 3199 * @syscap SystemCapability.Web.Webview.Core 3200 * @since 8 3201 */ 3202 /** 3203 * Gets the line number of a console message. 3204 * 3205 * @returns { number } Return the line number of a console message. 3206 * @syscap SystemCapability.Web.Webview.Core 3207 * @atomicservice 3208 * @since 11 3209 */ 3210 getLineNumber(): number; 3211 3212 /** 3213 * Gets the message level of a console message. 3214 * 3215 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 3216 * @syscap SystemCapability.Web.Webview.Core 3217 * @since 8 3218 */ 3219 /** 3220 * Gets the message level of a console message. 3221 * 3222 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 3223 * @syscap SystemCapability.Web.Webview.Core 3224 * @crossplatform 3225 * @atomicservice 3226 * @since 11 3227 */ 3228 getMessageLevel(): MessageLevel; 3229} 3230 3231/** 3232 * Encompassed message information as parameters to {@link onConsole} method. 3233 * 3234 * @syscap SystemCapability.Web.Webview.Core 3235 * @since 8 3236 */ 3237/** 3238 * Defines the Web resource request. 3239 * 3240 * @syscap SystemCapability.Web.Webview.Core 3241 * @since 8 3242 */ 3243/** 3244 * Defines the Web resource request. 3245 * 3246 * @syscap SystemCapability.Web.Webview.Core 3247 * @crossplatform 3248 * @since 10 3249 */ 3250/** 3251 * Defines the Web resource request. 3252 * 3253 * @syscap SystemCapability.Web.Webview.Core 3254 * @crossplatform 3255 * @atomicservice 3256 * @since 11 3257 */ 3258declare class WebResourceRequest { 3259 /** 3260 * Constructor. 3261 * 3262 * @syscap SystemCapability.Web.Webview.Core 3263 * @since 8 3264 */ 3265 /** 3266 * Constructor. 3267 * 3268 * @syscap SystemCapability.Web.Webview.Core 3269 * @crossplatform 3270 * @since 10 3271 */ 3272 /** 3273 * Constructor. 3274 * 3275 * @syscap SystemCapability.Web.Webview.Core 3276 * @crossplatform 3277 * @atomicservice 3278 * @since 11 3279 */ 3280 constructor(); 3281 3282 /** 3283 * Gets request headers. 3284 * 3285 * @returns { Array<Header> } Return the request headers 3286 * @syscap SystemCapability.Web.Webview.Core 3287 * @since 8 3288 */ 3289 /** 3290 * Gets request headers. 3291 * 3292 * @returns { Array<Header> } Return the request headers 3293 * @syscap SystemCapability.Web.Webview.Core 3294 * @atomicservice 3295 * @since 11 3296 */ 3297 getRequestHeader(): Array<Header>; 3298 3299 /** 3300 * Gets the request URL. 3301 * 3302 * @returns { string } Return the request URL. 3303 * @syscap SystemCapability.Web.Webview.Core 3304 * @since 8 3305 */ 3306 /** 3307 * Gets the request URL. 3308 * 3309 * @returns { string } Return the request URL. 3310 * @syscap SystemCapability.Web.Webview.Core 3311 * @crossplatform 3312 * @since 10 3313 */ 3314 /** 3315 * Gets the request URL. 3316 * 3317 * @returns { string } Return the request URL. 3318 * @syscap SystemCapability.Web.Webview.Core 3319 * @crossplatform 3320 * @atomicservice 3321 * @since 11 3322 */ 3323 getRequestUrl(): string; 3324 3325 /** 3326 * Check whether the request is associated with gesture. 3327 * 3328 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 3329 * @syscap SystemCapability.Web.Webview.Core 3330 * @since 8 3331 */ 3332 /** 3333 * Check whether the request is associated with gesture. 3334 * 3335 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 3336 * @syscap SystemCapability.Web.Webview.Core 3337 * @atomicservice 3338 * @since 11 3339 */ 3340 isRequestGesture(): boolean; 3341 3342 /** 3343 * Check whether the request is for getting the main frame. 3344 * 3345 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 3346 * @syscap SystemCapability.Web.Webview.Core 3347 * @since 8 3348 */ 3349 /** 3350 * Check whether the request is for getting the main frame. 3351 * 3352 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 3353 * @syscap SystemCapability.Web.Webview.Core 3354 * @atomicservice 3355 * @since 11 3356 */ 3357 isMainFrame(): boolean; 3358 3359 /** 3360 * Check whether the request redirects. 3361 * 3362 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 3363 * @syscap SystemCapability.Web.Webview.Core 3364 * @since 8 3365 */ 3366 /** 3367 * Check whether the request redirects. 3368 * 3369 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 3370 * @syscap SystemCapability.Web.Webview.Core 3371 * @atomicservice 3372 * @since 11 3373 */ 3374 isRedirect(): boolean; 3375 3376 /** 3377 * Get request method. 3378 * 3379 * @returns { string } Return the request method. 3380 * @syscap SystemCapability.Web.Webview.Core 3381 * @since 9 3382 */ 3383 /** 3384 * Get request method. 3385 * 3386 * @returns { string } Return the request method. 3387 * @syscap SystemCapability.Web.Webview.Core 3388 * @atomicservice 3389 * @since 11 3390 */ 3391 getRequestMethod(): string; 3392} 3393 3394/** 3395 * Defines the Web resource response. 3396 * 3397 * @syscap SystemCapability.Web.Webview.Core 3398 * @since 8 3399 */ 3400/** 3401 * Defines the Web resource response. 3402 * 3403 * @syscap SystemCapability.Web.Webview.Core 3404 * @crossplatform 3405 * @atomicservice 3406 * @since 11 3407 */ 3408declare class WebResourceResponse { 3409 /** 3410 * Constructor. 3411 * 3412 * @syscap SystemCapability.Web.Webview.Core 3413 * @since 8 3414 */ 3415 /** 3416 * Constructor. 3417 * 3418 * @syscap SystemCapability.Web.Webview.Core 3419 * @crossplatform 3420 * @atomicservice 3421 * @since 11 3422 */ 3423 constructor(); 3424 3425 /** 3426 * Gets the response data. 3427 * 3428 * @returns { string } Return the response data. 3429 * @syscap SystemCapability.Web.Webview.Core 3430 * @since 8 3431 */ 3432 /** 3433 * Gets the response data. 3434 * 3435 * @returns { string } Return the response data. 3436 * @syscap SystemCapability.Web.Webview.Core 3437 * @atomicservice 3438 * @since 11 3439 */ 3440 getResponseData(): string; 3441 3442 /** 3443 * Gets the response data. 3444 * 3445 * @returns { string | number | ArrayBuffer | Resource | undefined } Return the response data. 3446 * string type indicate string in HTML format. 3447 * number type indicate file handle. 3448 * Resource type indicate $rawfile resource. 3449 * ArrayBuffer type indicate binary data. 3450 * @syscap SystemCapability.Web.Webview.Core 3451 * @since 13 3452 */ 3453 getResponseDataEx(): string | number | ArrayBuffer | Resource | undefined; 3454 3455 /** 3456 * Gets the response encoding. 3457 * 3458 * @returns { string } Return the response encoding. 3459 * @syscap SystemCapability.Web.Webview.Core 3460 * @since 8 3461 */ 3462 /** 3463 * Gets the response encoding. 3464 * 3465 * @returns { string } Return the response encoding. 3466 * @syscap SystemCapability.Web.Webview.Core 3467 * @crossplatform 3468 * @atomicservice 3469 * @since 11 3470 */ 3471 getResponseEncoding(): string; 3472 3473 /** 3474 * Gets the response MIME type. 3475 * 3476 * @returns { string } Return the response MIME type. 3477 * @syscap SystemCapability.Web.Webview.Core 3478 * @since 8 3479 */ 3480 /** 3481 * Gets the response MIME type. 3482 * 3483 * @returns { string } Return the response MIME type. 3484 * @syscap SystemCapability.Web.Webview.Core 3485 * @crossplatform 3486 * @atomicservice 3487 * @since 11 3488 */ 3489 getResponseMimeType(): string; 3490 3491 /** 3492 * Gets the reason message. 3493 * 3494 * @returns { string } Return the reason message. 3495 * @syscap SystemCapability.Web.Webview.Core 3496 * @since 8 3497 */ 3498 /** 3499 * Gets the reason message. 3500 * 3501 * @returns { string } Return the reason message. 3502 * @syscap SystemCapability.Web.Webview.Core 3503 * @atomicservice 3504 * @since 11 3505 */ 3506 getReasonMessage(): string; 3507 3508 /** 3509 * Gets the response headers. 3510 * 3511 * @returns { Array<Header> } Return the response headers. 3512 * @syscap SystemCapability.Web.Webview.Core 3513 * @since 8 3514 */ 3515 /** 3516 * Gets the response headers. 3517 * 3518 * @returns { Array<Header> } Return the response headers. 3519 * @syscap SystemCapability.Web.Webview.Core 3520 * @atomicservice 3521 * @since 11 3522 */ 3523 getResponseHeader(): Array<Header>; 3524 3525 /** 3526 * Gets the response code. 3527 * 3528 * @returns { number } Return the response code. 3529 * @syscap SystemCapability.Web.Webview.Core 3530 * @since 8 3531 */ 3532 /** 3533 * Gets the response code. 3534 * 3535 * @returns { number } Return the response code. 3536 * @syscap SystemCapability.Web.Webview.Core 3537 * @crossplatform 3538 * @atomicservice 3539 * @since 11 3540 */ 3541 getResponseCode(): number; 3542 3543 /** 3544 * Sets the response data. 3545 * 3546 * @param { string | number | Resource } data - the response data. 3547 * @syscap SystemCapability.Web.Webview.Core 3548 * @since 9 3549 */ 3550 /** 3551 * Sets the response data. 3552 * 3553 * @param { string | number | Resource } data - the response data. 3554 * string type indicate strings in HTML format. 3555 * number type indicate file handle. 3556 * Resource type indicate $rawfile resource. 3557 * @syscap SystemCapability.Web.Webview.Core 3558 * @since 10 3559 */ 3560 /** 3561 * Sets the response data. 3562 * 3563 * @param { string | number | Resource | ArrayBuffer } data - the response data. 3564 * string type indicate strings in HTML format. 3565 * number type indicate file handle. 3566 * Resource type indicate $rawfile resource. 3567 * ArrayBuffer type indicate binary data. 3568 * @syscap SystemCapability.Web.Webview.Core 3569 * @atomicservice 3570 * @since 11 3571 */ 3572 setResponseData(data: string | number | Resource | ArrayBuffer): void; 3573 3574 /** 3575 * Sets the response encoding. 3576 * 3577 * @param { string } encoding the response encoding. 3578 * @syscap SystemCapability.Web.Webview.Core 3579 * @since 9 3580 */ 3581 /** 3582 * Sets the response encoding. 3583 * 3584 * @param { string } encoding the response encoding. 3585 * @syscap SystemCapability.Web.Webview.Core 3586 * @atomicservice 3587 * @since 11 3588 */ 3589 /** 3590 * Sets the response encoding. 3591 * 3592 * @param { string } encoding the response encoding. 3593 * @syscap SystemCapability.Web.Webview.Core 3594 * @atomicservice 3595 * @since 12 3596 */ 3597 setResponseEncoding(encoding: string): void; 3598 3599 /** 3600 * Sets the response MIME type. 3601 * 3602 * @param { string } mimeType the response MIME type. 3603 * @syscap SystemCapability.Web.Webview.Core 3604 * @since 9 3605 */ 3606 /** 3607 * Sets the response MIME type. 3608 * 3609 * @param { string } mimeType the response MIME type. 3610 * @syscap SystemCapability.Web.Webview.Core 3611 * @atomicservice 3612 * @since 11 3613 */ 3614 /** 3615 * Sets the response MIME type. 3616 * 3617 * @param { string } mimeType the response MIME type. 3618 * @syscap SystemCapability.Web.Webview.Core 3619 * @atomicservice 3620 * @since 12 3621 */ 3622 setResponseMimeType(mimeType: string): void; 3623 3624 /** 3625 * Sets the reason message. 3626 * 3627 * @param { string } reason the reason message. 3628 * @syscap SystemCapability.Web.Webview.Core 3629 * @since 9 3630 */ 3631 /** 3632 * Sets the reason message. 3633 * 3634 * @param { string } reason the reason message. 3635 * @syscap SystemCapability.Web.Webview.Core 3636 * @atomicservice 3637 * @since 11 3638 */ 3639 /** 3640 * Sets the reason message. 3641 * 3642 * @param { string } reason the reason message. 3643 * @syscap SystemCapability.Web.Webview.Core 3644 * @atomicservice 3645 * @since 12 3646 */ 3647 setReasonMessage(reason: string): void; 3648 3649 /** 3650 * Sets the response headers. 3651 * 3652 * @param { Array<Header> } header the response headers. 3653 * @syscap SystemCapability.Web.Webview.Core 3654 * @since 9 3655 */ 3656 /** 3657 * Sets the response headers. 3658 * 3659 * @param { Array<Header> } header the response headers. 3660 * @syscap SystemCapability.Web.Webview.Core 3661 * @atomicservice 3662 * @since 11 3663 */ 3664 /** 3665 * Sets the response headers. 3666 * 3667 * @param { Array<Header> } header the response headers. 3668 * @syscap SystemCapability.Web.Webview.Core 3669 * @atomicservice 3670 * @since 12 3671 */ 3672 setResponseHeader(header: Array<Header>): void; 3673 3674 /** 3675 * Sets the response code. 3676 * 3677 * @param { number } code the response code. 3678 * @syscap SystemCapability.Web.Webview.Core 3679 * @since 9 3680 */ 3681 /** 3682 * Sets the response code. 3683 * 3684 * @param { number } code the response code. 3685 * @syscap SystemCapability.Web.Webview.Core 3686 * @atomicservice 3687 * @since 11 3688 */ 3689 /** 3690 * Sets the response code. 3691 * 3692 * @param { number } code the response code. 3693 * @syscap SystemCapability.Web.Webview.Core 3694 * @atomicservice 3695 * @since 12 3696 */ 3697 setResponseCode(code: number): void; 3698 3699 /** 3700 * Sets the response is ready or not. 3701 * 3702 * @param { boolean } IsReady whether the response is ready. 3703 * @syscap SystemCapability.Web.Webview.Core 3704 * @since 9 3705 */ 3706 /** 3707 * Sets the response is ready or not. 3708 * 3709 * @param { boolean } IsReady whether the response is ready. 3710 * @syscap SystemCapability.Web.Webview.Core 3711 * @atomicservice 3712 * @since 11 3713 */ 3714 /** 3715 * Sets the response is ready or not. 3716 * 3717 * @param { boolean } IsReady whether the response is ready. 3718 * @syscap SystemCapability.Web.Webview.Core 3719 * @atomicservice 3720 * @since 12 3721 */ 3722 setResponseIsReady(IsReady: boolean): void; 3723 3724 /** 3725 * Gets whether the response is ready. 3726 * 3727 * @returns { boolean } True indicates the response data is ready and false is not ready. 3728 * @syscap SystemCapability.Web.Webview.Core 3729 * @since 13 3730 */ 3731 getResponseIsReady(): boolean; 3732} 3733 3734/** 3735 * Defines the Web's request/response header. 3736 * 3737 * @interface Header 3738 * @syscap SystemCapability.Web.Webview.Core 3739 * @since 8 3740 */ 3741/** 3742 * Defines the Web's request/response header. 3743 * 3744 * @interface Header 3745 * @syscap SystemCapability.Web.Webview.Core 3746 * @atomicservice 3747 * @since 11 3748 */ 3749/** 3750 * Defines the Web's request/response header. 3751 * 3752 * @typedef Header 3753 * @syscap SystemCapability.Web.Webview.Core 3754 * @atomicservice 3755 * @since 12 3756 */ 3757declare interface Header { 3758 /** 3759 * Gets the key of the request/response header. 3760 * 3761 * @type { string } 3762 * @syscap SystemCapability.Web.Webview.Core 3763 * @since 8 3764 */ 3765 /** 3766 * Gets the key of the request/response header. 3767 * 3768 * @type { string } 3769 * @syscap SystemCapability.Web.Webview.Core 3770 * @atomicservice 3771 * @since 11 3772 */ 3773 headerKey: string; 3774 3775 /** 3776 * Gets the value of the request/response header. 3777 * 3778 * @type { string } 3779 * @syscap SystemCapability.Web.Webview.Core 3780 * @since 8 3781 */ 3782 /** 3783 * Gets the value of the request/response header. 3784 * 3785 * @type { string } 3786 * @syscap SystemCapability.Web.Webview.Core 3787 * @atomicservice 3788 * @since 11 3789 */ 3790 headerValue: string; 3791} 3792 3793/** 3794 * Defines the Web resource error. 3795 * 3796 * @syscap SystemCapability.Web.Webview.Core 3797 * @since 8 3798 */ 3799/** 3800 * Defines the Web resource error. 3801 * 3802 * @syscap SystemCapability.Web.Webview.Core 3803 * @crossplatform 3804 * @since 10 3805 */ 3806/** 3807 * Defines the Web resource error. 3808 * 3809 * @syscap SystemCapability.Web.Webview.Core 3810 * @crossplatform 3811 * @atomicservice 3812 * @since 11 3813 */ 3814declare class WebResourceError { 3815 /** 3816 * Constructor. 3817 * 3818 * @syscap SystemCapability.Web.Webview.Core 3819 * @since 8 3820 */ 3821 /** 3822 * Constructor. 3823 * 3824 * @syscap SystemCapability.Web.Webview.Core 3825 * @crossplatform 3826 * @since 10 3827 */ 3828 /** 3829 * Constructor. 3830 * 3831 * @syscap SystemCapability.Web.Webview.Core 3832 * @crossplatform 3833 * @atomicservice 3834 * @since 11 3835 */ 3836 constructor(); 3837 3838 /** 3839 * Gets the info of the Web resource error. 3840 * 3841 * @returns { string } Return the info of the Web resource error. 3842 * @syscap SystemCapability.Web.Webview.Core 3843 * @since 8 3844 */ 3845 /** 3846 * Gets the info of the Web resource error. 3847 * 3848 * @returns { string } Return the info of the Web resource error. 3849 * @syscap SystemCapability.Web.Webview.Core 3850 * @crossplatform 3851 * @since 10 3852 */ 3853 /** 3854 * Gets the info of the Web resource error. 3855 * 3856 * @returns { string } Return the info of the Web resource error. 3857 * @syscap SystemCapability.Web.Webview.Core 3858 * @crossplatform 3859 * @atomicservice 3860 * @since 11 3861 */ 3862 getErrorInfo(): string; 3863 3864 /** 3865 * Gets the code of the Web resource error. 3866 * 3867 * @returns { number } Return the code of the Web resource error. 3868 * @syscap SystemCapability.Web.Webview.Core 3869 * @since 8 3870 */ 3871 /** 3872 * Gets the code of the Web resource error. 3873 * 3874 * @returns { number } Return the code of the Web resource error. 3875 * @syscap SystemCapability.Web.Webview.Core 3876 * @crossplatform 3877 * @since 10 3878 */ 3879 /** 3880 * Gets the code of the Web resource error. 3881 * 3882 * @returns { number } Return the code of the Web resource error. 3883 * @syscap SystemCapability.Web.Webview.Core 3884 * @crossplatform 3885 * @atomicservice 3886 * @since 11 3887 */ 3888 getErrorCode(): number; 3889} 3890 3891/** 3892 * Defines the js geolocation request. 3893 * 3894 * @syscap SystemCapability.Web.Webview.Core 3895 * @since 8 3896 */ 3897/** 3898 * Defines the js geolocation request. 3899 * 3900 * @syscap SystemCapability.Web.Webview.Core 3901 * @crossplatform 3902 * @atomicservice 3903 * @since 11 3904 */ 3905declare class JsGeolocation { 3906 /** 3907 * Constructor. 3908 * 3909 * @syscap SystemCapability.Web.Webview.Core 3910 * @since 8 3911 */ 3912 /** 3913 * Constructor. 3914 * 3915 * @syscap SystemCapability.Web.Webview.Core 3916 * @crossplatform 3917 * @atomicservice 3918 * @since 11 3919 */ 3920 constructor(); 3921 3922 /** 3923 * Report the geolocation permission status from users. 3924 * 3925 * @param { string } origin - The origin that ask for the geolocation permission. 3926 * @param { boolean } allow - The geolocation permission status. 3927 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3928 * @syscap SystemCapability.Web.Webview.Core 3929 * @since 8 3930 */ 3931 /** 3932 * Report the geolocation permission status from users. 3933 * 3934 * @param { string } origin - The origin that ask for the geolocation permission. 3935 * @param { boolean } allow - The geolocation permission status. 3936 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3937 * @syscap SystemCapability.Web.Webview.Core 3938 * @crossplatform 3939 * @atomicservice 3940 * @since 11 3941 */ 3942 invoke(origin: string, allow: boolean, retain: boolean): void; 3943} 3944 3945/** 3946 * Defines the Web cookie. 3947 * 3948 * @syscap SystemCapability.Web.Webview.Core 3949 * @since 8 3950 */ 3951/** 3952 * Defines the Web cookie. 3953 * 3954 * @syscap SystemCapability.Web.Webview.Core 3955 * @atomicservice 3956 * @since 11 3957 */ 3958declare class WebCookie { 3959 /** 3960 * Constructor. 3961 * 3962 * @syscap SystemCapability.Web.Webview.Core 3963 * @since 8 3964 */ 3965 /** 3966 * Constructor. 3967 * 3968 * @syscap SystemCapability.Web.Webview.Core 3969 * @atomicservice 3970 * @since 11 3971 */ 3972 constructor(); 3973 3974 /** 3975 * Sets the cookie. 3976 * 3977 * @syscap SystemCapability.Web.Webview.Core 3978 * @since 8 3979 * @deprecated since 9 3980 * @useinstead ohos.web.webview.webview.WebCookieManager#setCookie 3981 */ 3982 setCookie(); 3983 3984 /** 3985 * Saves the cookies. 3986 * 3987 * @syscap SystemCapability.Web.Webview.Core 3988 * @since 8 3989 * @deprecated since 9 3990 * @useinstead ohos.web.webview.webview.WebCookieManager#saveCookieAsync 3991 */ 3992 saveCookie(); 3993} 3994 3995/** 3996 * Defines the touch event result. 3997 * 3998 * @syscap SystemCapability.Web.Webview.Core 3999 * @atomicservice 4000 * @since 12 4001 */ 4002declare class EventResult { 4003 /** 4004 * Constructor. 4005 * 4006 * @syscap SystemCapability.Web.Webview.Core 4007 * @atomicservice 4008 * @since 12 4009 */ 4010 constructor(); 4011 4012 /** 4013 * Set whether the event is consumed. 4014 * 4015 * @param { boolean } result - True if the event is consumed. 4016 * @syscap SystemCapability.Web.Webview.Core 4017 * @atomicservice 4018 * @since 12 4019 */ 4020 setGestureEventResult(result: boolean): void; 4021} 4022 4023/** 4024 * Defines the Web controller. 4025 * 4026 * @syscap SystemCapability.Web.Webview.Core 4027 * @since 8 4028 * @deprecated since 9 4029 * @useinstead ohos.web.webview.webview.WebviewController 4030 */ 4031declare class WebController { 4032 /** 4033 * Constructor. 4034 * 4035 * @syscap SystemCapability.Web.Webview.Core 4036 * @since 8 4037 * @deprecated since 9 4038 */ 4039 constructor(); 4040 4041 /** 4042 * Let the Web inactive. 4043 * 4044 * @syscap SystemCapability.Web.Webview.Core 4045 * @since 8 4046 * @deprecated since 9 4047 * @useinstead ohos.web.webview.webview.WebviewController#onInactive 4048 */ 4049 onInactive(): void; 4050 4051 /** 4052 * Let the Web active. 4053 * 4054 * @syscap SystemCapability.Web.Webview.Core 4055 * @since 8 4056 * @deprecated since 9 4057 * @useinstead ohos.web.webview.webview.WebviewController#onActive 4058 */ 4059 onActive(): void; 4060 4061 /** 4062 * Let the Web zoom by. 4063 * 4064 * @param { number } factor The zoom factor. 4065 * @syscap SystemCapability.Web.Webview.Core 4066 * @since 8 4067 * @deprecated since 9 4068 * @useinstead ohos.web.webview.webview.WebviewController#zoom 4069 */ 4070 zoom(factor: number): void; 4071 4072 /** 4073 * Clears the history in the Web. 4074 * 4075 * @syscap SystemCapability.Web.Webview.Core 4076 * @since 8 4077 * @deprecated since 9 4078 * @useinstead ohos.web.webview.webview.WebviewController#clearHistory 4079 */ 4080 clearHistory(): void; 4081 4082 /** 4083 * Loads a piece of code and execute JS code in the context of the currently displayed page. 4084 * 4085 * @param { object } options The options with a piece of code and a callback. 4086 * @syscap SystemCapability.Web.Webview.Core 4087 * @since 8 4088 * @deprecated since 9 4089 * @useinstead ohos.web.webview.webview.WebviewController#runJavaScript 4090 */ 4091 runJavaScript(options: { script: string, callback?: (result: string) => void }); 4092 4093 /** 4094 * Loads the data or URL. 4095 * 4096 * @param { object } options The options with the data or URL and other information. 4097 * @syscap SystemCapability.Web.Webview.Core 4098 * @since 8 4099 * @deprecated since 9 4100 * @useinstead ohos.web.webview.webview.WebviewController#loadData 4101 */ 4102 loadData(options: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string }); 4103 4104 /** 4105 * Loads the given URL. 4106 * 4107 * @param { object } options The options with the URL and other information. 4108 * @syscap SystemCapability.Web.Webview.Core 4109 * @since 8 4110 * @deprecated since 9 4111 * @useinstead ohos.web.webview.webview.WebviewController#loadUrl 4112 */ 4113 loadUrl(options: { url: string | Resource, headers?: Array<Header> }); 4114 4115 /** 4116 * refreshes the current URL. 4117 * 4118 * @syscap SystemCapability.Web.Webview.Core 4119 * @since 8 4120 * @deprecated since 9 4121 * @useinstead ohos.web.webview.webview.WebviewController#refresh 4122 */ 4123 refresh(); 4124 4125 /** 4126 * Stops the current load. 4127 * 4128 * @syscap SystemCapability.Web.Webview.Core 4129 * @since 8 4130 * @deprecated since 9 4131 * @useinstead ohos.web.webview.webview.WebviewController#stop 4132 */ 4133 stop(); 4134 4135 /** 4136 * Registers the JavaScript object and method list. 4137 * 4138 * @param { object } options - The option with the JavaScript object and method list. 4139 * @syscap SystemCapability.Web.Webview.Core 4140 * @since 8 4141 * @deprecated since 9 4142 * @useinstead ohos.web.webview.webview.WebviewController#registerJavaScriptProxy 4143 */ 4144 registerJavaScriptProxy(options: { object: object, name: string, methodList: Array<string> }); 4145 4146 /** 4147 * Deletes a registered JavaScript object with given name. 4148 * 4149 * @param { string } name - The name of a registered JavaScript object to be deleted. 4150 * @syscap SystemCapability.Web.Webview.Core 4151 * @since 8 4152 * @deprecated since 9 4153 * @useinstead ohos.web.webview.webview.WebviewController#deleteJavaScriptRegister 4154 */ 4155 deleteJavaScriptRegister(name: string); 4156 4157 /** 4158 * Gets the type of HitTest. 4159 * 4160 * @returns { HitTestType } The type of HitTest. 4161 * @syscap SystemCapability.Web.Webview.Core 4162 * @since 8 4163 * @deprecated since 9 4164 * @useinstead ohos.web.webview.webview.WebviewController#getHitTest 4165 */ 4166 getHitTest(): HitTestType; 4167 4168 /** 4169 * Gets the request focus. 4170 * 4171 * @syscap SystemCapability.Web.Webview.Core 4172 * @since 8 4173 * @deprecated since 9 4174 * @useinstead ohos.web.webview.webview.WebviewController#requestFocus 4175 */ 4176 requestFocus(); 4177 4178 /** 4179 * Checks whether the web page can go back. 4180 * 4181 * @returns { boolean } Whether the web page can go back. 4182 * @syscap SystemCapability.Web.Webview.Core 4183 * @since 8 4184 * @deprecated since 9 4185 * @useinstead ohos.web.webview.webview.WebviewController#accessBackward 4186 */ 4187 accessBackward(): boolean; 4188 4189 /** 4190 * Checks whether the web page can go forward. 4191 * 4192 * @returns { boolean } 4193 * @syscap SystemCapability.Web.Webview.Core 4194 * @since 8 4195 * @deprecated since 9 4196 * @useinstead ohos.web.webview.webview.WebviewController#accessForward 4197 */ 4198 accessForward(): boolean; 4199 4200 /** 4201 * Checks whether the web page can go back or forward the given number of steps. 4202 * 4203 * @param { number } step The number of steps. 4204 * @returns { boolean } 4205 * @syscap SystemCapability.Web.Webview.Core 4206 * @since 8 4207 * @deprecated since 9 4208 * @useinstead ohos.web.webview.webview.WebviewController#accessStep 4209 */ 4210 accessStep(step: number): boolean; 4211 4212 /** 4213 * Goes back in the history of the web page. 4214 * 4215 * @syscap SystemCapability.Web.Webview.Core 4216 * @since 8 4217 * @deprecated since 9 4218 * @useinstead ohos.web.webview.webview.WebviewController#backward 4219 */ 4220 backward(); 4221 4222 /** 4223 * Goes forward in the history of the web page. 4224 * 4225 * @syscap SystemCapability.Web.Webview.Core 4226 * @since 8 4227 * @deprecated since 9 4228 * @useinstead ohos.web.webview.webview.WebviewController#forward 4229 */ 4230 forward(); 4231 4232 /** 4233 * Gets network cookie manager 4234 * 4235 * @returns { WebCookie } 4236 * @syscap SystemCapability.Web.Webview.Core 4237 * @since 9 4238 * @deprecated since 9 4239 * @useinstead ohos.web.webview.WebCookieManager 4240 */ 4241 getCookieManager(): WebCookie 4242} 4243 4244/** 4245 * Defines the Web options. 4246 * 4247 * @interface WebOptions 4248 * @syscap SystemCapability.Web.Webview.Core 4249 * @since 8 4250 */ 4251/** 4252 * Defines the Web options. 4253 * 4254 * @interface WebOptions 4255 * @syscap SystemCapability.Web.Webview.Core 4256 * @crossplatform 4257 * @since 10 4258 */ 4259/** 4260 * Defines the Web options. 4261 * 4262 * @interface WebOptions 4263 * @syscap SystemCapability.Web.Webview.Core 4264 * @crossplatform 4265 * @atomicservice 4266 * @since 11 4267 */ 4268/** 4269 * Defines the Web options. 4270 * 4271 * @typedef WebOptions 4272 * @syscap SystemCapability.Web.Webview.Core 4273 * @crossplatform 4274 * @atomicservice 4275 * @since 12 4276 */ 4277declare interface WebOptions { 4278 /** 4279 * Sets the address of the web page to be displayed. 4280 * 4281 * @type { string | Resource } 4282 * @syscap SystemCapability.Web.Webview.Core 4283 * @since 8 4284 */ 4285 /** 4286 * Sets the address of the web page to be displayed. 4287 * 4288 * @type { string | Resource } 4289 * @syscap SystemCapability.Web.Webview.Core 4290 * @crossplatform 4291 * @since 10 4292 */ 4293 /** 4294 * Sets the address of the web page to be displayed. 4295 * 4296 * @type { string | Resource } 4297 * @syscap SystemCapability.Web.Webview.Core 4298 * @crossplatform 4299 * @atomicservice 4300 * @since 11 4301 */ 4302 src: string | Resource; 4303 /** 4304 * Sets the controller of the Web. 4305 * 4306 * @type { WebController | WebviewController } 4307 * @syscap SystemCapability.Web.Webview.Core 4308 * @since 8 4309 */ 4310 /** 4311 * Sets the controller of the Web. 4312 * 4313 * @type { WebController | WebviewController } 4314 * @syscap SystemCapability.Web.Webview.Core 4315 * @since 9 4316 */ 4317 /** 4318 * Sets the controller of the Web. 4319 * 4320 * @type { WebController | WebviewController } 4321 * @syscap SystemCapability.Web.Webview.Core 4322 * @crossplatform 4323 * @since 10 4324 */ 4325 /** 4326 * Sets the controller of the Web. 4327 * 4328 * @type { WebController | WebviewController } 4329 * @syscap SystemCapability.Web.Webview.Core 4330 * @crossplatform 4331 * @atomicservice 4332 * @since 11 4333 */ 4334 controller: WebController | WebviewController; 4335 4336 /** 4337 * Sets the render mode of the web. 4338 * 4339 * @type { ?RenderMode } 4340 * @syscap SystemCapability.Web.Webview.Core 4341 * @atomicservice 4342 * @since 12 4343 */ 4344 renderMode? : RenderMode; 4345 4346 /** 4347 * Sets the incognito mode of the Web, the parameter is optional and default value is false. 4348 * When the Web is in incognito mode, cookies, records of websites, geolocation permissions 4349 * will not save in persistent files. 4350 * 4351 * @type { ?boolean } 4352 * @syscap SystemCapability.Web.Webview.Core 4353 * @atomicservice 4354 * @since 11 4355 */ 4356 incognitoMode? : boolean; 4357 4358 /** 4359 * Sets the shared render process token of the web. 4360 * When the web is in multiprocess mode, web with the same 4361 * sharedRenderProcessToken will attempt to reuse the same render process. 4362 * The shared render process will remain active until all associated 4363 * web are destroyed. 4364 * 4365 * @type { ?string } 4366 * @syscap SystemCapability.Web.Webview.Core 4367 * @since 12 4368 */ 4369 sharedRenderProcessToken? : string; 4370} 4371 4372/** 4373 * Defines the contents of the JavaScript to be injected. 4374 * 4375 * @interface ScriptItem 4376 * @syscap SystemCapability.Web.Webview.Core 4377 * @atomicservice 4378 * @since 11 4379 */ 4380/** 4381 * Defines the contents of the JavaScript to be injected. 4382 * 4383 * @typedef ScriptItem 4384 * @syscap SystemCapability.Web.Webview.Core 4385 * @atomicservice 4386 * @since 12 4387 */ 4388declare interface ScriptItem { 4389 /** 4390 * Sets the JavaScript to be injected. 4391 * 4392 * @type { string } 4393 * @syscap SystemCapability.Web.Webview.Core 4394 * @atomicservice 4395 * @since 11 4396 */ 4397 script: string; 4398 /** 4399 * Sets the rules of the JavaScript. 4400 * 4401 * @type { Array<string> } 4402 * @syscap SystemCapability.Web.Webview.Core 4403 * @atomicservice 4404 * @since 11 4405 */ 4406 scriptRules: Array<string>; 4407} 4408 4409/** 4410 * Defines the load committed details. 4411 * 4412 * @interface LoadCommittedDetails 4413 * @syscap SystemCapability.Web.Webview.Core 4414 * @atomicservice 4415 * @since 11 4416 */ 4417/** 4418 * Defines the load committed details. 4419 * 4420 * @typedef LoadCommittedDetails 4421 * @syscap SystemCapability.Web.Webview.Core 4422 * @atomicservice 4423 * @since 12 4424 */ 4425declare interface LoadCommittedDetails { 4426 /** 4427 * Check whether the request is for getting the main frame. 4428 * 4429 * @type { boolean } 4430 * @syscap SystemCapability.Web.Webview.Core 4431 * @atomicservice 4432 * @since 11 4433 */ 4434 isMainFrame: boolean; 4435 4436 /** 4437 * Whether the navigation happened without changing document. Examples of 4438 * same document navigations are: 4439 * 1. reference fragment navigations. 4440 * 2. pushState/replaceState. 4441 * 3. same page history navigation 4442 * 4443 * @type { boolean } 4444 * @syscap SystemCapability.Web.Webview.Core 4445 * @atomicservice 4446 * @since 11 4447 */ 4448 isSameDocument: boolean; 4449 4450 /** 4451 * True if the committed entry has replaced the existing one. Note that in 4452 * case of subframes, the NavigationEntry and FrameNavigationEntry objects 4453 * don't actually get replaced - they're reused, but with updated attributes. 4454 * 4455 * @type { boolean } 4456 * @syscap SystemCapability.Web.Webview.Core 4457 * @atomicservice 4458 * @since 11 4459 */ 4460 didReplaceEntry: boolean; 4461 4462 /** 4463 * The type of the navigation. 4464 * 4465 * @type { WebNavigationType } 4466 * @syscap SystemCapability.Web.Webview.Core 4467 * @atomicservice 4468 * @since 11 4469 */ 4470 navigationType: WebNavigationType; 4471 4472 /** 4473 * The url to navigate. 4474 * 4475 * @type { string } 4476 * @syscap SystemCapability.Web.Webview.Core 4477 * @atomicservice 4478 * @since 11 4479 */ 4480 url: string; 4481} 4482 4483/** 4484 * Defines the Intelligent Tracking Prevention details. 4485 * 4486 * @typedef IntelligentTrackingPreventionDetails 4487 * @syscap SystemCapability.Web.Webview.Core 4488 * @atomicservice 4489 * @since 12 4490 */ 4491declare interface IntelligentTrackingPreventionDetails { 4492 /** 4493 * The host of website url. 4494 * 4495 * @type { string } 4496 * @syscap SystemCapability.Web.Webview.Core 4497 * @atomicservice 4498 * @since 12 4499 */ 4500 host: string; 4501 4502 /** 4503 * The host of tracker url. 4504 * 4505 * @type { string } 4506 * @syscap SystemCapability.Web.Webview.Core 4507 * @atomicservice 4508 * @since 12 4509 */ 4510 trackerHost: string; 4511} 4512 4513/** 4514 * Defines the Web interface. 4515 * 4516 * @interface WebInterface 4517 * @syscap SystemCapability.Web.Webview.Core 4518 * @since 8 4519 */ 4520/** 4521 * Defines the Web interface. 4522 * 4523 * @interface WebInterface 4524 * @syscap SystemCapability.Web.Webview.Core 4525 * @crossplatform 4526 * @since 10 4527 */ 4528/** 4529 * Defines the Web interface. 4530 * 4531 * @interface WebInterface 4532 * @syscap SystemCapability.Web.Webview.Core 4533 * @crossplatform 4534 * @atomicservice 4535 * @since 11 4536 */ 4537/** 4538 * Defines the Web interface. 4539 * 4540 * @typedef WebInterface 4541 * @syscap SystemCapability.Web.Webview.Core 4542 * @crossplatform 4543 * @atomicservice 4544 * @since 12 4545 */ 4546interface WebInterface { 4547 /** 4548 * Sets Value. 4549 * 4550 * @param { WebOptions } value 4551 * @returns { WebAttribute } 4552 * @syscap SystemCapability.Web.Webview.Core 4553 * @since 8 4554 */ 4555 /** 4556 * Sets Value. 4557 * 4558 * @param { WebOptions } value 4559 * @returns { WebAttribute } 4560 * @syscap SystemCapability.Web.Webview.Core 4561 * @crossplatform 4562 * @since 10 4563 */ 4564 /** 4565 * Sets Value. 4566 * 4567 * @param { WebOptions } value 4568 * @returns { WebAttribute } 4569 * @syscap SystemCapability.Web.Webview.Core 4570 * @crossplatform 4571 * @atomicservice 4572 * @since 11 4573 */ 4574 (value: WebOptions): WebAttribute; 4575} 4576 4577/** 4578 * Defines the embed info. 4579 * 4580 * @interface NativeEmbedInfo 4581 * @syscap SystemCapability.Web.Webview.Core 4582 * @atomicservice 4583 * @since 11 4584 */ 4585/** 4586 * Defines the embed info. 4587 * 4588 * @typedef NativeEmbedInfo 4589 * @syscap SystemCapability.Web.Webview.Core 4590 * @atomicservice 4591 * @since 12 4592 */ 4593declare interface NativeEmbedInfo { 4594 /** 4595 * The embed id. 4596 * 4597 * @type { ?string } 4598 * @syscap SystemCapability.Web.Webview.Core 4599 * @atomicservice 4600 * @since 11 4601 */ 4602 id?: string; 4603 /** 4604 * Only when enableEmbedMode is true and type is marked as native/xxx will be recognized as a same layer component. 4605 * 4606 * @type { ?string } 4607 * @syscap SystemCapability.Web.Webview.Core 4608 * @atomicservice 4609 * @since 11 4610 */ 4611 type?: string; 4612 /** 4613 * The embed tag src. 4614 * 4615 * @type { ?string } 4616 * @syscap SystemCapability.Web.Webview.Core 4617 * @atomicservice 4618 * @since 11 4619 */ 4620 src?: string; 4621 /** 4622 * The coordinate position of embed element relative to the webComponent. 4623 * 4624 * @type { ?Position } 4625 * @syscap SystemCapability.Web.Webview.Core 4626 * @atomicservice 4627 * @since 12 4628 */ 4629 position?: Position; 4630 /** 4631 * The embed tag width. 4632 * 4633 * @type { ?number } 4634 * @syscap SystemCapability.Web.Webview.Core 4635 * @atomicservice 4636 * @since 11 4637 */ 4638 width?: number; 4639 /** 4640 * The embed tag height. 4641 * 4642 * @type { ?number } 4643 * @syscap SystemCapability.Web.Webview.Core 4644 * @atomicservice 4645 * @since 11 4646 */ 4647 height?: number; 4648 /** 4649 * The embed tag url. 4650 * 4651 * @type { ?string } 4652 * @syscap SystemCapability.Web.Webview.Core 4653 * @atomicservice 4654 * @since 11 4655 */ 4656 url?: string; 4657 /** 4658 * The embed tag name. 4659 * 4660 * @type { ?string } 4661 * @syscap SystemCapability.Web.Webview.Core 4662 * @atomicservice 4663 * @since 12 4664 */ 4665 tag?: string; 4666 /** 4667 * The embed param list information used by object tag. 4668 * 4669 * @type { ?Map<string, string> } 4670 * @syscap SystemCapability.Web.Webview.Core 4671 * @atomicservice 4672 * @since 12 4673 */ 4674 params?: Map<string, string>; 4675} 4676 4677/** 4678 * Defines the Embed Data info. 4679 * 4680 * @interface NativeEmbedDataInfo 4681 * @syscap SystemCapability.Web.Webview.Core 4682 * @atomicservice 4683 * @since 11 4684 */ 4685/** 4686 * Defines the Embed Data info. 4687 * 4688 * @typedef NativeEmbedDataInfo 4689 * @syscap SystemCapability.Web.Webview.Core 4690 * @atomicservice 4691 * @since 12 4692 */ 4693declare interface NativeEmbedDataInfo { 4694 /** 4695 * The embed status. 4696 * 4697 * @type { ?NativeEmbedStatus } 4698 * @syscap SystemCapability.Web.Webview.Core 4699 * @atomicservice 4700 * @since 11 4701 */ 4702 status?: NativeEmbedStatus; 4703 /** 4704 * The surface id. 4705 * 4706 * @type { ?string } 4707 * @syscap SystemCapability.Web.Webview.Core 4708 * @atomicservice 4709 * @since 11 4710 */ 4711 surfaceId?: string; 4712 /** 4713 * The embed id. 4714 * 4715 * @type { ?string } 4716 * @syscap SystemCapability.Web.Webview.Core 4717 * @atomicservice 4718 * @since 11 4719 */ 4720 embedId?: string; 4721 /** 4722 * The embed info. 4723 * 4724 * @type { ?NativeEmbedInfo } 4725 * @syscap SystemCapability.Web.Webview.Core 4726 * @atomicservice 4727 * @since 11 4728 */ 4729 info?: NativeEmbedInfo; 4730} 4731 4732/** 4733 * Defines the Embed Visibility info. 4734 * 4735 * @typedef NativeEmbedVisibilityInfo 4736 * @syscap SystemCapability.Web.Webview.Core 4737 * @since 12 4738 */ 4739declare interface NativeEmbedVisibilityInfo { 4740 /** 4741 * The embed visibility. 4742 * 4743 * @type { boolean } 4744 * @syscap SystemCapability.Web.Webview.Core 4745 * @since 12 4746 */ 4747 visibility: boolean; 4748 /** 4749 * The embed id. 4750 * 4751 * @type { string } 4752 * @syscap SystemCapability.Web.Webview.Core 4753 * @since 12 4754 */ 4755 embedId: string; 4756} 4757 4758/** 4759 * Defines the user touch info. 4760 * 4761 * @interface NativeEmbedTouchInfo 4762 * @syscap SystemCapability.Web.Webview.Core 4763 * @atomicservice 4764 * @since 11 4765 */ 4766/** 4767 * Defines the user touch info. 4768 * 4769 * @typedef NativeEmbedTouchInfo 4770 * @syscap SystemCapability.Web.Webview.Core 4771 * @atomicservice 4772 * @since 12 4773 */ 4774declare interface NativeEmbedTouchInfo { 4775 /** 4776 * The native embed id. 4777 * 4778 * @type { ?string } 4779 * @syscap SystemCapability.Web.Webview.Core 4780 * @atomicservice 4781 * @since 11 4782 */ 4783 embedId?: string; 4784 /** 4785 * An event sent when the state of contacts with a touch-sensitive surface changes. 4786 * 4787 * @type { ?TouchEvent } 4788 * @syscap SystemCapability.Web.Webview.Core 4789 * @atomicservice 4790 * @since 11 4791 */ 4792 touchEvent?: TouchEvent; 4793 /** 4794 * Handle the user's touch result. 4795 * 4796 * @type { ?EventResult } 4797 * @syscap SystemCapability.Web.Webview.Core 4798 * @atomicservice 4799 * @since 12 4800 */ 4801 result?: EventResult; 4802} 4803 4804 /** 4805 * Defines the first content paint rendering of web page. 4806 * 4807 * @typedef FirstMeaningfulPaint 4808 * @syscap SystemCapability.Web.Webview.Core 4809 * @atomicservice 4810 * @since 12 4811 */ 4812declare interface FirstMeaningfulPaint { 4813 /** 4814 * Start time of navigation. 4815 * 4816 * @type { ?number } 4817 * @syscap SystemCapability.Web.Webview.Core 4818 * @atomicservice 4819 * @since 12 4820 */ 4821 navigationStartTime?: number; 4822 4823 /** 4824 * Paint time of first meaningful content. 4825 * 4826 * @type { ?number } 4827 * @syscap SystemCapability.Web.Webview.Core 4828 * @atomicservice 4829 * @since 12 4830 */ 4831 firstMeaningfulPaintTime?: number; 4832} 4833 4834/** 4835 * Defines the largest content paint rendering of web page. 4836 * 4837 * @typedef LargestContentfulPaint 4838 * @syscap SystemCapability.Web.Webview.Core 4839 * @atomicservice 4840 * @since 12 4841 */ 4842declare interface LargestContentfulPaint { 4843 /** 4844 * Start time of navigation. 4845 * 4846 * @type { ?number } 4847 * @syscap SystemCapability.Web.Webview.Core 4848 * @atomicservice 4849 * @since 12 4850 */ 4851 navigationStartTime?: number; 4852 4853 /** 4854 * Paint time of largest image. 4855 * 4856 * @type { ?number } 4857 * @syscap SystemCapability.Web.Webview.Core 4858 * @atomicservice 4859 * @since 12 4860 */ 4861 largestImagePaintTime?: number; 4862 4863 /** 4864 * Paint time of largest text. 4865 * 4866 * @type { ?number } 4867 * @syscap SystemCapability.Web.Webview.Core 4868 * @atomicservice 4869 * @since 12 4870 */ 4871 largestTextPaintTime?: number; 4872 4873 /** 4874 * Bits per pixel of image. 4875 * 4876 * @type { ?number } 4877 * @syscap SystemCapability.Web.Webview.Core 4878 * @atomicservice 4879 * @since 12 4880 */ 4881 imageBPP?: number; 4882 4883 /** 4884 * Load start time of largest image. 4885 * 4886 * @type { ?number } 4887 * @syscap SystemCapability.Web.Webview.Core 4888 * @atomicservice 4889 * @since 12 4890 */ 4891 largestImageLoadStartTime?: number; 4892 4893 /** 4894 * Load end time of largest image. 4895 * 4896 * @type { ?number } 4897 * @syscap SystemCapability.Web.Webview.Core 4898 * @atomicservice 4899 * @since 12 4900 */ 4901 largestImageLoadEndTime?: number; 4902} 4903 4904/** 4905 * Defines the render process not responding info. 4906 * 4907 * @interface RenderProcessNotRespondingData 4908 * @syscap SystemCapability.Web.Webview.Core 4909 * @since 12 4910 */ 4911declare interface RenderProcessNotRespondingData { 4912 /** 4913 * JavaScript stack info of the webpage when render process not responding. 4914 * 4915 * @type { string } 4916 * @syscap SystemCapability.Web.Webview.Core 4917 * @since 12 4918 */ 4919 jsStack: string; 4920 4921 /** 4922 * Process id of render process not responding. 4923 * 4924 * @type { number } 4925 * @syscap SystemCapability.Web.Webview.Core 4926 * @since 12 4927 */ 4928 pid: number; 4929 4930 /** 4931 * Reason for the render process not responding. 4932 * 4933 * @type { RenderProcessNotRespondingReason } 4934 * @syscap SystemCapability.Web.Webview.Core 4935 * @since 12 4936 */ 4937 reason: RenderProcessNotRespondingReason; 4938} 4939 4940/** 4941 * Defines the triggered function at the end of web page loading. 4942 * 4943 * @typedef OnPageEndEvent 4944 * @syscap SystemCapability.Web.Webview.Core 4945 * @crossplatform 4946 * @atomicservice 4947 * @since 12 4948 */ 4949declare interface OnPageEndEvent { 4950 /** 4951 * The url of page. 4952 * 4953 * @type { string } 4954 * @syscap SystemCapability.Web.Webview.Core 4955 * @crossplatform 4956 * @atomicservice 4957 * @since 12 4958 */ 4959 url: string; 4960} 4961 4962/** 4963 * Defines the triggered function at the begin of web page loading. 4964 * 4965 * @typedef OnPageBeginEvent 4966 * @syscap SystemCapability.Web.Webview.Core 4967 * @crossplatform 4968 * @atomicservice 4969 * @since 12 4970 */ 4971declare interface OnPageBeginEvent { 4972 /** 4973 * The url of page. 4974 * 4975 * @type { string } 4976 * @syscap SystemCapability.Web.Webview.Core 4977 * @crossplatform 4978 * @atomicservice 4979 * @since 12 4980 */ 4981 url: string; 4982} 4983 4984/** 4985 * Defines the triggered function when the page loading progress changes. 4986 * 4987 * @typedef OnProgressChangeEvent 4988 * @syscap SystemCapability.Web.Webview.Core 4989 * @crossplatform 4990 * @atomicservice 4991 * @since 12 4992 */ 4993declare interface OnProgressChangeEvent { 4994 /** 4995 * The new progress of the page. 4996 * 4997 * @type { number } 4998 * @syscap SystemCapability.Web.Webview.Core 4999 * @crossplatform 5000 * @atomicservice 5001 * @since 12 5002 */ 5003 newProgress: number; 5004} 5005 5006/** 5007 * Defines the triggered function when the title of the main application document changes. 5008 * 5009 * @typedef OnTitleReceiveEvent 5010 * @syscap SystemCapability.Web.Webview.Core 5011 * @crossplatform 5012 * @atomicservice 5013 * @since 12 5014 */ 5015declare interface OnTitleReceiveEvent { 5016 /** 5017 * The title of the page. 5018 * 5019 * @type { string } 5020 * @syscap SystemCapability.Web.Webview.Core 5021 * @crossplatform 5022 * @atomicservice 5023 * @since 12 5024 */ 5025 title: string; 5026} 5027 5028/** 5029 * Defines the triggered function when requesting to show the geolocation permission. 5030 * 5031 * @typedef OnGeolocationShowEvent 5032 * @syscap SystemCapability.Web.Webview.Core 5033 * @crossplatform 5034 * @atomicservice 5035 * @since 12 5036 */ 5037declare interface OnGeolocationShowEvent { 5038 /** 5039 * Origin of the page. 5040 * 5041 * @type { string } 5042 * @syscap SystemCapability.Web.Webview.Core 5043 * @crossplatform 5044 * @atomicservice 5045 * @since 12 5046 */ 5047 origin: string; 5048 /** 5049 * Defines the js geolocation request. 5050 * 5051 * @type { JsGeolocation } 5052 * @syscap SystemCapability.Web.Webview.Core 5053 * @crossplatform 5054 * @atomicservice 5055 * @since 12 5056 */ 5057 geolocation: JsGeolocation; 5058} 5059 5060/** 5061 * Defines the triggered function when the web page wants to display a JavaScript alert() dialog. 5062 * 5063 * @typedef OnAlertEvent 5064 * @syscap SystemCapability.Web.Webview.Core 5065 * @crossplatform 5066 * @atomicservice 5067 * @since 12 5068 */ 5069declare interface OnAlertEvent { 5070 /** 5071 * The url of the page. 5072 * 5073 * @type { string } 5074 * @syscap SystemCapability.Web.Webview.Core 5075 * @crossplatform 5076 * @atomicservice 5077 * @since 12 5078 */ 5079 url: string; 5080 /** 5081 * The message of alert dialog. 5082 * 5083 * @type { string } 5084 * @syscap SystemCapability.Web.Webview.Core 5085 * @crossplatform 5086 * @atomicservice 5087 * @since 12 5088 */ 5089 message: string; 5090 /** 5091 * Handle the user's JavaScript result. 5092 * 5093 * @type { JsResult } 5094 * @syscap SystemCapability.Web.Webview.Core 5095 * @crossplatform 5096 * @atomicservice 5097 * @since 12 5098 */ 5099 result: JsResult; 5100} 5101 5102/** 5103 * Defines the triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 5104 * 5105 * @typedef OnBeforeUnloadEvent 5106 * @syscap SystemCapability.Web.Webview.Core 5107 * @atomicservice 5108 * @since 12 5109 */ 5110declare interface OnBeforeUnloadEvent { 5111 /** 5112 * The url of the page. 5113 * 5114 * @type { string } 5115 * @syscap SystemCapability.Web.Webview.Core 5116 * @atomicservice 5117 * @since 12 5118 */ 5119 url: string; 5120 /** 5121 * The message of confirm dialog. 5122 * 5123 * @type { string } 5124 * @syscap SystemCapability.Web.Webview.Core 5125 * @atomicservice 5126 * @since 12 5127 */ 5128 message: string; 5129 /** 5130 * Handle the user's JavaScript result. 5131 * 5132 * @type { JsResult } 5133 * @syscap SystemCapability.Web.Webview.Core 5134 * @atomicservice 5135 * @since 12 5136 */ 5137 result: JsResult; 5138} 5139 5140/** 5141 * Defines the triggered function when the web page wants to display a JavaScript confirm() dialog. 5142 * 5143 * @typedef OnConfirmEvent 5144 * @syscap SystemCapability.Web.Webview.Core 5145 * @crossplatform 5146 * @atomicservice 5147 * @since 12 5148 */ 5149declare interface OnConfirmEvent { 5150 /** 5151 * The url of the page. 5152 * 5153 * @type { string } 5154 * @syscap SystemCapability.Web.Webview.Core 5155 * @crossplatform 5156 * @atomicservice 5157 * @since 12 5158 */ 5159 url: string; 5160 /** 5161 * The message of confirm dialog. 5162 * 5163 * @type { string } 5164 * @syscap SystemCapability.Web.Webview.Core 5165 * @crossplatform 5166 * @atomicservice 5167 * @since 12 5168 */ 5169 message: string; 5170 /** 5171 * Handle the user's JavaScript result. 5172 * 5173 * @type { JsResult } 5174 * @syscap SystemCapability.Web.Webview.Core 5175 * @crossplatform 5176 * @atomicservice 5177 * @since 12 5178 */ 5179 result: JsResult; 5180} 5181 5182/** 5183 * Defines the triggered function when the web page wants to display a JavaScript prompt() dialog. 5184 * 5185 * @typedef OnPromptEvent 5186 * @syscap SystemCapability.Web.Webview.Core 5187 * @crossplatform 5188 * @atomicservice 5189 * @since 12 5190 */ 5191declare interface OnPromptEvent { 5192 /** 5193 * The url of the page. 5194 * 5195 * @type { string } 5196 * @syscap SystemCapability.Web.Webview.Core 5197 * @crossplatform 5198 * @atomicservice 5199 * @since 12 5200 */ 5201 url: string; 5202 /** 5203 * The message of prompt dialog. 5204 * 5205 * @type { string } 5206 * @syscap SystemCapability.Web.Webview.Core 5207 * @crossplatform 5208 * @atomicservice 5209 * @since 12 5210 */ 5211 message: string; 5212 /** 5213 * The value of prompt dialog. 5214 * 5215 * @type { string } 5216 * @syscap SystemCapability.Web.Webview.Core 5217 * @crossplatform 5218 * @atomicservice 5219 * @since 12 5220 */ 5221 value: string; 5222 /** 5223 * Handle the user's JavaScript result. 5224 * 5225 * @type { JsResult } 5226 * @syscap SystemCapability.Web.Webview.Core 5227 * @crossplatform 5228 * @atomicservice 5229 * @since 12 5230 */ 5231 result: JsResult; 5232} 5233 5234/** 5235 * Defines the triggered function when the web page receives a JavaScript console message. 5236 * 5237 * @typedef OnConsoleEvent 5238 * @syscap SystemCapability.Web.Webview.Core 5239 * @crossplatform 5240 * @atomicservice 5241 * @since 12 5242 */ 5243declare interface OnConsoleEvent { 5244 /** 5245 * Console message information of the event. 5246 * 5247 * @type { ConsoleMessage } 5248 * @syscap SystemCapability.Web.Webview.Core 5249 * @crossplatform 5250 * @atomicservice 5251 * @since 12 5252 */ 5253 message: ConsoleMessage; 5254} 5255 5256/** 5257 * Defines the triggered function when the web page receives a web resource loading error. 5258 * 5259 * @typedef OnErrorReceiveEvent 5260 * @syscap SystemCapability.Web.Webview.Core 5261 * @crossplatform 5262 * @atomicservice 5263 * @since 12 5264 */ 5265declare interface OnErrorReceiveEvent { 5266 /** 5267 * The information of request. 5268 * 5269 * @type { WebResourceRequest } 5270 * @syscap SystemCapability.Web.Webview.Core 5271 * @crossplatform 5272 * @atomicservice 5273 * @since 12 5274 */ 5275 request: WebResourceRequest; 5276 /** 5277 * The information of error. 5278 * 5279 * @type { WebResourceError } 5280 * @syscap SystemCapability.Web.Webview.Core 5281 * @crossplatform 5282 * @atomicservice 5283 * @since 12 5284 */ 5285 error: WebResourceError; 5286} 5287 5288/** 5289 * Defines the triggered function when the web page receives a web resource loading HTTP error. 5290 * 5291 * @typedef OnHttpErrorReceiveEvent 5292 * @syscap SystemCapability.Web.Webview.Core 5293 * @crossplatform 5294 * @atomicservice 5295 * @since 12 5296 */ 5297declare interface OnHttpErrorReceiveEvent { 5298 /** 5299 * The information of request. 5300 * 5301 * @type { WebResourceRequest } 5302 * @syscap SystemCapability.Web.Webview.Core 5303 * @crossplatform 5304 * @atomicservice 5305 * @since 12 5306 */ 5307 request: WebResourceRequest; 5308 /** 5309 * Web resource response of event. 5310 * 5311 * @type { WebResourceResponse } 5312 * @syscap SystemCapability.Web.Webview.Core 5313 * @crossplatform 5314 * @atomicservice 5315 * @since 12 5316 */ 5317 response: WebResourceResponse; 5318} 5319 5320/** 5321 * Defines the triggered function when starting to download. 5322 * 5323 * @typedef OnDownloadStartEvent 5324 * @syscap SystemCapability.Web.Webview.Core 5325 * @crossplatform 5326 * @atomicservice 5327 * @since 12 5328 */ 5329declare interface OnDownloadStartEvent { 5330 /** 5331 * The URL of page. 5332 * 5333 * @type { string } 5334 * @syscap SystemCapability.Web.Webview.Core 5335 * @crossplatform 5336 * @atomicservice 5337 * @since 12 5338 */ 5339 url: string; 5340 /** 5341 * The userAgent of page. 5342 * 5343 * @type { string } 5344 * @syscap SystemCapability.Web.Webview.Core 5345 * @crossplatform 5346 * @atomicservice 5347 * @since 12 5348 */ 5349 userAgent: string; 5350 /** 5351 * The contentDisposition of page. 5352 * 5353 * @type { string } 5354 * @syscap SystemCapability.Web.Webview.Core 5355 * @atomicservice 5356 * @since 12 5357 */ 5358 contentDisposition: string; 5359 /** 5360 * The mimetype of page. 5361 * 5362 * @type { string } 5363 * @syscap SystemCapability.Web.Webview.Core 5364 * @crossplatform 5365 * @atomicservice 5366 * @since 12 5367 */ 5368 mimetype: string; 5369 /** 5370 * The contentLength of page. 5371 * 5372 * @type { number } 5373 * @syscap SystemCapability.Web.Webview.Core 5374 * @crossplatform 5375 * @atomicservice 5376 * @since 12 5377 */ 5378 contentLength: number; 5379} 5380 5381/** 5382 * Defines the triggered callback when the Web page refreshes accessed history. 5383 * 5384 * @typedef OnRefreshAccessedHistoryEvent 5385 * @syscap SystemCapability.Web.Webview.Core 5386 * @atomicservice 5387 * @since 12 5388 */ 5389declare interface OnRefreshAccessedHistoryEvent { 5390 /** 5391 * URL of the visit. 5392 * 5393 * @type { string } 5394 * @syscap SystemCapability.Web.Webview.Core 5395 * @atomicservice 5396 * @since 12 5397 */ 5398 url: string; 5399 /** 5400 * If true, the page is being reloaded, otherwise, means that the page is newly loaded. 5401 * 5402 * @type { boolean } 5403 * @syscap SystemCapability.Web.Webview.Core 5404 * @atomicservice 5405 * @since 12 5406 */ 5407 isRefreshed: boolean; 5408} 5409 5410/** 5411 * Defines the triggered when the render process exits. 5412 * 5413 * @typedef OnRenderExitedEvent 5414 * @syscap SystemCapability.Web.Webview.Core 5415 * @atomicservice 5416 * @since 12 5417 */ 5418declare interface OnRenderExitedEvent { 5419 /** 5420 * The specific reason why the rendering process exits abnormally. 5421 * 5422 * @type { RenderExitReason } 5423 * @syscap SystemCapability.Web.Webview.Core 5424 * @atomicservice 5425 * @since 12 5426 */ 5427 renderExitReason: RenderExitReason; 5428} 5429 5430/** 5431 * Defines the triggered when the file selector shows. 5432 * 5433 * @typedef OnShowFileSelectorEvent 5434 * @syscap SystemCapability.Web.Webview.Core 5435 * @crossplatform 5436 * @atomicservice 5437 * @since 12 5438 */ 5439declare interface OnShowFileSelectorEvent { 5440 /** 5441 * Defines the file selector result. 5442 * 5443 * @type { FileSelectorResult } 5444 * @syscap SystemCapability.Web.Webview.Core 5445 * @crossplatform 5446 * @atomicservice 5447 * @since 11 5448 */ 5449 result: FileSelectorResult; 5450 /** 5451 * Encompassed message information as parameters to fileSelector. 5452 * 5453 * @type { FileSelectorParam } 5454 * @syscap SystemCapability.Web.Webview.Core 5455 * @crossplatform 5456 * @atomicservice 5457 * @since 11 5458 */ 5459 fileSelector: FileSelectorParam; 5460} 5461 5462/** 5463 * Defines the triggered when the url loading. 5464 * 5465 * @typedef OnResourceLoadEvent 5466 * @syscap SystemCapability.Web.Webview.Core 5467 * @atomicservice 5468 * @since 12 5469 */ 5470declare interface OnResourceLoadEvent { 5471 /** 5472 * The URL of the loaded resource file. 5473 * 5474 * @type { string } 5475 * @syscap SystemCapability.Web.Webview.Core 5476 * @atomicservice 5477 * @since 12 5478 */ 5479 url: string; 5480} 5481 5482/** 5483 * Defines the triggered when the scale of WebView changed. 5484 * 5485 * @typedef OnScaleChangeEvent 5486 * @syscap SystemCapability.Web.Webview.Core 5487 * @crossplatform 5488 * @atomicservice 5489 * @since 12 5490 */ 5491declare interface OnScaleChangeEvent { 5492 /** 5493 * Old scale of the page. 5494 * 5495 * @type { number } 5496 * @syscap SystemCapability.Web.Webview.Core 5497 * @crossplatform 5498 * @atomicservice 5499 * @since 12 5500 */ 5501 oldScale: number; 5502 /** 5503 * New scale of the page. 5504 * 5505 * @type { number } 5506 * @syscap SystemCapability.Web.Webview.Core 5507 * @crossplatform 5508 * @atomicservice 5509 * @since 12 5510 */ 5511 newScale: number; 5512} 5513 5514/** 5515 * Defines the triggered when the browser needs credentials from the user. 5516 * 5517 * @typedef OnHttpAuthRequestEvent 5518 * @syscap SystemCapability.Web.Webview.Core 5519 * @crossplatform 5520 * @atomicservice 5521 * @since 12 5522 */ 5523declare interface OnHttpAuthRequestEvent { 5524 /** 5525 * Defines the http auth request result. 5526 * 5527 * @type { HttpAuthHandler } 5528 * @syscap SystemCapability.Web.Webview.Core 5529 * @crossplatform 5530 * @atomicservice 5531 * @since 12 5532 */ 5533 handler: HttpAuthHandler; 5534 /** 5535 * Host of the page. 5536 * 5537 * @type { string } 5538 * @syscap SystemCapability.Web.Webview.Core 5539 * @crossplatform 5540 * @atomicservice 5541 * @since 12 5542 */ 5543 host: string; 5544 /** 5545 * realm of the page. 5546 * 5547 * @type { string } 5548 * @syscap SystemCapability.Web.Webview.Core 5549 * @crossplatform 5550 * @atomicservice 5551 * @since 12 5552 */ 5553 realm: string; 5554} 5555 5556/** 5557 * Defines the triggered callback when the resources loading is intercepted. 5558 * 5559 * @typedef OnInterceptRequestEvent 5560 * @syscap SystemCapability.Web.Webview.Core 5561 * @atomicservice 5562 * @since 12 5563 */ 5564declare interface OnInterceptRequestEvent { 5565 /** 5566 * The information of request. 5567 * 5568 * @type { WebResourceRequest } 5569 * @syscap SystemCapability.Web.Webview.Core 5570 * @atomicservice 5571 * @since 12 5572 */ 5573 request: WebResourceRequest; 5574} 5575 5576/** 5577 * Defines the triggered callback when the host application that web content from the specified origin is 5578 * attempting to access the resources. 5579 * 5580 * @typedef OnPermissionRequestEvent 5581 * @syscap SystemCapability.Web.Webview.Core 5582 * @crossplatform 5583 * @atomicservice 5584 * @since 12 5585 */ 5586declare interface OnPermissionRequestEvent { 5587 /** 5588 * Defines the onPermissionRequest callback. 5589 * 5590 * @type { PermissionRequest } 5591 * @syscap SystemCapability.Web.Webview.Core 5592 * @crossplatform 5593 * @atomicservice 5594 * @since 12 5595 */ 5596 request: PermissionRequest; 5597} 5598 5599/** 5600 * Defines the triggered callback when the host application that web content from the specified origin is 5601 * requesting to capture screen. 5602 * 5603 * @typedef OnScreenCaptureRequestEvent 5604 * @syscap SystemCapability.Web.Webview.Core 5605 * @atomicservice 5606 * @since 12 5607 */ 5608declare interface OnScreenCaptureRequestEvent { 5609 /** 5610 * Notifies the user of the operation behavior of the web component. 5611 * 5612 * @type { ScreenCaptureHandler } 5613 * @syscap SystemCapability.Web.Webview.Core 5614 * @atomicservice 5615 * @since 12 5616 */ 5617 handler: ScreenCaptureHandler; 5618} 5619 5620/** 5621 * Defines the triggered callback when called to allow custom display of the context menu. 5622 * 5623 * @typedef OnContextMenuShowEvent 5624 * @syscap SystemCapability.Web.Webview.Core 5625 * @atomicservice 5626 * @since 12 5627 */ 5628declare interface OnContextMenuShowEvent { 5629 /** 5630 * The menu-related parameters. 5631 * 5632 * @type { WebContextMenuParam } 5633 * @syscap SystemCapability.Web.Webview.Core 5634 * @atomicservice 5635 * @since 12 5636 */ 5637 param: WebContextMenuParam; 5638 /** 5639 * The menu corresponding event is passed to the kernel. 5640 * 5641 * @type { WebContextMenuResult } 5642 * @syscap SystemCapability.Web.Webview.Core 5643 * @atomicservice 5644 * @since 12 5645 */ 5646 result: WebContextMenuResult; 5647} 5648 5649/** 5650 * Defines function Triggered when the host application call searchAllAsync. 5651 * 5652 * @typedef OnSearchResultReceiveEvent 5653 * @syscap SystemCapability.Web.Webview.Core 5654 * @atomicservice 5655 * @since 12 5656 */ 5657declare interface OnSearchResultReceiveEvent { 5658 /** 5659 * The ordinal number of the currently matched lookup item (starting from 0). 5660 * 5661 * @type { number } 5662 * @syscap SystemCapability.Web.Webview.Core 5663 * @atomicservice 5664 * @since 12 5665 */ 5666 activeMatchOrdinal: number; 5667 /** 5668 * The number of all matched keywords. 5669 * 5670 * @type { number } 5671 * @syscap SystemCapability.Web.Webview.Core 5672 * @atomicservice 5673 * @since 12 5674 */ 5675 numberOfMatches: number; 5676 /** 5677 * Indicates whether the current in-page search operation is complete. The method may be called back multiple times until isDoneCounting is true. 5678 * 5679 * @type { boolean } 5680 * @syscap SystemCapability.Web.Webview.Core 5681 * @atomicservice 5682 * @since 12 5683 */ 5684 isDoneCounting: boolean; 5685} 5686 5687/** 5688 * Defines function Triggered when the scroll bar slides to the specified position. 5689 * 5690 * @typedef OnScrollEvent 5691 * @syscap SystemCapability.Web.Webview.Core 5692 * @crossplatform 5693 * @atomicservice 5694 * @since 12 5695 */ 5696declare interface OnScrollEvent { 5697 /** 5698 * The X offset of the scroll. 5699 * 5700 * @type { number } 5701 * @syscap SystemCapability.Web.Webview.Core 5702 * @crossplatform 5703 * @atomicservice 5704 * @since 12 5705 */ 5706 xOffset: number; 5707 /** 5708 * The Y offset of the scroll. 5709 * 5710 * @type { number } 5711 * @syscap SystemCapability.Web.Webview.Core 5712 * @crossplatform 5713 * @atomicservice 5714 * @since 12 5715 */ 5716 yOffset: number; 5717} 5718 5719/** 5720 * Defines the triggered callback when the Web page receives an ssl Error. 5721 * 5722 * @typedef OnSslErrorEventReceiveEvent 5723 * @syscap SystemCapability.Web.Webview.Core 5724 * @atomicservice 5725 * @since 12 5726 */ 5727declare interface OnSslErrorEventReceiveEvent { 5728 /** 5729 * Notifies the user of the operation behavior of the web component. 5730 * 5731 * @type { SslErrorHandler } 5732 * @syscap SystemCapability.Web.Webview.Core 5733 * @atomicservice 5734 * @since 12 5735 */ 5736 handler: SslErrorHandler; 5737 /** 5738 * Error codes. 5739 * 5740 * @type { SslError } 5741 * @syscap SystemCapability.Web.Webview.Core 5742 * @atomicservice 5743 * @since 12 5744 */ 5745 error: SslError; 5746 /** 5747 * Certificate chain data in DER format. 5748 * 5749 * @type { ?Array<Uint8Array> } 5750 * @syscap SystemCapability.Web.Webview.Core 5751 * @since 14 5752 */ 5753 certChainData?: Array<Uint8Array>; 5754} 5755 5756/** 5757 * Defines the triggered callback when needs ssl client certificate from the user. 5758 * 5759 * @typedef OnClientAuthenticationEvent 5760 * @syscap SystemCapability.Web.Webview.Core 5761 * @atomicservice 5762 * @since 12 5763 */ 5764declare interface OnClientAuthenticationEvent { 5765 /** 5766 * Notifies the user of the operation behavior of the web component. 5767 * 5768 * @type { ClientAuthenticationHandler } 5769 * @syscap SystemCapability.Web.Webview.Core 5770 * @atomicservice 5771 * @since 12 5772 */ 5773 handler : ClientAuthenticationHandler; 5774 /** 5775 * The hostname of the requesting certificate server. 5776 * 5777 * @type { string } 5778 * @syscap SystemCapability.Web.Webview.Core 5779 * @atomicservice 5780 * @since 12 5781 */ 5782 host : string; 5783 /** 5784 * The port number of the request certificate server. 5785 * 5786 * @type { number } 5787 * @syscap SystemCapability.Web.Webview.Core 5788 * @atomicservice 5789 * @since 12 5790 */ 5791 port : number; 5792 /** 5793 * Acceptable asymmetric key types. 5794 * 5795 * @type { Array<string> } 5796 * @syscap SystemCapability.Web.Webview.Core 5797 * @atomicservice 5798 * @since 12 5799 */ 5800 keyTypes : Array<string>; 5801 /** 5802 * Certificates that match the private key are acceptable to the issuer. 5803 * 5804 * @type { Array<string> } 5805 * @syscap SystemCapability.Web.Webview.Core 5806 * @atomicservice 5807 * @since 12 5808 */ 5809 issuers : Array<string>; 5810} 5811 5812/** 5813 * Defines the triggered callback when web page requires the user to create a window. 5814 * 5815 * @typedef OnWindowNewEvent 5816 * @syscap SystemCapability.Web.Webview.Core 5817 * @atomicservice 5818 * @since 12 5819 */ 5820declare interface OnWindowNewEvent { 5821 /** 5822 * true indicates the request to create a dialog and false indicates a new tab. 5823 * 5824 * @type { boolean } 5825 * @syscap SystemCapability.Web.Webview.Core 5826 * @atomicservice 5827 * @since 12 5828 */ 5829 isAlert: boolean; 5830 /** 5831 * true indicates that it is triggered by the user, and false indicates that it is triggered by a non-user. 5832 * 5833 * @type { boolean } 5834 * @syscap SystemCapability.Web.Webview.Core 5835 * @atomicservice 5836 * @since 12 5837 */ 5838 isUserTrigger: boolean; 5839 /** 5840 * Destination URL. 5841 * 5842 * @type { string } 5843 * @syscap SystemCapability.Web.Webview.Core 5844 * @atomicservice 5845 * @since 12 5846 */ 5847 targetUrl: string; 5848 /** 5849 * Lets you set the WebviewController instance for creating a new window. 5850 * 5851 * @type { ControllerHandler } 5852 * @syscap SystemCapability.Web.Webview.Core 5853 * @atomicservice 5854 * @since 12 5855 */ 5856 handler: ControllerHandler; 5857} 5858 5859/** 5860 * Defines the triggered callback when the application receive an new url of an apple-touch-icon. 5861 * 5862 * @typedef OnTouchIconUrlReceivedEvent 5863 * @syscap SystemCapability.Web.Webview.Core 5864 * @atomicservice 5865 * @since 12 5866 */ 5867declare interface OnTouchIconUrlReceivedEvent { 5868 /** 5869 * The apple-touch-icon URL address received. 5870 * 5871 * @type { string } 5872 * @syscap SystemCapability.Web.Webview.Core 5873 * @atomicservice 5874 * @since 12 5875 */ 5876 url: string; 5877 /** 5878 * Corresponding to whether apple-touch-icon is precomposited. 5879 * 5880 * @type { boolean } 5881 * @syscap SystemCapability.Web.Webview.Core 5882 * @atomicservice 5883 * @since 12 5884 */ 5885 precomposed: boolean; 5886} 5887 5888/** 5889 * Defines the triggered callback when the application receive a new favicon for the current web page. 5890 * 5891 * @typedef OnFaviconReceivedEvent 5892 * @syscap SystemCapability.Web.Webview.Core 5893 * @atomicservice 5894 * @since 12 5895 */ 5896declare interface OnFaviconReceivedEvent { 5897 /** 5898 * Received the Favicon icon for the PixelMap object. 5899 * 5900 * @type { PixelMap } 5901 * @syscap SystemCapability.Web.Webview.Core 5902 * @atomicservice 5903 * @since 12 5904 */ 5905 favicon: PixelMap; 5906} 5907 5908/** 5909 * Defines the triggered callback when previous page will no longer be drawn and next page begin to draw. 5910 * 5911 * @typedef OnPageVisibleEvent 5912 * @syscap SystemCapability.Web.Webview.Core 5913 * @crossplatform 5914 * @atomicservice 5915 * @since 12 5916 */ 5917declare interface OnPageVisibleEvent { 5918 /** 5919 * The URL of page. 5920 * 5921 * @type { string } 5922 * @syscap SystemCapability.Web.Webview.Core 5923 * @crossplatform 5924 * @atomicservice 5925 * @since 12 5926 */ 5927 url: string; 5928} 5929 5930/** 5931 * Defines the triggered callback to decision whether resend form data or not. 5932 * 5933 * @typedef OnDataResubmittedEvent 5934 * @syscap SystemCapability.Web.Webview.Core 5935 * @atomicservice 5936 * @since 12 5937 */ 5938declare interface OnDataResubmittedEvent { 5939 /** 5940 * Form data resubmission handle. 5941 * 5942 * @type { DataResubmissionHandler } 5943 * @syscap SystemCapability.Web.Webview.Core 5944 * @atomicservice 5945 * @since 12 5946 */ 5947 handler: DataResubmissionHandler; 5948} 5949 5950/** 5951 * Defines the playing state of audio on web page. 5952 * 5953 * @typedef OnAudioStateChangedEvent 5954 * @syscap SystemCapability.Web.Webview.Core 5955 * @atomicservice 5956 * @since 12 5957 */ 5958declare interface OnAudioStateChangedEvent { 5959 /** 5960 * The audio playback status of the current page, true if playing true otherwise false. 5961 * 5962 * @type { boolean } 5963 * @syscap SystemCapability.Web.Webview.Core 5964 * @atomicservice 5965 * @since 12 5966 */ 5967 playing: boolean; 5968} 5969 5970/** 5971 * Defines triggered when the first content rendering of web page. 5972 * 5973 * @typedef OnFirstContentfulPaintEvent 5974 * @syscap SystemCapability.Web.Webview.Core 5975 * @atomicservice 5976 * @since 12 5977 */ 5978declare interface OnFirstContentfulPaintEvent { 5979 /** 5980 * The time at which navigation begins, expressed in microseconds. 5981 * 5982 * @type { number } 5983 * @syscap SystemCapability.Web.Webview.Core 5984 * @atomicservice 5985 * @since 12 5986 */ 5987 navigationStartTick: number; 5988 /** 5989 * The time it takes to draw content for the first time from navigation, expressed in milliseconds. 5990 * 5991 * @type { number } 5992 * @syscap SystemCapability.Web.Webview.Core 5993 * @atomicservice 5994 * @since 12 5995 */ 5996 firstContentfulPaintMs: number; 5997} 5998 5999/** 6000 * Defines the triggered callback when the resources loading is intercepted. 6001 * 6002 * @typedef OnLoadInterceptEvent 6003 * @syscap SystemCapability.Web.Webview.Core 6004 * @crossplatform 6005 * @atomicservice 6006 * @since 12 6007 */ 6008declare interface OnLoadInterceptEvent { 6009 /** 6010 * The information of request. 6011 * 6012 * @type { WebResourceRequest } 6013 * @syscap SystemCapability.Web.Webview.Core 6014 * @crossplatform 6015 * @atomicservice 6016 * @since 12 6017 */ 6018 data: WebResourceRequest; 6019} 6020 6021/** 6022 * Defines the function Triggered when the over scrolling. 6023 * 6024 * @typedef OnOverScrollEvent 6025 * @syscap SystemCapability.Web.Webview.Core 6026 * @atomicservice 6027 * @since 12 6028 */ 6029declare interface OnOverScrollEvent { 6030 /** 6031 * Based on the leftmost part of the page, the horizontal scroll offset is over. 6032 * 6033 * @type { number } 6034 * @syscap SystemCapability.Web.Webview.Core 6035 * @atomicservice 6036 * @since 12 6037 */ 6038 xOffset: number; 6039 /** 6040 * Based on the top of the page, the vertical scroll offset is over. 6041 * 6042 * @type { number } 6043 * @syscap SystemCapability.Web.Webview.Core 6044 * @atomicservice 6045 * @since 12 6046 */ 6047 yOffset: number; 6048} 6049 6050/** 6051 * Defines the JavaScript object to be injected. 6052 * 6053 * @typedef JavaScriptProxy 6054 * @syscap SystemCapability.Web.Webview.Core 6055 * @atomicservice 6056 * @since 12 6057 */ 6058declare interface JavaScriptProxy { 6059 /** 6060 * Objects participating in registration. 6061 * 6062 * @type { object } 6063 * @syscap SystemCapability.Web.Webview.Core 6064 * @atomicservice 6065 * @since 12 6066 */ 6067 object: object; 6068 /** 6069 * The name of the registered object, which is consistent with the 6070 * object name called in the window. 6071 * 6072 * @type { string } 6073 * @syscap SystemCapability.Web.Webview.Core 6074 * @atomicservice 6075 * @since 12 6076 */ 6077 name: string; 6078 /** 6079 * The method of the application side JavaScript object participating 6080 * in the registration. 6081 * 6082 * @type { Array<string> } 6083 * @syscap SystemCapability.Web.Webview.Core 6084 * @atomicservice 6085 * @since 12 6086 */ 6087 methodList: Array<string>; 6088 /** 6089 * Controller. 6090 * 6091 * @type { WebController | WebviewController } 6092 * @syscap SystemCapability.Web.Webview.Core 6093 * @atomicservice 6094 * @since 12 6095 */ 6096 controller: WebController | WebviewController; 6097 /** 6098 * The async method of the application side JavaScript object participating in the registration. 6099 * 6100 * @type { ?Array<string> } 6101 * @syscap SystemCapability.Web.Webview.Core 6102 * @atomicservice 6103 * @since 12 6104 */ 6105 asyncMethodList?: Array<string>; 6106 /** 6107 * permission configuration defining web page URLs that can access JavaScriptProxy methods. 6108 * The configuration can be defined at two levels, object level and method level. 6109 * 6110 * @type { ?string } 6111 * @syscap SystemCapability.Web.Webview.Core 6112 * @atomicservice 6113 * @since 12 6114 */ 6115 permission?: string; 6116} 6117 6118/** 6119 * Enum type supplied to {@link keyboardAvoidMode} for setting the web keyboard avoid mode. 6120 * 6121 * @enum { number } 6122 * @syscap SystemCapability.Web.Webview.Core 6123 * @atomicservice 6124 * @since 12 6125 */ 6126declare enum WebKeyboardAvoidMode { 6127 /** 6128 * Resize the visual viewport when keyboard avoidance occurs. 6129 * 6130 * @syscap SystemCapability.Web.Webview.Core 6131 * @atomicservice 6132 * @since 12 6133 */ 6134 RESIZE_VISUAL = 0, 6135 6136 /** 6137 * Resize the visual and layout viewport when keyboard avoidance occurs. 6138 * 6139 * @syscap SystemCapability.Web.Webview.Core 6140 * @atomicservice 6141 * @since 12 6142 */ 6143 RESIZE_CONTENT = 1, 6144 6145 /** 6146 * Do not resize any viewport when keyboard avoidance occurs. 6147 * 6148 * @syscap SystemCapability.Web.Webview.Core 6149 * @atomicservice 6150 * @since 12 6151 */ 6152 OVERLAYS_CONTENT = 2, 6153} 6154 6155/** 6156 * Defines Web Elements type. 6157 * 6158 * @enum { number } 6159 * @syscap SystemCapability.Web.Webview.Core 6160 * @since 13 6161 */ 6162declare enum WebElementType { 6163 /** 6164 * Image,corresponding HTML image type. 6165 * 6166 * @syscap SystemCapability.Web.Webview.Core 6167 * @since 13 6168 */ 6169 IMAGE = 1, 6170} 6171 6172/** 6173 * ResponseType for contextMenu 6174 * 6175 * @enum { number } 6176 * @syscap SystemCapability.Web.Webview.Core 6177 * @since 13 6178 */ 6179declare enum WebResponseType { 6180 /** 6181 * Long press. 6182 * 6183 * @syscap SystemCapability.Web.Webview.Core 6184 * @since 13 6185 */ 6186 LONG_PRESS = 1, 6187} 6188 6189/** 6190 * Defines the selection menu options. 6191 * 6192 * @typedef SelectionMenuOptionsExt 6193 * @syscap SystemCapability.Web.Webview.Core 6194 * @since 13 6195 */ 6196declare interface SelectionMenuOptionsExt { 6197 /** 6198 * Callback function when the selection menu appears. 6199 * 6200 * @type { ?Callback<void> } 6201 * @syscap SystemCapability.Web.Webview.Core 6202 * @since 13 6203 */ 6204 onAppear?: Callback<void>; 6205 6206 /** 6207 * Callback function when the selection menu disappears. 6208 * 6209 * @type { ?Callback<void> } 6210 * @syscap SystemCapability.Web.Webview.Core 6211 * @since 13 6212 */ 6213 onDisappear?: Callback<void>; 6214 6215 /** 6216 * The preview content of selection menu. 6217 * 6218 * @type { ?CustomBuilder } 6219 * @syscap SystemCapability.Web.Webview.Core 6220 * @since 13 6221 */ 6222 preview?: CustomBuilder; 6223 6224 /** 6225 * Menu type, default value is MenuType.SELECTION_MENU. 6226 * 6227 * @type { ?MenuType } 6228 * @syscap SystemCapability.Web.Webview.Core 6229 * @since 13 6230 */ 6231 menuType?: MenuType; 6232} 6233 6234/** 6235 * Defines the Web attribute functions. 6236 * 6237 * @extends CommonMethod<WebAttribute> 6238 * @syscap SystemCapability.Web.Webview.Core 6239 * @since 8 6240 */ 6241/** 6242 * Defines the Web attribute functions. 6243 * 6244 * @extends CommonMethod<WebAttribute> 6245 * @syscap SystemCapability.Web.Webview.Core 6246 * @crossplatform 6247 * @since 10 6248 */ 6249/** 6250 * Defines the Web attribute functions. 6251 * 6252 * @extends CommonMethod<WebAttribute> 6253 * @syscap SystemCapability.Web.Webview.Core 6254 * @crossplatform 6255 * @atomicservice 6256 * @since 11 6257 */ 6258declare class WebAttribute extends CommonMethod<WebAttribute> { 6259 /** 6260 * Sets whether the Web allows JavaScript scripts to execute. 6261 * 6262 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6263 * @returns { WebAttribute } 6264 * @syscap SystemCapability.Web.Webview.Core 6265 * @since 8 6266 */ 6267 /** 6268 * Sets whether the Web allows JavaScript scripts to execute. 6269 * 6270 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6271 * @returns { WebAttribute } 6272 * @syscap SystemCapability.Web.Webview.Core 6273 * @crossplatform 6274 * @since 10 6275 */ 6276 /** 6277 * Sets whether the Web allows JavaScript scripts to execute. 6278 * 6279 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6280 * @returns { WebAttribute } 6281 * @syscap SystemCapability.Web.Webview.Core 6282 * @crossplatform 6283 * @atomicservice 6284 * @since 11 6285 */ 6286 javaScriptAccess(javaScriptAccess: boolean): WebAttribute; 6287 6288 /** 6289 * Sets whether enable local file system access in Web. 6290 * 6291 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 6292 * @returns { WebAttribute } 6293 * @syscap SystemCapability.Web.Webview.Core 6294 * @since 8 6295 */ 6296 /** 6297 * Sets whether enable local file system access in Web. 6298 * 6299 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 6300 * @returns { WebAttribute } 6301 * @syscap SystemCapability.Web.Webview.Core 6302 * @atomicservice 6303 * @since 11 6304 */ 6305 fileAccess(fileAccess: boolean): WebAttribute; 6306 6307 /** 6308 * Sets whether to allow image resources to be loaded from the network. 6309 * 6310 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 6311 * {@code false} otherwise. 6312 * @returns { WebAttribute } 6313 * @syscap SystemCapability.Web.Webview.Core 6314 * @since 8 6315 */ 6316 /** 6317 * Sets whether to allow image resources to be loaded from the network. 6318 * 6319 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 6320 * {@code false} otherwise. 6321 * @returns { WebAttribute } 6322 * @syscap SystemCapability.Web.Webview.Core 6323 * @atomicservice 6324 * @since 11 6325 */ 6326 onlineImageAccess(onlineImageAccess: boolean): WebAttribute; 6327 6328 /** 6329 * Sets whether to enable the DOM Storage API permission. 6330 * 6331 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 6332 * @returns { WebAttribute } 6333 * @syscap SystemCapability.Web.Webview.Core 6334 * @since 8 6335 */ 6336 /** 6337 * Sets whether to enable the DOM Storage API permission. 6338 * 6339 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 6340 * @returns { WebAttribute } 6341 * @syscap SystemCapability.Web.Webview.Core 6342 * @atomicservice 6343 * @since 11 6344 */ 6345 domStorageAccess(domStorageAccess: boolean): WebAttribute; 6346 6347 /** 6348 * Sets whether the Web can automatically load image resources. 6349 * 6350 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 6351 * @returns { WebAttribute } 6352 * @syscap SystemCapability.Web.Webview.Core 6353 * @since 8 6354 */ 6355 /** 6356 * Sets whether the Web can automatically load image resources. 6357 * 6358 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 6359 * @returns { WebAttribute } 6360 * @syscap SystemCapability.Web.Webview.Core 6361 * @atomicservice 6362 * @since 11 6363 */ 6364 imageAccess(imageAccess: boolean): WebAttribute; 6365 6366 /** 6367 * Sets how to load HTTP and HTTPS content. 6368 * 6369 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 6370 * @returns { WebAttribute } 6371 * @syscap SystemCapability.Web.Webview.Core 6372 * @since 8 6373 */ 6374 /** 6375 * Sets how to load HTTP and HTTPS content. 6376 * 6377 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 6378 * @returns { WebAttribute } 6379 * @syscap SystemCapability.Web.Webview.Core 6380 * @atomicservice 6381 * @since 11 6382 */ 6383 mixedMode(mixedMode: MixedMode): WebAttribute; 6384 6385 /** 6386 * Sets whether the Web supports zooming using gestures. 6387 * 6388 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6389 * @returns { WebAttribute } 6390 * @syscap SystemCapability.Web.Webview.Core 6391 * @since 8 6392 */ 6393 /** 6394 * Sets whether the Web supports zooming using gestures. 6395 * 6396 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6397 * @returns { WebAttribute } 6398 * @syscap SystemCapability.Web.Webview.Core 6399 * @crossplatform 6400 * @since 10 6401 */ 6402 /** 6403 * Sets whether the Web supports zooming using gestures. 6404 * 6405 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6406 * @returns { WebAttribute } 6407 * @syscap SystemCapability.Web.Webview.Core 6408 * @crossplatform 6409 * @atomicservice 6410 * @since 11 6411 */ 6412 zoomAccess(zoomAccess: boolean): WebAttribute; 6413 6414 /** 6415 * Sets whether to allow access to geographical locations. 6416 * 6417 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 6418 * @returns { WebAttribute } 6419 * @syscap SystemCapability.Web.Webview.Core 6420 * @since 8 6421 */ 6422 /** 6423 * Sets whether to allow access to geographical locations. 6424 * 6425 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 6426 * @returns { WebAttribute } 6427 * @syscap SystemCapability.Web.Webview.Core 6428 * @crossplatform 6429 * @atomicservice 6430 * @since 11 6431 */ 6432 geolocationAccess(geolocationAccess: boolean): WebAttribute; 6433 6434 /** 6435 * Injects the JavaScript object into window and invoke the function in window. 6436 * 6437 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6438 * @returns { WebAttribute } 6439 * @syscap SystemCapability.Web.Webview.Core 6440 * @since 8 6441 */ 6442 /** 6443 * Injects the JavaScript object into window and invoke the function in window. 6444 * 6445 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6446 * @returns { WebAttribute } 6447 * @syscap SystemCapability.Web.Webview.Core 6448 * @since 9 6449 */ 6450 /** 6451 * Injects the JavaScript object into window and invoke the function in window. 6452 * 6453 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6454 * @returns { WebAttribute } 6455 * @syscap SystemCapability.Web.Webview.Core 6456 * @atomicservice 6457 * @since 11 6458 */ 6459 /** 6460 * Injects the JavaScript object into window and invoke the function in window. 6461 * 6462 * @param { JavaScriptProxy } javaScriptProxy - The JavaScript object to be injected. 6463 * @returns { WebAttribute } 6464 * @syscap SystemCapability.Web.Webview.Core 6465 * @atomicservice 6466 * @since 12 6467 */ 6468 javaScriptProxy(javaScriptProxy: JavaScriptProxy): WebAttribute; 6469 6470 /** 6471 * Sets whether the Web should save the password. 6472 * 6473 * @param { boolean } password - {@code true} means the Web can save the password; {@code false} otherwise. 6474 * @returns { WebAttribute } 6475 * @syscap SystemCapability.Web.Webview.Core 6476 * @since 8 6477 * @deprecated since 10 6478 */ 6479 password(password: boolean): WebAttribute; 6480 6481 /** 6482 * Sets the mode of cache in Web. 6483 * 6484 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 6485 * @returns { WebAttribute } 6486 * @syscap SystemCapability.Web.Webview.Core 6487 * @since 8 6488 */ 6489 /** 6490 * Sets the mode of cache in Web. 6491 * 6492 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 6493 * @returns { WebAttribute } 6494 * @syscap SystemCapability.Web.Webview.Core 6495 * @atomicservice 6496 * @since 11 6497 */ 6498 cacheMode(cacheMode: CacheMode): WebAttribute; 6499 6500 /** 6501 * Sets the dark mode of Web. 6502 * 6503 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 6504 * @returns { WebAttribute } 6505 * @syscap SystemCapability.Web.Webview.Core 6506 * @since 9 6507 */ 6508 /** 6509 * Sets the dark mode of Web. 6510 * 6511 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 6512 * @returns { WebAttribute } 6513 * @syscap SystemCapability.Web.Webview.Core 6514 * @atomicservice 6515 * @since 11 6516 */ 6517 darkMode(mode: WebDarkMode): WebAttribute; 6518 6519 /** 6520 * Sets whether to enable forced dark algorithm when the web is in dark mode 6521 * 6522 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 6523 * @returns { WebAttribute } 6524 * @syscap SystemCapability.Web.Webview.Core 6525 * @since 9 6526 */ 6527 /** 6528 * Sets whether to enable forced dark algorithm when the web is in dark mode 6529 * 6530 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 6531 * @returns { WebAttribute } 6532 * @syscap SystemCapability.Web.Webview.Core 6533 * @atomicservice 6534 * @since 11 6535 */ 6536 forceDarkAccess(access: boolean): WebAttribute; 6537 6538 /** 6539 * Sets the media options. 6540 * 6541 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 6542 * @returns { WebAttribute } 6543 * @syscap SystemCapability.Web.Webview.Core 6544 * @since 10 6545 */ 6546 /** 6547 * Sets the media options. 6548 * 6549 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 6550 * @returns { WebAttribute } 6551 * @syscap SystemCapability.Web.Webview.Core 6552 * @atomicservice 6553 * @since 11 6554 */ 6555 mediaOptions(options: WebMediaOptions): WebAttribute; 6556 6557 /** 6558 * Sets whether the Web should save the table data. 6559 * 6560 * @param { boolean } tableData {@code true} means the Web can save the table data; {@code false} otherwise. 6561 * @returns { WebAttribute } 6562 * @syscap SystemCapability.Web.Webview.Core 6563 * @since 8 6564 * @deprecated since 10 6565 */ 6566 tableData(tableData: boolean): WebAttribute; 6567 6568 /** 6569 * Sets whether the Web access meta 'viewport' in HTML. 6570 * 6571 * @param { boolean } wideViewModeAccess {@code true} means the Web access meta 'viewport' in HTML; {@code false} otherwise. 6572 * @returns { WebAttribute } 6573 * @syscap SystemCapability.Web.Webview.Core 6574 * @since 8 6575 * @deprecated since 10 6576 */ 6577 wideViewModeAccess(wideViewModeAccess: boolean): WebAttribute; 6578 6579 /** 6580 * Sets whether the Web access overview mode. 6581 * 6582 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 6583 * @returns { WebAttribute } 6584 * @syscap SystemCapability.Web.Webview.Core 6585 * @since 8 6586 */ 6587 /** 6588 * Sets whether the Web access overview mode. 6589 * 6590 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 6591 * @returns { WebAttribute } 6592 * @syscap SystemCapability.Web.Webview.Core 6593 * @atomicservice 6594 * @since 11 6595 */ 6596 overviewModeAccess(overviewModeAccess: boolean): WebAttribute; 6597 /** 6598 * Sets the over-scroll mode for web 6599 * 6600 * @param { OverScrollMode } mode - The over-scroll mode, which can be {@link OverScrollMode}. 6601 * @returns { WebAttribute } 6602 * @syscap SystemCapability.Web.Webview.Core 6603 * @atomicservice 6604 * @since 11 6605 */ 6606 overScrollMode(mode: OverScrollMode): WebAttribute; 6607 /** 6608 * Sets the ratio of the text zoom. 6609 * 6610 * @param { number } textZoomAtio The ratio of the text zoom. 6611 * @returns { WebAttribute } 6612 * @syscap SystemCapability.Web.Webview.Core 6613 * @since 8 6614 * @deprecated since 9 6615 * @useinstead ohos.web.WebAttribute#textZoomRatio 6616 */ 6617 textZoomAtio(textZoomAtio: number): WebAttribute; 6618 6619 /** 6620 * Sets the ratio of the text zoom. 6621 * 6622 * @param { number } textZoomRatio The ratio of the text zoom. 6623 * @returns { WebAttribute } 6624 * @syscap SystemCapability.Web.Webview.Core 6625 * @since 9 6626 */ 6627 /** 6628 * Sets the ratio of the text zoom. 6629 * 6630 * @param { number } textZoomRatio The ratio of the text zoom. 6631 * @returns { WebAttribute } 6632 * @syscap SystemCapability.Web.Webview.Core 6633 * @atomicservice 6634 * @since 11 6635 */ 6636 textZoomRatio(textZoomRatio: number): WebAttribute; 6637 6638 /** 6639 * Sets whether the Web access the database. 6640 * 6641 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 6642 * @returns { WebAttribute } 6643 * @syscap SystemCapability.Web.Webview.Core 6644 * @since 8 6645 */ 6646 /** 6647 * Sets whether the Web access the database. 6648 * 6649 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 6650 * @returns { WebAttribute } 6651 * @syscap SystemCapability.Web.Webview.Core 6652 * @atomicservice 6653 * @since 11 6654 */ 6655 databaseAccess(databaseAccess: boolean): WebAttribute; 6656 6657 /** 6658 * Sets the initial scale for the Web. 6659 * 6660 * @param { number } percent the initial scale for the Web. 6661 * @returns { WebAttribute } 6662 * @syscap SystemCapability.Web.Webview.Core 6663 * @since 9 6664 */ 6665 /** 6666 * Sets the initial scale for the Web. 6667 * 6668 * @param { number } percent the initial scale for the Web. 6669 * @returns { WebAttribute } 6670 * @syscap SystemCapability.Web.Webview.Core 6671 * @atomicservice 6672 * @since 11 6673 */ 6674 initialScale(percent: number): WebAttribute; 6675 6676 /** 6677 * Sets the Web's user agent. 6678 * 6679 * @param { string } userAgent The Web's user agent. 6680 * @returns { WebAttribute } 6681 * @syscap SystemCapability.Web.Webview.Core 6682 * @since 8 6683 * @deprecated since 10 6684 * @useinstead ohos.web.webview.webview.WebviewController#setCustomUserAgent 6685 */ 6686 userAgent(userAgent: string): WebAttribute; 6687 6688 /** 6689 * Set whether to support the viewport attribute of the meta tag in the frontend page. 6690 * 6691 * @param { boolean } enabled {@code true} means support the viewport attribute of the meta tag; {@code false} otherwise. 6692 * @returns { WebAttribute } 6693 * @syscap SystemCapability.Web.Webview.Core 6694 * @atomicservice 6695 * @since 12 6696 */ 6697 metaViewport(enabled: boolean): WebAttribute; 6698 6699 /** 6700 * Triggered at the end of web page loading. 6701 * 6702 * @param { function } callback The triggered function at the end of web page loading. 6703 * @returns { WebAttribute } 6704 * @syscap SystemCapability.Web.Webview.Core 6705 * @since 8 6706 */ 6707 /** 6708 * Triggered at the end of web page loading. 6709 * 6710 * @param { function } callback The triggered function at the end of web page loading. 6711 * @returns { WebAttribute } 6712 * @syscap SystemCapability.Web.Webview.Core 6713 * @crossplatform 6714 * @since 10 6715 */ 6716 /** 6717 * Triggered at the end of web page loading. 6718 * 6719 * @param { function } callback The triggered function at the end of web page loading. 6720 * @returns { WebAttribute } 6721 * @syscap SystemCapability.Web.Webview.Core 6722 * @crossplatform 6723 * @atomicservice 6724 * @since 11 6725 */ 6726 /** 6727 * Triggered at the end of web page loading. 6728 * 6729 * @param { Callback<OnPageEndEvent> } callback The triggered function at the end of web page loading. 6730 * @returns { WebAttribute } 6731 * @syscap SystemCapability.Web.Webview.Core 6732 * @crossplatform 6733 * @atomicservice 6734 * @since 12 6735 */ 6736 onPageEnd(callback: Callback<OnPageEndEvent>): WebAttribute; 6737 6738 /** 6739 * Triggered at the begin of web page loading. 6740 * 6741 * @param { function } callback The triggered function at the begin of web page loading. 6742 * @returns { WebAttribute } 6743 * @syscap SystemCapability.Web.Webview.Core 6744 * @since 8 6745 */ 6746 /** 6747 * Triggered at the begin of web page loading. 6748 * 6749 * @param { function } callback The triggered function at the begin of web page loading. 6750 * @returns { WebAttribute } 6751 * @syscap SystemCapability.Web.Webview.Core 6752 * @crossplatform 6753 * @since 10 6754 */ 6755 /** 6756 * Triggered at the begin of web page loading. 6757 * 6758 * @param { function } callback The triggered function at the begin of web page loading. 6759 * @returns { WebAttribute } 6760 * @syscap SystemCapability.Web.Webview.Core 6761 * @crossplatform 6762 * @atomicservice 6763 * @since 11 6764 */ 6765 /** 6766 * Triggered at the begin of web page loading. 6767 * 6768 * @param { Callback<OnPageBeginEvent> } callback The triggered function at the begin of web page loading. 6769 * @returns { WebAttribute } 6770 * @syscap SystemCapability.Web.Webview.Core 6771 * @crossplatform 6772 * @atomicservice 6773 * @since 12 6774 */ 6775 onPageBegin(callback: Callback<OnPageBeginEvent>): WebAttribute; 6776 6777 /** 6778 * Triggered when the page loading progress changes. 6779 * 6780 * @param { function } callback The triggered function when the page loading progress changes. 6781 * @returns { WebAttribute } 6782 * @syscap SystemCapability.Web.Webview.Core 6783 * @since 8 6784 */ 6785 /** 6786 * Triggered when the page loading progress changes. 6787 * 6788 * @param { function } callback The triggered function when the page loading progress changes. 6789 * @returns { WebAttribute } 6790 * @syscap SystemCapability.Web.Webview.Core 6791 * @crossplatform 6792 * @atomicservice 6793 * @since 11 6794 */ 6795 /** 6796 * Triggered when the page loading progress changes. 6797 * 6798 * @param { Callback<OnProgressChangeEvent> } callback The triggered function when the page loading progress changes. 6799 * @returns { WebAttribute } 6800 * @syscap SystemCapability.Web.Webview.Core 6801 * @crossplatform 6802 * @atomicservice 6803 * @since 12 6804 */ 6805 onProgressChange(callback: Callback<OnProgressChangeEvent>): WebAttribute; 6806 6807 /** 6808 * Triggered when the title of the main application document changes. 6809 * 6810 * @param { function } callback The triggered function when the title of the main application document changes. 6811 * @returns { WebAttribute } 6812 * @syscap SystemCapability.Web.Webview.Core 6813 * @since 8 6814 */ 6815 /** 6816 * Triggered when the title of the main application document changes. 6817 * 6818 * @param { function } callback The triggered function when the title of the main application document changes. 6819 * @returns { WebAttribute } 6820 * @syscap SystemCapability.Web.Webview.Core 6821 * @crossplatform 6822 * @atomicservice 6823 * @since 11 6824 */ 6825 /** 6826 * Triggered when the title of the main application document changes. 6827 * 6828 * @param { Callback<OnTitleReceiveEvent> } callback The triggered function when the title of the main application document changes. 6829 * @returns { WebAttribute } 6830 * @syscap SystemCapability.Web.Webview.Core 6831 * @crossplatform 6832 * @atomicservice 6833 * @since 12 6834 */ 6835 onTitleReceive(callback: Callback<OnTitleReceiveEvent>): WebAttribute; 6836 6837 /** 6838 * Triggered when requesting to hide the geolocation. 6839 * 6840 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 6841 * @returns { WebAttribute } 6842 * @syscap SystemCapability.Web.Webview.Core 6843 * @since 8 6844 */ 6845 /** 6846 * Triggered when requesting to hide the geolocation. 6847 * 6848 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 6849 * @returns { WebAttribute } 6850 * @syscap SystemCapability.Web.Webview.Core 6851 * @crossplatform 6852 * @atomicservice 6853 * @since 11 6854 */ 6855 onGeolocationHide(callback: () => void): WebAttribute; 6856 6857 /** 6858 * Triggered when requesting to show the geolocation permission. 6859 * 6860 * @param { function } callback The triggered function when requesting to show the geolocation permission. 6861 * @returns { WebAttribute } 6862 * @syscap SystemCapability.Web.Webview.Core 6863 * @since 8 6864 */ 6865 /** 6866 * Triggered when requesting to show the geolocation permission. 6867 * 6868 * @param { function } callback The triggered function when requesting to show the geolocation permission. 6869 * @returns { WebAttribute } 6870 * @syscap SystemCapability.Web.Webview.Core 6871 * @crossplatform 6872 * @atomicservice 6873 * @since 11 6874 */ 6875 /** 6876 * Triggered when requesting to show the geolocation permission. 6877 * 6878 * @param { Callback<OnGeolocationShowEvent> } callback The triggered function when requesting to show the geolocation permission. 6879 * @returns { WebAttribute } 6880 * @syscap SystemCapability.Web.Webview.Core 6881 * @crossplatform 6882 * @atomicservice 6883 * @since 12 6884 */ 6885 onGeolocationShow(callback: Callback<OnGeolocationShowEvent>): WebAttribute; 6886 6887 /** 6888 * Triggered when the Web gets the focus. 6889 * 6890 * @param { function } callback The triggered function when the Web gets the focus. 6891 * @returns { WebAttribute } 6892 * @syscap SystemCapability.Web.Webview.Core 6893 * @since 8 6894 */ 6895 /** 6896 * Triggered when the Web gets the focus. 6897 * 6898 * @param { function } callback The triggered function when the Web gets the focus. 6899 * @returns { WebAttribute } 6900 * @syscap SystemCapability.Web.Webview.Core 6901 * @atomicservice 6902 * @since 11 6903 */ 6904 onRequestSelected(callback: () => void): WebAttribute; 6905 6906 /** 6907 * Triggered when the Web wants to display a JavaScript alert() dialog. 6908 * 6909 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 6910 * @returns { WebAttribute } 6911 * @syscap SystemCapability.Web.Webview.Core 6912 * @since 8 6913 */ 6914 /** 6915 * Triggered when the Web wants to display a JavaScript alert() dialog. 6916 * 6917 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 6918 * @returns { WebAttribute } 6919 * @syscap SystemCapability.Web.Webview.Core 6920 * @crossplatform 6921 * @atomicservice 6922 * @since 11 6923 */ 6924 /** 6925 * Triggered when the Web wants to display a JavaScript alert() dialog. 6926 * 6927 * @param { Callback<OnAlertEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 6928 * @returns { WebAttribute } 6929 * @syscap SystemCapability.Web.Webview.Core 6930 * @crossplatform 6931 * @atomicservice 6932 * @since 12 6933 */ 6934 onAlert(callback: Callback<OnAlertEvent, boolean>): WebAttribute; 6935 6936 /** 6937 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 6938 * 6939 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 6940 * @returns { WebAttribute } 6941 * @syscap SystemCapability.Web.Webview.Core 6942 * @since 8 6943 */ 6944 /** 6945 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 6946 * 6947 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 6948 * @returns { WebAttribute } 6949 * @syscap SystemCapability.Web.Webview.Core 6950 * @atomicservice 6951 * @since 11 6952 */ 6953 /** 6954 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 6955 * 6956 * @param { Callback<OnBeforeUnloadEvent, boolean> } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 6957 * @returns { WebAttribute } 6958 * @syscap SystemCapability.Web.Webview.Core 6959 * @atomicservice 6960 * @since 12 6961 */ 6962 onBeforeUnload(callback: Callback<OnBeforeUnloadEvent, boolean>): WebAttribute; 6963 6964 /** 6965 * Triggered when the web page wants to display a JavaScript confirm() dialog. 6966 * 6967 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 6968 * @returns { WebAttribute } 6969 * @syscap SystemCapability.Web.Webview.Core 6970 * @since 8 6971 */ 6972 /** 6973 * Triggered when the web page wants to display a JavaScript confirm() dialog. 6974 * 6975 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 6976 * @returns { WebAttribute } 6977 * @syscap SystemCapability.Web.Webview.Core 6978 * @crossplatform 6979 * @atomicservice 6980 * @since 11 6981 */ 6982 /** 6983 * Triggered when the web page wants to display a JavaScript confirm() dialog. 6984 * 6985 * @param { Callback<OnConfirmEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript confirm() dialog. 6986 * @returns { WebAttribute } 6987 * @syscap SystemCapability.Web.Webview.Core 6988 * @crossplatform 6989 * @atomicservice 6990 * @since 12 6991 */ 6992 onConfirm(callback: Callback<OnConfirmEvent, boolean>): WebAttribute; 6993 6994 /** 6995 * Triggered when the web page wants to display a JavaScript prompt() dialog. 6996 * 6997 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 6998 * @returns { WebAttribute } 6999 * @syscap SystemCapability.Web.Webview.Core 7000 * @since 9 7001 */ 7002 /** 7003 * Triggered when the web page wants to display a JavaScript prompt() dialog. 7004 * 7005 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 7006 * @returns { WebAttribute } 7007 * @syscap SystemCapability.Web.Webview.Core 7008 * @crossplatform 7009 * @atomicservice 7010 * @since 11 7011 */ 7012 /** 7013 * Triggered when the web page wants to display a JavaScript prompt() dialog. 7014 * 7015 * @param { Callback<OnPromptEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript prompt() dialog. 7016 * @returns { WebAttribute } 7017 * @syscap SystemCapability.Web.Webview.Core 7018 * @crossplatform 7019 * @atomicservice 7020 * @since 12 7021 */ 7022 onPrompt(callback: Callback<OnPromptEvent, boolean>): WebAttribute; 7023 7024 /** 7025 * Triggered when the web page receives a JavaScript console message. 7026 * 7027 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 7028 * @returns { WebAttribute } 7029 * @syscap SystemCapability.Web.Webview.Core 7030 * @since 8 7031 */ 7032 /** 7033 * Triggered when the web page receives a JavaScript console message. 7034 * 7035 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 7036 * @returns { WebAttribute } 7037 * @syscap SystemCapability.Web.Webview.Core 7038 * @crossplatform 7039 * @atomicservice 7040 * @since 11 7041 */ 7042 /** 7043 * Triggered when the web page receives a JavaScript console message. 7044 * 7045 * @param { Callback<OnConsoleEvent, boolean> } callback The triggered function when the web page receives a JavaScript console message. 7046 * @returns { WebAttribute } 7047 * @syscap SystemCapability.Web.Webview.Core 7048 * @crossplatform 7049 * @atomicservice 7050 * @since 12 7051 */ 7052 onConsole(callback: Callback<OnConsoleEvent, boolean>): WebAttribute; 7053 7054 /** 7055 * Triggered when the web page receives a web resource loading error. 7056 * 7057 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7058 * @returns { WebAttribute } 7059 * @syscap SystemCapability.Web.Webview.Core 7060 * @since 8 7061 */ 7062 /** 7063 * Triggered when the web page receives a web resource loading error. 7064 * 7065 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7066 * @returns { WebAttribute } 7067 * @syscap SystemCapability.Web.Webview.Core 7068 * @crossplatform 7069 * @since 10 7070 */ 7071 /** 7072 * Triggered when the web page receives a web resource loading error. 7073 * 7074 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7075 * @returns { WebAttribute } 7076 * @syscap SystemCapability.Web.Webview.Core 7077 * @crossplatform 7078 * @atomicservice 7079 * @since 11 7080 */ 7081 /** 7082 * Triggered when the web page receives a web resource loading error. 7083 * 7084 * @param { Callback<OnErrorReceiveEvent> } callback The triggered function when the web page receives a web resource loading error. 7085 * @returns { WebAttribute } 7086 * @syscap SystemCapability.Web.Webview.Core 7087 * @crossplatform 7088 * @atomicservice 7089 * @since 12 7090 */ 7091 onErrorReceive(callback: Callback<OnErrorReceiveEvent>): WebAttribute; 7092 7093 /** 7094 * Triggered when the web page receives a web resource loading HTTP error. 7095 * 7096 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 7097 * @returns { WebAttribute } 7098 * @syscap SystemCapability.Web.Webview.Core 7099 * @since 8 7100 */ 7101 /** 7102 * Triggered when the web page receives a web resource loading HTTP error. 7103 * 7104 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 7105 * @returns { WebAttribute } 7106 * @syscap SystemCapability.Web.Webview.Core 7107 * @crossplatform 7108 * @atomicservice 7109 * @since 11 7110 */ 7111 /** 7112 * Triggered when the web page receives a web resource loading HTTP error. 7113 * 7114 * @param { Callback<OnHttpErrorReceiveEvent> } callback The triggered function when the web page receives a web resource loading HTTP error. 7115 * @returns { WebAttribute } 7116 * @syscap SystemCapability.Web.Webview.Core 7117 * @crossplatform 7118 * @atomicservice 7119 * @since 12 7120 */ 7121 onHttpErrorReceive(callback: Callback<OnHttpErrorReceiveEvent>): WebAttribute; 7122 7123 /** 7124 * Triggered when starting to download. 7125 * 7126 * @param { function } callback The triggered function when starting to download. 7127 * @returns { WebAttribute } 7128 * @syscap SystemCapability.Web.Webview.Core 7129 * @since 8 7130 */ 7131 /** 7132 * Triggered when starting to download. 7133 * 7134 * @param { function } callback The triggered function when starting to download. 7135 * @returns { WebAttribute } 7136 * @syscap SystemCapability.Web.Webview.Core 7137 * @crossplatform 7138 * @atomicservice 7139 * @since 11 7140 */ 7141 /** 7142 * Triggered when starting to download. 7143 * 7144 * @param { Callback<OnDownloadStartEvent> } callback The triggered function when starting to download. 7145 * @returns { WebAttribute } 7146 * @syscap SystemCapability.Web.Webview.Core 7147 * @crossplatform 7148 * @atomicservice 7149 * @since 12 7150 */ 7151 onDownloadStart(callback: Callback<OnDownloadStartEvent>): WebAttribute; 7152 7153 /** 7154 * Triggered when the Web page refreshes accessed history. 7155 * 7156 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 7157 * @returns { WebAttribute } 7158 * @syscap SystemCapability.Web.Webview.Core 7159 * @since 8 7160 */ 7161 /** 7162 * Triggered when the Web page refreshes accessed history. 7163 * 7164 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 7165 * @returns { WebAttribute } 7166 * @syscap SystemCapability.Web.Webview.Core 7167 * @atomicservice 7168 * @since 11 7169 */ 7170 /** 7171 * Triggered when the Web page refreshes accessed history. 7172 * 7173 * @param { Callback<OnRefreshAccessedHistoryEvent> } callback The triggered callback when the Web page refreshes accessed history. 7174 * @returns { WebAttribute } 7175 * @syscap SystemCapability.Web.Webview.Core 7176 * @atomicservice 7177 * @since 12 7178 */ 7179 onRefreshAccessedHistory(callback: Callback<OnRefreshAccessedHistoryEvent>): WebAttribute; 7180 7181 /** 7182 * Triggered when the URL loading is intercepted. 7183 * 7184 * @param { function } callback The triggered callback when the URL loading is intercepted. 7185 * @returns { WebAttribute } 7186 * @syscap SystemCapability.Web.Webview.Core 7187 * @since 8 7188 * @deprecated since 10 7189 * @useinstead ohos.web.WebAttribute#onLoadIntercept 7190 */ 7191 onUrlLoadIntercept(callback: (event?: { data: string | WebResourceRequest }) => boolean): WebAttribute; 7192 7193 /** 7194 * Triggered when the Web page receives an ssl Error. 7195 * 7196 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7197 * @returns { WebAttribute } 7198 * @syscap SystemCapability.Web.Webview.Core 7199 * @since 8 7200 * @deprecated since 9 7201 * @useinstead ohos.web.WebAttribute#onSslErrorEventReceive 7202 */ 7203 onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; 7204 7205 /** 7206 * Triggered when the render process exits. 7207 * 7208 * @param { function } callback The triggered when the render process exits. 7209 * @returns { WebAttribute } 7210 * @syscap SystemCapability.Web.Webview.Core 7211 * @since 9 7212 */ 7213 /** 7214 * Triggered when the render process exits. 7215 * 7216 * @param { function } callback The triggered when the render process exits. 7217 * @returns { WebAttribute } 7218 * @syscap SystemCapability.Web.Webview.Core 7219 * @atomicservice 7220 * @since 11 7221 */ 7222 /** 7223 * Triggered when the render process exits. 7224 * 7225 * @param { Callback<OnRenderExitedEvent> } callback The triggered when the render process exits. 7226 * @returns { WebAttribute } 7227 * @syscap SystemCapability.Web.Webview.Core 7228 * @atomicservice 7229 * @since 12 7230 */ 7231 onRenderExited(callback: Callback<OnRenderExitedEvent>): WebAttribute; 7232 7233 /** 7234 * Triggered when the file selector shows. 7235 * 7236 * @param { function } callback The triggered when the file selector shows. 7237 * @returns { WebAttribute } 7238 * @syscap SystemCapability.Web.Webview.Core 7239 * @since 9 7240 */ 7241 /** 7242 * Triggered when the file selector shows. 7243 * 7244 * @param { function } callback The triggered when the file selector shows. 7245 * @returns { WebAttribute } 7246 * @syscap SystemCapability.Web.Webview.Core 7247 * @crossplatform 7248 * @atomicservice 7249 * @since 11 7250 */ 7251 /** 7252 * Triggered when the file selector shows. 7253 * 7254 * @param { Callback<OnShowFileSelectorEvent, boolean> } callback The triggered when the file selector shows. 7255 * @returns { WebAttribute } 7256 * @syscap SystemCapability.Web.Webview.Core 7257 * @crossplatform 7258 * @atomicservice 7259 * @since 12 7260 */ 7261 onShowFileSelector(callback: Callback<OnShowFileSelectorEvent, boolean>): WebAttribute; 7262 7263 /** 7264 * Triggered when the render process exits. 7265 * 7266 * @param { function } callback The triggered when the render process exits. 7267 * @returns { WebAttribute } 7268 * @syscap SystemCapability.Web.Webview.Core 7269 * @since 8 7270 * @deprecated since 9 7271 * @useinstead ohos.web.WebAttribute#onRenderExited 7272 */ 7273 onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; 7274 7275 /** 7276 * Triggered when the file selector shows. 7277 * 7278 * @param { function } callback The triggered when the file selector shows. 7279 * @returns { WebAttribute } 7280 * @syscap SystemCapability.Web.Webview.Core 7281 * @since 8 7282 * @deprecated since 9 7283 * @useinstead ohos.web.WebAttribute#onShowFileSelector 7284 */ 7285 onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; 7286 7287 /** 7288 * Triggered when the url loading. 7289 * 7290 * @param { function } callback The triggered when the url loading. 7291 * @returns { WebAttribute } 7292 * @syscap SystemCapability.Web.Webview.Core 7293 * @since 9 7294 */ 7295 /** 7296 * Triggered when the url loading. 7297 * 7298 * @param { function } callback The triggered when the url loading. 7299 * @returns { WebAttribute } 7300 * @syscap SystemCapability.Web.Webview.Core 7301 * @atomicservice 7302 * @since 11 7303 */ 7304 /** 7305 * Triggered when the url loading. 7306 * 7307 * @param { Callback<OnResourceLoadEvent> } callback The triggered when the url loading. 7308 * @returns { WebAttribute } 7309 * @syscap SystemCapability.Web.Webview.Core 7310 * @atomicservice 7311 * @since 12 7312 */ 7313 onResourceLoad(callback: Callback<OnResourceLoadEvent>): WebAttribute; 7314 7315 /** 7316 * Triggered when the web component exit the full screen mode. 7317 * 7318 * @param { function } callback The triggered function when the web component exit the full screen mode. 7319 * @returns { WebAttribute } 7320 * @syscap SystemCapability.Web.Webview.Core 7321 * @since 9 7322 */ 7323 /** 7324 * Triggered when the web component exit the full screen mode. 7325 * 7326 * @param { function } callback The triggered function when the web component exit the full screen mode. 7327 * @returns { WebAttribute } 7328 * @syscap SystemCapability.Web.Webview.Core 7329 * @atomicservice 7330 * @since 11 7331 */ 7332 onFullScreenExit(callback: () => void): WebAttribute; 7333 7334 /** 7335 * Triggered when the web component enter the full screen mode. 7336 * 7337 * @param { function } callback The triggered function when the web component enter the full screen mode. 7338 * @returns { WebAttribute } 7339 * @syscap SystemCapability.Web.Webview.Core 7340 * @since 9 7341 */ 7342 /** 7343 * Triggered when the web component enter the full screen mode. 7344 * 7345 * @param { function } callback The triggered function when the web component enter the full screen mode. 7346 * @returns { WebAttribute } 7347 * @syscap SystemCapability.Web.Webview.Core 7348 * @atomicservice 7349 * @since 11 7350 */ 7351 /** 7352 * Triggered when the web component enter the full screen mode. 7353 * 7354 * @param { OnFullScreenEnterCallback } callback - The triggered function when the web component enter the full screen mode. 7355 * @returns { WebAttribute } 7356 * @syscap SystemCapability.Web.Webview.Core 7357 * @atomicservice 7358 * @since 12 7359 */ 7360 onFullScreenEnter(callback: OnFullScreenEnterCallback): WebAttribute; 7361 7362 /** 7363 * Triggered when the scale of WebView changed. 7364 * 7365 * @param { function } callback The triggered when the scale of WebView changed. 7366 * @returns { WebAttribute } 7367 * @syscap SystemCapability.Web.Webview.Core 7368 * @since 9 7369 */ 7370 /** 7371 * Triggered when the scale of WebView changed. 7372 * 7373 * @param { function } callback The triggered when the scale of WebView changed. 7374 * @returns { WebAttribute } 7375 * @syscap SystemCapability.Web.Webview.Core 7376 * @crossplatform 7377 * @atomicservice 7378 * @since 11 7379 */ 7380 /** 7381 * Triggered when the scale of WebView changed. 7382 * 7383 * @param { Callback<OnScaleChangeEvent> } callback The triggered when the scale of WebView changed. 7384 * @returns { WebAttribute } 7385 * @syscap SystemCapability.Web.Webview.Core 7386 * @crossplatform 7387 * @atomicservice 7388 * @since 12 7389 */ 7390 onScaleChange(callback: Callback<OnScaleChangeEvent>): WebAttribute; 7391 7392 /** 7393 * Triggered when the browser needs credentials from the user. 7394 * 7395 * @param { function } callback The triggered when the browser needs credentials from the user. 7396 * @returns { WebAttribute } 7397 * @syscap SystemCapability.Web.Webview.Core 7398 * @since 9 7399 */ 7400 /** 7401 * Triggered when the browser needs credentials from the user. 7402 * 7403 * @param { function } callback The triggered when the browser needs credentials from the user. 7404 * @returns { WebAttribute } 7405 * @syscap SystemCapability.Web.Webview.Core 7406 * @crossplatform 7407 * @atomicservice 7408 * @since 11 7409 */ 7410 /** 7411 * Triggered when the browser needs credentials from the user. 7412 * 7413 * @param { Callback<OnHttpAuthRequestEvent, boolean> } callback The triggered when the browser needs credentials from the user. 7414 * @returns { WebAttribute } 7415 * @syscap SystemCapability.Web.Webview.Core 7416 * @crossplatform 7417 * @atomicservice 7418 * @since 12 7419 */ 7420 onHttpAuthRequest(callback: Callback<OnHttpAuthRequestEvent, boolean>): WebAttribute; 7421 7422 /** 7423 * Triggered when the resources loading is intercepted. 7424 * 7425 * @param { function } callback The triggered callback when the resources loading is intercepted. 7426 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7427 * @syscap SystemCapability.Web.Webview.Core 7428 * @since 9 7429 */ 7430 /** 7431 * Triggered when the resources loading is intercepted. 7432 * 7433 * @param { function } callback The triggered callback when the resources loading is intercepted. 7434 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7435 * @syscap SystemCapability.Web.Webview.Core 7436 * @atomicservice 7437 * @since 11 7438 */ 7439 /** 7440 * Triggered when the resources loading is intercepted. 7441 * 7442 * @param { Callback<OnInterceptRequestEvent, WebResourceResponse> } callback The triggered callback when the resources loading is intercepted. 7443 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7444 * @syscap SystemCapability.Web.Webview.Core 7445 * @atomicservice 7446 * @since 12 7447 */ 7448 onInterceptRequest(callback: Callback<OnInterceptRequestEvent, WebResourceResponse>): WebAttribute; 7449 7450 /** 7451 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7452 * 7453 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7454 * attempting to access the resources. 7455 * @returns { WebAttribute } 7456 * @syscap SystemCapability.Web.Webview.Core 7457 * @since 9 7458 */ 7459 /** 7460 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7461 * 7462 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7463 * attempting to access the resources. 7464 * @returns { WebAttribute } 7465 * @syscap SystemCapability.Web.Webview.Core 7466 * @crossplatform 7467 * @atomicservice 7468 * @since 11 7469 */ 7470 /** 7471 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7472 * 7473 * @param { Callback<OnPermissionRequestEvent> } callback The triggered callback when the host application that web content from the specified origin is 7474 * attempting to access the resources. 7475 * @returns { WebAttribute } 7476 * @syscap SystemCapability.Web.Webview.Core 7477 * @crossplatform 7478 * @atomicservice 7479 * @since 12 7480 */ 7481 onPermissionRequest(callback: Callback<OnPermissionRequestEvent>): WebAttribute; 7482 7483 /** 7484 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7485 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7486 * requesting to capture screen. 7487 * @returns { WebAttribute } 7488 * @syscap SystemCapability.Web.Webview.Core 7489 * @since 10 7490 */ 7491 /** 7492 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7493 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7494 * requesting to capture screen. 7495 * @returns { WebAttribute } 7496 * @syscap SystemCapability.Web.Webview.Core 7497 * @atomicservice 7498 * @since 11 7499 */ 7500 /** 7501 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7502 * @param { Callback<OnScreenCaptureRequestEvent> } callback The triggered callback when the host application that web content from the specified origin is 7503 * requesting to capture screen. 7504 * @returns { WebAttribute } 7505 * @syscap SystemCapability.Web.Webview.Core 7506 * @atomicservice 7507 * @since 12 7508 */ 7509 onScreenCaptureRequest(callback: Callback<OnScreenCaptureRequestEvent>): WebAttribute; 7510 7511 /** 7512 * Triggered when called to allow custom display of the context menu. 7513 * 7514 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 7515 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7516 * @syscap SystemCapability.Web.Webview.Core 7517 * @since 9 7518 */ 7519 /** 7520 * Triggered when called to allow custom display of the context menu. 7521 * 7522 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 7523 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7524 * @syscap SystemCapability.Web.Webview.Core 7525 * @atomicservice 7526 * @since 11 7527 */ 7528 /** 7529 * Triggered when called to allow custom display of the context menu. 7530 * 7531 * @param { Callback<OnContextMenuShowEvent, boolean> } callback The triggered callback when called to allow custom display of the context menu. 7532 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7533 * @syscap SystemCapability.Web.Webview.Core 7534 * @atomicservice 7535 * @since 12 7536 */ 7537 onContextMenuShow(callback: Callback<OnContextMenuShowEvent, boolean>): WebAttribute; 7538 7539 /** 7540 * Triggered when called to allow custom hide of the context menu. 7541 * 7542 * @param { OnContextMenuHideCallback } callback The triggered function when called to allow custom hide of the context menu. 7543 * @returns { WebAttribute } 7544 * @syscap SystemCapability.Web.Webview.Core 7545 * @atomicservice 7546 * @since 11 7547 */ 7548 onContextMenuHide(callback: OnContextMenuHideCallback): WebAttribute; 7549 7550 /** 7551 * Set whether media playback needs to be triggered by user gestures. 7552 * 7553 * @param { boolean } access True if it needs to be triggered manually by the user else false. 7554 * @returns { WebAttribute } 7555 * @syscap SystemCapability.Web.Webview.Core 7556 * @since 9 7557 */ 7558 /** 7559 * Set whether media playback needs to be triggered by user gestures. 7560 * 7561 * @param { boolean } access True if it needs to be triggered manually by the user else false. 7562 * @returns { WebAttribute } 7563 * @syscap SystemCapability.Web.Webview.Core 7564 * @crossplatform 7565 * @atomicservice 7566 * @since 11 7567 */ 7568 mediaPlayGestureAccess(access: boolean): WebAttribute; 7569 7570 /** 7571 * Notify search result to host application through onSearchResultReceive. 7572 * 7573 * @param { function } callback Function Triggered when the host application call searchAllAsync. 7574 * or searchNext api on WebController and the request is valid. 7575 * @returns { WebAttribute } 7576 * @syscap SystemCapability.Web.Webview.Core 7577 * @since 9 7578 */ 7579 /** 7580 * Notify search result to host application through onSearchResultReceive. 7581 * 7582 * @param { function } callback Function Triggered when the host application call searchAllAsync. 7583 * or searchNext api on WebController and the request is valid. 7584 * @returns { WebAttribute } 7585 * @syscap SystemCapability.Web.Webview.Core 7586 * @atomicservice 7587 * @since 11 7588 */ 7589 /** 7590 * Notify search result to host application through onSearchResultReceive. 7591 * 7592 * @param { Callback<OnSearchResultReceiveEvent> } callback Function Triggered when the host application call searchAllAsync. 7593 * or searchNext api on WebController and the request is valid. 7594 * @returns { WebAttribute } 7595 * @syscap SystemCapability.Web.Webview.Core 7596 * @atomicservice 7597 * @since 12 7598 */ 7599 onSearchResultReceive(callback: Callback<OnSearchResultReceiveEvent>): WebAttribute; 7600 7601 /** 7602 * Triggered when the scroll bar slides to the specified position. 7603 * 7604 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 7605 * @returns { WebAttribute } 7606 * @syscap SystemCapability.Web.Webview.Core 7607 * @since 9 7608 */ 7609 /** 7610 * Triggered when the scroll bar slides to the specified position. 7611 * 7612 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 7613 * @returns { WebAttribute } 7614 * @syscap SystemCapability.Web.Webview.Core 7615 * @crossplatform 7616 * @atomicservice 7617 * @since 11 7618 */ 7619 /** 7620 * Triggered when the scroll bar slides to the specified position. 7621 * 7622 * @param { Callback<OnScrollEvent> } callback Function Triggered when the scroll bar slides to the specified position. 7623 * @returns { WebAttribute } 7624 * @syscap SystemCapability.Web.Webview.Core 7625 * @crossplatform 7626 * @atomicservice 7627 * @since 12 7628 */ 7629 onScroll(callback: Callback<OnScrollEvent>): WebAttribute; 7630 7631 /** 7632 * Triggered when the Web page receives an ssl Error. 7633 * 7634 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7635 * @returns { WebAttribute } 7636 * @syscap SystemCapability.Web.Webview.Core 7637 * @since 9 7638 */ 7639 /** 7640 * Triggered when the Web page receives an ssl Error. 7641 * 7642 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7643 * @returns { WebAttribute } 7644 * @syscap SystemCapability.Web.Webview.Core 7645 * @atomicservice 7646 * @since 11 7647 */ 7648 /** 7649 * Triggered when the Web page receives an ssl Error. 7650 * 7651 * @param { Callback<OnSslErrorEventReceiveEvent> } callback The triggered callback when the Web page receives an ssl Error. 7652 * @returns { WebAttribute } 7653 * @syscap SystemCapability.Web.Webview.Core 7654 * @atomicservice 7655 * @since 12 7656 */ 7657 onSslErrorEventReceive(callback: Callback<OnSslErrorEventReceiveEvent>): WebAttribute; 7658 7659 /** 7660 * Triggered when the Web page receives an ssl Error. 7661 * 7662 * @param { OnSslErrorEventCallback } callback The triggered callback when the Web page receives an ssl Error. 7663 * @returns { WebAttribute } 7664 * @syscap SystemCapability.Web.Webview.Core 7665 * @atomicservice 7666 * @since 12 7667 */ 7668 onSslErrorEvent(callback: OnSslErrorEventCallback): WebAttribute; 7669 7670 /** 7671 * Triggered when the Web page needs ssl client certificate from the user. 7672 * 7673 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 7674 * @returns { WebAttribute } 7675 * @syscap SystemCapability.Web.Webview.Core 7676 * @since 9 7677 */ 7678 /** 7679 * Triggered when the Web page needs ssl client certificate from the user. 7680 * 7681 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 7682 * @returns { WebAttribute } 7683 * @syscap SystemCapability.Web.Webview.Core 7684 * @atomicservice 7685 * @since 11 7686 */ 7687 /** 7688 * Triggered when the Web page needs ssl client certificate from the user. 7689 * 7690 * @param { Callback<OnClientAuthenticationEvent> } callback The triggered callback when needs ssl client certificate from the user. 7691 * @returns { WebAttribute } 7692 * @syscap SystemCapability.Web.Webview.Core 7693 * @atomicservice 7694 * @since 12 7695 */ 7696 onClientAuthenticationRequest(callback: Callback<OnClientAuthenticationEvent>): WebAttribute; 7697 7698 /** 7699 * Triggered when web page requires the user to create a window. 7700 * 7701 * @param { function } callback The triggered callback when web page requires the user to create a window. 7702 * @returns { WebAttribute } 7703 * @syscap SystemCapability.Web.Webview.Core 7704 * @since 9 7705 */ 7706 /** 7707 * Triggered when web page requires the user to create a window. 7708 * 7709 * @param { function } callback The triggered callback when web page requires the user to create a window. 7710 * @returns { WebAttribute } 7711 * @syscap SystemCapability.Web.Webview.Core 7712 * @atomicservice 7713 * @since 11 7714 */ 7715 /** 7716 * Triggered when web page requires the user to create a window. 7717 * 7718 * @param { Callback<OnWindowNewEvent> } callback The triggered callback when web page requires the user to create a window. 7719 * @returns { WebAttribute } 7720 * @syscap SystemCapability.Web.Webview.Core 7721 * @atomicservice 7722 * @since 12 7723 */ 7724 onWindowNew(callback: Callback<OnWindowNewEvent>): WebAttribute; 7725 7726 /** 7727 * Triggered when web page requires the user to close a window. 7728 * 7729 * @param { function } callback The triggered callback when web page requires the user to close a window. 7730 * @returns { WebAttribute } 7731 * @syscap SystemCapability.Web.Webview.Core 7732 * @since 9 7733 */ 7734 /** 7735 * Triggered when web page requires the user to close a window. 7736 * 7737 * @param { function } callback The triggered callback when web page requires the user to close a window. 7738 * @returns { WebAttribute } 7739 * @syscap SystemCapability.Web.Webview.Core 7740 * @atomicservice 7741 * @since 11 7742 */ 7743 onWindowExit(callback: () => void): WebAttribute; 7744 7745 /** 7746 * Set whether multiple windows are supported. 7747 * 7748 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 7749 * @returns { WebAttribute } 7750 * @syscap SystemCapability.Web.Webview.Core 7751 * @since 9 7752 */ 7753 /** 7754 * Set whether multiple windows are supported. 7755 * 7756 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 7757 * @returns { WebAttribute } 7758 * @syscap SystemCapability.Web.Webview.Core 7759 * @atomicservice 7760 * @since 11 7761 */ 7762 multiWindowAccess(multiWindow: boolean): WebAttribute; 7763 7764 /** 7765 * Key events notify the application before the WebView consumes them. 7766 * 7767 * @param { function } callback Key event info. 7768 * @returns { WebAttribute } True if the application consumes key events else false. 7769 * @syscap SystemCapability.Web.Webview.Core 7770 * @since 9 7771 */ 7772 /** 7773 * Key events notify the application before the WebView consumes them. 7774 * 7775 * @param { function } callback Key event info. 7776 * @returns { WebAttribute } True if the application consumes key events else false. 7777 * @syscap SystemCapability.Web.Webview.Core 7778 * @atomicservice 7779 * @since 11 7780 */ 7781 onInterceptKeyEvent(callback: (event: KeyEvent) => boolean): WebAttribute; 7782 7783 /** 7784 * Set the font of webview standard font library. The default font is "sans serif". 7785 * 7786 * @param { string } family Standard font set series. 7787 * @returns { WebAttribute } 7788 * @syscap SystemCapability.Web.Webview.Core 7789 * @since 9 7790 */ 7791 /** 7792 * Set the font of webview standard font library. The default font is "sans serif". 7793 * 7794 * @param { string } family Standard font set series. 7795 * @returns { WebAttribute } 7796 * @syscap SystemCapability.Web.Webview.Core 7797 * @atomicservice 7798 * @since 11 7799 */ 7800 webStandardFont(family: string): WebAttribute; 7801 7802 /** 7803 * Set the font of webview serif font library. The default font is "serif". 7804 * 7805 * @param { string } family Serif font set series. 7806 * @returns { WebAttribute } 7807 * @syscap SystemCapability.Web.Webview.Core 7808 * @since 9 7809 */ 7810 /** 7811 * Set the font of webview serif font library. The default font is "serif". 7812 * 7813 * @param { string } family Serif font set series. 7814 * @returns { WebAttribute } 7815 * @syscap SystemCapability.Web.Webview.Core 7816 * @atomicservice 7817 * @since 11 7818 */ 7819 webSerifFont(family: string): WebAttribute; 7820 7821 /** 7822 * Set the font of webview sans serif font library. The default font is "sans-serif". 7823 * 7824 * @param { string } family Sans serif font set series. 7825 * @returns { WebAttribute } 7826 * @syscap SystemCapability.Web.Webview.Core 7827 * @since 9 7828 */ 7829 /** 7830 * Set the font of webview sans serif font library. The default font is "sans-serif". 7831 * 7832 * @param { string } family Sans serif font set series. 7833 * @returns { WebAttribute } 7834 * @syscap SystemCapability.Web.Webview.Core 7835 * @atomicservice 7836 * @since 11 7837 */ 7838 webSansSerifFont(family: string): WebAttribute; 7839 7840 /** 7841 * Set the font of webview fixed font library. The default font is "monospace". 7842 * 7843 * @param { string } family Fixed font set series. 7844 * @returns { WebAttribute } 7845 * @syscap SystemCapability.Web.Webview.Core 7846 * @since 9 7847 */ 7848 /** 7849 * Set the font of webview fixed font library. The default font is "monospace". 7850 * 7851 * @param { string } family Fixed font set series. 7852 * @returns { WebAttribute } 7853 * @syscap SystemCapability.Web.Webview.Core 7854 * @atomicservice 7855 * @since 11 7856 */ 7857 webFixedFont(family: string): WebAttribute; 7858 7859 /** 7860 * Set the font of webview fantasy font library. The default font is "fantasy". 7861 * 7862 * @param { string } family fantasy font set series. 7863 * @returns { WebAttribute } 7864 * @syscap SystemCapability.Web.Webview.Core 7865 * @since 9 7866 */ 7867 /** 7868 * Set the font of webview fantasy font library. The default font is "fantasy". 7869 * 7870 * @param { string } family fantasy font set series. 7871 * @returns { WebAttribute } 7872 * @syscap SystemCapability.Web.Webview.Core 7873 * @atomicservice 7874 * @since 11 7875 */ 7876 webFantasyFont(family: string): WebAttribute; 7877 7878 /** 7879 * Set the font of webview cursive font library. The default font is "cursive". 7880 * 7881 * @param { string } family Cursive font set series. 7882 * @returns { WebAttribute } 7883 * @syscap SystemCapability.Web.Webview.Core 7884 * @since 9 7885 */ 7886 /** 7887 * Set the font of webview cursive font library. The default font is "cursive". 7888 * 7889 * @param { string } family Cursive font set series. 7890 * @returns { WebAttribute } 7891 * @syscap SystemCapability.Web.Webview.Core 7892 * @atomicservice 7893 * @since 11 7894 */ 7895 webCursiveFont(family: string): WebAttribute; 7896 7897 /** 7898 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 7899 * 7900 * @param { number } size Font size. 7901 * @returns { WebAttribute } 7902 * @syscap SystemCapability.Web.Webview.Core 7903 * @since 9 7904 */ 7905 /** 7906 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 7907 * 7908 * @param { number } size Font size. 7909 * @returns { WebAttribute } 7910 * @syscap SystemCapability.Web.Webview.Core 7911 * @atomicservice 7912 * @since 11 7913 */ 7914 defaultFixedFontSize(size: number): WebAttribute; 7915 7916 /** 7917 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 7918 * 7919 * @param { number } size Font size. 7920 * @returns { WebAttribute } 7921 * @syscap SystemCapability.Web.Webview.Core 7922 * @since 9 7923 */ 7924 /** 7925 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 7926 * 7927 * @param { number } size Font size. 7928 * @returns { WebAttribute } 7929 * @syscap SystemCapability.Web.Webview.Core 7930 * @atomicservice 7931 * @since 11 7932 */ 7933 defaultFontSize(size: number): WebAttribute; 7934 7935 /** 7936 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 7937 * 7938 * @param { number } size Font size. 7939 * @returns { WebAttribute } 7940 * @syscap SystemCapability.Web.Webview.Core 7941 * @since 9 7942 */ 7943 /** 7944 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 7945 * 7946 * @param { number } size Font size. 7947 * @returns { WebAttribute } 7948 * @syscap SystemCapability.Web.Webview.Core 7949 * @crossplatform 7950 * @atomicservice 7951 * @since 11 7952 */ 7953 minFontSize(size: number): WebAttribute; 7954 7955 /** 7956 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 7957 * 7958 * @param { number } size Font size. 7959 * @returns { WebAttribute } 7960 * @syscap SystemCapability.Web.Webview.Core 7961 * @since 9 7962 */ 7963 /** 7964 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 7965 * 7966 * @param { number } size Font size. 7967 * @returns { WebAttribute } 7968 * @syscap SystemCapability.Web.Webview.Core 7969 * @atomicservice 7970 * @since 11 7971 */ 7972 minLogicalFontSize(size: number): WebAttribute; 7973 7974 /** 7975 * Set the default text encodingFormat value of webview. The default value is UTF-8. 7976 * 7977 * @param { string } textEncodingFormat text encodingFormat. 7978 * @returns { WebAttribute } 7979 * @syscap SystemCapability.Web.Webview.Core 7980 * @atomicservice 7981 * @since 12 7982 */ 7983 defaultTextEncodingFormat(textEncodingFormat: string): WebAttribute; 7984 7985 /** 7986 * Whether force display the scroll bar. 7987 * 7988 * @param { boolean } enabled {@code true} means show; {@code false} otherwise. 7989 * @returns { WebAttribute } 7990 * @syscap SystemCapability.Web.Webview.Core 7991 * @atomicservice 7992 * @since 14 7993 */ 7994 forceDisplayScrollBar(enabled: boolean): WebAttribute; 7995 7996 /** 7997 * Whether web component can load resource from network. 7998 * 7999 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 8000 * @returns { WebAttribute } 8001 * @syscap SystemCapability.Web.Webview.Core 8002 * @since 9 8003 */ 8004 /** 8005 * Whether web component can load resource from network. 8006 * 8007 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 8008 * @returns { WebAttribute } 8009 * @syscap SystemCapability.Web.Webview.Core 8010 * @atomicservice 8011 * @since 11 8012 */ 8013 blockNetwork(block: boolean): WebAttribute; 8014 8015 /** 8016 * Set whether paint horizontal scroll bar. 8017 * 8018 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 8019 * @returns { WebAttribute } 8020 * @syscap SystemCapability.Web.Webview.Core 8021 * @since 9 8022 */ 8023 /** 8024 * Set whether paint horizontal scroll bar. 8025 * 8026 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 8027 * @returns { WebAttribute } 8028 * @syscap SystemCapability.Web.Webview.Core 8029 * @crossplatform 8030 * @atomicservice 8031 * @since 11 8032 */ 8033 horizontalScrollBarAccess(horizontalScrollBar: boolean): WebAttribute; 8034 8035 /** 8036 * Set whether paint vertical scroll bar. 8037 * 8038 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 8039 * @returns { WebAttribute } 8040 * @syscap SystemCapability.Web.Webview.Core 8041 * @since 9 8042 */ 8043 /** 8044 * Set whether paint vertical scroll bar. 8045 * 8046 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 8047 * @returns { WebAttribute } 8048 * @syscap SystemCapability.Web.Webview.Core 8049 * @crossplatform 8050 * @atomicservice 8051 * @since 11 8052 */ 8053 verticalScrollBarAccess(verticalScrollBar: boolean): WebAttribute; 8054 8055 /** 8056 * Triggered when the application receive the url of an apple-touch-icon. 8057 * 8058 * @param { function } callback The triggered callback when the application receive an new url of an 8059 * apple-touch-icon. 8060 * @returns { WebAttribute } 8061 * @syscap SystemCapability.Web.Webview.Core 8062 * @since 9 8063 */ 8064 /** 8065 * Triggered when the application receive the url of an apple-touch-icon. 8066 * 8067 * @param { function } callback The triggered callback when the application receive an new url of an 8068 * apple-touch-icon. 8069 * @returns { WebAttribute } 8070 * @syscap SystemCapability.Web.Webview.Core 8071 * @atomicservice 8072 * @since 11 8073 */ 8074 /** 8075 * Triggered when the application receive the url of an apple-touch-icon. 8076 * 8077 * @param { Callback<OnTouchIconUrlReceivedEvent> } callback The triggered callback when the application receive an new url of an 8078 * apple-touch-icon. 8079 * @returns { WebAttribute } 8080 * @syscap SystemCapability.Web.Webview.Core 8081 * @atomicservice 8082 * @since 12 8083 */ 8084 onTouchIconUrlReceived(callback: Callback<OnTouchIconUrlReceivedEvent>): WebAttribute; 8085 8086 /** 8087 * Triggered when the application receive a new favicon for the current web page. 8088 * 8089 * @param { function } callback The triggered callback when the application receive a new favicon for the 8090 * current web page. 8091 * @returns { WebAttribute } 8092 * @syscap SystemCapability.Web.Webview.Core 8093 * @since 9 8094 */ 8095 /** 8096 * Triggered when the application receive a new favicon for the current web page. 8097 * 8098 * @param { function } callback The triggered callback when the application receive a new favicon for the 8099 * current web page. 8100 * @returns { WebAttribute } 8101 * @syscap SystemCapability.Web.Webview.Core 8102 * @atomicservice 8103 * @since 11 8104 */ 8105 /** 8106 * Triggered when the application receive a new favicon for the current web page. 8107 * 8108 * @param { Callback<OnFaviconReceivedEvent> } callback The triggered callback when the application receive a new favicon for the 8109 * current web page. 8110 * @returns { WebAttribute } 8111 * @syscap SystemCapability.Web.Webview.Core 8112 * @atomicservice 8113 * @since 12 8114 */ 8115 onFaviconReceived(callback: Callback<OnFaviconReceivedEvent>): WebAttribute; 8116 8117 /** 8118 * Triggered when previous page will no longer be drawn and next page begin to draw. 8119 * 8120 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 8121 * page begin to draw. 8122 * @returns { WebAttribute } 8123 * @syscap SystemCapability.Web.Webview.Core 8124 * @since 9 8125 */ 8126 /** 8127 * Triggered when previous page will no longer be drawn and next page begin to draw. 8128 * 8129 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 8130 * page begin to draw. 8131 * @returns { WebAttribute } 8132 * @syscap SystemCapability.Web.Webview.Core 8133 * @crossplatform 8134 * @atomicservice 8135 * @since 11 8136 */ 8137 /** 8138 * Triggered when previous page will no longer be drawn and next page begin to draw. 8139 * 8140 * @param { Callback<OnPageVisibleEvent> } callback The triggered callback when previous page will no longer be drawn and next 8141 * page begin to draw. 8142 * @returns { WebAttribute } 8143 * @syscap SystemCapability.Web.Webview.Core 8144 * @crossplatform 8145 * @atomicservice 8146 * @since 12 8147 */ 8148 onPageVisible(callback: Callback<OnPageVisibleEvent>): WebAttribute; 8149 8150 /** 8151 * Triggered when the form could be resubmitted. 8152 * 8153 * @param { function } callback The triggered callback to decision whether resend form data or not. 8154 * @returns { WebAttribute } 8155 * @syscap SystemCapability.Web.Webview.Core 8156 * @since 9 8157 */ 8158 /** 8159 * Triggered when the form could be resubmitted. 8160 * 8161 * @param { function } callback The triggered callback to decision whether resend form data or not. 8162 * @returns { WebAttribute } 8163 * @syscap SystemCapability.Web.Webview.Core 8164 * @atomicservice 8165 * @since 11 8166 */ 8167 /** 8168 * Triggered when the form could be resubmitted. 8169 * 8170 * @param { Callback<OnDataResubmittedEvent> } callback The triggered callback to decision whether resend form data or not. 8171 * @returns { WebAttribute } 8172 * @syscap SystemCapability.Web.Webview.Core 8173 * @atomicservice 8174 * @since 12 8175 */ 8176 onDataResubmitted(callback: Callback<OnDataResubmittedEvent>): WebAttribute; 8177 8178 /** 8179 * Set whether enable pinch smooth mode. 8180 * 8181 * @param { boolean } isEnabled True if it needs to enable smooth mode. 8182 * @returns { WebAttribute } 8183 * @syscap SystemCapability.Web.Webview.Core 8184 * @since 9 8185 */ 8186 /** 8187 * Set whether enable pinch smooth mode. 8188 * 8189 * @param { boolean } isEnabled True if it needs to enable smooth mode. 8190 * @returns { WebAttribute } 8191 * @syscap SystemCapability.Web.Webview.Core 8192 * @atomicservice 8193 * @since 11 8194 */ 8195 pinchSmooth(isEnabled: boolean): WebAttribute; 8196 8197 /** 8198 * Whether the window can be open automatically through JavaScript. 8199 * 8200 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 8201 * If it is false and user behavior, the window can be opened automatically through JavaScript. 8202 * Otherwise, the window cannot be opened. 8203 * @returns { WebAttribute } 8204 * @syscap SystemCapability.Web.Webview.Core 8205 * @since 10 8206 */ 8207 /** 8208 * Whether the window can be open automatically through JavaScript. 8209 * 8210 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 8211 * If it is false and user behavior, the window can be opened automatically through JavaScript. 8212 * Otherwise, the window cannot be opened. 8213 * @returns { WebAttribute } 8214 * @syscap SystemCapability.Web.Webview.Core 8215 * @atomicservice 8216 * @since 11 8217 */ 8218 allowWindowOpenMethod(flag: boolean): WebAttribute; 8219 8220 /** 8221 * Triggered when the playing state of audio on web page changed. 8222 * 8223 * @param { function } callback The playing state of audio on web page. 8224 * @returns { WebAttribute } 8225 * @syscap SystemCapability.Web.Webview.Core 8226 * @since 10 8227 */ 8228 /** 8229 * Triggered when the playing state of audio on web page changed. 8230 * 8231 * @param { function } callback The playing state of audio on web page. 8232 * @returns { WebAttribute } 8233 * @syscap SystemCapability.Web.Webview.Core 8234 * @atomicservice 8235 * @since 11 8236 */ 8237 /** 8238 * Triggered when the playing state of audio on web page changed. 8239 * 8240 * @param { Callback<OnAudioStateChangedEvent> } callback The playing state of audio on web page. 8241 * @returns { WebAttribute } 8242 * @syscap SystemCapability.Web.Webview.Core 8243 * @atomicservice 8244 * @since 12 8245 */ 8246 onAudioStateChanged(callback: Callback<OnAudioStateChangedEvent>): WebAttribute; 8247 8248 /** 8249 * Triggered when the first content rendering of web page. 8250 * 8251 * @param { function } callback 8252 * @returns { WebAttribute } 8253 * @syscap SystemCapability.Web.Webview.Core 8254 * @since 10 8255 */ 8256 /** 8257 * Triggered when the first content rendering of web page. 8258 * 8259 * @param { function } callback 8260 * @returns { WebAttribute } 8261 * @syscap SystemCapability.Web.Webview.Core 8262 * @atomicservice 8263 * @since 11 8264 */ 8265 /** 8266 * Triggered when the first content rendering of web page. 8267 * 8268 * @param { Callback<OnFirstContentfulPaintEvent> } callback 8269 * @returns { WebAttribute } 8270 * @syscap SystemCapability.Web.Webview.Core 8271 * @atomicservice 8272 * @since 12 8273 */ 8274 onFirstContentfulPaint(callback: Callback<OnFirstContentfulPaintEvent>): WebAttribute; 8275 8276 /** 8277 * Called when the First rendering of meaningful content time(FMP) 8278 * 8279 * @param { OnFirstMeaningfulPaintCallback } callback Function Triggered when the firstMeaningfulPaint. 8280 * @returns { WebAttribute } 8281 * @syscap SystemCapability.Web.Webview.Core 8282 * @atomicservice 8283 * @since 12 8284 */ 8285 onFirstMeaningfulPaint(callback: OnFirstMeaningfulPaintCallback): WebAttribute; 8286 8287 /** 8288 * Called when the Maximum content rendering time(LCP). 8289 * 8290 * @param { OnLargestContentfulPaintCallback } callback Function Triggered when the largestContentfulPaint. 8291 * @returns { WebAttribute } 8292 * @syscap SystemCapability.Web.Webview.Core 8293 * @atomicservice 8294 * @since 12 8295 */ 8296 onLargestContentfulPaint(callback: OnLargestContentfulPaintCallback): WebAttribute; 8297 8298 /** 8299 * Triggered when the resources loading is intercepted. 8300 * 8301 * @param { function } callback The triggered callback when the resources loading is intercepted. 8302 * @returns { WebAttribute } 8303 * @syscap SystemCapability.Web.Webview.Core 8304 * @since 10 8305 */ 8306 /** 8307 * Triggered when the resources loading is intercepted. 8308 * 8309 * @param { function } callback The triggered callback when the resources loading is intercepted. 8310 * @returns { WebAttribute } 8311 * @syscap SystemCapability.Web.Webview.Core 8312 * @crossplatform 8313 * @atomicservice 8314 * @since 11 8315 */ 8316 /** 8317 * Triggered when the resources loading is intercepted. 8318 * 8319 * @param { Callback<OnLoadInterceptEvent, boolean> } callback The triggered callback when the resources loading is intercepted. 8320 * @returns { WebAttribute } 8321 * @syscap SystemCapability.Web.Webview.Core 8322 * @crossplatform 8323 * @atomicservice 8324 * @since 12 8325 */ 8326 onLoadIntercept(callback: Callback<OnLoadInterceptEvent, boolean>): WebAttribute; 8327 8328 /** 8329 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 8330 * This callback can not use the interface about manipulating web pages. 8331 * @param { function } callback The triggered callback when web controller initialization success. 8332 * @returns { WebAttribute } 8333 * @syscap SystemCapability.Web.Webview.Core 8334 * @since 10 8335 */ 8336 /** 8337 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 8338 * This callback can not use the interface about manipulating web pages. 8339 * @param { function } callback The triggered callback when web controller initialization success. 8340 * @returns { WebAttribute } 8341 * @syscap SystemCapability.Web.Webview.Core 8342 * @crossplatform 8343 * @atomicservice 8344 * @since 11 8345 */ 8346 onControllerAttached(callback: () => void): WebAttribute; 8347 8348 /** 8349 * Triggered when the over scrolling. 8350 * @param { function } callback Function Triggered when the over scrolling. 8351 * @returns { WebAttribute } 8352 * @syscap SystemCapability.Web.Webview.Core 8353 * @since 10 8354 */ 8355 /** 8356 * Triggered when the over scrolling. 8357 * @param { function } callback Function Triggered when the over scrolling. 8358 * @returns { WebAttribute } 8359 * @syscap SystemCapability.Web.Webview.Core 8360 * @atomicservice 8361 * @since 11 8362 */ 8363 /** 8364 * Triggered when the over scrolling. 8365 * @param { Callback<OnOverScrollEvent> } callback Function Triggered when the over scrolling. 8366 * @returns { WebAttribute } 8367 * @syscap SystemCapability.Web.Webview.Core 8368 * @atomicservice 8369 * @since 12 8370 */ 8371 onOverScroll(callback: Callback<OnOverScrollEvent>): WebAttribute; 8372 8373 /** 8374 * Called when received website security risk check result. 8375 * 8376 * @param { OnSafeBrowsingCheckResultCallback } callback - Function triggered when received website security risk check result. 8377 * @returns { WebAttribute } 8378 * @syscap SystemCapability.Web.Webview.Core 8379 * @atomicservice 8380 * @since 11 8381 */ 8382 onSafeBrowsingCheckResult(callback: OnSafeBrowsingCheckResultCallback): WebAttribute; 8383 8384 /** 8385 * Called when the load committed. 8386 * 8387 * @param { OnNavigationEntryCommittedCallback } callback Function Triggered when a load committed. 8388 * @returns { WebAttribute } 8389 * @syscap SystemCapability.Web.Webview.Core 8390 * @atomicservice 8391 * @since 11 8392 */ 8393 onNavigationEntryCommitted(callback: OnNavigationEntryCommittedCallback): WebAttribute; 8394 8395 /** 8396 * Called when tracker's cookie is prevented. 8397 * 8398 * @param { OnIntelligentTrackingPreventionCallback } callback - Callback triggered when tracker's cookie is prevented. 8399 * @returns { WebAttribute } 8400 * @syscap SystemCapability.Web.Webview.Core 8401 * @atomicservice 8402 * @since 12 8403 */ 8404 onIntelligentTrackingPreventionResult(callback: OnIntelligentTrackingPreventionCallback): WebAttribute; 8405 8406 /** 8407 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 8408 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 8409 * @returns { WebAttribute } 8410 * @syscap SystemCapability.Web.Webview.Core 8411 * @atomicservice 8412 * @since 11 8413 */ 8414 javaScriptOnDocumentStart(scripts: Array<ScriptItem>): WebAttribute; 8415 8416 /** 8417 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 8418 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 8419 * @returns { WebAttribute } 8420 * @syscap SystemCapability.Web.Webview.Core 8421 * @atomicservice 8422 * @since 11 8423 */ 8424 javaScriptOnDocumentEnd(scripts: Array<ScriptItem>): WebAttribute; 8425 8426 /** 8427 * Set web layout Mode. 8428 * @param { WebLayoutMode } mode - The web layout mode, which can be {@link WebLayoutMode}. 8429 * @returns { WebAttribute } 8430 * @syscap SystemCapability.Web.Webview.Core 8431 * @atomicservice 8432 * @since 11 8433 */ 8434 layoutMode(mode: WebLayoutMode): WebAttribute; 8435 8436 /** 8437 * Called to setting the nested scroll options. 8438 * 8439 * @param { NestedScrollOptions } value - options for nested scrolling. 8440 * @returns { WebAttribute } the attribute of the scroll. 8441 * @syscap SystemCapability.Web.Webview.Core 8442 * @atomicservice 8443 * @since 11 8444 */ 8445 /** 8446 * Called to setting the nested scroll options. 8447 * 8448 * @param { NestedScrollOptions | NestedScrollOptionsExt } value - options for 8449 * nested scrolling. 8450 * @returns { WebAttribute } the attribute of the scroll. 8451 * @syscap SystemCapability.Web.Webview.Core 8452 * @atomicservice 8453 * @since 14 8454 */ 8455 nestedScroll(value: NestedScrollOptions | NestedScrollOptionsExt): WebAttribute; 8456 8457 /** 8458 * Sets the enable native embed mode for web. 8459 * 8460 * @param { boolean } mode - True if it needs to enable native embed mode. 8461 * @returns { WebAttribute } 8462 * @syscap SystemCapability.Web.Webview.Core 8463 * @atomicservice 8464 * @since 11 8465 */ 8466 enableNativeEmbedMode(mode: boolean): WebAttribute; 8467 8468 /** 8469 * Register native pattern with specific tag and type. 8470 * 8471 * @param { string } tag - Tag name used by html webpage. 8472 * @param { string } type - Type of the tag. 8473 * @returns { WebAttribute } 8474 * @syscap SystemCapability.Web.Webview.Core 8475 * @atomicservice 8476 * @since 12 8477 */ 8478 registerNativeEmbedRule(tag: string, type:string): WebAttribute; 8479 8480 /** 8481 * Triggered when embed lifecycle changes. 8482 * 8483 * @param { function } callback - Function Triggered when embed lifecycle changes. 8484 * @returns { WebAttribute } 8485 * @syscap SystemCapability.Web.Webview.Core 8486 * @atomicservice 8487 * @since 11 8488 */ 8489 onNativeEmbedLifecycleChange(callback: (event: NativeEmbedDataInfo) => void): WebAttribute; 8490 8491 /** 8492 * Triggered when embed visibility changes. 8493 * 8494 * @param { OnNativeEmbedVisibilityChangeCallback } callback - Callback triggered when embed visibility changes. 8495 * @returns { WebAttribute } 8496 * @syscap SystemCapability.Web.Webview.Core 8497 * @since 12 8498 */ 8499 onNativeEmbedVisibilityChange(callback: OnNativeEmbedVisibilityChangeCallback): WebAttribute; 8500 8501 /** 8502 * Triggered when gesture effect on embed tag. 8503 * 8504 * @param { function } callback - Function Triggered when gesture effect on embed tag. 8505 * @returns { WebAttribute } 8506 * @syscap SystemCapability.Web.Webview.Core 8507 * @atomicservice 8508 * @since 11 8509 */ 8510 onNativeEmbedGestureEvent(callback: (event: NativeEmbedTouchInfo) => void): WebAttribute; 8511 8512 /** 8513 * Called to set copy option 8514 * 8515 * @param { CopyOptions } value - copy option. 8516 * @returns { WebAttribute } the attribute of the scroll. 8517 * @syscap SystemCapability.Web.Webview.Core 8518 * @atomicservice 8519 * @since 11 8520 */ 8521 copyOptions(value: CopyOptions): WebAttribute; 8522 8523 /** 8524 * When the URL is about to be loaded into the current Web, it gives the application the opportunity to take control. 8525 * This will not called for POST requests, may be called for subframes and with non-HTTP(S) schemes. 8526 * 8527 * @param { OnOverrideUrlLoadingCallback } callback - The callback for onOverrideUrlLoading. 8528 * @returns { WebAttribute } 8529 * @syscap SystemCapability.Web.Webview.Core 8530 * @atomicservice 8531 * @since 12 8532 */ 8533 onOverrideUrlLoading(callback: OnOverrideUrlLoadingCallback): WebAttribute; 8534 8535 /** 8536 * Enable whether to automatically resize text. The default value is true. 8537 * 8538 * @param { boolean } textAutosizing - Whether to enable text autosizing. 8539 * @returns { WebAttribute } 8540 * @syscap SystemCapability.Web.Webview.Core 8541 * @atomicservice 8542 * @since 12 8543 */ 8544 textAutosizing(textAutosizing: boolean): WebAttribute; 8545 8546 /** 8547 * Enable app creates native media player to play web page media source. 8548 * 8549 * @param { NativeMediaPlayerConfig } config - The configuration of native media player. 8550 * @returns { WebAttribute } 8551 * @syscap SystemCapability.Web.Webview.Core 8552 * @atomicservice 8553 * @since 12 8554 */ 8555 enableNativeMediaPlayer(config: NativeMediaPlayerConfig): WebAttribute; 8556 8557 /** 8558 * Sets the enable window drag smooth for web. 8559 * 8560 * @param { boolean } mode - True if it needs to enable window drag smooth. 8561 * @returns { WebAttribute } 8562 * @syscap SystemCapability.Web.Webview.Core 8563 * @atomicservice 8564 * @since 12 8565 */ 8566 enableSmoothDragResize(mode: boolean): WebAttribute; 8567 8568 /** 8569 * Triggered when render process not responding. 8570 * 8571 * @param { OnRenderProcessNotRespondingCallback } callback The triggered function when render process not responding. 8572 * @returns { WebAttribute } 8573 * @syscap SystemCapability.Web.Webview.Core 8574 * @since 12 8575 */ 8576 onRenderProcessNotResponding(callback: OnRenderProcessNotRespondingCallback): WebAttribute; 8577 8578 /** 8579 * Triggered when the unresponsive render process becomes responsive. 8580 * 8581 * @param { OnRenderProcessRespondingCallback } callback The triggered function when the unresponsive render process becomes responsive. 8582 * @returns { WebAttribute } 8583 * @syscap SystemCapability.Web.Webview.Core 8584 * @since 12 8585 */ 8586 onRenderProcessResponding(callback: OnRenderProcessRespondingCallback): WebAttribute; 8587 8588 /** 8589 * Set the custom text menu. 8590 * 8591 * @param { Array<ExpandedMenuItemOptions> } expandedMenuOptions - Customize text menu options. 8592 * @returns { WebAttribute } 8593 * @syscap SystemCapability.Web.Webview.Core 8594 * @since 12 8595 */ 8596 selectionMenuOptions(expandedMenuOptions: Array<ExpandedMenuItemOptions>): WebAttribute; 8597 8598 /** 8599 * Triggered when the viewport-fit meta is detected for web page. 8600 * 8601 * @param { OnViewportFitChangedCallback } callback - The callback for onViewportFitChanged. 8602 * @returns { WebAttribute } 8603 * @syscap SystemCapability.Web.Webview.Core 8604 * @atomicservice 8605 * @since 12 8606 */ 8607 onViewportFitChanged(callback: OnViewportFitChangedCallback): WebAttribute; 8608 8609 /** 8610 * When the soft keyboard is about to be displayed on the current Web, 8611 * it gives the application the opportunity to intercept the system keyboard attachment. 8612 * The application can return the keyboard options to control the web to 8613 * pull up the soft keyboard of the different type. 8614 * 8615 * @param { WebKeyboardCallback } callback - The callback for onInterceptKeyboardAttach. 8616 * @returns { WebAttribute } 8617 * @syscap SystemCapability.Web.Webview.Core 8618 * @atomicservice 8619 * @since 12 8620 */ 8621 onInterceptKeyboardAttach(callback: WebKeyboardCallback): WebAttribute; 8622 8623 /** 8624 * Called when received Ads blocked results. 8625 * If blocked results exist at the end of page loading, the first call will be triggered. 8626 * To avoid performance issues, subsequent results will be periodically reported through this api. 8627 * 8628 * @param { OnAdsBlockedCallback } callback - The callback for OnAdsBlockedCallback. 8629 * @returns { WebAttribute } 8630 * @syscap SystemCapability.Web.Webview.Core 8631 * @atomicservice 8632 * @since 12 8633 */ 8634 onAdsBlocked(callback: OnAdsBlockedCallback): WebAttribute; 8635 8636 /** 8637 * Set web avoidance keyboard mode. The default value is WebKeyboardAvoidMode.RESIZE_CONTENT. 8638 * 8639 * @param { WebKeyboardAvoidMode } mode - The web keyboard avoid mode, which can be {@link WebKeyboardAvoidMode}. 8640 * @returns { WebAttribute } 8641 * @syscap SystemCapability.Web.Webview.Core 8642 * @atomicservice 8643 * @since 12 8644 */ 8645 keyboardAvoidMode(mode: WebKeyboardAvoidMode): WebAttribute; 8646 8647 /** 8648 * Set the custom text menu. 8649 * 8650 * @param { EditMenuOptions } editMenu - Customize text menu options. 8651 * @returns { WebAttribute } 8652 * @syscap SystemCapability.Web.Webview.Core 8653 * @since 12 8654 */ 8655 editMenuOptions(editMenu: EditMenuOptions): WebAttribute; 8656 8657 /** 8658 * Enable or disable haptic feedback. 8659 * 8660 * @param { boolean } enabled - Default value is true, set false to disable haptic feedback. 8661 * @returns { WebAttribute } 8662 * @syscap SystemCapability.Web.Webview.Core 8663 * @since 13 8664 */ 8665 enableHapticFeedback(enabled: boolean): WebAttribute; 8666 8667 /** 8668 * Bind to the selection menu. 8669 * 8670 * @param { WebElementType } elementType - Indicates the type of selection menu. 8671 * @param { CustomBuilder } content - Indicates the content of selection menu. 8672 * @param { WebResponseType } responseType - Indicates response type of selection menu. 8673 * @param { SelectionMenuOptionsExt } [options] - Indicates the options of selection menu. 8674 * @returns { WebAttribute } 8675 * @syscap SystemCapability.Web.Webview.Core 8676 * @since 13 8677 */ 8678 bindSelectionMenu(elementType: WebElementType, content: CustomBuilder, responseType: WebResponseType, 8679 options?: SelectionMenuOptionsExt): WebAttribute; 8680} 8681 8682/** 8683 * Defines Web Component. 8684 * 8685 * @syscap SystemCapability.Web.Webview.Core 8686 * @atomicservice 8687 * @since 8 8688 */ 8689/** 8690 * Defines Web Component. 8691 * 8692 * @syscap SystemCapability.Web.Webview.Core 8693 * @crossplatform 8694 * @since 10 8695 */ 8696/** 8697 * Defines Web Component. 8698 * 8699 * @constant 8700 * @syscap SystemCapability.Web.Webview.Core 8701 * @crossplatform 8702 * @atomicservice 8703 * @since 11 8704 */ 8705declare const Web: WebInterface; 8706 8707/** 8708 * Defines Web Component instance. 8709 * 8710 * @syscap SystemCapability.Web.Webview.Core 8711 * @since 8 8712 */ 8713/** 8714 * Defines Web Component instance. 8715 * 8716 * @constant 8717 * @syscap SystemCapability.Web.Webview.Core 8718 * @atomicservice 8719 * @since 11 8720 */ 8721declare const WebInstance: WebAttribute; 8722 8723/** 8724 * Defines the ssl error event. 8725 * 8726 * @typedef SslErrorEvent 8727 * @syscap SystemCapability.Web.Webview.Core 8728 * @atomicservice 8729 * @since 12 8730 */ 8731declare interface SslErrorEvent { 8732 /** 8733 * Notifies the user of the operation behavior of the web component. 8734 * 8735 * @type { SslErrorHandler } 8736 * @syscap SystemCapability.Web.Webview.Core 8737 * @atomicservice 8738 * @since 12 8739 */ 8740 handler: SslErrorHandler, 8741 /** 8742 * Error codes. 8743 * 8744 * @type { SslError } 8745 * @syscap SystemCapability.Web.Webview.Core 8746 * @atomicservice 8747 * @since 12 8748 */ 8749 error: SslError 8750 /** 8751 * Request url. 8752 * 8753 * @type { string } 8754 * @syscap SystemCapability.Web.Webview.Core 8755 * @atomicservice 8756 * @since 12 8757 */ 8758 url: string; 8759 /** 8760 * Original url. 8761 * 8762 * @type { string } 8763 * @syscap SystemCapability.Web.Webview.Core 8764 * @atomicservice 8765 * @since 12 8766 */ 8767 originalUrl: string; 8768 /** 8769 * Referrer. 8770 * 8771 * @type { string } 8772 * @syscap SystemCapability.Web.Webview.Core 8773 * @atomicservice 8774 * @since 12 8775 */ 8776 referrer: string; 8777 /** 8778 * Whether the error is fatal. 8779 * 8780 * @type { boolean } 8781 * @syscap SystemCapability.Web.Webview.Core 8782 * @atomicservice 8783 * @since 12 8784 */ 8785 isFatalError: boolean; 8786 /** 8787 * Whether the request is main frame. 8788 * 8789 * @type { boolean } 8790 * @syscap SystemCapability.Web.Webview.Core 8791 * @atomicservice 8792 * @since 12 8793 */ 8794 isMainFrame: boolean; 8795} 8796 8797/** 8798 * Defines the menu item option. 8799 * 8800 * @interface ExpandedMenuItemOptions 8801 * @syscap SystemCapability.Web.Webview.Core 8802 * @atomicservice 8803 * @since 12 8804 */ 8805declare interface ExpandedMenuItemOptions { 8806 /** 8807 * Customize what the menu displays. 8808 * 8809 * @type { ResourceStr } 8810 * @syscap SystemCapability.Web.Webview.Core 8811 * @atomicservice 8812 * @since 12 8813 */ 8814 content: ResourceStr; 8815 /** 8816 * Customize the icon before the menu displays content. 8817 * 8818 * @type { ?ResourceStr } 8819 * @syscap SystemCapability.Web.Webview.Core 8820 * @atomicservice 8821 * @since 12 8822 */ 8823 startIcon?: ResourceStr; 8824 /** 8825 * Get the selected text information. 8826 * 8827 * @type { function } 8828 * @syscap SystemCapability.Web.Webview.Core 8829 * @atomicservice 8830 * @since 12 8831 */ 8832 action: (selectedText: {plainText: string}) => void; 8833} 8834 8835/** 8836 * Define nested scroll options 8837 * 8838 * @interface NestedScrollOptionsExt 8839 * @syscap SystemCapability.Web.Webview.Core 8840 * @since 14 8841 */ 8842declare interface NestedScrollOptionsExt { 8843 /** 8844 * Set NestedScrollMode when the scrollable component scrolls up 8845 * 8846 * @type { ?NestedScrollMode } 8847 * @syscap SystemCapability.Web.Webview.Core 8848 * @since 14 8849 */ 8850 scrollUp?: NestedScrollMode; 8851 8852 /** 8853 * Set NestedScrollMode when the scrollable component scrolls down 8854 * 8855 * @type { ?NestedScrollMode } 8856 * @syscap SystemCapability.Web.Webview.Core 8857 * @since 14 8858 */ 8859 scrollDown?: NestedScrollMode; 8860 8861 /** 8862 * Set NestedScrollMode when the scrollable component scrolls right 8863 * 8864 * @type { ?NestedScrollMode } 8865 * @syscap SystemCapability.Web.Webview.Core 8866 * @since 14 8867 */ 8868 scrollRight?: NestedScrollMode; 8869 8870 /** 8871 * Set NestedScrollMode when the scrollable component scrolls left 8872 * 8873 * @type { ?NestedScrollMode } 8874 * @syscap SystemCapability.Web.Webview.Core 8875 * @since 14 8876 */ 8877 scrollLeft?: NestedScrollMode; 8878} 8879