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