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