161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkWeb 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback, BusinessError } from './@ohos.base'; 2261847f8eSopenharmony_ciimport { Callback } from './@ohos.base'; 2361847f8eSopenharmony_ciimport cert from './@ohos.security.cert'; 2461847f8eSopenharmony_ciimport image from './@ohos.multimedia.image'; 2561847f8eSopenharmony_ciimport type print from './@ohos.print'; 2661847f8eSopenharmony_ciimport { WebNetErrorList } from './@ohos.web.netErrorList'; 2761847f8eSopenharmony_ci 2861847f8eSopenharmony_ci/** 2961847f8eSopenharmony_ci * This module provides the capability to manage web modules. 3061847f8eSopenharmony_ci * 3161847f8eSopenharmony_ci * @namespace webview 3261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 3361847f8eSopenharmony_ci * @since 9 3461847f8eSopenharmony_ci */ 3561847f8eSopenharmony_ci/** 3661847f8eSopenharmony_ci * This module provides the capability to manage web modules. 3761847f8eSopenharmony_ci * 3861847f8eSopenharmony_ci * @namespace webview 3961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 4061847f8eSopenharmony_ci * @crossplatform 4161847f8eSopenharmony_ci * @since 10 4261847f8eSopenharmony_ci */ 4361847f8eSopenharmony_ci/** 4461847f8eSopenharmony_ci * This module provides the capability to manage web modules. 4561847f8eSopenharmony_ci * 4661847f8eSopenharmony_ci * @namespace webview 4761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 4861847f8eSopenharmony_ci * @crossplatform 4961847f8eSopenharmony_ci * @atomicservice 5061847f8eSopenharmony_ci * @since 11 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_cideclare namespace webview { 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Defines the Web's request/response header. 5561847f8eSopenharmony_ci * 5661847f8eSopenharmony_ci * @interface WebHeader 5761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 5861847f8eSopenharmony_ci * @since 9 5961847f8eSopenharmony_ci */ 6061847f8eSopenharmony_ci /** 6161847f8eSopenharmony_ci * Defines the Web's request/response header. 6261847f8eSopenharmony_ci * 6361847f8eSopenharmony_ci * @interface WebHeader 6461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 6561847f8eSopenharmony_ci * @crossplatform 6661847f8eSopenharmony_ci * @since 10 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci /** 6961847f8eSopenharmony_ci * Defines the Web's request/response header. 7061847f8eSopenharmony_ci * 7161847f8eSopenharmony_ci * @interface WebHeader 7261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 7361847f8eSopenharmony_ci * @crossplatform 7461847f8eSopenharmony_ci * @atomicservice 7561847f8eSopenharmony_ci * @since 11 7661847f8eSopenharmony_ci */ 7761847f8eSopenharmony_ci /** 7861847f8eSopenharmony_ci * Defines the Web's request/response header. 7961847f8eSopenharmony_ci * 8061847f8eSopenharmony_ci * @typedef WebHeader 8161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 8261847f8eSopenharmony_ci * @crossplatform 8361847f8eSopenharmony_ci * @atomicservice 8461847f8eSopenharmony_ci * @since 12 8561847f8eSopenharmony_ci */ 8661847f8eSopenharmony_ci interface WebHeader { 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Gets the key of the request/response header. 8961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 9061847f8eSopenharmony_ci * @since 9 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci /** 9361847f8eSopenharmony_ci * Gets the key of the request/response header. 9461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 9561847f8eSopenharmony_ci * @crossplatform 9661847f8eSopenharmony_ci * @since 10 9761847f8eSopenharmony_ci */ 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * Gets the key of the request/response header. 10061847f8eSopenharmony_ci * @type { string } 10161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 10261847f8eSopenharmony_ci * @crossplatform 10361847f8eSopenharmony_ci * @atomicservice 10461847f8eSopenharmony_ci * @since 11 10561847f8eSopenharmony_ci */ 10661847f8eSopenharmony_ci headerKey: string; 10761847f8eSopenharmony_ci 10861847f8eSopenharmony_ci /** 10961847f8eSopenharmony_ci * Gets the value of the request/response header. 11061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 11161847f8eSopenharmony_ci * @since 9 11261847f8eSopenharmony_ci */ 11361847f8eSopenharmony_ci /** 11461847f8eSopenharmony_ci * Gets the value of the request/response header. 11561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 11661847f8eSopenharmony_ci * @crossplatform 11761847f8eSopenharmony_ci * @since 10 11861847f8eSopenharmony_ci */ 11961847f8eSopenharmony_ci /** 12061847f8eSopenharmony_ci * Gets the value of the request/response header. 12161847f8eSopenharmony_ci * @type { string } 12261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 12361847f8eSopenharmony_ci * @crossplatform 12461847f8eSopenharmony_ci * @atomicservice 12561847f8eSopenharmony_ci * @since 11 12661847f8eSopenharmony_ci */ 12761847f8eSopenharmony_ci headerValue: string; 12861847f8eSopenharmony_ci } 12961847f8eSopenharmony_ci 13061847f8eSopenharmony_ci /** 13161847f8eSopenharmony_ci * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 13261847f8eSopenharmony_ci * @enum {number} 13361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 13461847f8eSopenharmony_ci * @since 9 13561847f8eSopenharmony_ci */ 13661847f8eSopenharmony_ci /** 13761847f8eSopenharmony_ci * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 13861847f8eSopenharmony_ci * @enum {number} 13961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 14061847f8eSopenharmony_ci * @atomicservice 14161847f8eSopenharmony_ci * @since 11 14261847f8eSopenharmony_ci */ 14361847f8eSopenharmony_ci enum WebHitTestType { 14461847f8eSopenharmony_ci /** 14561847f8eSopenharmony_ci * The edit text. 14661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 14761847f8eSopenharmony_ci * @since 9 14861847f8eSopenharmony_ci */ 14961847f8eSopenharmony_ci /** 15061847f8eSopenharmony_ci * The edit text. 15161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 15261847f8eSopenharmony_ci * @atomicservice 15361847f8eSopenharmony_ci * @since 11 15461847f8eSopenharmony_ci */ 15561847f8eSopenharmony_ci EditText, 15661847f8eSopenharmony_ci 15761847f8eSopenharmony_ci /** 15861847f8eSopenharmony_ci * The email address. 15961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 16061847f8eSopenharmony_ci * @since 9 16161847f8eSopenharmony_ci */ 16261847f8eSopenharmony_ci /** 16361847f8eSopenharmony_ci * The email address. 16461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 16561847f8eSopenharmony_ci * @atomicservice 16661847f8eSopenharmony_ci * @since 11 16761847f8eSopenharmony_ci */ 16861847f8eSopenharmony_ci Email, 16961847f8eSopenharmony_ci 17061847f8eSopenharmony_ci /** 17161847f8eSopenharmony_ci * The HTML::a tag with src=http. 17261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 17361847f8eSopenharmony_ci * @since 9 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci /** 17661847f8eSopenharmony_ci * The HTML::a tag with src=http. 17761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 17861847f8eSopenharmony_ci * @atomicservice 17961847f8eSopenharmony_ci * @since 11 18061847f8eSopenharmony_ci */ 18161847f8eSopenharmony_ci HttpAnchor, 18261847f8eSopenharmony_ci 18361847f8eSopenharmony_ci /** 18461847f8eSopenharmony_ci * The HTML::a tag with src=http + HTML::img. 18561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 18661847f8eSopenharmony_ci * @since 9 18761847f8eSopenharmony_ci */ 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * The HTML::a tag with src=http + HTML::img. 19061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 19161847f8eSopenharmony_ci * @atomicservice 19261847f8eSopenharmony_ci * @since 11 19361847f8eSopenharmony_ci */ 19461847f8eSopenharmony_ci HttpAnchorImg, 19561847f8eSopenharmony_ci 19661847f8eSopenharmony_ci /** 19761847f8eSopenharmony_ci * The HTML::img tag. 19861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 19961847f8eSopenharmony_ci * @since 9 20061847f8eSopenharmony_ci */ 20161847f8eSopenharmony_ci /** 20261847f8eSopenharmony_ci * The HTML::img tag. 20361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 20461847f8eSopenharmony_ci * @atomicservice 20561847f8eSopenharmony_ci * @since 11 20661847f8eSopenharmony_ci */ 20761847f8eSopenharmony_ci Img, 20861847f8eSopenharmony_ci 20961847f8eSopenharmony_ci /** 21061847f8eSopenharmony_ci * The map address. 21161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 21261847f8eSopenharmony_ci * @since 9 21361847f8eSopenharmony_ci */ 21461847f8eSopenharmony_ci /** 21561847f8eSopenharmony_ci * The map address. 21661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 21761847f8eSopenharmony_ci * @atomicservice 21861847f8eSopenharmony_ci * @since 11 21961847f8eSopenharmony_ci */ 22061847f8eSopenharmony_ci Map, 22161847f8eSopenharmony_ci 22261847f8eSopenharmony_ci /** 22361847f8eSopenharmony_ci * The phone number. 22461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 22561847f8eSopenharmony_ci * @since 9 22661847f8eSopenharmony_ci */ 22761847f8eSopenharmony_ci /** 22861847f8eSopenharmony_ci * The phone number. 22961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 23061847f8eSopenharmony_ci * @atomicservice 23161847f8eSopenharmony_ci * @since 11 23261847f8eSopenharmony_ci */ 23361847f8eSopenharmony_ci Phone, 23461847f8eSopenharmony_ci 23561847f8eSopenharmony_ci /** 23661847f8eSopenharmony_ci * Other unknown HitTest. 23761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 23861847f8eSopenharmony_ci * @since 9 23961847f8eSopenharmony_ci */ 24061847f8eSopenharmony_ci /** 24161847f8eSopenharmony_ci * Other unknown HitTest. 24261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 24361847f8eSopenharmony_ci * @atomicservice 24461847f8eSopenharmony_ci * @since 11 24561847f8eSopenharmony_ci */ 24661847f8eSopenharmony_ci Unknown 24761847f8eSopenharmony_ci } 24861847f8eSopenharmony_ci 24961847f8eSopenharmony_ci /** 25061847f8eSopenharmony_ci * Defines the mode for using HttpDns. 25161847f8eSopenharmony_ci * @enum {number} 25261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 25361847f8eSopenharmony_ci * @since 10 25461847f8eSopenharmony_ci */ 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Defines the mode for using HttpDns. 25761847f8eSopenharmony_ci * @enum {number} 25861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 25961847f8eSopenharmony_ci * @atomicservice 26061847f8eSopenharmony_ci * @since 11 26161847f8eSopenharmony_ci */ 26261847f8eSopenharmony_ci enum SecureDnsMode { 26361847f8eSopenharmony_ci /** 26461847f8eSopenharmony_ci * Do not use HttpDns, can be used to revoke previously used HttpDns configuration. 26561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 26661847f8eSopenharmony_ci * @since 10 26761847f8eSopenharmony_ci */ 26861847f8eSopenharmony_ci /** 26961847f8eSopenharmony_ci * Do not use HttpDns, can be used to revoke previously used HttpDns configuration. 27061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 27161847f8eSopenharmony_ci * @atomicservice 27261847f8eSopenharmony_ci * @since 11 27361847f8eSopenharmony_ci */ 27461847f8eSopenharmony_ci OFF = 0, 27561847f8eSopenharmony_ci /** 27661847f8eSopenharmony_ci * By default, the user-settings of HttpDns is used for dns resolution, and if it fails, 27761847f8eSopenharmony_ci * the system dns is used for resolution. 27861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 27961847f8eSopenharmony_ci * @since 10 28061847f8eSopenharmony_ci */ 28161847f8eSopenharmony_ci /** 28261847f8eSopenharmony_ci * By default, the user-settings of HttpDns is used for dns resolution, and if it fails, 28361847f8eSopenharmony_ci * the system dns is used for resolution. 28461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 28561847f8eSopenharmony_ci * @atomicservice 28661847f8eSopenharmony_ci * @since 11 28761847f8eSopenharmony_ci */ 28861847f8eSopenharmony_ci AUTO = 1, 28961847f8eSopenharmony_ci /** 29061847f8eSopenharmony_ci * Use the user-settings of HttpDns for dns resolution. If it fails, it will not 29161847f8eSopenharmony_ci * fall back to the system dns, which will directly cause the page to fail to load. 29261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 29361847f8eSopenharmony_ci * @since 10 29461847f8eSopenharmony_ci */ 29561847f8eSopenharmony_ci /** 29661847f8eSopenharmony_ci * Use the user-settings of HttpDns for dns resolution. If it fails, it will not 29761847f8eSopenharmony_ci * fall back to the system dns, which will directly cause the page to fail to load. 29861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 29961847f8eSopenharmony_ci * @atomicservice 30061847f8eSopenharmony_ci * @since 11 30161847f8eSopenharmony_ci */ 30261847f8eSopenharmony_ci SECURE_ONLY = 2, 30361847f8eSopenharmony_ci } 30461847f8eSopenharmony_ci 30561847f8eSopenharmony_ci /** 30661847f8eSopenharmony_ci * Defines the security level for the page. 30761847f8eSopenharmony_ci * 30861847f8eSopenharmony_ci * @enum {number} 30961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 31061847f8eSopenharmony_ci * @atomicservice 31161847f8eSopenharmony_ci * @since 11 31261847f8eSopenharmony_ci */ 31361847f8eSopenharmony_ci enum SecurityLevel { 31461847f8eSopenharmony_ci /** 31561847f8eSopenharmony_ci * Unable to determine whether it is safe or not, the non-http/https protocol used. 31661847f8eSopenharmony_ci * 31761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 31861847f8eSopenharmony_ci * @atomicservice 31961847f8eSopenharmony_ci * @since 11 32061847f8eSopenharmony_ci */ 32161847f8eSopenharmony_ci NONE = 0, 32261847f8eSopenharmony_ci 32361847f8eSopenharmony_ci /** 32461847f8eSopenharmony_ci * Indicates the HTTPS protocol used by the page and the authentication is successful. 32561847f8eSopenharmony_ci * 32661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 32761847f8eSopenharmony_ci * @atomicservice 32861847f8eSopenharmony_ci * @since 11 32961847f8eSopenharmony_ci */ 33061847f8eSopenharmony_ci SECURE = 1, 33161847f8eSopenharmony_ci 33261847f8eSopenharmony_ci /** 33361847f8eSopenharmony_ci * The page is insecure. For example, the HTTP protocol is used or the HTTPS protocol 33461847f8eSopenharmony_ci * is used but use an legacy TLS version. 33561847f8eSopenharmony_ci * 33661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 33761847f8eSopenharmony_ci * @atomicservice 33861847f8eSopenharmony_ci * @since 11 33961847f8eSopenharmony_ci */ 34061847f8eSopenharmony_ci WARNING = 2, 34161847f8eSopenharmony_ci 34261847f8eSopenharmony_ci /** 34361847f8eSopenharmony_ci * Attempted HTTPS and failed, the authentication is failed. 34461847f8eSopenharmony_ci * 34561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 34661847f8eSopenharmony_ci * @atomicservice 34761847f8eSopenharmony_ci * @since 11 34861847f8eSopenharmony_ci */ 34961847f8eSopenharmony_ci DANGEROUS = 3, 35061847f8eSopenharmony_ci } 35161847f8eSopenharmony_ci 35261847f8eSopenharmony_ci /** 35361847f8eSopenharmony_ci * The playback status of all audio and video. 35461847f8eSopenharmony_ci * @enum {number} 35561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 35661847f8eSopenharmony_ci * @atomicservice 35761847f8eSopenharmony_ci * @since 12 35861847f8eSopenharmony_ci */ 35961847f8eSopenharmony_ci enum MediaPlaybackState { 36061847f8eSopenharmony_ci /** 36161847f8eSopenharmony_ci * No audio or video currently. 36261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 36361847f8eSopenharmony_ci * @atomicservice 36461847f8eSopenharmony_ci * @since 12 36561847f8eSopenharmony_ci */ 36661847f8eSopenharmony_ci NONE = 0, 36761847f8eSopenharmony_ci 36861847f8eSopenharmony_ci /** 36961847f8eSopenharmony_ci * All audio and video are playing. 37061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 37161847f8eSopenharmony_ci * @atomicservice 37261847f8eSopenharmony_ci * @since 12 37361847f8eSopenharmony_ci */ 37461847f8eSopenharmony_ci PLAYING = 1, 37561847f8eSopenharmony_ci 37661847f8eSopenharmony_ci /** 37761847f8eSopenharmony_ci * All audio and video are paused. 37861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 37961847f8eSopenharmony_ci * @atomicservice 38061847f8eSopenharmony_ci * @since 12 38161847f8eSopenharmony_ci */ 38261847f8eSopenharmony_ci PAUSED = 2, 38361847f8eSopenharmony_ci 38461847f8eSopenharmony_ci /** 38561847f8eSopenharmony_ci * All audio and video are stopped. 38661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 38761847f8eSopenharmony_ci * @atomicservice 38861847f8eSopenharmony_ci * @since 12 38961847f8eSopenharmony_ci */ 39061847f8eSopenharmony_ci STOPPED = 3 39161847f8eSopenharmony_ci } 39261847f8eSopenharmony_ci 39361847f8eSopenharmony_ci /** 39461847f8eSopenharmony_ci * The memory pressure level that can be set. 39561847f8eSopenharmony_ci * @enum {number} 39661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 39761847f8eSopenharmony_ci * @atomicservice 39861847f8eSopenharmony_ci * @since 14 39961847f8eSopenharmony_ci */ 40061847f8eSopenharmony_ci enum PressureLevel { 40161847f8eSopenharmony_ci /** 40261847f8eSopenharmony_ci * Modules are advised to free buffers that are cheap to re-allocate and not immediately needed. 40361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 40461847f8eSopenharmony_ci * @atomicservice 40561847f8eSopenharmony_ci * @since 14 40661847f8eSopenharmony_ci */ 40761847f8eSopenharmony_ci MEMORY_PRESSURE_LEVEL_MODERATE = 1, 40861847f8eSopenharmony_ci 40961847f8eSopenharmony_ci /** 41061847f8eSopenharmony_ci * At this level, modules are advised to free all possible memory. 41161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 41261847f8eSopenharmony_ci * @atomicservice 41361847f8eSopenharmony_ci * @since 14 41461847f8eSopenharmony_ci */ 41561847f8eSopenharmony_ci MEMORY_PRESSURE_LEVEL_CRITICAL = 2 41661847f8eSopenharmony_ci } 41761847f8eSopenharmony_ci 41861847f8eSopenharmony_ci /** 41961847f8eSopenharmony_ci * Defines the hit test value, related to {@link getHitTestValue} method. 42061847f8eSopenharmony_ci * 42161847f8eSopenharmony_ci * @interface HitTestValue 42261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 42361847f8eSopenharmony_ci * @since 9 42461847f8eSopenharmony_ci */ 42561847f8eSopenharmony_ci /** 42661847f8eSopenharmony_ci * Defines the hit test value, related to {@link getHitTestValue} method. 42761847f8eSopenharmony_ci * 42861847f8eSopenharmony_ci * @interface HitTestValue 42961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 43061847f8eSopenharmony_ci * @atomicservice 43161847f8eSopenharmony_ci * @since 11 43261847f8eSopenharmony_ci */ 43361847f8eSopenharmony_ci /** 43461847f8eSopenharmony_ci * Defines the hit test value, related to {@link getHitTestValue} method. 43561847f8eSopenharmony_ci * 43661847f8eSopenharmony_ci * @typedef HitTestValue 43761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 43861847f8eSopenharmony_ci * @atomicservice 43961847f8eSopenharmony_ci * @since 12 44061847f8eSopenharmony_ci */ 44161847f8eSopenharmony_ci interface HitTestValue { 44261847f8eSopenharmony_ci 44361847f8eSopenharmony_ci /** 44461847f8eSopenharmony_ci * Get the hit test type. 44561847f8eSopenharmony_ci * 44661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 44761847f8eSopenharmony_ci * @since 9 44861847f8eSopenharmony_ci */ 44961847f8eSopenharmony_ci /** 45061847f8eSopenharmony_ci * Get the hit test type. 45161847f8eSopenharmony_ci * 45261847f8eSopenharmony_ci * @type { WebHitTestType } 45361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 45461847f8eSopenharmony_ci * @atomicservice 45561847f8eSopenharmony_ci * @since 11 45661847f8eSopenharmony_ci */ 45761847f8eSopenharmony_ci type: WebHitTestType; 45861847f8eSopenharmony_ci 45961847f8eSopenharmony_ci /** 46061847f8eSopenharmony_ci * Get the hit test extra data. 46161847f8eSopenharmony_ci * 46261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 46361847f8eSopenharmony_ci * @since 9 46461847f8eSopenharmony_ci */ 46561847f8eSopenharmony_ci /** 46661847f8eSopenharmony_ci * Get the hit test extra data. 46761847f8eSopenharmony_ci * 46861847f8eSopenharmony_ci * @type { string } 46961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 47061847f8eSopenharmony_ci * @atomicservice 47161847f8eSopenharmony_ci * @since 11 47261847f8eSopenharmony_ci */ 47361847f8eSopenharmony_ci extra: string; 47461847f8eSopenharmony_ci } 47561847f8eSopenharmony_ci 47661847f8eSopenharmony_ci /** 47761847f8eSopenharmony_ci * Defines the configuration of web custom scheme, related to {@link customizeSchemes} method. 47861847f8eSopenharmony_ci * 47961847f8eSopenharmony_ci * @interface WebCustomScheme 48061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 48161847f8eSopenharmony_ci * @since 9 48261847f8eSopenharmony_ci */ 48361847f8eSopenharmony_ci /** 48461847f8eSopenharmony_ci * Defines the configuration of web custom scheme, related to {@link customizeSchemes} method. 48561847f8eSopenharmony_ci * 48661847f8eSopenharmony_ci * @interface WebCustomScheme 48761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 48861847f8eSopenharmony_ci * @atomicservice 48961847f8eSopenharmony_ci * @since 11 49061847f8eSopenharmony_ci */ 49161847f8eSopenharmony_ci /** 49261847f8eSopenharmony_ci * Defines the configuration of web custom scheme, related to {@link customizeSchemes} method. 49361847f8eSopenharmony_ci * 49461847f8eSopenharmony_ci * @typedef WebCustomScheme 49561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 49661847f8eSopenharmony_ci * @atomicservice 49761847f8eSopenharmony_ci * @since 12 49861847f8eSopenharmony_ci */ 49961847f8eSopenharmony_ci interface WebCustomScheme { 50061847f8eSopenharmony_ci 50161847f8eSopenharmony_ci /** 50261847f8eSopenharmony_ci * Name of the custom scheme. 50361847f8eSopenharmony_ci * 50461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 50561847f8eSopenharmony_ci * @since 9 50661847f8eSopenharmony_ci */ 50761847f8eSopenharmony_ci /** 50861847f8eSopenharmony_ci * Name of the custom scheme. 50961847f8eSopenharmony_ci * 51061847f8eSopenharmony_ci * @type { string } 51161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 51261847f8eSopenharmony_ci * @atomicservice 51361847f8eSopenharmony_ci * @since 11 51461847f8eSopenharmony_ci */ 51561847f8eSopenharmony_ci schemeName: string; 51661847f8eSopenharmony_ci 51761847f8eSopenharmony_ci /** 51861847f8eSopenharmony_ci * Whether Cross-Origin Resource Sharing is supported. 51961847f8eSopenharmony_ci * 52061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 52161847f8eSopenharmony_ci * @since 9 52261847f8eSopenharmony_ci */ 52361847f8eSopenharmony_ci /** 52461847f8eSopenharmony_ci * Whether Cross-Origin Resource Sharing is supported. 52561847f8eSopenharmony_ci * 52661847f8eSopenharmony_ci * @type { boolean } 52761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 52861847f8eSopenharmony_ci * @atomicservice 52961847f8eSopenharmony_ci * @since 11 53061847f8eSopenharmony_ci */ 53161847f8eSopenharmony_ci isSupportCORS: boolean; 53261847f8eSopenharmony_ci 53361847f8eSopenharmony_ci /** 53461847f8eSopenharmony_ci * Whether fetch request is supported. 53561847f8eSopenharmony_ci * 53661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 53761847f8eSopenharmony_ci * @since 9 53861847f8eSopenharmony_ci */ 53961847f8eSopenharmony_ci /** 54061847f8eSopenharmony_ci * Whether fetch request is supported. 54161847f8eSopenharmony_ci * 54261847f8eSopenharmony_ci * @type { boolean } 54361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 54461847f8eSopenharmony_ci * @atomicservice 54561847f8eSopenharmony_ci * @since 11 54661847f8eSopenharmony_ci */ 54761847f8eSopenharmony_ci isSupportFetch: boolean; 54861847f8eSopenharmony_ci 54961847f8eSopenharmony_ci /** 55061847f8eSopenharmony_ci * If isStandard is true, the scheme will be handled as a standard scheme. The standard 55161847f8eSopenharmony_ci * schemes needs to comply with the URL normalization and parsing rules defined in Section 3.1 of RFC 1738, 55261847f8eSopenharmony_ci * which can be found in the http://www.ietf.org/rfc/rfc1738.txt. 55361847f8eSopenharmony_ci * 55461847f8eSopenharmony_ci * @type { ?boolean } 55561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 55661847f8eSopenharmony_ci * @atomicservice 55761847f8eSopenharmony_ci * @since 12 55861847f8eSopenharmony_ci */ 55961847f8eSopenharmony_ci isStandard?: boolean; 56061847f8eSopenharmony_ci 56161847f8eSopenharmony_ci /** 56261847f8eSopenharmony_ci * If isLocal is true, the same security rules as those applied to the "file" URL will be 56361847f8eSopenharmony_ci * used to handle the scheme. 56461847f8eSopenharmony_ci * 56561847f8eSopenharmony_ci * @type { ?boolean } 56661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 56761847f8eSopenharmony_ci * @atomicservice 56861847f8eSopenharmony_ci * @since 12 56961847f8eSopenharmony_ci */ 57061847f8eSopenharmony_ci isLocal?: boolean; 57161847f8eSopenharmony_ci 57261847f8eSopenharmony_ci /** 57361847f8eSopenharmony_ci * If isDisplayIsolated is true, then the scheme can only be displayed from other content 57461847f8eSopenharmony_ci * hosted using the same scheme. 57561847f8eSopenharmony_ci * 57661847f8eSopenharmony_ci * @type { ?boolean } 57761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 57861847f8eSopenharmony_ci * @atomicservice 57961847f8eSopenharmony_ci * @since 12 58061847f8eSopenharmony_ci */ 58161847f8eSopenharmony_ci isDisplayIsolated?: boolean; 58261847f8eSopenharmony_ci 58361847f8eSopenharmony_ci /** 58461847f8eSopenharmony_ci * If isSecure is true, the same security rules as those applied to the "https" URL will be 58561847f8eSopenharmony_ci * used to handle the scheme. 58661847f8eSopenharmony_ci * 58761847f8eSopenharmony_ci * @type { ?boolean } 58861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 58961847f8eSopenharmony_ci * @atomicservice 59061847f8eSopenharmony_ci * @since 12 59161847f8eSopenharmony_ci */ 59261847f8eSopenharmony_ci isSecure?: boolean; 59361847f8eSopenharmony_ci 59461847f8eSopenharmony_ci /** 59561847f8eSopenharmony_ci * If isCspBypassing is true, then this scheme can bypass Content Security Policy (CSP) 59661847f8eSopenharmony_ci * checks. In most cases, this value should not be true when isStandard is true. 59761847f8eSopenharmony_ci * 59861847f8eSopenharmony_ci * @type { ?boolean } 59961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 60061847f8eSopenharmony_ci * @atomicservice 60161847f8eSopenharmony_ci * @since 12 60261847f8eSopenharmony_ci */ 60361847f8eSopenharmony_ci isCspBypassing?: boolean; 60461847f8eSopenharmony_ci 60561847f8eSopenharmony_ci /** 60661847f8eSopenharmony_ci * If isCodeCacheSupported is true, then the js of this scheme can generate code cache. 60761847f8eSopenharmony_ci * 60861847f8eSopenharmony_ci * @type { ?boolean } 60961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 61061847f8eSopenharmony_ci * @since 12 61161847f8eSopenharmony_ci */ 61261847f8eSopenharmony_ci isCodeCacheSupported?: boolean; 61361847f8eSopenharmony_ci } 61461847f8eSopenharmony_ci 61561847f8eSopenharmony_ci /** 61661847f8eSopenharmony_ci * Defines the callback of createPdf, related to {@link createPDF} method. 61761847f8eSopenharmony_ci * 61861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 61961847f8eSopenharmony_ci * @atomicservice 62061847f8eSopenharmony_ci * @since 14 62161847f8eSopenharmony_ci */ 62261847f8eSopenharmony_ci class PdfData { 62361847f8eSopenharmony_ci /** 62461847f8eSopenharmony_ci * Return the data stream generated by the webpage. 62561847f8eSopenharmony_ci * 62661847f8eSopenharmony_ci * @returns { Uint8Array } return pdf data. 62761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 62861847f8eSopenharmony_ci * @atomicservice 62961847f8eSopenharmony_ci * @since 14 63061847f8eSopenharmony_ci */ 63161847f8eSopenharmony_ci pdfArrayBuffer(): Uint8Array; 63261847f8eSopenharmony_ci } 63361847f8eSopenharmony_ci 63461847f8eSopenharmony_ci /** 63561847f8eSopenharmony_ci * Defines the configuration of creating pdf, related to {@Link createPdf} method. 63661847f8eSopenharmony_ci * 63761847f8eSopenharmony_ci * @typedef PdfConfiguration 63861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 63961847f8eSopenharmony_ci * @atomicservice 64061847f8eSopenharmony_ci * @since 14 64161847f8eSopenharmony_ci */ 64261847f8eSopenharmony_ci interface PdfConfiguration { 64361847f8eSopenharmony_ci /** 64461847f8eSopenharmony_ci * Number of the width. 64561847f8eSopenharmony_ci * 64661847f8eSopenharmony_ci * @type { number } 64761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 64861847f8eSopenharmony_ci * @atomicservice 64961847f8eSopenharmony_ci * @since 14 65061847f8eSopenharmony_ci */ 65161847f8eSopenharmony_ci width: number; 65261847f8eSopenharmony_ci 65361847f8eSopenharmony_ci /** 65461847f8eSopenharmony_ci * Number of the height. 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @type { number } 65761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 65861847f8eSopenharmony_ci * @atomicservice 65961847f8eSopenharmony_ci * @since 14 66061847f8eSopenharmony_ci */ 66161847f8eSopenharmony_ci height: number; 66261847f8eSopenharmony_ci 66361847f8eSopenharmony_ci /** 66461847f8eSopenharmony_ci * Number of the marginTop. 66561847f8eSopenharmony_ci * 66661847f8eSopenharmony_ci * @type { number } 66761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 66861847f8eSopenharmony_ci * @atomicservice 66961847f8eSopenharmony_ci * @since 14 67061847f8eSopenharmony_ci */ 67161847f8eSopenharmony_ci marginTop: number; 67261847f8eSopenharmony_ci 67361847f8eSopenharmony_ci /** 67461847f8eSopenharmony_ci * Number of the marginBottom. 67561847f8eSopenharmony_ci * 67661847f8eSopenharmony_ci * @type { number } 67761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 67861847f8eSopenharmony_ci * @atomicservice 67961847f8eSopenharmony_ci * @since 14 68061847f8eSopenharmony_ci */ 68161847f8eSopenharmony_ci marginBottom: number; 68261847f8eSopenharmony_ci 68361847f8eSopenharmony_ci /** 68461847f8eSopenharmony_ci * Number of the marginRight. 68561847f8eSopenharmony_ci * 68661847f8eSopenharmony_ci * @type { number } 68761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 68861847f8eSopenharmony_ci * @atomicservice 68961847f8eSopenharmony_ci * @since 14 69061847f8eSopenharmony_ci */ 69161847f8eSopenharmony_ci marginRight: number; 69261847f8eSopenharmony_ci 69361847f8eSopenharmony_ci /** 69461847f8eSopenharmony_ci * Number of the marginLeft. 69561847f8eSopenharmony_ci * 69661847f8eSopenharmony_ci * @type { number } 69761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 69861847f8eSopenharmony_ci * @atomicservice 69961847f8eSopenharmony_ci * @since 14 70061847f8eSopenharmony_ci */ 70161847f8eSopenharmony_ci marginLeft: number; 70261847f8eSopenharmony_ci 70361847f8eSopenharmony_ci /** 70461847f8eSopenharmony_ci * Number of the scaling. 70561847f8eSopenharmony_ci * 70661847f8eSopenharmony_ci * @type { ?number } 70761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 70861847f8eSopenharmony_ci * @atomicservice 70961847f8eSopenharmony_ci * @since 14 71061847f8eSopenharmony_ci */ 71161847f8eSopenharmony_ci scale?: number; 71261847f8eSopenharmony_ci 71361847f8eSopenharmony_ci /** 71461847f8eSopenharmony_ci * Whether background should be printed when creating pdf. 71561847f8eSopenharmony_ci * 71661847f8eSopenharmony_ci * @type { ?boolean } 71761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 71861847f8eSopenharmony_ci * @atomicservice 71961847f8eSopenharmony_ci * @since 14 72061847f8eSopenharmony_ci */ 72161847f8eSopenharmony_ci shouldPrintBackground?: boolean; 72261847f8eSopenharmony_ci } 72361847f8eSopenharmony_ci 72461847f8eSopenharmony_ci /** 72561847f8eSopenharmony_ci * Provides basic information of web storage. 72661847f8eSopenharmony_ci * 72761847f8eSopenharmony_ci * @interface WebStorageOrigin 72861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 72961847f8eSopenharmony_ci * @since 9 73061847f8eSopenharmony_ci */ 73161847f8eSopenharmony_ci /** 73261847f8eSopenharmony_ci * Provides basic information of web storage. 73361847f8eSopenharmony_ci * 73461847f8eSopenharmony_ci * @interface WebStorageOrigin 73561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 73661847f8eSopenharmony_ci * @atomicservice 73761847f8eSopenharmony_ci * @since 11 73861847f8eSopenharmony_ci */ 73961847f8eSopenharmony_ci /** 74061847f8eSopenharmony_ci * Provides basic information of web storage. 74161847f8eSopenharmony_ci * 74261847f8eSopenharmony_ci * @typedef WebStorageOrigin 74361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 74461847f8eSopenharmony_ci * @atomicservice 74561847f8eSopenharmony_ci * @since 12 74661847f8eSopenharmony_ci */ 74761847f8eSopenharmony_ci interface WebStorageOrigin { 74861847f8eSopenharmony_ci /** 74961847f8eSopenharmony_ci * Url source. 75061847f8eSopenharmony_ci * 75161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 75261847f8eSopenharmony_ci * @since 9 75361847f8eSopenharmony_ci */ 75461847f8eSopenharmony_ci /** 75561847f8eSopenharmony_ci * Url source. 75661847f8eSopenharmony_ci * 75761847f8eSopenharmony_ci * @type { string } 75861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 75961847f8eSopenharmony_ci * @atomicservice 76061847f8eSopenharmony_ci * @since 11 76161847f8eSopenharmony_ci */ 76261847f8eSopenharmony_ci origin: string; 76361847f8eSopenharmony_ci /** 76461847f8eSopenharmony_ci * Specify the amount of storage for the source. 76561847f8eSopenharmony_ci * 76661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 76761847f8eSopenharmony_ci * @since 9 76861847f8eSopenharmony_ci */ 76961847f8eSopenharmony_ci /** 77061847f8eSopenharmony_ci * Specify the amount of storage for the source. 77161847f8eSopenharmony_ci * 77261847f8eSopenharmony_ci * @type { number } 77361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 77461847f8eSopenharmony_ci * @atomicservice 77561847f8eSopenharmony_ci * @since 11 77661847f8eSopenharmony_ci */ 77761847f8eSopenharmony_ci usage: number; 77861847f8eSopenharmony_ci /** 77961847f8eSopenharmony_ci * the callback of getOriginUsage. 78061847f8eSopenharmony_ci * 78161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 78261847f8eSopenharmony_ci * @since 9 78361847f8eSopenharmony_ci */ 78461847f8eSopenharmony_ci /** 78561847f8eSopenharmony_ci * the callback of getOriginUsage. 78661847f8eSopenharmony_ci * 78761847f8eSopenharmony_ci * @type { number } 78861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 78961847f8eSopenharmony_ci * @atomicservice 79061847f8eSopenharmony_ci * @since 11 79161847f8eSopenharmony_ci */ 79261847f8eSopenharmony_ci quota: number; 79361847f8eSopenharmony_ci } 79461847f8eSopenharmony_ci 79561847f8eSopenharmony_ci /** 79661847f8eSopenharmony_ci * Defines the Web's request info. 79761847f8eSopenharmony_ci * 79861847f8eSopenharmony_ci * @typedef RequestInfo 79961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 80061847f8eSopenharmony_ci * @atomicservice 80161847f8eSopenharmony_ci * @since 12 80261847f8eSopenharmony_ci */ 80361847f8eSopenharmony_ci interface RequestInfo { 80461847f8eSopenharmony_ci /** 80561847f8eSopenharmony_ci * Gets the url of the request. 80661847f8eSopenharmony_ci * @type { string } 80761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 80861847f8eSopenharmony_ci * @atomicservice 80961847f8eSopenharmony_ci * @since 12 81061847f8eSopenharmony_ci */ 81161847f8eSopenharmony_ci url: string; 81261847f8eSopenharmony_ci 81361847f8eSopenharmony_ci /** 81461847f8eSopenharmony_ci * Gets the method of the request. 81561847f8eSopenharmony_ci * @type { string } 81661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 81761847f8eSopenharmony_ci * @atomicservice 81861847f8eSopenharmony_ci * @since 12 81961847f8eSopenharmony_ci */ 82061847f8eSopenharmony_ci method: string; 82161847f8eSopenharmony_ci 82261847f8eSopenharmony_ci /** 82361847f8eSopenharmony_ci * Gets the form data of the request. 82461847f8eSopenharmony_ci * @type { string } 82561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 82661847f8eSopenharmony_ci * @atomicservice 82761847f8eSopenharmony_ci * @since 12 82861847f8eSopenharmony_ci */ 82961847f8eSopenharmony_ci formData: string; 83061847f8eSopenharmony_ci } 83161847f8eSopenharmony_ci 83261847f8eSopenharmony_ci /** 83361847f8eSopenharmony_ci * Defines the scroll offset of the webpage in view port, the unit is virtual pixel. 83461847f8eSopenharmony_ci * Related to {@link getScrollOffset} method. 83561847f8eSopenharmony_ci * 83661847f8eSopenharmony_ci * @typedef ScrollOffset 83761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 83861847f8eSopenharmony_ci * @atomicservice 83961847f8eSopenharmony_ci * @since 13 84061847f8eSopenharmony_ci */ 84161847f8eSopenharmony_ci interface ScrollOffset { 84261847f8eSopenharmony_ci /** 84361847f8eSopenharmony_ci * Get the horizontal offset. 84461847f8eSopenharmony_ci * @type { number } 84561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 84661847f8eSopenharmony_ci * @atomicservice 84761847f8eSopenharmony_ci * @since 13 84861847f8eSopenharmony_ci */ 84961847f8eSopenharmony_ci x: number; 85061847f8eSopenharmony_ci 85161847f8eSopenharmony_ci /** 85261847f8eSopenharmony_ci * Get the vertical offset. 85361847f8eSopenharmony_ci * @type { number } 85461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 85561847f8eSopenharmony_ci * @atomicservice 85661847f8eSopenharmony_ci * @since 13 85761847f8eSopenharmony_ci */ 85861847f8eSopenharmony_ci y: number; 85961847f8eSopenharmony_ci } 86061847f8eSopenharmony_ci 86161847f8eSopenharmony_ci /** 86261847f8eSopenharmony_ci * Subscribe to a callback of a specified type of web event once. 86361847f8eSopenharmony_ci * 86461847f8eSopenharmony_ci * @param {string} type Types of web event. 86561847f8eSopenharmony_ci * @param {Callback<void>} callback Indicate callback used to receive the web event. 86661847f8eSopenharmony_ci * 86761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 86861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 86961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 87061847f8eSopenharmony_ci * @since 9 87161847f8eSopenharmony_ci */ 87261847f8eSopenharmony_ci /** 87361847f8eSopenharmony_ci * Subscribe to a callback of a specified type of web event once. 87461847f8eSopenharmony_ci * 87561847f8eSopenharmony_ci * @param {string} type Types of web event. 87661847f8eSopenharmony_ci * @param {Callback<void>} callback Indicate callback used to receive the web event. 87761847f8eSopenharmony_ci * 87861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 87961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 88061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 88161847f8eSopenharmony_ci * @atomicservice 88261847f8eSopenharmony_ci * @since 11 88361847f8eSopenharmony_ci */ 88461847f8eSopenharmony_ci function once(type: string, callback: Callback<void>): void; 88561847f8eSopenharmony_ci 88661847f8eSopenharmony_ci /** 88761847f8eSopenharmony_ci * Provides methods for managing web storage.3 88861847f8eSopenharmony_ci * 88961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 89061847f8eSopenharmony_ci * @since 9 89161847f8eSopenharmony_ci */ 89261847f8eSopenharmony_ci /** 89361847f8eSopenharmony_ci * Provides methods for managing web storage.3 89461847f8eSopenharmony_ci * 89561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 89661847f8eSopenharmony_ci * @atomicservice 89761847f8eSopenharmony_ci * @since 11 89861847f8eSopenharmony_ci */ 89961847f8eSopenharmony_ci class WebStorage { 90061847f8eSopenharmony_ci /** 90161847f8eSopenharmony_ci * Delete all the storage data. 90261847f8eSopenharmony_ci * 90361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 90461847f8eSopenharmony_ci * @since 9 90561847f8eSopenharmony_ci */ 90661847f8eSopenharmony_ci /** 90761847f8eSopenharmony_ci * Delete all the storage data. 90861847f8eSopenharmony_ci * 90961847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} delete all the storage data in incognito mode; 91061847f8eSopenharmony_ci * {@code false} otherwise. 91161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 91261847f8eSopenharmony_ci * @atomicservice 91361847f8eSopenharmony_ci * @since 11 91461847f8eSopenharmony_ci */ 91561847f8eSopenharmony_ci static deleteAllData(incognito?: boolean): void; 91661847f8eSopenharmony_ci 91761847f8eSopenharmony_ci /** 91861847f8eSopenharmony_ci * Delete the storage data with the origin. 91961847f8eSopenharmony_ci * 92061847f8eSopenharmony_ci * @param { string } origin - The origin which to be deleted. 92161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 92261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 92361847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 92461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 92561847f8eSopenharmony_ci * @since 9 92661847f8eSopenharmony_ci */ 92761847f8eSopenharmony_ci /** 92861847f8eSopenharmony_ci * Delete the storage data with the origin. 92961847f8eSopenharmony_ci * 93061847f8eSopenharmony_ci * @param { string } origin - The origin which to be deleted. 93161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 93261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 93361847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 93461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 93561847f8eSopenharmony_ci * @atomicservice 93661847f8eSopenharmony_ci * @since 11 93761847f8eSopenharmony_ci */ 93861847f8eSopenharmony_ci static deleteOrigin(origin: string): void; 93961847f8eSopenharmony_ci 94061847f8eSopenharmony_ci /** 94161847f8eSopenharmony_ci * Get current all the web storage origins. 94261847f8eSopenharmony_ci * @returns { Promise<Array<WebStorageOrigin>> } - returns all the WebStorageOrigin. 94361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 94461847f8eSopenharmony_ci * @throws { BusinessError } 17100012 - Invalid web storage origin. 94561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 94661847f8eSopenharmony_ci * @since 9 94761847f8eSopenharmony_ci */ 94861847f8eSopenharmony_ci /** 94961847f8eSopenharmony_ci * Get current all the web storage origins. 95061847f8eSopenharmony_ci * @returns { Promise<Array<WebStorageOrigin>> } - returns all the WebStorageOrigin. 95161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 95261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 95361847f8eSopenharmony_ci * @throws { BusinessError } 17100012 - Invalid web storage origin. 95461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 95561847f8eSopenharmony_ci * @atomicservice 95661847f8eSopenharmony_ci * @since 11 95761847f8eSopenharmony_ci */ 95861847f8eSopenharmony_ci static getOrigins(): Promise<Array<WebStorageOrigin>>; 95961847f8eSopenharmony_ci 96061847f8eSopenharmony_ci /** 96161847f8eSopenharmony_ci * Get current all the web storage origins. 96261847f8eSopenharmony_ci * @param { AsyncCallback<Array<WebStorageOrigin>> } callback - callback used to return all the WebStorageOrigin. 96361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 96461847f8eSopenharmony_ci * @throws { BusinessError } 17100012 - Invalid web storage origin. 96561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 96661847f8eSopenharmony_ci * @since 9 96761847f8eSopenharmony_ci */ 96861847f8eSopenharmony_ci /** 96961847f8eSopenharmony_ci * Get current all the web storage origins. 97061847f8eSopenharmony_ci * @param { AsyncCallback<Array<WebStorageOrigin>> } callback - callback used to return all the WebStorageOrigin. 97161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 97261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 97361847f8eSopenharmony_ci * @throws { BusinessError } 17100012 - Invalid web storage origin. 97461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 97561847f8eSopenharmony_ci * @atomicservice 97661847f8eSopenharmony_ci * @since 11 97761847f8eSopenharmony_ci */ 97861847f8eSopenharmony_ci static getOrigins(callback: AsyncCallback<Array<WebStorageOrigin>>): void; 97961847f8eSopenharmony_ci 98061847f8eSopenharmony_ci /** 98161847f8eSopenharmony_ci * Get the web storage quota with the origin. 98261847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 98361847f8eSopenharmony_ci * @returns { Promise<number> } - the promise returned by the function 98461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 98561847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 98661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 98761847f8eSopenharmony_ci * @since 9 98861847f8eSopenharmony_ci */ 98961847f8eSopenharmony_ci /** 99061847f8eSopenharmony_ci * Get the web storage quota with the origin. 99161847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 99261847f8eSopenharmony_ci * @returns { Promise<number> } - the promise returned by the function 99361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 99461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 99561847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 99661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 99761847f8eSopenharmony_ci * @atomicservice 99861847f8eSopenharmony_ci * @since 11 99961847f8eSopenharmony_ci */ 100061847f8eSopenharmony_ci static getOriginQuota(origin: string): Promise<number>; 100161847f8eSopenharmony_ci 100261847f8eSopenharmony_ci /** 100361847f8eSopenharmony_ci * Get the web storage quota with the origin. 100461847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 100561847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getOriginQuota. 100661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 100761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 100861847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 100961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 101061847f8eSopenharmony_ci * @since 9 101161847f8eSopenharmony_ci */ 101261847f8eSopenharmony_ci /** 101361847f8eSopenharmony_ci * Get the web storage quota with the origin. 101461847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 101561847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getOriginQuota. 101661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 101761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 101861847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 101961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 102061847f8eSopenharmony_ci * @atomicservice 102161847f8eSopenharmony_ci * @since 11 102261847f8eSopenharmony_ci */ 102361847f8eSopenharmony_ci static getOriginQuota(origin: string, callback: AsyncCallback<number>): void; 102461847f8eSopenharmony_ci 102561847f8eSopenharmony_ci /** 102661847f8eSopenharmony_ci * Get the web amount of storage with the origin. 102761847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 102861847f8eSopenharmony_ci * @returns { Promise<number> } - the promise returned by the function 102961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 103061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 103161847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 103261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 103361847f8eSopenharmony_ci * @since 9 103461847f8eSopenharmony_ci */ 103561847f8eSopenharmony_ci /** 103661847f8eSopenharmony_ci * Get the web amount of storage with the origin. 103761847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 103861847f8eSopenharmony_ci * @returns { Promise<number> } - the promise returned by the function 103961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 104061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 104161847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 104261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 104361847f8eSopenharmony_ci * @atomicservice 104461847f8eSopenharmony_ci * @since 11 104561847f8eSopenharmony_ci */ 104661847f8eSopenharmony_ci static getOriginUsage(origin: string): Promise<number>; 104761847f8eSopenharmony_ci 104861847f8eSopenharmony_ci /** 104961847f8eSopenharmony_ci * Get the web amount of storage with the origin. 105061847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 105161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getOriginUsage. 105261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 105361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 105461847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 105561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 105661847f8eSopenharmony_ci * @since 9 105761847f8eSopenharmony_ci */ 105861847f8eSopenharmony_ci /** 105961847f8eSopenharmony_ci * Get the web amount of storage with the origin. 106061847f8eSopenharmony_ci * @param { string } origin - The origin which to be inquired. 106161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getOriginUsage. 106261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 106361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 106461847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 106561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 106661847f8eSopenharmony_ci * @atomicservice 106761847f8eSopenharmony_ci * @since 11 106861847f8eSopenharmony_ci */ 106961847f8eSopenharmony_ci static getOriginUsage(origin: string, callback: AsyncCallback<number>): void; 107061847f8eSopenharmony_ci } 107161847f8eSopenharmony_ci 107261847f8eSopenharmony_ci /** 107361847f8eSopenharmony_ci * Provides methods for managing web database. 107461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 107561847f8eSopenharmony_ci * @since 9 107661847f8eSopenharmony_ci */ 107761847f8eSopenharmony_ci /** 107861847f8eSopenharmony_ci * Provides methods for managing web database. 107961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 108061847f8eSopenharmony_ci * @crossplatform 108161847f8eSopenharmony_ci * @atomicservice 108261847f8eSopenharmony_ci * @since 11 108361847f8eSopenharmony_ci */ 108461847f8eSopenharmony_ci class WebDataBase { 108561847f8eSopenharmony_ci /** 108661847f8eSopenharmony_ci * Get whether instances holds any http authentication credentials. 108761847f8eSopenharmony_ci * @returns { boolean } true if instances saved any http authentication credentials otherwise false. 108861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 108961847f8eSopenharmony_ci * @since 9 109061847f8eSopenharmony_ci */ 109161847f8eSopenharmony_ci /** 109261847f8eSopenharmony_ci * Get whether instances holds any http authentication credentials. 109361847f8eSopenharmony_ci * @returns { boolean } true if instances saved any http authentication credentials otherwise false. 109461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 109561847f8eSopenharmony_ci * @crossplatform 109661847f8eSopenharmony_ci * @atomicservice 109761847f8eSopenharmony_ci * @since 11 109861847f8eSopenharmony_ci */ 109961847f8eSopenharmony_ci static existHttpAuthCredentials(): boolean; 110061847f8eSopenharmony_ci 110161847f8eSopenharmony_ci /** 110261847f8eSopenharmony_ci * Delete all http authentication credentials. 110361847f8eSopenharmony_ci * 110461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 110561847f8eSopenharmony_ci * @since 9 110661847f8eSopenharmony_ci */ 110761847f8eSopenharmony_ci /** 110861847f8eSopenharmony_ci * Delete all http authentication credentials. 110961847f8eSopenharmony_ci * 111061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 111161847f8eSopenharmony_ci * @crossplatform 111261847f8eSopenharmony_ci * @atomicservice 111361847f8eSopenharmony_ci * @since 11 111461847f8eSopenharmony_ci */ 111561847f8eSopenharmony_ci static deleteHttpAuthCredentials(): void; 111661847f8eSopenharmony_ci 111761847f8eSopenharmony_ci /** 111861847f8eSopenharmony_ci * Get http authentication credentials. 111961847f8eSopenharmony_ci * @param { string } host - The host to which the credentials apply. 112061847f8eSopenharmony_ci * @param { string } realm - The realm to which the credentials apply. 112161847f8eSopenharmony_ci * @returns { Array<string> } Return an array containing username and password. 112261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 112361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 112461847f8eSopenharmony_ci * @since 9 112561847f8eSopenharmony_ci */ 112661847f8eSopenharmony_ci /** 112761847f8eSopenharmony_ci * Get http authentication credentials. 112861847f8eSopenharmony_ci * @param { string } host - The host to which the credentials apply. 112961847f8eSopenharmony_ci * @param { string } realm - The realm to which the credentials apply. 113061847f8eSopenharmony_ci * @returns { Array<string> } Return an array containing username and password. 113161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 113261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 113361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 113461847f8eSopenharmony_ci * @crossplatform 113561847f8eSopenharmony_ci * @atomicservice 113661847f8eSopenharmony_ci * @since 11 113761847f8eSopenharmony_ci */ 113861847f8eSopenharmony_ci static getHttpAuthCredentials(host: string, realm: string): Array<string>; 113961847f8eSopenharmony_ci 114061847f8eSopenharmony_ci /** 114161847f8eSopenharmony_ci * Save http authentication credentials. 114261847f8eSopenharmony_ci * @param { string } host - The host to which the credentials apply. 114361847f8eSopenharmony_ci * @param { string } realm - The realm to which the credentials apply. 114461847f8eSopenharmony_ci * @param { string } username - The username. 114561847f8eSopenharmony_ci * @param { string } password - The password. 114661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 114761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 114861847f8eSopenharmony_ci * @since 9 114961847f8eSopenharmony_ci */ 115061847f8eSopenharmony_ci /** 115161847f8eSopenharmony_ci * Save http authentication credentials. 115261847f8eSopenharmony_ci * @param { string } host - The host to which the credentials apply. 115361847f8eSopenharmony_ci * @param { string } realm - The realm to which the credentials apply. 115461847f8eSopenharmony_ci * @param { string } username - The username. 115561847f8eSopenharmony_ci * @param { string } password - The password. 115661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 115761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 115861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 115961847f8eSopenharmony_ci * @crossplatform 116061847f8eSopenharmony_ci * @atomicservice 116161847f8eSopenharmony_ci * @since 11 116261847f8eSopenharmony_ci */ 116361847f8eSopenharmony_ci static saveHttpAuthCredentials(host: string, realm: string, username: string, password: string): void; 116461847f8eSopenharmony_ci } 116561847f8eSopenharmony_ci 116661847f8eSopenharmony_ci /** 116761847f8eSopenharmony_ci * Provides a method for managing web geographic location permissions. 116861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 116961847f8eSopenharmony_ci * @since 9 117061847f8eSopenharmony_ci */ 117161847f8eSopenharmony_ci /** 117261847f8eSopenharmony_ci * Provides a method for managing web geographic location permissions. 117361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 117461847f8eSopenharmony_ci * @atomicservice 117561847f8eSopenharmony_ci * @since 11 117661847f8eSopenharmony_ci */ 117761847f8eSopenharmony_ci class GeolocationPermissions { 117861847f8eSopenharmony_ci /** 117961847f8eSopenharmony_ci * Allow geolocation permissions for specifies source. 118061847f8eSopenharmony_ci * @param { string } origin - Url source. 118161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 118261847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 118361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 118461847f8eSopenharmony_ci * @since 9 118561847f8eSopenharmony_ci */ 118661847f8eSopenharmony_ci /** 118761847f8eSopenharmony_ci * Allow geolocation permissions for specifies source. 118861847f8eSopenharmony_ci * @param { string } origin - Url source. 118961847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} Allow geolocation permissions for specifies source 119061847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 119161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 119261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 119361847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 119461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 119561847f8eSopenharmony_ci * @atomicservice 119661847f8eSopenharmony_ci * @since 11 119761847f8eSopenharmony_ci */ 119861847f8eSopenharmony_ci static allowGeolocation(origin: string, incognito?: boolean): void; 119961847f8eSopenharmony_ci 120061847f8eSopenharmony_ci /** 120161847f8eSopenharmony_ci * Delete geolocation permissions for specifies source. 120261847f8eSopenharmony_ci * @param { string } origin - Url source. 120361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 120461847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 120561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 120661847f8eSopenharmony_ci * @since 9 120761847f8eSopenharmony_ci */ 120861847f8eSopenharmony_ci /** 120961847f8eSopenharmony_ci * Delete geolocation permissions for specifies source. 121061847f8eSopenharmony_ci * @param { string } origin - Url source. 121161847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} delete geolocation permissions for specifies source 121261847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 121361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 121461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 121561847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 121661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 121761847f8eSopenharmony_ci * @atomicservice 121861847f8eSopenharmony_ci * @since 11 121961847f8eSopenharmony_ci */ 122061847f8eSopenharmony_ci static deleteGeolocation(origin: string, incognito?: boolean): void; 122161847f8eSopenharmony_ci 122261847f8eSopenharmony_ci /** 122361847f8eSopenharmony_ci * Delete all geolocation permissions. 122461847f8eSopenharmony_ci * 122561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 122661847f8eSopenharmony_ci * @since 9 122761847f8eSopenharmony_ci */ 122861847f8eSopenharmony_ci /** 122961847f8eSopenharmony_ci * Delete all geolocation permissions. 123061847f8eSopenharmony_ci * 123161847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} delete all geolocation in incognito mode; 123261847f8eSopenharmony_ci * {@code false} otherwise. 123361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 123461847f8eSopenharmony_ci * @atomicservice 123561847f8eSopenharmony_ci * @since 11 123661847f8eSopenharmony_ci */ 123761847f8eSopenharmony_ci static deleteAllGeolocation(incognito?: boolean): void; 123861847f8eSopenharmony_ci 123961847f8eSopenharmony_ci /** 124061847f8eSopenharmony_ci * Gets the geolocation permission status of the specified source. 124161847f8eSopenharmony_ci * @param { string } origin - Url source. 124261847f8eSopenharmony_ci * @returns { Promise<boolean> } A Promise instance that obtains the permission 124361847f8eSopenharmony_ci * status of the specified source and obtains successfully, 124461847f8eSopenharmony_ci * true for authorization, false for access denial. Failed 124561847f8eSopenharmony_ci * to get, indicating that the permission status of the 124661847f8eSopenharmony_ci * specified source does not exist. 124761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 124861847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 124961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 125061847f8eSopenharmony_ci * @since 9 125161847f8eSopenharmony_ci */ 125261847f8eSopenharmony_ci /** 125361847f8eSopenharmony_ci * Gets the geolocation permission status of the specified source. 125461847f8eSopenharmony_ci * @param { string } origin - Url source. 125561847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} gets the geolocation permission status of the 125661847f8eSopenharmony_ci * specified source in incognito mode; {@code false} otherwise. 125761847f8eSopenharmony_ci * @returns { Promise<boolean> } A Promise instance that obtains the permission 125861847f8eSopenharmony_ci * status of the specified source and obtains successfully, 125961847f8eSopenharmony_ci * true for authorization, false for access denial. Failed 126061847f8eSopenharmony_ci * to get, indicating that the permission status of the 126161847f8eSopenharmony_ci * specified source does not exist. 126261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 126361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 126461847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 126561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 126661847f8eSopenharmony_ci * @atomicservice 126761847f8eSopenharmony_ci * @since 11 126861847f8eSopenharmony_ci */ 126961847f8eSopenharmony_ci static getAccessibleGeolocation(origin: string, incognito?: boolean): Promise<boolean>; 127061847f8eSopenharmony_ci 127161847f8eSopenharmony_ci /** 127261847f8eSopenharmony_ci * Gets the geolocation permission status of the specified source. 127361847f8eSopenharmony_ci * @param { string } origin - Url source. 127461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Returns the geolocation permission status for 127561847f8eSopenharmony_ci * the specified source. Successful acquisition, 127661847f8eSopenharmony_ci * true means authorized, false means access is 127761847f8eSopenharmony_ci * denied. Failed to get, indicating that the 127861847f8eSopenharmony_ci * permission status of the specified source does 127961847f8eSopenharmony_ci * not exist. 128061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 128161847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 128261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 128361847f8eSopenharmony_ci * @since 9 128461847f8eSopenharmony_ci */ 128561847f8eSopenharmony_ci /** 128661847f8eSopenharmony_ci * Gets the geolocation permission status of the specified source. 128761847f8eSopenharmony_ci * @param { string } origin - Url source. 128861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Returns the geolocation permission status for 128961847f8eSopenharmony_ci * the specified source. Successful acquisition, 129061847f8eSopenharmony_ci * true means authorized, false means access is 129161847f8eSopenharmony_ci * denied. Failed to get, indicating that the 129261847f8eSopenharmony_ci * permission status of the specified source does 129361847f8eSopenharmony_ci * not exist. 129461847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} gets the geolocation permission status of the 129561847f8eSopenharmony_ci * specified source in incognito mode; {@code false} otherwise. 129661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 129761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 129861847f8eSopenharmony_ci * @throws { BusinessError } 17100011 - Invalid origin. 129961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 130061847f8eSopenharmony_ci * @atomicservice 130161847f8eSopenharmony_ci * @since 11 130261847f8eSopenharmony_ci */ 130361847f8eSopenharmony_ci static getAccessibleGeolocation(origin: string, callback: AsyncCallback<boolean>, incognito?: boolean): void; 130461847f8eSopenharmony_ci 130561847f8eSopenharmony_ci /** 130661847f8eSopenharmony_ci * Get all stored geolocation permission url source. 130761847f8eSopenharmony_ci * 130861847f8eSopenharmony_ci * @returns { Promise<Array<string>> } A Promise instance that gets all source information about 130961847f8eSopenharmony_ci * the stored geolocation permission state. 131061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 131161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 131261847f8eSopenharmony_ci * @since 9 131361847f8eSopenharmony_ci */ 131461847f8eSopenharmony_ci /** 131561847f8eSopenharmony_ci * Get all stored geolocation permission url source. 131661847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} get all stored geolocation permission url source 131761847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 131861847f8eSopenharmony_ci * @returns { Promise<Array<string>> } A Promise instance that gets all source information about 131961847f8eSopenharmony_ci * the stored geolocation permission state. 132061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 132161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 132261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 132361847f8eSopenharmony_ci * @atomicservice 132461847f8eSopenharmony_ci * @since 11 132561847f8eSopenharmony_ci */ 132661847f8eSopenharmony_ci static getStoredGeolocation(incognito?: boolean): Promise<Array<string>>; 132761847f8eSopenharmony_ci 132861847f8eSopenharmony_ci /** 132961847f8eSopenharmony_ci * Get all stored geolocation permission url source. 133061847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - Returns all source information for 133161847f8eSopenharmony_ci * stored geolocation permission states. 133261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 133361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 133461847f8eSopenharmony_ci * @since 9 133561847f8eSopenharmony_ci */ 133661847f8eSopenharmony_ci /** 133761847f8eSopenharmony_ci * Get all stored geolocation permission url source. 133861847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - Returns all source information for 133961847f8eSopenharmony_ci * stored geolocation permission states. 134061847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} gets all stored geolocation permission url 134161847f8eSopenharmony_ci * source in incognito mode; {@code false} otherwise. 134261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 134361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 134461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 134561847f8eSopenharmony_ci * @atomicservice 134661847f8eSopenharmony_ci * @since 11 134761847f8eSopenharmony_ci */ 134861847f8eSopenharmony_ci static getStoredGeolocation(callback: AsyncCallback<Array<string>>, incognito?: boolean): void; 134961847f8eSopenharmony_ci } 135061847f8eSopenharmony_ci 135161847f8eSopenharmony_ci /** 135261847f8eSopenharmony_ci * Provides methods for managing the web cookies. 135361847f8eSopenharmony_ci * 135461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 135561847f8eSopenharmony_ci * @since 9 135661847f8eSopenharmony_ci */ 135761847f8eSopenharmony_ci /** 135861847f8eSopenharmony_ci * Provides methods for managing the web cookies. 135961847f8eSopenharmony_ci * 136061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 136161847f8eSopenharmony_ci * @crossplatform 136261847f8eSopenharmony_ci * @atomicservice 136361847f8eSopenharmony_ci * @since 11 136461847f8eSopenharmony_ci */ 136561847f8eSopenharmony_ci class WebCookieManager { 136661847f8eSopenharmony_ci /** 136761847f8eSopenharmony_ci * Gets all cookies for the given URL. 136861847f8eSopenharmony_ci * 136961847f8eSopenharmony_ci * @param { string } url - The URL for which the cookies are requested. 137061847f8eSopenharmony_ci * @returns { string } - The cookie value for the given URL. 137161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 137261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 137361847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 137461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 137561847f8eSopenharmony_ci * @since 9 137661847f8eSopenharmony_ci * @deprecated since 11 137761847f8eSopenharmony_ci * @useinstead ohos.web.webview.WebCookieManager#fetchCookieSync 137861847f8eSopenharmony_ci */ 137961847f8eSopenharmony_ci static getCookie(url: string): string; 138061847f8eSopenharmony_ci 138161847f8eSopenharmony_ci /** 138261847f8eSopenharmony_ci * Gets all cookies for the given URL. 138361847f8eSopenharmony_ci * 138461847f8eSopenharmony_ci * @param { string } url - The URL for which the cookies are requested. 138561847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} gets all cookies for the given URL 138661847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 138761847f8eSopenharmony_ci * @returns { string } - The cookie value for the given URL. 138861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 138961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 139061847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 139161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 139261847f8eSopenharmony_ci * @atomicservice 139361847f8eSopenharmony_ci * @since 11 139461847f8eSopenharmony_ci */ 139561847f8eSopenharmony_ci static fetchCookieSync(url: string, incognito?: boolean): string; 139661847f8eSopenharmony_ci 139761847f8eSopenharmony_ci /** 139861847f8eSopenharmony_ci * Gets all cookies for the given URL Asynchronously. 139961847f8eSopenharmony_ci * 140061847f8eSopenharmony_ci * @param { string } url - The URL for which the cookies are requested. 140161847f8eSopenharmony_ci * @returns { Promise<string> } - A promise resolved after the cookies of given URL have been gotten. 140261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 140361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 140461847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 140561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 140661847f8eSopenharmony_ci * @crossplatform 140761847f8eSopenharmony_ci * @atomicservice 140861847f8eSopenharmony_ci * @since 11 140961847f8eSopenharmony_ci */ 141061847f8eSopenharmony_ci static fetchCookie(url: string): Promise<string>; 141161847f8eSopenharmony_ci 141261847f8eSopenharmony_ci /** 141361847f8eSopenharmony_ci * Gets all cookies for the given URL Asynchronously. 141461847f8eSopenharmony_ci * 141561847f8eSopenharmony_ci * @param { string } url - The URL for which the cookies are requested. 141661847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} gets all cookies for the given URL 141761847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 141861847f8eSopenharmony_ci * @returns { Promise<string> } - A promise resolved after the cookies of given URL have been gotten. 141961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 142061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 142161847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 142261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 142361847f8eSopenharmony_ci * @since 14 142461847f8eSopenharmony_ci */ 142561847f8eSopenharmony_ci static fetchCookie(url: string, incognito: boolean): Promise<string>; 142661847f8eSopenharmony_ci 142761847f8eSopenharmony_ci /** 142861847f8eSopenharmony_ci * Gets all cookies for the given URL Asynchronously. 142961847f8eSopenharmony_ci * 143061847f8eSopenharmony_ci * @param { string } url - The URL for which the cookies are requested. 143161847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Called after the cookies of given URL have been gotten. 143261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 143361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 143461847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 143561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 143661847f8eSopenharmony_ci * @crossplatform 143761847f8eSopenharmony_ci * @atomicservice 143861847f8eSopenharmony_ci * @since 11 143961847f8eSopenharmony_ci */ 144061847f8eSopenharmony_ci static fetchCookie(url: string, callback: AsyncCallback<string>): void; 144161847f8eSopenharmony_ci 144261847f8eSopenharmony_ci /** 144361847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL. 144461847f8eSopenharmony_ci * 144561847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 144661847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 144761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 144861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 144961847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 145061847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 145161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 145261847f8eSopenharmony_ci * @since 9 145361847f8eSopenharmony_ci * @deprecated since 11 145461847f8eSopenharmony_ci * @useinstead ohos.web.webview.WebCookieManager#configCookieSync 145561847f8eSopenharmony_ci */ 145661847f8eSopenharmony_ci static setCookie(url: string, value: string): void; 145761847f8eSopenharmony_ci 145861847f8eSopenharmony_ci /** 145961847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL. 146061847f8eSopenharmony_ci * 146161847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 146261847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 146361847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL 146461847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 146561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 146661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 146761847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 146861847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 146961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 147061847f8eSopenharmony_ci * @atomicservice 147161847f8eSopenharmony_ci * @since 11 147261847f8eSopenharmony_ci */ 147361847f8eSopenharmony_ci static configCookieSync(url: string, value: string, incognito?: boolean): void; 147461847f8eSopenharmony_ci 147561847f8eSopenharmony_ci /** 147661847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL. 147761847f8eSopenharmony_ci * 147861847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 147961847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 148061847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL 148161847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 148261847f8eSopenharmony_ci * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; 148361847f8eSopenharmony_ci * {@code false} otherwise. 148461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 148561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 148661847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 148761847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 148861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 148961847f8eSopenharmony_ci * @since 14 149061847f8eSopenharmony_ci */ 149161847f8eSopenharmony_ci static configCookieSync(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): void; 149261847f8eSopenharmony_ci 149361847f8eSopenharmony_ci /** 149461847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL Asynchronously. 149561847f8eSopenharmony_ci * 149661847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 149761847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 149861847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies of given URL have been set. 149961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 150061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 150161847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 150261847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 150361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 150461847f8eSopenharmony_ci * @crossplatform 150561847f8eSopenharmony_ci * @atomicservice 150661847f8eSopenharmony_ci * @since 11 150761847f8eSopenharmony_ci */ 150861847f8eSopenharmony_ci static configCookie(url: string, value: string): Promise<void>; 150961847f8eSopenharmony_ci 151061847f8eSopenharmony_ci /** 151161847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL Asynchronously. 151261847f8eSopenharmony_ci * 151361847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 151461847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 151561847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL 151661847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 151761847f8eSopenharmony_ci * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; 151861847f8eSopenharmony_ci * {@code false} otherwise. 151961847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies of given URL have been set. 152061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 152161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 152261847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 152361847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 152461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 152561847f8eSopenharmony_ci * @since 14 152661847f8eSopenharmony_ci */ 152761847f8eSopenharmony_ci static configCookie(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): Promise<void>; 152861847f8eSopenharmony_ci 152961847f8eSopenharmony_ci /** 153061847f8eSopenharmony_ci * Set a single cookie (key-value pair) for the given URL Asynchronously. 153161847f8eSopenharmony_ci * 153261847f8eSopenharmony_ci * @param { string } url - The URL for which the cookie is to be set. 153361847f8eSopenharmony_ci * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. 153461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Called after the cookies have been set. 153561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 153661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 153761847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 153861847f8eSopenharmony_ci * @throws { BusinessError } 17100005 - Invalid cookie value. 153961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 154061847f8eSopenharmony_ci * @crossplatform 154161847f8eSopenharmony_ci * @atomicservice 154261847f8eSopenharmony_ci * @since 11 154361847f8eSopenharmony_ci */ 154461847f8eSopenharmony_ci static configCookie(url: string, value: string, callback: AsyncCallback<void>): void; 154561847f8eSopenharmony_ci 154661847f8eSopenharmony_ci /** 154761847f8eSopenharmony_ci * Save the cookies Asynchronously. 154861847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies have been saved. 154961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 155061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 155161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 155261847f8eSopenharmony_ci * @since 9 155361847f8eSopenharmony_ci */ 155461847f8eSopenharmony_ci /** 155561847f8eSopenharmony_ci * Save the cookies Asynchronously. 155661847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies have been saved. 155761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 155861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 155961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 156061847f8eSopenharmony_ci * @atomicservice 156161847f8eSopenharmony_ci * @since 11 156261847f8eSopenharmony_ci */ 156361847f8eSopenharmony_ci static saveCookieAsync(): Promise<void>; 156461847f8eSopenharmony_ci 156561847f8eSopenharmony_ci /** 156661847f8eSopenharmony_ci * Save the cookies Asynchronously. 156761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Called after the cookies have been saved. 156861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 156961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 157061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 157161847f8eSopenharmony_ci * @since 9 157261847f8eSopenharmony_ci */ 157361847f8eSopenharmony_ci /** 157461847f8eSopenharmony_ci * Save the cookies Asynchronously. 157561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Called after the cookies have been saved. 157661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 157761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 157861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 157961847f8eSopenharmony_ci * @atomicservice 158061847f8eSopenharmony_ci * @since 11 158161847f8eSopenharmony_ci */ 158261847f8eSopenharmony_ci static saveCookieAsync(callback: AsyncCallback<void>): void; 158361847f8eSopenharmony_ci 158461847f8eSopenharmony_ci /** 158561847f8eSopenharmony_ci * Get whether the instance can send and accept cookies. 158661847f8eSopenharmony_ci * 158761847f8eSopenharmony_ci * @returns { boolean } True if the instance can send and accept cookies else false. 158861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 158961847f8eSopenharmony_ci * @since 9 159061847f8eSopenharmony_ci */ 159161847f8eSopenharmony_ci /** 159261847f8eSopenharmony_ci * Get whether the instance can send and accept cookies. 159361847f8eSopenharmony_ci * 159461847f8eSopenharmony_ci * @returns { boolean } True if the instance can send and accept cookies else false. 159561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 159661847f8eSopenharmony_ci * @atomicservice 159761847f8eSopenharmony_ci * @since 11 159861847f8eSopenharmony_ci */ 159961847f8eSopenharmony_ci static isCookieAllowed(): boolean; 160061847f8eSopenharmony_ci 160161847f8eSopenharmony_ci /** 160261847f8eSopenharmony_ci * Set whether the instance should send and accept cookies. 160361847f8eSopenharmony_ci * By default this is set to be true. 160461847f8eSopenharmony_ci * 160561847f8eSopenharmony_ci * @param { boolean } accept - Whether the instance should send and accept cookies. 160661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 160761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 160861847f8eSopenharmony_ci * @since 9 160961847f8eSopenharmony_ci */ 161061847f8eSopenharmony_ci /** 161161847f8eSopenharmony_ci * Set whether the instance should send and accept cookies. 161261847f8eSopenharmony_ci * By default this is set to be true. 161361847f8eSopenharmony_ci * 161461847f8eSopenharmony_ci * @param { boolean } accept - Whether the instance should send and accept cookies. 161561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 161661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 161761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 161861847f8eSopenharmony_ci * @atomicservice 161961847f8eSopenharmony_ci * @since 11 162061847f8eSopenharmony_ci */ 162161847f8eSopenharmony_ci static putAcceptCookieEnabled(accept: boolean): void; 162261847f8eSopenharmony_ci 162361847f8eSopenharmony_ci /** 162461847f8eSopenharmony_ci * Get whether the instance can send and accept thirdparty cookies. 162561847f8eSopenharmony_ci * 162661847f8eSopenharmony_ci * @returns { boolean } True if the instance can send and accept thirdparty cookies else false. 162761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 162861847f8eSopenharmony_ci * @since 9 162961847f8eSopenharmony_ci */ 163061847f8eSopenharmony_ci /** 163161847f8eSopenharmony_ci * Get whether the instance can send and accept thirdparty cookies. 163261847f8eSopenharmony_ci * 163361847f8eSopenharmony_ci * @returns { boolean } True if the instance can send and accept thirdparty cookies else false. 163461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 163561847f8eSopenharmony_ci * @atomicservice 163661847f8eSopenharmony_ci * @since 11 163761847f8eSopenharmony_ci */ 163861847f8eSopenharmony_ci static isThirdPartyCookieAllowed(): boolean; 163961847f8eSopenharmony_ci 164061847f8eSopenharmony_ci /** 164161847f8eSopenharmony_ci * Set whether the instance should send and accept thirdparty cookies. 164261847f8eSopenharmony_ci * By default this is set to be false. 164361847f8eSopenharmony_ci * 164461847f8eSopenharmony_ci * @param { boolean } accept - Whether the instance should send and accept thirdparty cookies. 164561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 164661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 164761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 164861847f8eSopenharmony_ci * @since 9 164961847f8eSopenharmony_ci */ 165061847f8eSopenharmony_ci /** 165161847f8eSopenharmony_ci * Set whether the instance should send and accept thirdparty cookies. 165261847f8eSopenharmony_ci * By default this is set to be false. 165361847f8eSopenharmony_ci * 165461847f8eSopenharmony_ci * @param { boolean } accept - Whether the instance should send and accept thirdparty cookies. 165561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 165661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 165761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 165861847f8eSopenharmony_ci * @atomicservice 165961847f8eSopenharmony_ci * @since 11 166061847f8eSopenharmony_ci */ 166161847f8eSopenharmony_ci static putAcceptThirdPartyCookieEnabled(accept: boolean): void; 166261847f8eSopenharmony_ci 166361847f8eSopenharmony_ci /** 166461847f8eSopenharmony_ci * Check whether exists any cookies. 166561847f8eSopenharmony_ci * 166661847f8eSopenharmony_ci * @returns { boolean } True if exists more than one cookie else false; 166761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 166861847f8eSopenharmony_ci * @since 9 166961847f8eSopenharmony_ci */ 167061847f8eSopenharmony_ci /** 167161847f8eSopenharmony_ci * Check whether exists any cookies. 167261847f8eSopenharmony_ci * 167361847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} check whether exists any cookies. 167461847f8eSopenharmony_ci * in incognito mode; {@code false} otherwise. 167561847f8eSopenharmony_ci * @returns { boolean } True if exists more than one cookie else false; 167661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 167761847f8eSopenharmony_ci * @atomicservice 167861847f8eSopenharmony_ci * @since 11 167961847f8eSopenharmony_ci */ 168061847f8eSopenharmony_ci static existCookie(incognito?: boolean): boolean; 168161847f8eSopenharmony_ci 168261847f8eSopenharmony_ci /** 168361847f8eSopenharmony_ci * Remove all cookies. 168461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 168561847f8eSopenharmony_ci * @since 9 168661847f8eSopenharmony_ci * @deprecated since 11 168761847f8eSopenharmony_ci * @useinstead ohos.web.webview.WebCookieManager#clearAllCookiesSync 168861847f8eSopenharmony_ci */ 168961847f8eSopenharmony_ci static deleteEntireCookie(): void; 169061847f8eSopenharmony_ci 169161847f8eSopenharmony_ci /** 169261847f8eSopenharmony_ci * Remove all cookies. 169361847f8eSopenharmony_ci * 169461847f8eSopenharmony_ci * @param { boolean } incognito - {@code true} remove all cookies in incognito mode; 169561847f8eSopenharmony_ci * {@code false} otherwise. 169661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 169761847f8eSopenharmony_ci * @atomicservice 169861847f8eSopenharmony_ci * @since 11 169961847f8eSopenharmony_ci */ 170061847f8eSopenharmony_ci static clearAllCookiesSync(incognito?: boolean): void; 170161847f8eSopenharmony_ci 170261847f8eSopenharmony_ci /** 170361847f8eSopenharmony_ci * Remove all cookies Asynchronously. 170461847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies have been deleted. 170561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 170661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 170761847f8eSopenharmony_ci * @crossplatform 170861847f8eSopenharmony_ci * @atomicservice 170961847f8eSopenharmony_ci * @since 11 171061847f8eSopenharmony_ci */ 171161847f8eSopenharmony_ci static clearAllCookies(): Promise<void>; 171261847f8eSopenharmony_ci 171361847f8eSopenharmony_ci /** 171461847f8eSopenharmony_ci * Remove all cookies Asynchronously. 171561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Called after the cookies have been deleted. 171661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 171761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 171861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 171961847f8eSopenharmony_ci * @crossplatform 172061847f8eSopenharmony_ci * @atomicservice 172161847f8eSopenharmony_ci * @since 11 172261847f8eSopenharmony_ci */ 172361847f8eSopenharmony_ci static clearAllCookies(callback: AsyncCallback<void>): void; 172461847f8eSopenharmony_ci 172561847f8eSopenharmony_ci /** 172661847f8eSopenharmony_ci * Delete the session cookies. 172761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 172861847f8eSopenharmony_ci * @since 9 172961847f8eSopenharmony_ci * @deprecated since 11 173061847f8eSopenharmony_ci * @useinstead ohos.web.webview.WebCookieManager#clearSessionCookieSync 173161847f8eSopenharmony_ci */ 173261847f8eSopenharmony_ci static deleteSessionCookie(): void; 173361847f8eSopenharmony_ci 173461847f8eSopenharmony_ci /** 173561847f8eSopenharmony_ci * Delete the session cookies. 173661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 173761847f8eSopenharmony_ci * @atomicservice 173861847f8eSopenharmony_ci * @since 11 173961847f8eSopenharmony_ci */ 174061847f8eSopenharmony_ci static clearSessionCookieSync(): void; 174161847f8eSopenharmony_ci 174261847f8eSopenharmony_ci /** 174361847f8eSopenharmony_ci * Delete the session cookies Asynchronously. 174461847f8eSopenharmony_ci * @returns { Promise<void> } - A promise resolved after the cookies have been deleted. 174561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 174661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 174761847f8eSopenharmony_ci * @atomicservice 174861847f8eSopenharmony_ci * @since 11 174961847f8eSopenharmony_ci */ 175061847f8eSopenharmony_ci static clearSessionCookie(): Promise<void>; 175161847f8eSopenharmony_ci 175261847f8eSopenharmony_ci /** 175361847f8eSopenharmony_ci * Delete the session cookies Asynchronously. 175461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Called after the cookies have been deleted. 175561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 175661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 175761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 175861847f8eSopenharmony_ci * @atomicservice 175961847f8eSopenharmony_ci * @since 11 176061847f8eSopenharmony_ci */ 176161847f8eSopenharmony_ci static clearSessionCookie(callback: AsyncCallback<void>): void; 176261847f8eSopenharmony_ci } 176361847f8eSopenharmony_ci 176461847f8eSopenharmony_ci /** 176561847f8eSopenharmony_ci * Enum type supplied to {@link onMessageEventExt} for indicating the type of web message. 176661847f8eSopenharmony_ci * 176761847f8eSopenharmony_ci * @enum {number} 176861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 176961847f8eSopenharmony_ci * @since 10 177061847f8eSopenharmony_ci */ 177161847f8eSopenharmony_ci /** 177261847f8eSopenharmony_ci * Enum type supplied to {@link onMessageEventExt} for indicating the type of web message. 177361847f8eSopenharmony_ci * 177461847f8eSopenharmony_ci * @enum {number} 177561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 177661847f8eSopenharmony_ci * @atomicservice 177761847f8eSopenharmony_ci * @since 11 177861847f8eSopenharmony_ci */ 177961847f8eSopenharmony_ci enum WebMessageType { 178061847f8eSopenharmony_ci /** 178161847f8eSopenharmony_ci * Unsupported data type. 178261847f8eSopenharmony_ci * 178361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 178461847f8eSopenharmony_ci * @since 10 178561847f8eSopenharmony_ci */ 178661847f8eSopenharmony_ci /** 178761847f8eSopenharmony_ci * Unsupported data type. 178861847f8eSopenharmony_ci * 178961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 179061847f8eSopenharmony_ci * @atomicservice 179161847f8eSopenharmony_ci * @since 11 179261847f8eSopenharmony_ci */ 179361847f8eSopenharmony_ci NOT_SUPPORT, 179461847f8eSopenharmony_ci 179561847f8eSopenharmony_ci /** 179661847f8eSopenharmony_ci * The string data type. 179761847f8eSopenharmony_ci * 179861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 179961847f8eSopenharmony_ci * @since 10 180061847f8eSopenharmony_ci */ 180161847f8eSopenharmony_ci /** 180261847f8eSopenharmony_ci * The string data type. 180361847f8eSopenharmony_ci * 180461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 180561847f8eSopenharmony_ci * @atomicservice 180661847f8eSopenharmony_ci * @since 11 180761847f8eSopenharmony_ci */ 180861847f8eSopenharmony_ci STRING, 180961847f8eSopenharmony_ci 181061847f8eSopenharmony_ci /** 181161847f8eSopenharmony_ci * The number data type. 181261847f8eSopenharmony_ci * 181361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 181461847f8eSopenharmony_ci * @since 10 181561847f8eSopenharmony_ci */ 181661847f8eSopenharmony_ci /** 181761847f8eSopenharmony_ci * The number data type. 181861847f8eSopenharmony_ci * 181961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 182061847f8eSopenharmony_ci * @atomicservice 182161847f8eSopenharmony_ci * @since 11 182261847f8eSopenharmony_ci */ 182361847f8eSopenharmony_ci NUMBER, 182461847f8eSopenharmony_ci 182561847f8eSopenharmony_ci /** 182661847f8eSopenharmony_ci * The boolean data type. 182761847f8eSopenharmony_ci * 182861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 182961847f8eSopenharmony_ci * @since 10 183061847f8eSopenharmony_ci */ 183161847f8eSopenharmony_ci /** 183261847f8eSopenharmony_ci * The boolean data type. 183361847f8eSopenharmony_ci * 183461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 183561847f8eSopenharmony_ci * @atomicservice 183661847f8eSopenharmony_ci * @since 11 183761847f8eSopenharmony_ci */ 183861847f8eSopenharmony_ci BOOLEAN, 183961847f8eSopenharmony_ci 184061847f8eSopenharmony_ci /** 184161847f8eSopenharmony_ci * The arraybuffer data type. 184261847f8eSopenharmony_ci * 184361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 184461847f8eSopenharmony_ci * @since 10 184561847f8eSopenharmony_ci */ 184661847f8eSopenharmony_ci /** 184761847f8eSopenharmony_ci * The arraybuffer data type. 184861847f8eSopenharmony_ci * 184961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 185061847f8eSopenharmony_ci * @atomicservice 185161847f8eSopenharmony_ci * @since 11 185261847f8eSopenharmony_ci */ 185361847f8eSopenharmony_ci ARRAY_BUFFER, 185461847f8eSopenharmony_ci 185561847f8eSopenharmony_ci /** 185661847f8eSopenharmony_ci * The array data type. 185761847f8eSopenharmony_ci * 185861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 185961847f8eSopenharmony_ci * @since 10 186061847f8eSopenharmony_ci */ 186161847f8eSopenharmony_ci /** 186261847f8eSopenharmony_ci * The array data type. 186361847f8eSopenharmony_ci * 186461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 186561847f8eSopenharmony_ci * @atomicservice 186661847f8eSopenharmony_ci * @since 11 186761847f8eSopenharmony_ci */ 186861847f8eSopenharmony_ci ARRAY, 186961847f8eSopenharmony_ci 187061847f8eSopenharmony_ci /** 187161847f8eSopenharmony_ci * The error data type. 187261847f8eSopenharmony_ci * 187361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 187461847f8eSopenharmony_ci * @since 10 187561847f8eSopenharmony_ci */ 187661847f8eSopenharmony_ci /** 187761847f8eSopenharmony_ci * The error data type. 187861847f8eSopenharmony_ci * 187961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 188061847f8eSopenharmony_ci * @atomicservice 188161847f8eSopenharmony_ci * @since 11 188261847f8eSopenharmony_ci */ 188361847f8eSopenharmony_ci ERROR 188461847f8eSopenharmony_ci } 188561847f8eSopenharmony_ci 188661847f8eSopenharmony_ci /** 188761847f8eSopenharmony_ci * The message received or sent from web message port. 188861847f8eSopenharmony_ci * 188961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 189061847f8eSopenharmony_ci * @since 10 189161847f8eSopenharmony_ci */ 189261847f8eSopenharmony_ci /** 189361847f8eSopenharmony_ci * The message received or sent from web message port. 189461847f8eSopenharmony_ci * 189561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 189661847f8eSopenharmony_ci * @atomicservice 189761847f8eSopenharmony_ci * @since 11 189861847f8eSopenharmony_ci */ 189961847f8eSopenharmony_ci class WebMessageExt { 190061847f8eSopenharmony_ci /** 190161847f8eSopenharmony_ci * Get the type of the web message. 190261847f8eSopenharmony_ci * @returns { WebMessageType } - Returns data of WebMessageType type 190361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 190461847f8eSopenharmony_ci * @since 10 190561847f8eSopenharmony_ci */ 190661847f8eSopenharmony_ci /** 190761847f8eSopenharmony_ci * Get the type of the web message. 190861847f8eSopenharmony_ci * @returns { WebMessageType } - Returns data of WebMessageType type 190961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 191061847f8eSopenharmony_ci * @atomicservice 191161847f8eSopenharmony_ci * @since 11 191261847f8eSopenharmony_ci */ 191361847f8eSopenharmony_ci getType(): WebMessageType; 191461847f8eSopenharmony_ci 191561847f8eSopenharmony_ci /** 191661847f8eSopenharmony_ci * Get the string value of the web message. 191761847f8eSopenharmony_ci * @returns { string } - Returns data of string type 191861847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 191961847f8eSopenharmony_ci * 192061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 192161847f8eSopenharmony_ci * @since 10 192261847f8eSopenharmony_ci */ 192361847f8eSopenharmony_ci /** 192461847f8eSopenharmony_ci * Get the string value of the web message. 192561847f8eSopenharmony_ci * @returns { string } - Returns data of string type 192661847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 192761847f8eSopenharmony_ci * 192861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 192961847f8eSopenharmony_ci * @atomicservice 193061847f8eSopenharmony_ci * @since 11 193161847f8eSopenharmony_ci */ 193261847f8eSopenharmony_ci getString(): string; 193361847f8eSopenharmony_ci 193461847f8eSopenharmony_ci /** 193561847f8eSopenharmony_ci * Get the number value of the web message. 193661847f8eSopenharmony_ci * @returns { number } - Returns data of number type 193761847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 193861847f8eSopenharmony_ci * 193961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 194061847f8eSopenharmony_ci * @since 10 194161847f8eSopenharmony_ci */ 194261847f8eSopenharmony_ci /** 194361847f8eSopenharmony_ci * Get the number value of the web message. 194461847f8eSopenharmony_ci * @returns { number } - Returns data of number type 194561847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 194661847f8eSopenharmony_ci * 194761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 194861847f8eSopenharmony_ci * @atomicservice 194961847f8eSopenharmony_ci * @since 11 195061847f8eSopenharmony_ci */ 195161847f8eSopenharmony_ci getNumber(): number; 195261847f8eSopenharmony_ci 195361847f8eSopenharmony_ci /** 195461847f8eSopenharmony_ci * Get the boolean value of the web message. 195561847f8eSopenharmony_ci * @returns { boolean } - Returns data of Boolean type 195661847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 195761847f8eSopenharmony_ci * 195861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 195961847f8eSopenharmony_ci * @since 10 196061847f8eSopenharmony_ci */ 196161847f8eSopenharmony_ci /** 196261847f8eSopenharmony_ci * Get the boolean value of the web message. 196361847f8eSopenharmony_ci * @returns { boolean } - Returns data of Boolean type 196461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 196561847f8eSopenharmony_ci * 196661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 196761847f8eSopenharmony_ci * @atomicservice 196861847f8eSopenharmony_ci * @since 11 196961847f8eSopenharmony_ci */ 197061847f8eSopenharmony_ci getBoolean(): boolean; 197161847f8eSopenharmony_ci 197261847f8eSopenharmony_ci /** 197361847f8eSopenharmony_ci * Get the array buffer value of the web message. 197461847f8eSopenharmony_ci * @returns { ArrayBuffer } - Returns data of ArrayBuffer type 197561847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 197661847f8eSopenharmony_ci * 197761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 197861847f8eSopenharmony_ci * @since 10 197961847f8eSopenharmony_ci */ 198061847f8eSopenharmony_ci /** 198161847f8eSopenharmony_ci * Get the array buffer value of the web message. 198261847f8eSopenharmony_ci * @returns { ArrayBuffer } - Returns data of ArrayBuffer type 198361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 198461847f8eSopenharmony_ci * 198561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 198661847f8eSopenharmony_ci * @atomicservice 198761847f8eSopenharmony_ci * @since 11 198861847f8eSopenharmony_ci */ 198961847f8eSopenharmony_ci getArrayBuffer(): ArrayBuffer; 199061847f8eSopenharmony_ci 199161847f8eSopenharmony_ci /** 199261847f8eSopenharmony_ci * Get the array value of the web message. 199361847f8eSopenharmony_ci * @returns { Array<string | number | boolean> } - Returns data of Array type 199461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 199561847f8eSopenharmony_ci * 199661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 199761847f8eSopenharmony_ci * @since 10 199861847f8eSopenharmony_ci */ 199961847f8eSopenharmony_ci /** 200061847f8eSopenharmony_ci * Get the array value of the web message. 200161847f8eSopenharmony_ci * @returns { Array<string | number | boolean> } - Returns data of Array type 200261847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 200361847f8eSopenharmony_ci * 200461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 200561847f8eSopenharmony_ci * @atomicservice 200661847f8eSopenharmony_ci * @since 11 200761847f8eSopenharmony_ci */ 200861847f8eSopenharmony_ci getArray(): Array<string | number | boolean>; 200961847f8eSopenharmony_ci 201061847f8eSopenharmony_ci /** 201161847f8eSopenharmony_ci * Get the error value of the web message. 201261847f8eSopenharmony_ci * @returns { Error } - Returns data of Error type 201361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 201461847f8eSopenharmony_ci * 201561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 201661847f8eSopenharmony_ci * @since 10 201761847f8eSopenharmony_ci */ 201861847f8eSopenharmony_ci /** 201961847f8eSopenharmony_ci * Get the error value of the web message. 202061847f8eSopenharmony_ci * @returns { Error } - Returns data of Error type 202161847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 202261847f8eSopenharmony_ci * 202361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 202461847f8eSopenharmony_ci * @atomicservice 202561847f8eSopenharmony_ci * @since 11 202661847f8eSopenharmony_ci */ 202761847f8eSopenharmony_ci getError(): Error; 202861847f8eSopenharmony_ci 202961847f8eSopenharmony_ci /** 203061847f8eSopenharmony_ci * Set the type of the web message. 203161847f8eSopenharmony_ci * @param { WebMessageType } type - set WebMessageType type data 203261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 203361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 203461847f8eSopenharmony_ci * 203561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 203661847f8eSopenharmony_ci * @since 10 203761847f8eSopenharmony_ci */ 203861847f8eSopenharmony_ci /** 203961847f8eSopenharmony_ci * Set the type of the web message. 204061847f8eSopenharmony_ci * @param { WebMessageType } type - set WebMessageType type data 204161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 204261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 204361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 204461847f8eSopenharmony_ci * 204561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 204661847f8eSopenharmony_ci * @atomicservice 204761847f8eSopenharmony_ci * @since 11 204861847f8eSopenharmony_ci */ 204961847f8eSopenharmony_ci setType(type: WebMessageType): void; 205061847f8eSopenharmony_ci 205161847f8eSopenharmony_ci /** 205261847f8eSopenharmony_ci * Set the string value of the web message. 205361847f8eSopenharmony_ci * @param { string } message - set string type data 205461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 205561847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 205661847f8eSopenharmony_ci * 205761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 205861847f8eSopenharmony_ci * @since 10 205961847f8eSopenharmony_ci */ 206061847f8eSopenharmony_ci /** 206161847f8eSopenharmony_ci * Set the string value of the web message. 206261847f8eSopenharmony_ci * @param { string } message - set string type data 206361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 206461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 206561847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 206661847f8eSopenharmony_ci * 206761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 206861847f8eSopenharmony_ci * @atomicservice 206961847f8eSopenharmony_ci * @since 11 207061847f8eSopenharmony_ci */ 207161847f8eSopenharmony_ci setString(message: string): void; 207261847f8eSopenharmony_ci 207361847f8eSopenharmony_ci /** 207461847f8eSopenharmony_ci * Set the number value of the web message. 207561847f8eSopenharmony_ci * @param { number } message - set number type data 207661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 207761847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 207861847f8eSopenharmony_ci * 207961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 208061847f8eSopenharmony_ci * @since 10 208161847f8eSopenharmony_ci */ 208261847f8eSopenharmony_ci /** 208361847f8eSopenharmony_ci * Set the number value of the web message. 208461847f8eSopenharmony_ci * @param { number } message - set number type data 208561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 208661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 208761847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 208861847f8eSopenharmony_ci * 208961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 209061847f8eSopenharmony_ci * @atomicservice 209161847f8eSopenharmony_ci * @since 11 209261847f8eSopenharmony_ci */ 209361847f8eSopenharmony_ci setNumber(message: number): void; 209461847f8eSopenharmony_ci 209561847f8eSopenharmony_ci /** 209661847f8eSopenharmony_ci * Set the boolean value of the web message. 209761847f8eSopenharmony_ci * @param { boolean } message - set boolean type data 209861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 209961847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 210061847f8eSopenharmony_ci * 210161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 210261847f8eSopenharmony_ci * @since 10 210361847f8eSopenharmony_ci */ 210461847f8eSopenharmony_ci /** 210561847f8eSopenharmony_ci * Set the boolean value of the web message. 210661847f8eSopenharmony_ci * @param { boolean } message - set boolean type data 210761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 210861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 210961847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 211061847f8eSopenharmony_ci * 211161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 211261847f8eSopenharmony_ci * @atomicservice 211361847f8eSopenharmony_ci * @since 11 211461847f8eSopenharmony_ci */ 211561847f8eSopenharmony_ci setBoolean(message: boolean): void; 211661847f8eSopenharmony_ci 211761847f8eSopenharmony_ci /** 211861847f8eSopenharmony_ci * Set the array buffer value of the web message. 211961847f8eSopenharmony_ci * @param { ArrayBuffer } message - set ArrayBuffer type data 212061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 212161847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 212261847f8eSopenharmony_ci * 212361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 212461847f8eSopenharmony_ci * @since 10 212561847f8eSopenharmony_ci */ 212661847f8eSopenharmony_ci /** 212761847f8eSopenharmony_ci * Set the array buffer value of the web message. 212861847f8eSopenharmony_ci * @param { ArrayBuffer } message - set ArrayBuffer type data 212961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 213061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 213161847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 213261847f8eSopenharmony_ci * 213361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 213461847f8eSopenharmony_ci * @atomicservice 213561847f8eSopenharmony_ci * @since 11 213661847f8eSopenharmony_ci */ 213761847f8eSopenharmony_ci setArrayBuffer(message: ArrayBuffer): void; 213861847f8eSopenharmony_ci 213961847f8eSopenharmony_ci /** 214061847f8eSopenharmony_ci * Set the array value of the web message. 214161847f8eSopenharmony_ci * @param { Array<string | number | boolean> } message - set Array type data 214261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 214361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 214461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 214561847f8eSopenharmony_ci * @since 10 214661847f8eSopenharmony_ci */ 214761847f8eSopenharmony_ci /** 214861847f8eSopenharmony_ci * Set the array value of the web message. 214961847f8eSopenharmony_ci * @param { Array<string | number | boolean> } message - set Array type data 215061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 215161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 215261847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 215361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 215461847f8eSopenharmony_ci * @atomicservice 215561847f8eSopenharmony_ci * @since 11 215661847f8eSopenharmony_ci */ 215761847f8eSopenharmony_ci setArray(message: Array<string | number | boolean>): void; 215861847f8eSopenharmony_ci 215961847f8eSopenharmony_ci /** 216061847f8eSopenharmony_ci * Set the error value of the web message. 216161847f8eSopenharmony_ci * @param { Error } message - set Error type data 216261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 216361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 216461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 216561847f8eSopenharmony_ci * 216661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 216761847f8eSopenharmony_ci * @since 10 216861847f8eSopenharmony_ci */ 216961847f8eSopenharmony_ci /** 217061847f8eSopenharmony_ci * Set the error value of the web message. 217161847f8eSopenharmony_ci * @param { Error } message - set Error type data 217261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 217361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 217461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 217561847f8eSopenharmony_ci * 217661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 217761847f8eSopenharmony_ci * @atomicservice 217861847f8eSopenharmony_ci * @since 11 217961847f8eSopenharmony_ci */ 218061847f8eSopenharmony_ci setError(message: Error): void; 218161847f8eSopenharmony_ci } 218261847f8eSopenharmony_ci 218361847f8eSopenharmony_ci /** 218461847f8eSopenharmony_ci * WebMessage type supplied to {@link onMessageEventExt} for indicating the type of web message. 218561847f8eSopenharmony_ci * 218661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 218761847f8eSopenharmony_ci * @since 9 218861847f8eSopenharmony_ci */ 218961847f8eSopenharmony_ci /** 219061847f8eSopenharmony_ci * WebMessage type supplied to {@link onMessageEventExt} for indicating the type of web message. 219161847f8eSopenharmony_ci * 219261847f8eSopenharmony_ci * @typedef { ArrayBuffer | string } 219361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 219461847f8eSopenharmony_ci * @atomicservice 219561847f8eSopenharmony_ci * @since 11 219661847f8eSopenharmony_ci */ 219761847f8eSopenharmony_ci type WebMessage = ArrayBuffer | string; 219861847f8eSopenharmony_ci /** 219961847f8eSopenharmony_ci * Define html web message port. 220061847f8eSopenharmony_ci * @interface WebMessagePort 220161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 220261847f8eSopenharmony_ci * @since 9 220361847f8eSopenharmony_ci */ 220461847f8eSopenharmony_ci /** 220561847f8eSopenharmony_ci * Define html web message port. 220661847f8eSopenharmony_ci * @interface WebMessagePort 220761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 220861847f8eSopenharmony_ci * @crossplatform 220961847f8eSopenharmony_ci * @atomicservice 221061847f8eSopenharmony_ci * @since 11 221161847f8eSopenharmony_ci */ 221261847f8eSopenharmony_ci /** 221361847f8eSopenharmony_ci * Define html web message port. 221461847f8eSopenharmony_ci * @typedef WebMessagePort 221561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 221661847f8eSopenharmony_ci * @crossplatform 221761847f8eSopenharmony_ci * @atomicservice 221861847f8eSopenharmony_ci * @since 12 221961847f8eSopenharmony_ci */ 222061847f8eSopenharmony_ci interface WebMessagePort { 222161847f8eSopenharmony_ci /** 222261847f8eSopenharmony_ci * The flag indicates whether more formats are supported than string and array buffers. 222361847f8eSopenharmony_ci * 222461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 222561847f8eSopenharmony_ci * @since 10 222661847f8eSopenharmony_ci */ 222761847f8eSopenharmony_ci /** 222861847f8eSopenharmony_ci * The flag indicates whether more formats are supported than string and array buffers. 222961847f8eSopenharmony_ci * 223061847f8eSopenharmony_ci * @type { ?boolean } 223161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 223261847f8eSopenharmony_ci * @atomicservice 223361847f8eSopenharmony_ci * @since 11 223461847f8eSopenharmony_ci */ 223561847f8eSopenharmony_ci isExtentionType?: boolean; 223661847f8eSopenharmony_ci 223761847f8eSopenharmony_ci /** 223861847f8eSopenharmony_ci * Close port. 223961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 224061847f8eSopenharmony_ci * @since 9 224161847f8eSopenharmony_ci */ 224261847f8eSopenharmony_ci /** 224361847f8eSopenharmony_ci * Close port. 224461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 224561847f8eSopenharmony_ci * @crossplatform 224661847f8eSopenharmony_ci * @atomicservice 224761847f8eSopenharmony_ci * @since 11 224861847f8eSopenharmony_ci */ 224961847f8eSopenharmony_ci close(): void; 225061847f8eSopenharmony_ci 225161847f8eSopenharmony_ci /** 225261847f8eSopenharmony_ci * Post a message to other port. 225361847f8eSopenharmony_ci * @param { WebMessage } message - Message to send. 225461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 225561847f8eSopenharmony_ci * @throws { BusinessError } 17100010 - Failed to post messages through the port. 225661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 225761847f8eSopenharmony_ci * @since 9 225861847f8eSopenharmony_ci */ 225961847f8eSopenharmony_ci /** 226061847f8eSopenharmony_ci * Post a message to other port. 226161847f8eSopenharmony_ci * @param { WebMessage } message - Message to send. 226261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 226361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 226461847f8eSopenharmony_ci * @throws { BusinessError } 17100010 - Failed to post messages through the port. 226561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 226661847f8eSopenharmony_ci * @crossplatform 226761847f8eSopenharmony_ci * @atomicservice 226861847f8eSopenharmony_ci * @since 11 226961847f8eSopenharmony_ci */ 227061847f8eSopenharmony_ci postMessageEvent(message: WebMessage): void; 227161847f8eSopenharmony_ci 227261847f8eSopenharmony_ci /** 227361847f8eSopenharmony_ci * Receive message from other port. 227461847f8eSopenharmony_ci * @param { function } callback - Callback function for receiving messages. 227561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 227661847f8eSopenharmony_ci * @throws { BusinessError } 17100006 - Failed to register a message event for the port. 227761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 227861847f8eSopenharmony_ci * @since 9 227961847f8eSopenharmony_ci */ 228061847f8eSopenharmony_ci /** 228161847f8eSopenharmony_ci * Receive message from other port. 228261847f8eSopenharmony_ci * @param { function } callback - Callback function for receiving messages. 228361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 228461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 228561847f8eSopenharmony_ci * @throws { BusinessError } 17100006 - Failed to register a message event for the port. 228661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 228761847f8eSopenharmony_ci * @crossplatform 228861847f8eSopenharmony_ci * @atomicservice 228961847f8eSopenharmony_ci * @since 11 229061847f8eSopenharmony_ci */ 229161847f8eSopenharmony_ci onMessageEvent(callback: (result: WebMessage) => void): void; 229261847f8eSopenharmony_ci 229361847f8eSopenharmony_ci /** 229461847f8eSopenharmony_ci * Post a message to other port. 229561847f8eSopenharmony_ci * @param { WebMessageExt } message - Message to send. 229661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 229761847f8eSopenharmony_ci * @throws { BusinessError } 17100010 - Failed to post messages through the port. 229861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 229961847f8eSopenharmony_ci * @since 10 230061847f8eSopenharmony_ci */ 230161847f8eSopenharmony_ci /** 230261847f8eSopenharmony_ci * Post a message to other port. 230361847f8eSopenharmony_ci * @param { WebMessageExt } message - Message to send. 230461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 230561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 230661847f8eSopenharmony_ci * @throws { BusinessError } 17100010 - Failed to post messages through the port. 230761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 230861847f8eSopenharmony_ci * @atomicservice 230961847f8eSopenharmony_ci * @since 11 231061847f8eSopenharmony_ci */ 231161847f8eSopenharmony_ci postMessageEventExt(message: WebMessageExt): void; 231261847f8eSopenharmony_ci 231361847f8eSopenharmony_ci /** 231461847f8eSopenharmony_ci * Receive message from other port. 231561847f8eSopenharmony_ci * @param { function } callback - Callback function for receiving messages. 231661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 231761847f8eSopenharmony_ci * @throws { BusinessError } 17100006 - Failed to register a message event for the port. 231861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 231961847f8eSopenharmony_ci * @since 10 232061847f8eSopenharmony_ci */ 232161847f8eSopenharmony_ci /** 232261847f8eSopenharmony_ci * Receive message from other port. 232361847f8eSopenharmony_ci * @param { function } callback - Callback function for receiving messages. 232461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 232561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 232661847f8eSopenharmony_ci * @throws { BusinessError } 17100006 - Failed to register a message event for the port. 232761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 232861847f8eSopenharmony_ci * @atomicservice 232961847f8eSopenharmony_ci * @since 11 233061847f8eSopenharmony_ci */ 233161847f8eSopenharmony_ci onMessageEventExt(callback: (result: WebMessageExt) => void): void; 233261847f8eSopenharmony_ci } 233361847f8eSopenharmony_ci 233461847f8eSopenharmony_ci /** 233561847f8eSopenharmony_ci * Provides information for history item in BackForwardList. 233661847f8eSopenharmony_ci * @interface HistoryItem 233761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 233861847f8eSopenharmony_ci * @since 9 233961847f8eSopenharmony_ci */ 234061847f8eSopenharmony_ci /** 234161847f8eSopenharmony_ci * Provides information for history item in BackForwardList. 234261847f8eSopenharmony_ci * @interface HistoryItem 234361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 234461847f8eSopenharmony_ci * @crossplatform 234561847f8eSopenharmony_ci * @atomicservice 234661847f8eSopenharmony_ci * @since 11 234761847f8eSopenharmony_ci */ 234861847f8eSopenharmony_ci /** 234961847f8eSopenharmony_ci * Provides information for history item in BackForwardList. 235061847f8eSopenharmony_ci * @typedef HistoryItem 235161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 235261847f8eSopenharmony_ci * @crossplatform 235361847f8eSopenharmony_ci * @atomicservice 235461847f8eSopenharmony_ci * @since 12 235561847f8eSopenharmony_ci */ 235661847f8eSopenharmony_ci interface HistoryItem { 235761847f8eSopenharmony_ci /** 235861847f8eSopenharmony_ci * Pixelmap of icon. 235961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 236061847f8eSopenharmony_ci * @since 9 236161847f8eSopenharmony_ci */ 236261847f8eSopenharmony_ci /** 236361847f8eSopenharmony_ci * Pixelmap of icon. 236461847f8eSopenharmony_ci * @type { image.PixelMap } 236561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 236661847f8eSopenharmony_ci * @atomicservice 236761847f8eSopenharmony_ci * @since 11 236861847f8eSopenharmony_ci */ 236961847f8eSopenharmony_ci icon: image.PixelMap; 237061847f8eSopenharmony_ci 237161847f8eSopenharmony_ci /** 237261847f8eSopenharmony_ci * Url of this history item. 237361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 237461847f8eSopenharmony_ci * @since 9 237561847f8eSopenharmony_ci */ 237661847f8eSopenharmony_ci /** 237761847f8eSopenharmony_ci * Url of this history item. 237861847f8eSopenharmony_ci * @type { string } 237961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 238061847f8eSopenharmony_ci * @crossplatform 238161847f8eSopenharmony_ci * @atomicservice 238261847f8eSopenharmony_ci * @since 11 238361847f8eSopenharmony_ci */ 238461847f8eSopenharmony_ci historyUrl: string; 238561847f8eSopenharmony_ci 238661847f8eSopenharmony_ci /** 238761847f8eSopenharmony_ci * Original request url of this history item. 238861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 238961847f8eSopenharmony_ci * @since 9 239061847f8eSopenharmony_ci */ 239161847f8eSopenharmony_ci /** 239261847f8eSopenharmony_ci * Original request url of this history item. 239361847f8eSopenharmony_ci * @type { string } 239461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 239561847f8eSopenharmony_ci * @crossplatform 239661847f8eSopenharmony_ci * @atomicservice 239761847f8eSopenharmony_ci * @since 11 239861847f8eSopenharmony_ci */ 239961847f8eSopenharmony_ci historyRawUrl: string; 240061847f8eSopenharmony_ci 240161847f8eSopenharmony_ci /** 240261847f8eSopenharmony_ci * Title of this history item. 240361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 240461847f8eSopenharmony_ci * @since 9 240561847f8eSopenharmony_ci */ 240661847f8eSopenharmony_ci /** 240761847f8eSopenharmony_ci * Title of this history item. 240861847f8eSopenharmony_ci * @type { string } 240961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 241061847f8eSopenharmony_ci * @crossplatform 241161847f8eSopenharmony_ci * @atomicservice 241261847f8eSopenharmony_ci * @since 11 241361847f8eSopenharmony_ci */ 241461847f8eSopenharmony_ci title: string; 241561847f8eSopenharmony_ci } 241661847f8eSopenharmony_ci 241761847f8eSopenharmony_ci /** 241861847f8eSopenharmony_ci * Provides back and forward history list information method. related to {@link HistoryItem}. 241961847f8eSopenharmony_ci * @interface BackForwardList 242061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 242161847f8eSopenharmony_ci * @since 9 242261847f8eSopenharmony_ci */ 242361847f8eSopenharmony_ci /** 242461847f8eSopenharmony_ci * Provides back and forward history list information method. related to {@link HistoryItem}. 242561847f8eSopenharmony_ci * @interface BackForwardList 242661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 242761847f8eSopenharmony_ci * @crossplatform 242861847f8eSopenharmony_ci * @atomicservice 242961847f8eSopenharmony_ci * @since 11 243061847f8eSopenharmony_ci */ 243161847f8eSopenharmony_ci /** 243261847f8eSopenharmony_ci * Provides back and forward history list information method. related to {@link HistoryItem}. 243361847f8eSopenharmony_ci * @typedef BackForwardList 243461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 243561847f8eSopenharmony_ci * @crossplatform 243661847f8eSopenharmony_ci * @atomicservice 243761847f8eSopenharmony_ci * @since 12 243861847f8eSopenharmony_ci */ 243961847f8eSopenharmony_ci interface BackForwardList { 244061847f8eSopenharmony_ci /** 244161847f8eSopenharmony_ci * Current index in BackForwardList. 244261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 244361847f8eSopenharmony_ci * @since 9 244461847f8eSopenharmony_ci */ 244561847f8eSopenharmony_ci /** 244661847f8eSopenharmony_ci * Current index in BackForwardList. 244761847f8eSopenharmony_ci * @type { number } 244861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 244961847f8eSopenharmony_ci * @crossplatform 245061847f8eSopenharmony_ci * @atomicservice 245161847f8eSopenharmony_ci * @since 11 245261847f8eSopenharmony_ci */ 245361847f8eSopenharmony_ci currentIndex: number; 245461847f8eSopenharmony_ci 245561847f8eSopenharmony_ci /** 245661847f8eSopenharmony_ci * Size of in BackForwardList. 245761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 245861847f8eSopenharmony_ci * @since 9 245961847f8eSopenharmony_ci */ 246061847f8eSopenharmony_ci /** 246161847f8eSopenharmony_ci * Size of in BackForwardList. 246261847f8eSopenharmony_ci * @type { number } 246361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 246461847f8eSopenharmony_ci * @crossplatform 246561847f8eSopenharmony_ci * @atomicservice 246661847f8eSopenharmony_ci * @since 11 246761847f8eSopenharmony_ci */ 246861847f8eSopenharmony_ci size: number; 246961847f8eSopenharmony_ci 247061847f8eSopenharmony_ci /** 247161847f8eSopenharmony_ci * Get history entry at given index. 247261847f8eSopenharmony_ci * 247361847f8eSopenharmony_ci * @param { number } index Index of back forward list entry. 247461847f8eSopenharmony_ci * @returns { HistoryItem } HistoryItem at given index in back forward list. 247561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 247661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 247761847f8eSopenharmony_ci * @since 9 247861847f8eSopenharmony_ci */ 247961847f8eSopenharmony_ci /** 248061847f8eSopenharmony_ci * Get history entry at given index. 248161847f8eSopenharmony_ci * 248261847f8eSopenharmony_ci * @param { number } index Index of back forward list entry. 248361847f8eSopenharmony_ci * @returns { HistoryItem } HistoryItem at given index in back forward list. 248461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 248561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 248661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 248761847f8eSopenharmony_ci * @crossplatform 248861847f8eSopenharmony_ci * @atomicservice 248961847f8eSopenharmony_ci * @since 11 249061847f8eSopenharmony_ci */ 249161847f8eSopenharmony_ci getItemAtIndex(index: number): HistoryItem; 249261847f8eSopenharmony_ci } 249361847f8eSopenharmony_ci 249461847f8eSopenharmony_ci /** 249561847f8eSopenharmony_ci * Defines the snapshot info. 249661847f8eSopenharmony_ci * 249761847f8eSopenharmony_ci * @typedef SnapshotInfo 249861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 249961847f8eSopenharmony_ci * @atomicservice 250061847f8eSopenharmony_ci * @since 12 250161847f8eSopenharmony_ci */ 250261847f8eSopenharmony_ci interface SnapshotInfo { 250361847f8eSopenharmony_ci /** 250461847f8eSopenharmony_ci * Id of the snapshot. 250561847f8eSopenharmony_ci * 250661847f8eSopenharmony_ci * @type { ?string } 250761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 250861847f8eSopenharmony_ci * @atomicservice 250961847f8eSopenharmony_ci * @since 12 251061847f8eSopenharmony_ci */ 251161847f8eSopenharmony_ci id?: string; 251261847f8eSopenharmony_ci 251361847f8eSopenharmony_ci /** 251461847f8eSopenharmony_ci * Size of the web. 251561847f8eSopenharmony_ci * 251661847f8eSopenharmony_ci * @type { ?SizeOptions } 251761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 251861847f8eSopenharmony_ci * @atomicservice 251961847f8eSopenharmony_ci * @since 12 252061847f8eSopenharmony_ci */ 252161847f8eSopenharmony_ci size?: SizeOptions; 252261847f8eSopenharmony_ci } 252361847f8eSopenharmony_ci 252461847f8eSopenharmony_ci /** 252561847f8eSopenharmony_ci * Defines the snapshot result. 252661847f8eSopenharmony_ci * 252761847f8eSopenharmony_ci * @typedef SnapshotResult 252861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 252961847f8eSopenharmony_ci * @atomicservice 253061847f8eSopenharmony_ci * @since 12 253161847f8eSopenharmony_ci */ 253261847f8eSopenharmony_ci interface SnapshotResult { 253361847f8eSopenharmony_ci /** 253461847f8eSopenharmony_ci * Id of the snapshot. 253561847f8eSopenharmony_ci * 253661847f8eSopenharmony_ci * @type { ?string } 253761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 253861847f8eSopenharmony_ci * @atomicservice 253961847f8eSopenharmony_ci * @since 12 254061847f8eSopenharmony_ci */ 254161847f8eSopenharmony_ci id?: string; 254261847f8eSopenharmony_ci 254361847f8eSopenharmony_ci /** 254461847f8eSopenharmony_ci * The status of the snapshot. 254561847f8eSopenharmony_ci * 254661847f8eSopenharmony_ci * @type { ?boolean } 254761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 254861847f8eSopenharmony_ci * @atomicservice 254961847f8eSopenharmony_ci * @since 12 255061847f8eSopenharmony_ci */ 255161847f8eSopenharmony_ci status?: boolean; 255261847f8eSopenharmony_ci 255361847f8eSopenharmony_ci /** 255461847f8eSopenharmony_ci * Size of the web. 255561847f8eSopenharmony_ci * 255661847f8eSopenharmony_ci * @type { ?SizeOptions } 255761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 255861847f8eSopenharmony_ci * @atomicservice 255961847f8eSopenharmony_ci * @since 12 256061847f8eSopenharmony_ci */ 256161847f8eSopenharmony_ci size?: SizeOptions; 256261847f8eSopenharmony_ci 256361847f8eSopenharmony_ci /** 256461847f8eSopenharmony_ci * The image in PixelMap format. 256561847f8eSopenharmony_ci * 256661847f8eSopenharmony_ci * @type { ?image.PixelMap } 256761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 256861847f8eSopenharmony_ci * @atomicservice 256961847f8eSopenharmony_ci * @since 12 257061847f8eSopenharmony_ci */ 257161847f8eSopenharmony_ci imagePixelMap?: image.PixelMap; 257261847f8eSopenharmony_ci } 257361847f8eSopenharmony_ci /** 257461847f8eSopenharmony_ci * Enum type supplied to {@link runJavaScriptExt} for indicating the result of JavaScript code execution. 257561847f8eSopenharmony_ci * @enum {number} 257661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 257761847f8eSopenharmony_ci * @since 10 257861847f8eSopenharmony_ci */ 257961847f8eSopenharmony_ci /** 258061847f8eSopenharmony_ci * Enum type supplied to {@link runJavaScriptExt} for indicating the result of JavaScript code execution. 258161847f8eSopenharmony_ci * @enum {number} 258261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 258361847f8eSopenharmony_ci * @atomicservice 258461847f8eSopenharmony_ci * @since 11 258561847f8eSopenharmony_ci */ 258661847f8eSopenharmony_ci enum JsMessageType { 258761847f8eSopenharmony_ci /** 258861847f8eSopenharmony_ci * Unsupported data type. 258961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 259061847f8eSopenharmony_ci * @since 10 259161847f8eSopenharmony_ci */ 259261847f8eSopenharmony_ci /** 259361847f8eSopenharmony_ci * Unsupported data type. 259461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 259561847f8eSopenharmony_ci * @atomicservice 259661847f8eSopenharmony_ci * @since 11 259761847f8eSopenharmony_ci */ 259861847f8eSopenharmony_ci NOT_SUPPORT, 259961847f8eSopenharmony_ci 260061847f8eSopenharmony_ci /** 260161847f8eSopenharmony_ci * The string data type. 260261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 260361847f8eSopenharmony_ci * @since 10 260461847f8eSopenharmony_ci */ 260561847f8eSopenharmony_ci /** 260661847f8eSopenharmony_ci * The string data type. 260761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 260861847f8eSopenharmony_ci * @atomicservice 260961847f8eSopenharmony_ci * @since 11 261061847f8eSopenharmony_ci */ 261161847f8eSopenharmony_ci STRING, 261261847f8eSopenharmony_ci 261361847f8eSopenharmony_ci /** 261461847f8eSopenharmony_ci * The number data type. 261561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 261661847f8eSopenharmony_ci * @since 10 261761847f8eSopenharmony_ci */ 261861847f8eSopenharmony_ci /** 261961847f8eSopenharmony_ci * The number data type. 262061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 262161847f8eSopenharmony_ci * @atomicservice 262261847f8eSopenharmony_ci * @since 11 262361847f8eSopenharmony_ci */ 262461847f8eSopenharmony_ci NUMBER, 262561847f8eSopenharmony_ci 262661847f8eSopenharmony_ci /** 262761847f8eSopenharmony_ci * The boolean data type. 262861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 262961847f8eSopenharmony_ci * @since 10 263061847f8eSopenharmony_ci */ 263161847f8eSopenharmony_ci /** 263261847f8eSopenharmony_ci * The boolean data type. 263361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 263461847f8eSopenharmony_ci * @atomicservice 263561847f8eSopenharmony_ci * @since 11 263661847f8eSopenharmony_ci */ 263761847f8eSopenharmony_ci BOOLEAN, 263861847f8eSopenharmony_ci 263961847f8eSopenharmony_ci /** 264061847f8eSopenharmony_ci * The arraybuffer data type. 264161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 264261847f8eSopenharmony_ci * @since 10 264361847f8eSopenharmony_ci */ 264461847f8eSopenharmony_ci /** 264561847f8eSopenharmony_ci * The arraybuffer data type. 264661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 264761847f8eSopenharmony_ci * @atomicservice 264861847f8eSopenharmony_ci * @since 11 264961847f8eSopenharmony_ci */ 265061847f8eSopenharmony_ci ARRAY_BUFFER, 265161847f8eSopenharmony_ci 265261847f8eSopenharmony_ci /** 265361847f8eSopenharmony_ci * The array data type. 265461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 265561847f8eSopenharmony_ci * @since 10 265661847f8eSopenharmony_ci */ 265761847f8eSopenharmony_ci /** 265861847f8eSopenharmony_ci * The array data type. 265961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 266061847f8eSopenharmony_ci * @atomicservice 266161847f8eSopenharmony_ci * @since 11 266261847f8eSopenharmony_ci */ 266361847f8eSopenharmony_ci ARRAY 266461847f8eSopenharmony_ci } 266561847f8eSopenharmony_ci 266661847f8eSopenharmony_ci /** 266761847f8eSopenharmony_ci * The message for indicating the of result of JavaScript code execution. 266861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 266961847f8eSopenharmony_ci * @since 10 267061847f8eSopenharmony_ci */ 267161847f8eSopenharmony_ci /** 267261847f8eSopenharmony_ci * The message for indicating the of result of JavaScript code execution. 267361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 267461847f8eSopenharmony_ci * @atomicservice 267561847f8eSopenharmony_ci * @since 11 267661847f8eSopenharmony_ci */ 267761847f8eSopenharmony_ci class JsMessageExt { 267861847f8eSopenharmony_ci /** 267961847f8eSopenharmony_ci * Get the type of the JavaScript code execution result. 268061847f8eSopenharmony_ci * @returns { JsMessageType } - Returns data of JsMessageType type 268161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 268261847f8eSopenharmony_ci * @since 10 268361847f8eSopenharmony_ci */ 268461847f8eSopenharmony_ci /** 268561847f8eSopenharmony_ci * Get the type of the JavaScript code execution result. 268661847f8eSopenharmony_ci * @returns { JsMessageType } - Returns data of JsMessageType type 268761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 268861847f8eSopenharmony_ci * @atomicservice 268961847f8eSopenharmony_ci * @since 11 269061847f8eSopenharmony_ci */ 269161847f8eSopenharmony_ci getType(): JsMessageType; 269261847f8eSopenharmony_ci 269361847f8eSopenharmony_ci /** 269461847f8eSopenharmony_ci * Get the string value of the JavaScript code execution result. 269561847f8eSopenharmony_ci * @returns { string } - Returns data of string type 269661847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 269761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 269861847f8eSopenharmony_ci * @since 10 269961847f8eSopenharmony_ci */ 270061847f8eSopenharmony_ci /** 270161847f8eSopenharmony_ci * Get the string value of the JavaScript code execution result. 270261847f8eSopenharmony_ci * @returns { string } - Returns data of string type 270361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 270461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 270561847f8eSopenharmony_ci * @atomicservice 270661847f8eSopenharmony_ci * @since 11 270761847f8eSopenharmony_ci */ 270861847f8eSopenharmony_ci getString(): string; 270961847f8eSopenharmony_ci 271061847f8eSopenharmony_ci /** 271161847f8eSopenharmony_ci * Get the number value of the JavaScript code execution result. 271261847f8eSopenharmony_ci * @returns { number } - Returns data of number type 271361847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 271461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 271561847f8eSopenharmony_ci * @since 10 271661847f8eSopenharmony_ci */ 271761847f8eSopenharmony_ci /** 271861847f8eSopenharmony_ci * Get the number value of the JavaScript code execution result. 271961847f8eSopenharmony_ci * @returns { number } - Returns data of number type 272061847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 272161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 272261847f8eSopenharmony_ci * @atomicservice 272361847f8eSopenharmony_ci * @since 11 272461847f8eSopenharmony_ci */ 272561847f8eSopenharmony_ci getNumber(): number; 272661847f8eSopenharmony_ci 272761847f8eSopenharmony_ci /** 272861847f8eSopenharmony_ci * Get the boolean value of the JavaScript code execution result. 272961847f8eSopenharmony_ci * @returns { boolean } - Returns data of Boolean type 273061847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 273161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 273261847f8eSopenharmony_ci * @since 10 273361847f8eSopenharmony_ci */ 273461847f8eSopenharmony_ci /** 273561847f8eSopenharmony_ci * Get the boolean value of the JavaScript code execution result. 273661847f8eSopenharmony_ci * @returns { boolean } - Returns data of Boolean type 273761847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 273861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 273961847f8eSopenharmony_ci * @atomicservice 274061847f8eSopenharmony_ci * @since 11 274161847f8eSopenharmony_ci */ 274261847f8eSopenharmony_ci getBoolean(): boolean; 274361847f8eSopenharmony_ci 274461847f8eSopenharmony_ci /** 274561847f8eSopenharmony_ci * Get the array buffer value of the JavaScript code execution result. 274661847f8eSopenharmony_ci * @returns { ArrayBuffer } - Returns data of ArrayBuffer 274761847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 274861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 274961847f8eSopenharmony_ci * @since 10 275061847f8eSopenharmony_ci */ 275161847f8eSopenharmony_ci /** 275261847f8eSopenharmony_ci * Get the array buffer value of the JavaScript code execution result. 275361847f8eSopenharmony_ci * @returns { ArrayBuffer } - Returns data of ArrayBuffer 275461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 275561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 275661847f8eSopenharmony_ci * @atomicservice 275761847f8eSopenharmony_ci * @since 11 275861847f8eSopenharmony_ci */ 275961847f8eSopenharmony_ci getArrayBuffer(): ArrayBuffer; 276061847f8eSopenharmony_ci 276161847f8eSopenharmony_ci /** 276261847f8eSopenharmony_ci * Get the array value of the the JavaScript code execution result. 276361847f8eSopenharmony_ci * @returns { Array<string | number | boolean> } - Returns data of Array type 276461847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 276561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 276661847f8eSopenharmony_ci * @since 10 276761847f8eSopenharmony_ci */ 276861847f8eSopenharmony_ci /** 276961847f8eSopenharmony_ci * Get the array value of the the JavaScript code execution result. 277061847f8eSopenharmony_ci * @returns { Array<string | number | boolean> } - Returns data of Array type 277161847f8eSopenharmony_ci * @throws { BusinessError } 17100014 - The type and value of the message do not match. 277261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 277361847f8eSopenharmony_ci * @atomicservice 277461847f8eSopenharmony_ci * @since 11 277561847f8eSopenharmony_ci */ 277661847f8eSopenharmony_ci getArray(): Array<string | number | boolean>; 277761847f8eSopenharmony_ci } 277861847f8eSopenharmony_ci 277961847f8eSopenharmony_ci /** 278061847f8eSopenharmony_ci * Defines the render process mode. 278161847f8eSopenharmony_ci * 278261847f8eSopenharmony_ci * @enum {number} 278361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 278461847f8eSopenharmony_ci * @atomicservice 278561847f8eSopenharmony_ci * @since 12 278661847f8eSopenharmony_ci */ 278761847f8eSopenharmony_ci enum RenderProcessMode { 278861847f8eSopenharmony_ci /** 278961847f8eSopenharmony_ci * Indicates the ArkWeb operates in single render process mode, which is the default value for 279061847f8eSopenharmony_ci * mobile devices. 279161847f8eSopenharmony_ci * 279261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 279361847f8eSopenharmony_ci * @atomicservice 279461847f8eSopenharmony_ci * @since 12 279561847f8eSopenharmony_ci */ 279661847f8eSopenharmony_ci SINGLE = 0, 279761847f8eSopenharmony_ci 279861847f8eSopenharmony_ci /** 279961847f8eSopenharmony_ci * Indicates the ArkWeb operates in multiple render process mode. 280061847f8eSopenharmony_ci * 280161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 280261847f8eSopenharmony_ci * @atomicservice 280361847f8eSopenharmony_ci * @since 12 280461847f8eSopenharmony_ci */ 280561847f8eSopenharmony_ci MULTIPLE, 280661847f8eSopenharmony_ci } 280761847f8eSopenharmony_ci 280861847f8eSopenharmony_ci /** 280961847f8eSopenharmony_ci * Options of generating code cache 281061847f8eSopenharmony_ci * @typedef CacheOptions 281161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 281261847f8eSopenharmony_ci * @since 12 281361847f8eSopenharmony_ci */ 281461847f8eSopenharmony_ci interface CacheOptions { 281561847f8eSopenharmony_ci /** 281661847f8eSopenharmony_ci * Response headers used to configure the validation key of code cache. 281761847f8eSopenharmony_ci * Currently only support E-Tag and Last-Modified. 281861847f8eSopenharmony_ci * 281961847f8eSopenharmony_ci * @type { Array<WebHeader> } 282061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 282161847f8eSopenharmony_ci * @since 12 282261847f8eSopenharmony_ci */ 282361847f8eSopenharmony_ci responseHeaders: Array<WebHeader>; 282461847f8eSopenharmony_ci } 282561847f8eSopenharmony_ci 282661847f8eSopenharmony_ci /** 282761847f8eSopenharmony_ci * Enum type supplied to {@link OfflineResourceMap} for indicating the type of resource. 282861847f8eSopenharmony_ci * @enum {number} 282961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 283061847f8eSopenharmony_ci * @since 12 283161847f8eSopenharmony_ci */ 283261847f8eSopenharmony_ci enum OfflineResourceType { 283361847f8eSopenharmony_ci /** 283461847f8eSopenharmony_ci * Image resource 283561847f8eSopenharmony_ci * 283661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 283761847f8eSopenharmony_ci * @since 12 283861847f8eSopenharmony_ci */ 283961847f8eSopenharmony_ci IMAGE, 284061847f8eSopenharmony_ci 284161847f8eSopenharmony_ci /** 284261847f8eSopenharmony_ci * CSS resource 284361847f8eSopenharmony_ci * 284461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 284561847f8eSopenharmony_ci * @since 12 284661847f8eSopenharmony_ci */ 284761847f8eSopenharmony_ci CSS, 284861847f8eSopenharmony_ci 284961847f8eSopenharmony_ci /** 285061847f8eSopenharmony_ci * Classic javascript resource 285161847f8eSopenharmony_ci * 285261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 285361847f8eSopenharmony_ci * @since 12 285461847f8eSopenharmony_ci */ 285561847f8eSopenharmony_ci CLASSIC_JS, 285661847f8eSopenharmony_ci 285761847f8eSopenharmony_ci /** 285861847f8eSopenharmony_ci * Module javascript resource 285961847f8eSopenharmony_ci * 286061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 286161847f8eSopenharmony_ci * @since 12 286261847f8eSopenharmony_ci */ 286361847f8eSopenharmony_ci MODULE_JS 286461847f8eSopenharmony_ci } 286561847f8eSopenharmony_ci 286661847f8eSopenharmony_ci /** 286761847f8eSopenharmony_ci * Define offline resource's content and info. 286861847f8eSopenharmony_ci * @typedef OfflineResourceMap 286961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 287061847f8eSopenharmony_ci * @since 12 287161847f8eSopenharmony_ci */ 287261847f8eSopenharmony_ci interface OfflineResourceMap { 287361847f8eSopenharmony_ci /** 287461847f8eSopenharmony_ci * Url list of resource. Url of urlList must be HTTP/HTTPS protocol and no longer than 2048. 287561847f8eSopenharmony_ci * 287661847f8eSopenharmony_ci * @type { Array<string> } 287761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 287861847f8eSopenharmony_ci * @since 12 287961847f8eSopenharmony_ci */ 288061847f8eSopenharmony_ci urlList: Array<string>, 288161847f8eSopenharmony_ci 288261847f8eSopenharmony_ci /** 288361847f8eSopenharmony_ci * Arraybuffer of resource. Size must less than 10Mb and cannot be empty. 288461847f8eSopenharmony_ci * 288561847f8eSopenharmony_ci * @type { Uint8Array } 288661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 288761847f8eSopenharmony_ci * @since 12 288861847f8eSopenharmony_ci */ 288961847f8eSopenharmony_ci resource: Uint8Array, 289061847f8eSopenharmony_ci 289161847f8eSopenharmony_ci /** 289261847f8eSopenharmony_ci * Response headers of resource. 289361847f8eSopenharmony_ci * 289461847f8eSopenharmony_ci * @type { Array<WebHeader> } 289561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 289661847f8eSopenharmony_ci * @since 12 289761847f8eSopenharmony_ci */ 289861847f8eSopenharmony_ci responseHeaders: Array<WebHeader>, 289961847f8eSopenharmony_ci 290061847f8eSopenharmony_ci /** 290161847f8eSopenharmony_ci * Resource type 290261847f8eSopenharmony_ci * 290361847f8eSopenharmony_ci * @type { OfflineResourceType } 290461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 290561847f8eSopenharmony_ci * @since 12 290661847f8eSopenharmony_ci */ 290761847f8eSopenharmony_ci type: OfflineResourceType 290861847f8eSopenharmony_ci } 290961847f8eSopenharmony_ci 291061847f8eSopenharmony_ci /** 291161847f8eSopenharmony_ci * Enum type supplied to {@link setScrollable} for indicating the type of scroll. 291261847f8eSopenharmony_ci * 291361847f8eSopenharmony_ci * @enum { number } 291461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 291561847f8eSopenharmony_ci * @since 12 291661847f8eSopenharmony_ci */ 291761847f8eSopenharmony_ci enum ScrollType { 291861847f8eSopenharmony_ci /** 291961847f8eSopenharmony_ci * Indicates scrolling the web page through scroll event, include touch screen, touch pad, and mouse wheel. 292061847f8eSopenharmony_ci * 292161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 292261847f8eSopenharmony_ci * @since 12 292361847f8eSopenharmony_ci */ 292461847f8eSopenharmony_ci EVENT 292561847f8eSopenharmony_ci } 292661847f8eSopenharmony_ci 292761847f8eSopenharmony_ci /** 292861847f8eSopenharmony_ci * Provides methods for controlling the web controller. 292961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 293061847f8eSopenharmony_ci * @since 9 293161847f8eSopenharmony_ci */ 293261847f8eSopenharmony_ci /** 293361847f8eSopenharmony_ci * Provides methods for controlling the web controller. 293461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 293561847f8eSopenharmony_ci * @crossplatform 293661847f8eSopenharmony_ci * @since 10 293761847f8eSopenharmony_ci */ 293861847f8eSopenharmony_ci /** 293961847f8eSopenharmony_ci * Provides methods for controlling the web controller. 294061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 294161847f8eSopenharmony_ci * @crossplatform 294261847f8eSopenharmony_ci * @atomicservice 294361847f8eSopenharmony_ci * @since 11 294461847f8eSopenharmony_ci */ 294561847f8eSopenharmony_ci class WebviewController { 294661847f8eSopenharmony_ci /** 294761847f8eSopenharmony_ci * A constructor used to create a WebviewController object. 294861847f8eSopenharmony_ci * 294961847f8eSopenharmony_ci * @param { string } [webTag] - specified the name of the web component, Empty by default. 295061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 295161847f8eSopenharmony_ci * @atomicservice 295261847f8eSopenharmony_ci * @since 11 295361847f8eSopenharmony_ci */ 295461847f8eSopenharmony_ci constructor(webTag?: string); 295561847f8eSopenharmony_ci 295661847f8eSopenharmony_ci /** 295761847f8eSopenharmony_ci * Initialize the web engine before loading the Web components. 295861847f8eSopenharmony_ci * This is a global static API that must be called on the UI thread, and it will have no effect if any 295961847f8eSopenharmony_ci * Web components are loaded. 296061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 296161847f8eSopenharmony_ci * @since 9 296261847f8eSopenharmony_ci */ 296361847f8eSopenharmony_ci /** 296461847f8eSopenharmony_ci * Initialize the web engine before loading the Web components. 296561847f8eSopenharmony_ci * This is a global static API that must be called on the UI thread, and it will have no effect if any 296661847f8eSopenharmony_ci * Web components are loaded. 296761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 296861847f8eSopenharmony_ci * @atomicservice 296961847f8eSopenharmony_ci * @since 11 297061847f8eSopenharmony_ci */ 297161847f8eSopenharmony_ci static initializeWebEngine(): void; 297261847f8eSopenharmony_ci 297361847f8eSopenharmony_ci /** 297461847f8eSopenharmony_ci * Set web engine to use HttpDns server to resolve dns. 297561847f8eSopenharmony_ci * @param { SecureDnsMode } secureDnsMode - using HttpDns. 297661847f8eSopenharmony_ci * @param { string } secureDnsConfig - The configuration of the HttpDns server. 297761847f8eSopenharmony_ci * Must be https protocol and only allow one server to be configured. 297861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 297961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 298061847f8eSopenharmony_ci * @since 10 298161847f8eSopenharmony_ci */ 298261847f8eSopenharmony_ci /** 298361847f8eSopenharmony_ci * Set web engine to use HttpDns server to resolve dns. 298461847f8eSopenharmony_ci * @param { SecureDnsMode } secureDnsMode - using HttpDns. 298561847f8eSopenharmony_ci * @param { string } secureDnsConfig - The configuration of the HttpDns server. 298661847f8eSopenharmony_ci * Must be https protocol and only allow one server to be configured. 298761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 298861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 298961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 299061847f8eSopenharmony_ci * @atomicservice 299161847f8eSopenharmony_ci * @since 11 299261847f8eSopenharmony_ci */ 299361847f8eSopenharmony_ci static setHttpDns(secureDnsMode: SecureDnsMode, secureDnsConfig: string): void; 299461847f8eSopenharmony_ci 299561847f8eSopenharmony_ci /** 299661847f8eSopenharmony_ci * Enables debugging of web contents. 299761847f8eSopenharmony_ci * @param { boolean } webDebuggingAccess {@code true} enables debugging of web contents; {@code false} otherwise. 299861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 299961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 300061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 300161847f8eSopenharmony_ci * @since 9 300261847f8eSopenharmony_ci */ 300361847f8eSopenharmony_ci /** 300461847f8eSopenharmony_ci * Enables debugging of web contents. 300561847f8eSopenharmony_ci * @param { boolean } webDebuggingAccess {@code true} enables debugging of web contents; {@code false} otherwise. 300661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 300761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 300861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 300961847f8eSopenharmony_ci * @atomicservice 301061847f8eSopenharmony_ci * @since 11 301161847f8eSopenharmony_ci */ 301261847f8eSopenharmony_ci static setWebDebuggingAccess(webDebuggingAccess: boolean): void; 301361847f8eSopenharmony_ci 301461847f8eSopenharmony_ci /** 301561847f8eSopenharmony_ci * Enable the ability to check website security risks. 301661847f8eSopenharmony_ci * Illegal and fraudulent websites are mandatory enabled and can't be disabled by this function. 301761847f8eSopenharmony_ci * @param { boolean } enable - {@code true} enable check the website security risks; {@code false} otherwise. 301861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 301961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 302061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 302161847f8eSopenharmony_ci * @atomicservice 302261847f8eSopenharmony_ci * @since 11 302361847f8eSopenharmony_ci */ 302461847f8eSopenharmony_ci enableSafeBrowsing(enable: boolean): void; 302561847f8eSopenharmony_ci 302661847f8eSopenharmony_ci /** 302761847f8eSopenharmony_ci * Get whether checking website security risks is enabled. 302861847f8eSopenharmony_ci * @returns { boolean } True if enable the ability to check website security risks else false. 302961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 303061847f8eSopenharmony_ci * @atomicservice 303161847f8eSopenharmony_ci * @since 11 303261847f8eSopenharmony_ci */ 303361847f8eSopenharmony_ci isSafeBrowsingEnabled(): boolean; 303461847f8eSopenharmony_ci 303561847f8eSopenharmony_ci /** 303661847f8eSopenharmony_ci * Checks whether the web page can go forward. 303761847f8eSopenharmony_ci * @returns { boolean } True if the web page can go forward else false. 303861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 303961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 304061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 304161847f8eSopenharmony_ci * @since 9 304261847f8eSopenharmony_ci */ 304361847f8eSopenharmony_ci /** 304461847f8eSopenharmony_ci * Checks whether the web page can go forward. 304561847f8eSopenharmony_ci * @returns { boolean } True if the web page can go forward else false. 304661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 304761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 304861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 304961847f8eSopenharmony_ci * @crossplatform 305061847f8eSopenharmony_ci * @atomicservice 305161847f8eSopenharmony_ci * @since 11 305261847f8eSopenharmony_ci */ 305361847f8eSopenharmony_ci accessForward(): boolean; 305461847f8eSopenharmony_ci 305561847f8eSopenharmony_ci /** 305661847f8eSopenharmony_ci * Checks whether the web page can go back. 305761847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 305861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 305961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 306061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 306161847f8eSopenharmony_ci * @since 9 306261847f8eSopenharmony_ci */ 306361847f8eSopenharmony_ci /** 306461847f8eSopenharmony_ci * Checks whether the web page can go back. 306561847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 306661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 306761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 306861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 306961847f8eSopenharmony_ci * @crossplatform 307061847f8eSopenharmony_ci * @atomicservice 307161847f8eSopenharmony_ci * @since 11 307261847f8eSopenharmony_ci */ 307361847f8eSopenharmony_ci accessBackward(): boolean; 307461847f8eSopenharmony_ci 307561847f8eSopenharmony_ci /** 307661847f8eSopenharmony_ci * Checks whether the web page can go back or forward the given number of steps. 307761847f8eSopenharmony_ci * 307861847f8eSopenharmony_ci * @param { number } step - The number of steps. 307961847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 308061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 308161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 308261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 308361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 308461847f8eSopenharmony_ci * @since 9 308561847f8eSopenharmony_ci */ 308661847f8eSopenharmony_ci /** 308761847f8eSopenharmony_ci * Checks whether the web page can go back or forward the given number of steps. 308861847f8eSopenharmony_ci * 308961847f8eSopenharmony_ci * @param { number } step - The number of steps. 309061847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 309161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 309261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 309361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 309461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 309561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 309661847f8eSopenharmony_ci * @crossplatform 309761847f8eSopenharmony_ci * @atomicservice 309861847f8eSopenharmony_ci * @since 11 309961847f8eSopenharmony_ci */ 310061847f8eSopenharmony_ci accessStep(step: number): boolean; 310161847f8eSopenharmony_ci 310261847f8eSopenharmony_ci /** 310361847f8eSopenharmony_ci * Goes forward in the history of the web page. 310461847f8eSopenharmony_ci * 310561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 310661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 310761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 310861847f8eSopenharmony_ci * @since 9 310961847f8eSopenharmony_ci */ 311061847f8eSopenharmony_ci /** 311161847f8eSopenharmony_ci * Goes forward in the history of the web page. 311261847f8eSopenharmony_ci * 311361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 311461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 311561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 311661847f8eSopenharmony_ci * @crossplatform 311761847f8eSopenharmony_ci * @atomicservice 311861847f8eSopenharmony_ci * @since 11 311961847f8eSopenharmony_ci */ 312061847f8eSopenharmony_ci forward(): void; 312161847f8eSopenharmony_ci 312261847f8eSopenharmony_ci /** 312361847f8eSopenharmony_ci * Goes back in the history of the web page. 312461847f8eSopenharmony_ci * 312561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 312661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 312761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 312861847f8eSopenharmony_ci * @since 9 312961847f8eSopenharmony_ci */ 313061847f8eSopenharmony_ci /** 313161847f8eSopenharmony_ci * Goes back in the history of the web page. 313261847f8eSopenharmony_ci * 313361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 313461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 313561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 313661847f8eSopenharmony_ci * @crossplatform 313761847f8eSopenharmony_ci * @atomicservice 313861847f8eSopenharmony_ci * @since 11 313961847f8eSopenharmony_ci */ 314061847f8eSopenharmony_ci backward(): void; 314161847f8eSopenharmony_ci 314261847f8eSopenharmony_ci /** 314361847f8eSopenharmony_ci * Clears the history in the Web. 314461847f8eSopenharmony_ci * 314561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 314661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 314761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 314861847f8eSopenharmony_ci * @since 9 314961847f8eSopenharmony_ci */ 315061847f8eSopenharmony_ci /** 315161847f8eSopenharmony_ci * Clears the history in the Web. 315261847f8eSopenharmony_ci * 315361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 315461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 315561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 315661847f8eSopenharmony_ci * @crossplatform 315761847f8eSopenharmony_ci * @atomicservice 315861847f8eSopenharmony_ci * @since 11 315961847f8eSopenharmony_ci */ 316061847f8eSopenharmony_ci clearHistory(): void; 316161847f8eSopenharmony_ci 316261847f8eSopenharmony_ci /** 316361847f8eSopenharmony_ci * Let the Web active. 316461847f8eSopenharmony_ci * 316561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 316661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 316761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 316861847f8eSopenharmony_ci * @since 9 316961847f8eSopenharmony_ci */ 317061847f8eSopenharmony_ci /** 317161847f8eSopenharmony_ci * Let the Web active. 317261847f8eSopenharmony_ci * 317361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 317461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 317561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 317661847f8eSopenharmony_ci * @atomicservice 317761847f8eSopenharmony_ci * @since 11 317861847f8eSopenharmony_ci */ 317961847f8eSopenharmony_ci onActive(): void; 318061847f8eSopenharmony_ci 318161847f8eSopenharmony_ci /** 318261847f8eSopenharmony_ci * Let the Web inactive. 318361847f8eSopenharmony_ci * 318461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 318561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 318661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 318761847f8eSopenharmony_ci * @since 9 318861847f8eSopenharmony_ci */ 318961847f8eSopenharmony_ci /** 319061847f8eSopenharmony_ci * Let the Web inactive. 319161847f8eSopenharmony_ci * 319261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 319361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 319461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 319561847f8eSopenharmony_ci * @atomicservice 319661847f8eSopenharmony_ci * @since 11 319761847f8eSopenharmony_ci */ 319861847f8eSopenharmony_ci onInactive(): void; 319961847f8eSopenharmony_ci 320061847f8eSopenharmony_ci /** 320161847f8eSopenharmony_ci * Refreshes the current URL. 320261847f8eSopenharmony_ci * 320361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 320461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 320561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 320661847f8eSopenharmony_ci * @since 9 320761847f8eSopenharmony_ci */ 320861847f8eSopenharmony_ci /** 320961847f8eSopenharmony_ci * Refreshes the current URL. 321061847f8eSopenharmony_ci * 321161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 321261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 321361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 321461847f8eSopenharmony_ci * @crossplatform 321561847f8eSopenharmony_ci * @atomicservice 321661847f8eSopenharmony_ci * @since 11 321761847f8eSopenharmony_ci */ 321861847f8eSopenharmony_ci refresh(): void; 321961847f8eSopenharmony_ci 322061847f8eSopenharmony_ci /** 322161847f8eSopenharmony_ci * Loads the data or URL. 322261847f8eSopenharmony_ci * 322361847f8eSopenharmony_ci * @param { string } data - A string encoded according to "Base64" or "URL". 322461847f8eSopenharmony_ci * @param { string } mimeType - Media type. For example: "text/html". 322561847f8eSopenharmony_ci * @param { string } encoding - Encoding type. For example: "UTF-8". 322661847f8eSopenharmony_ci * @param { string } [baseUrl] - A specified URL path ("http"/"https"/"data" protocol), 322761847f8eSopenharmony_ci * which is assigned to window.origin by the Web component. 322861847f8eSopenharmony_ci * @param { string } [historyUrl] - History URL. When it is not empty, it can be managed by 322961847f8eSopenharmony_ci * history records to realize the back and forth function. 323061847f8eSopenharmony_ci * This property is invalid when baseUrl is empty. 323161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 323261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 323361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 323461847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 323561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 323661847f8eSopenharmony_ci * @since 9 323761847f8eSopenharmony_ci */ 323861847f8eSopenharmony_ci /** 323961847f8eSopenharmony_ci * Loads the data or URL. 324061847f8eSopenharmony_ci * 324161847f8eSopenharmony_ci * @param { string } data - A string encoded according to "Base64" or "URL". 324261847f8eSopenharmony_ci * @param { string } mimeType - Media type. For example: "text/html". 324361847f8eSopenharmony_ci * @param { string } encoding - Encoding type. For example: "UTF-8". 324461847f8eSopenharmony_ci * @param { string } [baseUrl] - A specified URL path ("http"/"https"/"data" protocol), 324561847f8eSopenharmony_ci * which is assigned to window.origin by the Web component. 324661847f8eSopenharmony_ci * @param { string } [historyUrl] - History URL. When it is not empty, it can be managed by 324761847f8eSopenharmony_ci * history records to realize the back and forth function. 324861847f8eSopenharmony_ci * This property is invalid when baseUrl is empty. 324961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 325061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 325161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 325261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 325361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 325461847f8eSopenharmony_ci * @crossplatform 325561847f8eSopenharmony_ci * @atomicservice 325661847f8eSopenharmony_ci * @since 11 325761847f8eSopenharmony_ci */ 325861847f8eSopenharmony_ci loadData(data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string): void; 325961847f8eSopenharmony_ci 326061847f8eSopenharmony_ci /** 326161847f8eSopenharmony_ci * Loads the data or URL. 326261847f8eSopenharmony_ci * 326361847f8eSopenharmony_ci * @param { string | Resource } url - The URL to load. 326461847f8eSopenharmony_ci * @param { Array<WebHeader> } [headers] - Additional HTTP request header for URL. 326561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 326661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 326761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 326861847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 326961847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 327061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 327161847f8eSopenharmony_ci * @since 9 327261847f8eSopenharmony_ci */ 327361847f8eSopenharmony_ci /** 327461847f8eSopenharmony_ci * Loads the data or URL. 327561847f8eSopenharmony_ci * 327661847f8eSopenharmony_ci * @param { string | Resource } url - The URL to load. 327761847f8eSopenharmony_ci * @param { Array<WebHeader> } [headers] - Additional HTTP request header for URL. 327861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 327961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 328061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 328161847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 328261847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 328361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 328461847f8eSopenharmony_ci * @crossplatform 328561847f8eSopenharmony_ci * @since 10 328661847f8eSopenharmony_ci */ 328761847f8eSopenharmony_ci /** 328861847f8eSopenharmony_ci * Loads the data or URL. 328961847f8eSopenharmony_ci * 329061847f8eSopenharmony_ci * @param { string | Resource } url - The URL to load. 329161847f8eSopenharmony_ci * @param { Array<WebHeader> } [headers] - Additional HTTP request header for URL. 329261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 329361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 329461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 329561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 329661847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 329761847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 329861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 329961847f8eSopenharmony_ci * @crossplatform 330061847f8eSopenharmony_ci * @atomicservice 330161847f8eSopenharmony_ci * @since 11 330261847f8eSopenharmony_ci */ 330361847f8eSopenharmony_ci loadUrl(url: string | Resource, headers?: Array<WebHeader>): void; 330461847f8eSopenharmony_ci 330561847f8eSopenharmony_ci /** 330661847f8eSopenharmony_ci * Gets the type of HitTest. 330761847f8eSopenharmony_ci * @returns { WebHitTestType } The type of HitTest. 330861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 330961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 331061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 331161847f8eSopenharmony_ci * @since 9 331261847f8eSopenharmony_ci */ 331361847f8eSopenharmony_ci /** 331461847f8eSopenharmony_ci * Gets the type of HitTest. 331561847f8eSopenharmony_ci * @returns { WebHitTestType } The type of HitTest. 331661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 331761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 331861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 331961847f8eSopenharmony_ci * @atomicservice 332061847f8eSopenharmony_ci * @since 11 332161847f8eSopenharmony_ci */ 332261847f8eSopenharmony_ci getHitTest(): WebHitTestType; 332361847f8eSopenharmony_ci 332461847f8eSopenharmony_ci /** 332561847f8eSopenharmony_ci * Stores the current page as a web archive. 332661847f8eSopenharmony_ci * 332761847f8eSopenharmony_ci * @param { string } baseName - Where the generated offline webpage is stored, This value cannot be null. 332861847f8eSopenharmony_ci * @param { boolean } autoName - Decide whether to automatically generate the file name. If false, it is 332961847f8eSopenharmony_ci * stored by the file name of baseName. If true, the file name is 333061847f8eSopenharmony_ci * automatically generated based on the current URL and stored in the file 333161847f8eSopenharmony_ci * directory of baseName. 333261847f8eSopenharmony_ci * @returns { Promise<string> } a promise resolved after the web archive has been stored. The parameter 333361847f8eSopenharmony_ci * will either be the filename under which the file was stored, or empty 333461847f8eSopenharmony_ci * if storing the file failed. 333561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 333661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 333761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 333861847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 333961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 334061847f8eSopenharmony_ci * @since 9 334161847f8eSopenharmony_ci */ 334261847f8eSopenharmony_ci /** 334361847f8eSopenharmony_ci * Stores the current page as a web archive. 334461847f8eSopenharmony_ci * 334561847f8eSopenharmony_ci * @param { string } baseName - Where the generated offline webpage is stored, This value cannot be null. 334661847f8eSopenharmony_ci * @param { boolean } autoName - Decide whether to automatically generate the file name. If false, it is 334761847f8eSopenharmony_ci * stored by the file name of baseName. If true, the file name is 334861847f8eSopenharmony_ci * automatically generated based on the current URL and stored in the file 334961847f8eSopenharmony_ci * directory of baseName. 335061847f8eSopenharmony_ci * @returns { Promise<string> } a promise resolved after the web archive has been stored. The parameter 335161847f8eSopenharmony_ci * will either be the filename under which the file was stored, or empty 335261847f8eSopenharmony_ci * if storing the file failed. 335361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 335461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 335561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 335661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 335761847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 335861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 335961847f8eSopenharmony_ci * @atomicservice 336061847f8eSopenharmony_ci * @since 11 336161847f8eSopenharmony_ci */ 336261847f8eSopenharmony_ci storeWebArchive(baseName: string, autoName: boolean): Promise<string>; 336361847f8eSopenharmony_ci 336461847f8eSopenharmony_ci /** 336561847f8eSopenharmony_ci * Stores the current page as a web archive. 336661847f8eSopenharmony_ci * 336761847f8eSopenharmony_ci * @param { string } baseName - Where the generated offline webpage is stored, This value cannot be null. 336861847f8eSopenharmony_ci * @param { boolean } autoName - Decide whether to automatically generate the file name. If false, it is 336961847f8eSopenharmony_ci * stored by the file name of baseName. If true, the file name is 337061847f8eSopenharmony_ci * automatically generated based on the current URL and stored in the file 337161847f8eSopenharmony_ci * directory of baseName. 337261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - called after the web archive has been stored. The parameter 337361847f8eSopenharmony_ci * will either be the filename under which the file was stored, 337461847f8eSopenharmony_ci * or empty if storing the file failed. 337561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 337661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 337761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 337861847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 337961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 338061847f8eSopenharmony_ci * @since 9 338161847f8eSopenharmony_ci */ 338261847f8eSopenharmony_ci /** 338361847f8eSopenharmony_ci * Stores the current page as a web archive. 338461847f8eSopenharmony_ci * 338561847f8eSopenharmony_ci * @param { string } baseName - Where the generated offline webpage is stored, This value cannot be null. 338661847f8eSopenharmony_ci * @param { boolean } autoName - Decide whether to automatically generate the file name. If false, it is 338761847f8eSopenharmony_ci * stored by the file name of baseName. If true, the file name is 338861847f8eSopenharmony_ci * automatically generated based on the current URL and stored in the file 338961847f8eSopenharmony_ci * directory of baseName. 339061847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - called after the web archive has been stored. The parameter 339161847f8eSopenharmony_ci * will either be the filename under which the file was stored, 339261847f8eSopenharmony_ci * or empty if storing the file failed. 339361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 339461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 339561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 339661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 339761847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 339861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 339961847f8eSopenharmony_ci * @atomicservice 340061847f8eSopenharmony_ci * @since 11 340161847f8eSopenharmony_ci */ 340261847f8eSopenharmony_ci storeWebArchive(baseName: string, autoName: boolean, callback: AsyncCallback<string>): void; 340361847f8eSopenharmony_ci 340461847f8eSopenharmony_ci /** 340561847f8eSopenharmony_ci * Let the Web zoom by. 340661847f8eSopenharmony_ci * 340761847f8eSopenharmony_ci * @param { number } factor - The zoom factor. 340861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 340961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 341061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 341161847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 341261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 341361847f8eSopenharmony_ci * @since 9 341461847f8eSopenharmony_ci */ 341561847f8eSopenharmony_ci /** 341661847f8eSopenharmony_ci * Let the Web zoom by. 341761847f8eSopenharmony_ci * 341861847f8eSopenharmony_ci * @param { number } factor - The zoom factor. 341961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 342061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 342161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 342261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 342361847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 342461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 342561847f8eSopenharmony_ci * @crossplatform 342661847f8eSopenharmony_ci * @atomicservice 342761847f8eSopenharmony_ci * @since 11 342861847f8eSopenharmony_ci */ 342961847f8eSopenharmony_ci zoom(factor: number): void; 343061847f8eSopenharmony_ci 343161847f8eSopenharmony_ci /** 343261847f8eSopenharmony_ci * Let the Web zoom in. 343361847f8eSopenharmony_ci * 343461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 343561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 343661847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 343761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 343861847f8eSopenharmony_ci * @since 9 343961847f8eSopenharmony_ci */ 344061847f8eSopenharmony_ci /** 344161847f8eSopenharmony_ci * Let the Web zoom in. 344261847f8eSopenharmony_ci * 344361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 344461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 344561847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 344661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 344761847f8eSopenharmony_ci * @atomicservice 344861847f8eSopenharmony_ci * @since 11 344961847f8eSopenharmony_ci */ 345061847f8eSopenharmony_ci zoomIn(): void; 345161847f8eSopenharmony_ci 345261847f8eSopenharmony_ci /** 345361847f8eSopenharmony_ci * Let the Web zoom out. 345461847f8eSopenharmony_ci * 345561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 345661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 345761847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 345861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 345961847f8eSopenharmony_ci * @since 9 346061847f8eSopenharmony_ci */ 346161847f8eSopenharmony_ci /** 346261847f8eSopenharmony_ci * Let the Web zoom out. 346361847f8eSopenharmony_ci * 346461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 346561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 346661847f8eSopenharmony_ci * @throws { BusinessError } 17100004 - Function not enabled. 346761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 346861847f8eSopenharmony_ci * @atomicservice 346961847f8eSopenharmony_ci * @since 11 347061847f8eSopenharmony_ci */ 347161847f8eSopenharmony_ci zoomOut(): void; 347261847f8eSopenharmony_ci 347361847f8eSopenharmony_ci /** 347461847f8eSopenharmony_ci * Gets the hit test value of HitTest. 347561847f8eSopenharmony_ci * @returns { HitTestValue } Return the element information of the clicked area. 347661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 347761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 347861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 347961847f8eSopenharmony_ci * @since 9 348061847f8eSopenharmony_ci */ 348161847f8eSopenharmony_ci /** 348261847f8eSopenharmony_ci * Gets the hit test value of HitTest. 348361847f8eSopenharmony_ci * @returns { HitTestValue } Return the element information of the clicked area. 348461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 348561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 348661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 348761847f8eSopenharmony_ci * @atomicservice 348861847f8eSopenharmony_ci * @since 11 348961847f8eSopenharmony_ci */ 349061847f8eSopenharmony_ci getHitTestValue(): HitTestValue; 349161847f8eSopenharmony_ci 349261847f8eSopenharmony_ci /** 349361847f8eSopenharmony_ci * Gets the id for the current Web. 349461847f8eSopenharmony_ci * @returns { number } Returns the index value of the current Web component. 349561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 349661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 349761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 349861847f8eSopenharmony_ci * @since 9 349961847f8eSopenharmony_ci */ 350061847f8eSopenharmony_ci /** 350161847f8eSopenharmony_ci * Gets the id for the current Web. 350261847f8eSopenharmony_ci * @returns { number } Returns the index value of the current Web component. 350361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 350461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 350561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 350661847f8eSopenharmony_ci * @atomicservice 350761847f8eSopenharmony_ci * @since 11 350861847f8eSopenharmony_ci */ 350961847f8eSopenharmony_ci getWebId(): number; 351061847f8eSopenharmony_ci 351161847f8eSopenharmony_ci /** 351261847f8eSopenharmony_ci * Gets the default user agent. 351361847f8eSopenharmony_ci * @returns { string } Return user agent information. 351461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 351561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 351661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 351761847f8eSopenharmony_ci * @since 9 351861847f8eSopenharmony_ci */ 351961847f8eSopenharmony_ci /** 352061847f8eSopenharmony_ci * Gets the default user agent. 352161847f8eSopenharmony_ci * @returns { string } Return user agent information. 352261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 352361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 352461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 352561847f8eSopenharmony_ci * @atomicservice 352661847f8eSopenharmony_ci * @since 11 352761847f8eSopenharmony_ci */ 352861847f8eSopenharmony_ci getUserAgent(): string; 352961847f8eSopenharmony_ci 353061847f8eSopenharmony_ci /** 353161847f8eSopenharmony_ci * Gets the title of current Web page. 353261847f8eSopenharmony_ci * @returns { string } Return to File Selector Title. 353361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 353461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 353561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 353661847f8eSopenharmony_ci * @since 9 353761847f8eSopenharmony_ci */ 353861847f8eSopenharmony_ci /** 353961847f8eSopenharmony_ci * Gets the title of current Web page. 354061847f8eSopenharmony_ci * @returns { string } Return to File Selector Title. 354161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 354261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 354361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 354461847f8eSopenharmony_ci * @crossplatform 354561847f8eSopenharmony_ci * @atomicservice 354661847f8eSopenharmony_ci * @since 11 354761847f8eSopenharmony_ci */ 354861847f8eSopenharmony_ci getTitle(): string; 354961847f8eSopenharmony_ci 355061847f8eSopenharmony_ci /** 355161847f8eSopenharmony_ci * Gets the content height of current Web page. 355261847f8eSopenharmony_ci * @returns { number } Returns the page height of the current page. 355361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 355461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 355561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 355661847f8eSopenharmony_ci * @since 9 355761847f8eSopenharmony_ci */ 355861847f8eSopenharmony_ci /** 355961847f8eSopenharmony_ci * Gets the content height of current Web page. 356061847f8eSopenharmony_ci * @returns { number } Returns the page height of the current page. 356161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 356261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 356361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 356461847f8eSopenharmony_ci * @crossplatform 356561847f8eSopenharmony_ci * @atomicservice 356661847f8eSopenharmony_ci * @since 11 356761847f8eSopenharmony_ci */ 356861847f8eSopenharmony_ci getPageHeight(): number; 356961847f8eSopenharmony_ci 357061847f8eSopenharmony_ci /** 357161847f8eSopenharmony_ci * Goes forward or back backOrForward in the history of the web page. 357261847f8eSopenharmony_ci * 357361847f8eSopenharmony_ci * @param { number } step - Steps to go forward or backward. 357461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 357561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 357661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 357761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 357861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 357961847f8eSopenharmony_ci * @since 9 358061847f8eSopenharmony_ci */ 358161847f8eSopenharmony_ci /** 358261847f8eSopenharmony_ci * Goes forward or back backOrForward in the history of the web page. 358361847f8eSopenharmony_ci * 358461847f8eSopenharmony_ci * @param { number } step - Steps to go forward or backward. 358561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 358661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 358761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 358861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 358961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 359061847f8eSopenharmony_ci * @crossplatform 359161847f8eSopenharmony_ci * @atomicservice 359261847f8eSopenharmony_ci * @since 11 359361847f8eSopenharmony_ci */ 359461847f8eSopenharmony_ci backOrForward(step: number): void; 359561847f8eSopenharmony_ci 359661847f8eSopenharmony_ci /** 359761847f8eSopenharmony_ci * Gets the request focus. 359861847f8eSopenharmony_ci * 359961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 360061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 360161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 360261847f8eSopenharmony_ci * @since 9 360361847f8eSopenharmony_ci */ 360461847f8eSopenharmony_ci /** 360561847f8eSopenharmony_ci * Gets the request focus. 360661847f8eSopenharmony_ci * 360761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 360861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 360961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 361061847f8eSopenharmony_ci * @atomicservice 361161847f8eSopenharmony_ci * @since 11 361261847f8eSopenharmony_ci */ 361361847f8eSopenharmony_ci requestFocus(): void; 361461847f8eSopenharmony_ci 361561847f8eSopenharmony_ci /** 361661847f8eSopenharmony_ci * Create web message ports 361761847f8eSopenharmony_ci * @returns { Array<WebMessagePort> } An array represent 2 WebMessagePort, then can use 361861847f8eSopenharmony_ci * those ports to communication with html pages. 361961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 362061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 362161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 362261847f8eSopenharmony_ci * @since 9 362361847f8eSopenharmony_ci */ 362461847f8eSopenharmony_ci /** 362561847f8eSopenharmony_ci * Create web message ports 362661847f8eSopenharmony_ci * @param { boolean } isExtentionType - Set whether the web message port supports extention type. 362761847f8eSopenharmony_ci * @returns { Array<WebMessagePort> } An array represent 2 WebMessagePort, then can use 362861847f8eSopenharmony_ci * those ports to communication with html pages. 362961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 363061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 363161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 363261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 363361847f8eSopenharmony_ci * @since 10 363461847f8eSopenharmony_ci */ 363561847f8eSopenharmony_ci /** 363661847f8eSopenharmony_ci * Create web message ports 363761847f8eSopenharmony_ci * @param { boolean } isExtentionType - Set whether the web message port supports extention type. 363861847f8eSopenharmony_ci * @returns { Array<WebMessagePort> } An array represent 2 WebMessagePort, then can use 363961847f8eSopenharmony_ci * those ports to communication with html pages. 364061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 364161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 364261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 364361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 364461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 364561847f8eSopenharmony_ci * @crossplatform 364661847f8eSopenharmony_ci * @atomicservice 364761847f8eSopenharmony_ci * @since 11 364861847f8eSopenharmony_ci */ 364961847f8eSopenharmony_ci createWebMessagePorts(isExtentionType?: boolean): Array<WebMessagePort>; 365061847f8eSopenharmony_ci 365161847f8eSopenharmony_ci /** 365261847f8eSopenharmony_ci * Post web message port to html 365361847f8eSopenharmony_ci * 365461847f8eSopenharmony_ci * @param { string } name - Data name information to send. 365561847f8eSopenharmony_ci * @param { Array<WebMessagePort> } ports - Port number array information to send. 365661847f8eSopenharmony_ci * @param { string } uri - URI to receive this information. 365761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 365861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 365961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 366061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 366161847f8eSopenharmony_ci * @since 9 366261847f8eSopenharmony_ci */ 366361847f8eSopenharmony_ci /** 366461847f8eSopenharmony_ci * Post web message port to html 366561847f8eSopenharmony_ci * 366661847f8eSopenharmony_ci * @param { string } name - Data name information to send. 366761847f8eSopenharmony_ci * @param { Array<WebMessagePort> } ports - Port number array information to send. 366861847f8eSopenharmony_ci * @param { string } uri - URI to receive this information. 366961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 367061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 367161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 367261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 367361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 367461847f8eSopenharmony_ci * @crossplatform 367561847f8eSopenharmony_ci * @atomicservice 367661847f8eSopenharmony_ci * @since 11 367761847f8eSopenharmony_ci */ 367861847f8eSopenharmony_ci postMessage(name: string, ports: Array<WebMessagePort>, uri: string): void; 367961847f8eSopenharmony_ci 368061847f8eSopenharmony_ci /** 368161847f8eSopenharmony_ci * Stops the current load. 368261847f8eSopenharmony_ci * 368361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 368461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 368561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 368661847f8eSopenharmony_ci * @since 9 368761847f8eSopenharmony_ci */ 368861847f8eSopenharmony_ci /** 368961847f8eSopenharmony_ci * Stops the current load. 369061847f8eSopenharmony_ci * 369161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 369261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 369361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 369461847f8eSopenharmony_ci * @crossplatform 369561847f8eSopenharmony_ci * @atomicservice 369661847f8eSopenharmony_ci * @since 11 369761847f8eSopenharmony_ci */ 369861847f8eSopenharmony_ci stop(): void; 369961847f8eSopenharmony_ci 370061847f8eSopenharmony_ci /** 370161847f8eSopenharmony_ci * Registers the JavaScript object and method list. 370261847f8eSopenharmony_ci * 370361847f8eSopenharmony_ci * @param { object } object - Application side JavaScript objects participating in registration. 370461847f8eSopenharmony_ci * @param { string } name - The name of the registered object, which is consistent with the 370561847f8eSopenharmony_ci * object name called in the window. 370661847f8eSopenharmony_ci * @param { Array<string> } methodList - Thr method of the application side JavaScript object participating 370761847f8eSopenharmony_ci * in the registration. 370861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 370961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 371061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 371161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 371261847f8eSopenharmony_ci * @since 9 371361847f8eSopenharmony_ci */ 371461847f8eSopenharmony_ci /** 371561847f8eSopenharmony_ci * Registers the JavaScript object and method list. 371661847f8eSopenharmony_ci * 371761847f8eSopenharmony_ci * @param { object } object - Application side JavaScript objects participating in registration. 371861847f8eSopenharmony_ci * @param { string } name - The name of the registered object, which is consistent with the 371961847f8eSopenharmony_ci * object name called in the window. 372061847f8eSopenharmony_ci * @param { Array<string> } methodList - Thr method of the application side JavaScript object participating 372161847f8eSopenharmony_ci * in the registration. 372261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 372361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 372461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 372561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 372661847f8eSopenharmony_ci * @atomicservice 372761847f8eSopenharmony_ci * @since 11 372861847f8eSopenharmony_ci */ 372961847f8eSopenharmony_ci /** 373061847f8eSopenharmony_ci * Registers the JavaScript object and method list. 373161847f8eSopenharmony_ci * 373261847f8eSopenharmony_ci * @param { object } object - Application side JavaScript objects participating in registration. 373361847f8eSopenharmony_ci * @param { string } name - The name of the registered object, which is consistent with the 373461847f8eSopenharmony_ci * object name called in the window. 373561847f8eSopenharmony_ci * @param { Array<string> } methodList - The method of the application side JavaScript object participating 373661847f8eSopenharmony_ci * in the registration. 373761847f8eSopenharmony_ci * @param { Array<string> } [asyncMethodList] - The async method of the application side JavaScript object 373861847f8eSopenharmony_ci * participating in the registration. 373961847f8eSopenharmony_ci * @param { string } [permission] - permission configuration defining web page URLs that can access JavaScriptProxy methods. 374061847f8eSopenharmony_ci * The configuration can be defined at two levels, object level and method level. 374161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 374261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 374361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 374461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 374561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 374661847f8eSopenharmony_ci * @atomicservice 374761847f8eSopenharmony_ci * @since 12 374861847f8eSopenharmony_ci */ 374961847f8eSopenharmony_ci registerJavaScriptProxy(object: object, name: string, methodList: Array<string>, 375061847f8eSopenharmony_ci asyncMethodList?: Array<string>, permission?: string): void; 375161847f8eSopenharmony_ci 375261847f8eSopenharmony_ci /** 375361847f8eSopenharmony_ci * Deletes a registered JavaScript object with given name. 375461847f8eSopenharmony_ci * 375561847f8eSopenharmony_ci * @param { string } name - The name of a registered JavaScript object to be deleted. 375661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 375761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 375861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 375961847f8eSopenharmony_ci * @throws { BusinessError } 17100008 - Failed to delete JavaScriptProxy because it does not exist. 376061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 376161847f8eSopenharmony_ci * @since 9 376261847f8eSopenharmony_ci */ 376361847f8eSopenharmony_ci /** 376461847f8eSopenharmony_ci * Deletes a registered JavaScript object with given name. 376561847f8eSopenharmony_ci * 376661847f8eSopenharmony_ci * @param { string } name - The name of a registered JavaScript object to be deleted. 376761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 376861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 376961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 377061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 377161847f8eSopenharmony_ci * @throws { BusinessError } 17100008 - Failed to delete JavaScriptProxy because it does not exist. 377261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 377361847f8eSopenharmony_ci * @atomicservice 377461847f8eSopenharmony_ci * @since 11 377561847f8eSopenharmony_ci */ 377661847f8eSopenharmony_ci deleteJavaScriptRegister(name: string): void; 377761847f8eSopenharmony_ci 377861847f8eSopenharmony_ci /** 377961847f8eSopenharmony_ci * Search all instances of 'searchString' on the page and highlights them, 378061847f8eSopenharmony_ci * result will be notify through callback onSearchResultReceive. 378161847f8eSopenharmony_ci * 378261847f8eSopenharmony_ci * @param { string } searchString - String to be search. 378361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 378461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 378561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 378661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 378761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 378861847f8eSopenharmony_ci * @since 9 378961847f8eSopenharmony_ci */ 379061847f8eSopenharmony_ci /** 379161847f8eSopenharmony_ci * Search all instances of 'searchString' on the page and highlights them, 379261847f8eSopenharmony_ci * result will be notify through callback onSearchResultReceive. 379361847f8eSopenharmony_ci * 379461847f8eSopenharmony_ci * @param { string } searchString - String to be search. 379561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 379661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 379761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 379861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 379961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 380061847f8eSopenharmony_ci * @atomicservice 380161847f8eSopenharmony_ci * @since 11 380261847f8eSopenharmony_ci */ 380361847f8eSopenharmony_ci searchAllAsync(searchString: string): void; 380461847f8eSopenharmony_ci 380561847f8eSopenharmony_ci /** 380661847f8eSopenharmony_ci * Clears the highlighting surrounding text matches created by searchAllAsync. 380761847f8eSopenharmony_ci * 380861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 380961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 381061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 381161847f8eSopenharmony_ci * @since 9 381261847f8eSopenharmony_ci */ 381361847f8eSopenharmony_ci /** 381461847f8eSopenharmony_ci * Clears the highlighting surrounding text matches created by searchAllAsync. 381561847f8eSopenharmony_ci * 381661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 381761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 381861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 381961847f8eSopenharmony_ci * @atomicservice 382061847f8eSopenharmony_ci * @since 11 382161847f8eSopenharmony_ci */ 382261847f8eSopenharmony_ci clearMatches(): void; 382361847f8eSopenharmony_ci 382461847f8eSopenharmony_ci /** 382561847f8eSopenharmony_ci * Highlights and scrolls to the next match search. 382661847f8eSopenharmony_ci * 382761847f8eSopenharmony_ci * @param { boolean } forward - Step of search is back or forward. 382861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 382961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 383061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 383161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 383261847f8eSopenharmony_ci * @since 9 383361847f8eSopenharmony_ci */ 383461847f8eSopenharmony_ci /** 383561847f8eSopenharmony_ci * Highlights and scrolls to the next match search. 383661847f8eSopenharmony_ci * 383761847f8eSopenharmony_ci * @param { boolean } forward - Step of search is back or forward. 383861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 383961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 384061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 384161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 384261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 384361847f8eSopenharmony_ci * @atomicservice 384461847f8eSopenharmony_ci * @since 11 384561847f8eSopenharmony_ci */ 384661847f8eSopenharmony_ci searchNext(forward: boolean): void; 384761847f8eSopenharmony_ci 384861847f8eSopenharmony_ci /** 384961847f8eSopenharmony_ci * Clears the ssl cache in the Web. 385061847f8eSopenharmony_ci * 385161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 385261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 385361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 385461847f8eSopenharmony_ci * @since 9 385561847f8eSopenharmony_ci */ 385661847f8eSopenharmony_ci /** 385761847f8eSopenharmony_ci * Clears the ssl cache in the Web. 385861847f8eSopenharmony_ci * 385961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 386061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 386161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 386261847f8eSopenharmony_ci * @atomicservice 386361847f8eSopenharmony_ci * @since 11 386461847f8eSopenharmony_ci */ 386561847f8eSopenharmony_ci clearSslCache(): void; 386661847f8eSopenharmony_ci 386761847f8eSopenharmony_ci /** 386861847f8eSopenharmony_ci * Clears the client authentication certificate cache in the Web. 386961847f8eSopenharmony_ci * 387061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 387161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 387261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 387361847f8eSopenharmony_ci * @since 9 387461847f8eSopenharmony_ci */ 387561847f8eSopenharmony_ci /** 387661847f8eSopenharmony_ci * Clears the client authentication certificate cache in the Web. 387761847f8eSopenharmony_ci * 387861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 387961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 388061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 388161847f8eSopenharmony_ci * @atomicservice 388261847f8eSopenharmony_ci * @since 11 388361847f8eSopenharmony_ci */ 388461847f8eSopenharmony_ci clearClientAuthenticationCache(): void; 388561847f8eSopenharmony_ci 388661847f8eSopenharmony_ci /** 388761847f8eSopenharmony_ci * Loads a piece of code and execute JS code in the context of the currently displayed page. 388861847f8eSopenharmony_ci * 388961847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 389061847f8eSopenharmony_ci * @returns { Promise<string> } A promise is solved after the JavaScript script is executed. 389161847f8eSopenharmony_ci * This parameter will be the result of JavaScript script execution. 389261847f8eSopenharmony_ci * If the JavaScript script fails to execute or has no return value, 389361847f8eSopenharmony_ci * null will be returned. 389461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 389561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 389661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 389761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 389861847f8eSopenharmony_ci * @since 9 389961847f8eSopenharmony_ci */ 390061847f8eSopenharmony_ci /** 390161847f8eSopenharmony_ci * Loads a piece of code and execute JS code in the context of the currently displayed page. 390261847f8eSopenharmony_ci * 390361847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 390461847f8eSopenharmony_ci * @returns { Promise<string> } A promise is solved after the JavaScript script is executed. 390561847f8eSopenharmony_ci * This parameter will be the result of JavaScript script execution. 390661847f8eSopenharmony_ci * If the JavaScript script fails to execute or has no return value, 390761847f8eSopenharmony_ci * null will be returned. 390861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 390961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 391061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 391161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 391261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 391361847f8eSopenharmony_ci * @crossplatform 391461847f8eSopenharmony_ci * @atomicservice 391561847f8eSopenharmony_ci * @since 11 391661847f8eSopenharmony_ci */ 391761847f8eSopenharmony_ci runJavaScript(script: string): Promise<string>; 391861847f8eSopenharmony_ci 391961847f8eSopenharmony_ci /** 392061847f8eSopenharmony_ci * Loads a piece of code and execute JS code in the context of the currently displayed page. 392161847f8eSopenharmony_ci * 392261847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 392361847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Callbacks execute JavaScript script results. 392461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 392561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 392661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 392761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 392861847f8eSopenharmony_ci * @since 9 392961847f8eSopenharmony_ci */ 393061847f8eSopenharmony_ci /** 393161847f8eSopenharmony_ci * Loads a piece of code and execute JS code in the context of the currently displayed page. 393261847f8eSopenharmony_ci * 393361847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 393461847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Callbacks execute JavaScript script results. 393561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 393661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 393761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 393861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 393961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 394061847f8eSopenharmony_ci * @crossplatform 394161847f8eSopenharmony_ci * @atomicservice 394261847f8eSopenharmony_ci * @since 11 394361847f8eSopenharmony_ci */ 394461847f8eSopenharmony_ci runJavaScript(script: string, callback: AsyncCallback<string>): void; 394561847f8eSopenharmony_ci 394661847f8eSopenharmony_ci /** 394761847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 394861847f8eSopenharmony_ci * 394961847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 395061847f8eSopenharmony_ci * @returns { Promise<JsMessageExt> } A promise is solved after the JavaScript script is executed. 395161847f8eSopenharmony_ci * This parameter will be the result of JavaScript script execution. 395261847f8eSopenharmony_ci * If the JavaScript script fails to execute or has no return value, 395361847f8eSopenharmony_ci * a none type value will be returned. 395461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 395561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 395661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 395761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 395861847f8eSopenharmony_ci * @since 10 395961847f8eSopenharmony_ci */ 396061847f8eSopenharmony_ci /** 396161847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 396261847f8eSopenharmony_ci * 396361847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 396461847f8eSopenharmony_ci * @returns { Promise<JsMessageExt> } A promise is solved after the JavaScript script is executed. 396561847f8eSopenharmony_ci * This parameter will be the result of JavaScript script execution. 396661847f8eSopenharmony_ci * If the JavaScript script fails to execute or has no return value, 396761847f8eSopenharmony_ci * a none type value will be returned. 396861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 396961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 397061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 397161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 397261847f8eSopenharmony_ci * @atomicservice 397361847f8eSopenharmony_ci * @since 11 397461847f8eSopenharmony_ci */ 397561847f8eSopenharmony_ci /** 397661847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 397761847f8eSopenharmony_ci * 397861847f8eSopenharmony_ci * @param { string | ArrayBuffer } script - JavaScript Script. 397961847f8eSopenharmony_ci * @returns { Promise<JsMessageExt> } A promise is solved after the JavaScript script is executed. 398061847f8eSopenharmony_ci * This parameter will be the result of JavaScript script execution. 398161847f8eSopenharmony_ci * If the JavaScript script fails to execute or has no return value, 398261847f8eSopenharmony_ci * a none type value will be returned. 398361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 398461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 398561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 398661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 398761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 398861847f8eSopenharmony_ci * @atomicservice 398961847f8eSopenharmony_ci * @since 12 399061847f8eSopenharmony_ci */ 399161847f8eSopenharmony_ci runJavaScriptExt(script: string | ArrayBuffer): Promise<JsMessageExt>; 399261847f8eSopenharmony_ci 399361847f8eSopenharmony_ci /** 399461847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 399561847f8eSopenharmony_ci * 399661847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 399761847f8eSopenharmony_ci * @param { AsyncCallback<JsMessageExt> } callback - Callbacks execute JavaScript script results. 399861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 399961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 400061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 400161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 400261847f8eSopenharmony_ci * @since 10 400361847f8eSopenharmony_ci */ 400461847f8eSopenharmony_ci /** 400561847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 400661847f8eSopenharmony_ci * 400761847f8eSopenharmony_ci * @param { string } script - JavaScript Script. 400861847f8eSopenharmony_ci * @param { AsyncCallback<JsMessageExt> } callback - Callbacks execute JavaScript script results. 400961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 401061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 401161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 401261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 401361847f8eSopenharmony_ci * @atomicservice 401461847f8eSopenharmony_ci * @since 11 401561847f8eSopenharmony_ci */ 401661847f8eSopenharmony_ci /** 401761847f8eSopenharmony_ci * Execute JavaScript code in the context of the currently displayed page, and return the result. 401861847f8eSopenharmony_ci * 401961847f8eSopenharmony_ci * @param { string | ArrayBuffer } script - JavaScript Script. 402061847f8eSopenharmony_ci * @param { AsyncCallback<JsMessageExt> } callback - Callbacks execute JavaScript script results. 402161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 402261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 402361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 402461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 402561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 402661847f8eSopenharmony_ci * @atomicservice 402761847f8eSopenharmony_ci * @since 12 402861847f8eSopenharmony_ci */ 402961847f8eSopenharmony_ci runJavaScriptExt(script: string | ArrayBuffer, callback: AsyncCallback<JsMessageExt>): void; 403061847f8eSopenharmony_ci 403161847f8eSopenharmony_ci /** 403261847f8eSopenharmony_ci * Execute createPdf code in the context of the currently displayed page and return the result. 403361847f8eSopenharmony_ci * 403461847f8eSopenharmony_ci * @param { PdfConfiguration } configuration - createPdf configuration. 403561847f8eSopenharmony_ci * @param { AsyncCallback<PdfData> } callback - Callbacks execute createPdf results. 403661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 403761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 403861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 403961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 404061847f8eSopenharmony_ci * @atomicservice 404161847f8eSopenharmony_ci * @since 14 404261847f8eSopenharmony_ci */ 404361847f8eSopenharmony_ci createPdf(configuration: PdfConfiguration, callback: AsyncCallback<PdfData>): void; 404461847f8eSopenharmony_ci 404561847f8eSopenharmony_ci /** 404661847f8eSopenharmony_ci * Execute createPdf code in the context of the currently displayed page and return the result. 404761847f8eSopenharmony_ci * 404861847f8eSopenharmony_ci * @param { PdfConfiguration } configuration - createPdf configuration. 404961847f8eSopenharmony_ci * @returns { Promise<PdfData> } A promise is solved after the createPdf is executed. 405061847f8eSopenharmony_ci * This parameter will be the result of createPdf execution. 405161847f8eSopenharmony_ci * If the createPdf fails to execute or has no return value, 405261847f8eSopenharmony_ci * a none type value will be returned. 405361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 405461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 405561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 405661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 405761847f8eSopenharmony_ci * @atomicservice 405861847f8eSopenharmony_ci * @since 14 405961847f8eSopenharmony_ci */ 406061847f8eSopenharmony_ci createPdf(configuration: PdfConfiguration): Promise<PdfData>; 406161847f8eSopenharmony_ci 406261847f8eSopenharmony_ci /** 406361847f8eSopenharmony_ci * Gets the url of current Web page. 406461847f8eSopenharmony_ci * @returns { string } Return the url of the current page. 406561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 406661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 406761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 406861847f8eSopenharmony_ci * @since 9 406961847f8eSopenharmony_ci */ 407061847f8eSopenharmony_ci /** 407161847f8eSopenharmony_ci * Gets the url of current Web page. 407261847f8eSopenharmony_ci * @returns { string } Return the url of the current page. 407361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 407461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 407561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 407661847f8eSopenharmony_ci * @crossplatform 407761847f8eSopenharmony_ci * @atomicservice 407861847f8eSopenharmony_ci * @since 11 407961847f8eSopenharmony_ci */ 408061847f8eSopenharmony_ci getUrl(): string; 408161847f8eSopenharmony_ci 408261847f8eSopenharmony_ci /** 408361847f8eSopenharmony_ci * Scroll the contents of this Webview up by half the view size. 408461847f8eSopenharmony_ci * 408561847f8eSopenharmony_ci * @param { boolean } top - Whether to jump to the top of the page, if set to false, 408661847f8eSopenharmony_ci * the page content will scroll up half the size of the viewframe, 408761847f8eSopenharmony_ci * and when set to true, it will jump to the top of the page. 408861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 408961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 409061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 409161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 409261847f8eSopenharmony_ci * @since 9 409361847f8eSopenharmony_ci */ 409461847f8eSopenharmony_ci /** 409561847f8eSopenharmony_ci * Scroll the contents of this Webview up by half the view size. 409661847f8eSopenharmony_ci * 409761847f8eSopenharmony_ci * @param { boolean } top - Whether to jump to the top of the page, if set to false, 409861847f8eSopenharmony_ci * the page content will scroll up half the size of the viewframe, 409961847f8eSopenharmony_ci * and when set to true, it will jump to the top of the page. 410061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 410161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 410261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 410361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 410461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 410561847f8eSopenharmony_ci * @atomicservice 410661847f8eSopenharmony_ci * @since 11 410761847f8eSopenharmony_ci */ 410861847f8eSopenharmony_ci pageUp(top: boolean): void; 410961847f8eSopenharmony_ci 411061847f8eSopenharmony_ci /** 411161847f8eSopenharmony_ci * Scroll the contents of this Webview down by half the view size. 411261847f8eSopenharmony_ci * 411361847f8eSopenharmony_ci * @param { boolean } bottom - Whether to jump to the top of the page, if set to false, 411461847f8eSopenharmony_ci * the page content will scroll up half the size of the viewframe, 411561847f8eSopenharmony_ci * and when set to true, it will jump to the top of the page. 411661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 411761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 411861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 411961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 412061847f8eSopenharmony_ci * @since 9 412161847f8eSopenharmony_ci */ 412261847f8eSopenharmony_ci /** 412361847f8eSopenharmony_ci * Scroll the contents of this Webview down by half the view size. 412461847f8eSopenharmony_ci * 412561847f8eSopenharmony_ci * @param { boolean } bottom - Whether to jump to the top of the page, if set to false, 412661847f8eSopenharmony_ci * the page content will scroll up half the size of the viewframe, 412761847f8eSopenharmony_ci * and when set to true, it will jump to the top of the page. 412861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 412961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 413061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 413161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 413261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 413361847f8eSopenharmony_ci * @atomicservice 413461847f8eSopenharmony_ci * @since 11 413561847f8eSopenharmony_ci */ 413661847f8eSopenharmony_ci pageDown(bottom: boolean): void; 413761847f8eSopenharmony_ci 413861847f8eSopenharmony_ci /** 413961847f8eSopenharmony_ci * Gets the original url of current Web page. 414061847f8eSopenharmony_ci * @returns { string } Return the original url of the current page. 414161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 414261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 414361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 414461847f8eSopenharmony_ci * @since 9 414561847f8eSopenharmony_ci */ 414661847f8eSopenharmony_ci /** 414761847f8eSopenharmony_ci * Gets the original url of current Web page. 414861847f8eSopenharmony_ci * @returns { string } Return the original url of the current page. 414961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 415061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 415161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 415261847f8eSopenharmony_ci * @atomicservice 415361847f8eSopenharmony_ci * @since 11 415461847f8eSopenharmony_ci */ 415561847f8eSopenharmony_ci getOriginalUrl(): string; 415661847f8eSopenharmony_ci 415761847f8eSopenharmony_ci /** 415861847f8eSopenharmony_ci * Gets the favicon of current Web page. 415961847f8eSopenharmony_ci * @returns { image.PixelMap } Return the favicon bitmap of the current page. 416061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 416161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 416261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 416361847f8eSopenharmony_ci * @since 9 416461847f8eSopenharmony_ci */ 416561847f8eSopenharmony_ci /** 416661847f8eSopenharmony_ci * Gets the favicon of current Web page. 416761847f8eSopenharmony_ci * @returns { image.PixelMap } Return the favicon bitmap of the current page. 416861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 416961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 417061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 417161847f8eSopenharmony_ci * @atomicservice 417261847f8eSopenharmony_ci * @since 11 417361847f8eSopenharmony_ci */ 417461847f8eSopenharmony_ci getFavicon(): image.PixelMap; 417561847f8eSopenharmony_ci 417661847f8eSopenharmony_ci /** 417761847f8eSopenharmony_ci * Put network state for web. Which is used to set window.navigator.onLine property in 417861847f8eSopenharmony_ci * JavaScript. 417961847f8eSopenharmony_ci * @param { boolean } enable - Whether enable window.navigator.onLine. 418061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 418161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 418261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 418361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 418461847f8eSopenharmony_ci * @since 9 418561847f8eSopenharmony_ci */ 418661847f8eSopenharmony_ci /** 418761847f8eSopenharmony_ci * Put network state for web. Which is used to set window.navigator.onLine property in 418861847f8eSopenharmony_ci * JavaScript. 418961847f8eSopenharmony_ci * @param { boolean } enable - Whether enable window.navigator.onLine. 419061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 419161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 419261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 419361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 419461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 419561847f8eSopenharmony_ci * @atomicservice 419661847f8eSopenharmony_ci * @since 11 419761847f8eSopenharmony_ci */ 419861847f8eSopenharmony_ci setNetworkAvailable(enable: boolean): void; 419961847f8eSopenharmony_ci 420061847f8eSopenharmony_ci /** 420161847f8eSopenharmony_ci * Query if current document has image. 420261847f8eSopenharmony_ci * 420361847f8eSopenharmony_ci * @returns { Promise<boolean> } A promise resolved after query image has finished. 420461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 420561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 420661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 420761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 420861847f8eSopenharmony_ci * @since 9 420961847f8eSopenharmony_ci */ 421061847f8eSopenharmony_ci /** 421161847f8eSopenharmony_ci * Query if current document has image. 421261847f8eSopenharmony_ci * 421361847f8eSopenharmony_ci * @returns { Promise<boolean> } A promise resolved after query image has finished. 421461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 421561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 421661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 421761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 421861847f8eSopenharmony_ci * @atomicservice 421961847f8eSopenharmony_ci * @since 11 422061847f8eSopenharmony_ci */ 422161847f8eSopenharmony_ci hasImage(): Promise<boolean>; 422261847f8eSopenharmony_ci 422361847f8eSopenharmony_ci /** 422461847f8eSopenharmony_ci * Query if current document has image. 422561847f8eSopenharmony_ci * 422661847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Called after query image has finished. 422761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 422861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 422961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 423061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 423161847f8eSopenharmony_ci * @since 9 423261847f8eSopenharmony_ci */ 423361847f8eSopenharmony_ci /** 423461847f8eSopenharmony_ci * Query if current document has image. 423561847f8eSopenharmony_ci * 423661847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Called after query image has finished. 423761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 423861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 423961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 424061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 424161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 424261847f8eSopenharmony_ci * @atomicservice 424361847f8eSopenharmony_ci * @since 11 424461847f8eSopenharmony_ci */ 424561847f8eSopenharmony_ci hasImage(callback: AsyncCallback<boolean>): void; 424661847f8eSopenharmony_ci 424761847f8eSopenharmony_ci /** 424861847f8eSopenharmony_ci * Get back forward stack list from current webview. 424961847f8eSopenharmony_ci * @returns { BackForwardList } Back forward list for current webview. 425061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 425161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 425261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 425361847f8eSopenharmony_ci * @since 9 425461847f8eSopenharmony_ci */ 425561847f8eSopenharmony_ci /** 425661847f8eSopenharmony_ci * Get back forward stack list from current webview. 425761847f8eSopenharmony_ci * @returns { BackForwardList } Back forward list for current webview. 425861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 425961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 426061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 426161847f8eSopenharmony_ci * @crossplatform 426261847f8eSopenharmony_ci * @atomicservice 426361847f8eSopenharmony_ci * @since 11 426461847f8eSopenharmony_ci */ 426561847f8eSopenharmony_ci getBackForwardEntries(): BackForwardList; 426661847f8eSopenharmony_ci 426761847f8eSopenharmony_ci /** 426861847f8eSopenharmony_ci * Remove resource cache in application. So this method will remove all cache for all web components in the 426961847f8eSopenharmony_ci * same application. 427061847f8eSopenharmony_ci * 427161847f8eSopenharmony_ci * @param { boolean } clearRom - Remove cache in both rom and ram if true. Otherwise only clear cache 427261847f8eSopenharmony_ci * in ram. 427361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 427461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 427561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 427661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 427761847f8eSopenharmony_ci * @since 9 427861847f8eSopenharmony_ci */ 427961847f8eSopenharmony_ci /** 428061847f8eSopenharmony_ci * Remove resource cache in application. So this method will remove all cache for all web components in the 428161847f8eSopenharmony_ci * same application. 428261847f8eSopenharmony_ci * 428361847f8eSopenharmony_ci * @param { boolean } clearRom - Remove cache in both rom and ram if true. Otherwise only clear cache 428461847f8eSopenharmony_ci * in ram. 428561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 428661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 428761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 428861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 428961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 429061847f8eSopenharmony_ci * @crossplatform 429161847f8eSopenharmony_ci * @atomicservice 429261847f8eSopenharmony_ci * @since 11 429361847f8eSopenharmony_ci */ 429461847f8eSopenharmony_ci removeCache(clearRom: boolean): void; 429561847f8eSopenharmony_ci 429661847f8eSopenharmony_ci /** 429761847f8eSopenharmony_ci * Scroll to the position. 429861847f8eSopenharmony_ci * 429961847f8eSopenharmony_ci * @param { number } x - the x of the position. 430061847f8eSopenharmony_ci * @param { number } y - the y of the position. 430161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 430261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 430361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 430461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 430561847f8eSopenharmony_ci * @since 9 430661847f8eSopenharmony_ci */ 430761847f8eSopenharmony_ci /** 430861847f8eSopenharmony_ci * Scroll to the position. 430961847f8eSopenharmony_ci * 431061847f8eSopenharmony_ci * @param { number } x - the x of the position. 431161847f8eSopenharmony_ci * @param { number } y - the y of the position. 431261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 431361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 431461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 431561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 431661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 431761847f8eSopenharmony_ci * @crossplatform 431861847f8eSopenharmony_ci * @atomicservice 431961847f8eSopenharmony_ci * @since 11 432061847f8eSopenharmony_ci */ 432161847f8eSopenharmony_ci /** 432261847f8eSopenharmony_ci * Scroll to the position. 432361847f8eSopenharmony_ci * 432461847f8eSopenharmony_ci * @param { number } x - the x of the position. 432561847f8eSopenharmony_ci * @param { number } y - the y of the position. 432661847f8eSopenharmony_ci * @param { number } duration - the scroll animation duration. Unit: millisecond. 432761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 432861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 432961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 433061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 433161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 433261847f8eSopenharmony_ci * @crossplatform 433361847f8eSopenharmony_ci * @atomicservice 433461847f8eSopenharmony_ci * @since 14 433561847f8eSopenharmony_ci */ 433661847f8eSopenharmony_ci scrollTo(x: number, y: number, duration?: number): void; 433761847f8eSopenharmony_ci 433861847f8eSopenharmony_ci /** 433961847f8eSopenharmony_ci * Scroll by the delta position. 434061847f8eSopenharmony_ci * 434161847f8eSopenharmony_ci * @param { number } deltaX - the delta x of the position. 434261847f8eSopenharmony_ci * @param { number } deltaY - the delta y of the position. 434361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 434461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 434561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 434661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 434761847f8eSopenharmony_ci * @since 9 434861847f8eSopenharmony_ci */ 434961847f8eSopenharmony_ci /** 435061847f8eSopenharmony_ci * Scroll by the delta position. 435161847f8eSopenharmony_ci * 435261847f8eSopenharmony_ci * @param { number } deltaX - the delta x of the position. 435361847f8eSopenharmony_ci * @param { number } deltaY - the delta y of the position. 435461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 435561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 435661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 435761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 435861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 435961847f8eSopenharmony_ci * @crossplatform 436061847f8eSopenharmony_ci * @atomicservice 436161847f8eSopenharmony_ci * @since 11 436261847f8eSopenharmony_ci */ 436361847f8eSopenharmony_ci /** 436461847f8eSopenharmony_ci * Scroll by the delta position. 436561847f8eSopenharmony_ci * 436661847f8eSopenharmony_ci * @param { number } deltaX - the delta x of the position. 436761847f8eSopenharmony_ci * @param { number } deltaY - the delta y of the position. 436861847f8eSopenharmony_ci * @param { number } duration - the scroll animation duration. Unit: millisecond. 436961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 437061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 437161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 437261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 437361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 437461847f8eSopenharmony_ci * @crossplatform 437561847f8eSopenharmony_ci * @atomicservice 437661847f8eSopenharmony_ci * @since 14 437761847f8eSopenharmony_ci */ 437861847f8eSopenharmony_ci scrollBy(deltaX: number, deltaY: number, duration?: number): void; 437961847f8eSopenharmony_ci 438061847f8eSopenharmony_ci /** 438161847f8eSopenharmony_ci * Slide by the speed. 438261847f8eSopenharmony_ci * 438361847f8eSopenharmony_ci * @param { number } vx - the x speed of the speed. 438461847f8eSopenharmony_ci * @param { number } vy - the y speed of the speed. 438561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 438661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 438761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 438861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 438961847f8eSopenharmony_ci * @since 9 439061847f8eSopenharmony_ci */ 439161847f8eSopenharmony_ci /** 439261847f8eSopenharmony_ci * Slide by the speed. 439361847f8eSopenharmony_ci * 439461847f8eSopenharmony_ci * @param { number } vx - the x speed of the speed. 439561847f8eSopenharmony_ci * @param { number } vy - the y speed of the speed. 439661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 439761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 439861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 439961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 440061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 440161847f8eSopenharmony_ci * @atomicservice 440261847f8eSopenharmony_ci * @since 11 440361847f8eSopenharmony_ci */ 440461847f8eSopenharmony_ci slideScroll(vx: number, vy: number): void; 440561847f8eSopenharmony_ci 440661847f8eSopenharmony_ci /** 440761847f8eSopenharmony_ci * Serialize the access stack of the web, that is, the history of access. 440861847f8eSopenharmony_ci * @returns { Uint8Array } Web access stack after serialization. 440961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 441061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 441161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 441261847f8eSopenharmony_ci * @since 9 441361847f8eSopenharmony_ci */ 441461847f8eSopenharmony_ci /** 441561847f8eSopenharmony_ci * Serialize the access stack of the web, that is, the history of access. 441661847f8eSopenharmony_ci * @returns { Uint8Array } Web access stack after serialization. 441761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 441861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 441961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 442061847f8eSopenharmony_ci * @atomicservice 442161847f8eSopenharmony_ci * @since 11 442261847f8eSopenharmony_ci */ 442361847f8eSopenharmony_ci serializeWebState(): Uint8Array; 442461847f8eSopenharmony_ci 442561847f8eSopenharmony_ci /** 442661847f8eSopenharmony_ci * Restoring the web access stack, that is, the history of access. 442761847f8eSopenharmony_ci * @param { Uint8Array } state - Web access stack after serialization. 442861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 442961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 443061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 443161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 443261847f8eSopenharmony_ci * @since 9 443361847f8eSopenharmony_ci */ 443461847f8eSopenharmony_ci /** 443561847f8eSopenharmony_ci * Restoring the web access stack, that is, the history of access. 443661847f8eSopenharmony_ci * @param { Uint8Array } state - Web access stack after serialization. 443761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 443861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 443961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 444061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 444161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 444261847f8eSopenharmony_ci * @atomicservice 444361847f8eSopenharmony_ci * @since 11 444461847f8eSopenharmony_ci */ 444561847f8eSopenharmony_ci restoreWebState(state: Uint8Array): void; 444661847f8eSopenharmony_ci 444761847f8eSopenharmony_ci /** 444861847f8eSopenharmony_ci * Set whether the Web custom scheme supports cross domain and fetch requests. 444961847f8eSopenharmony_ci * @param { Array<WebCustomScheme> } schemes - Configuration of web custom scheme. 445061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 445161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 445261847f8eSopenharmony_ci * @since 9 445361847f8eSopenharmony_ci */ 445461847f8eSopenharmony_ci /** 445561847f8eSopenharmony_ci * Set whether the Web custom scheme supports cross domain and fetch requests. 445661847f8eSopenharmony_ci * @param { Array<WebCustomScheme> } schemes - Configuration of web custom scheme. 445761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 445861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 445961847f8eSopenharmony_ci * @atomicservice 446061847f8eSopenharmony_ci * @since 11 446161847f8eSopenharmony_ci */ 446261847f8eSopenharmony_ci /** 446361847f8eSopenharmony_ci * Register Web custom schemes. 446461847f8eSopenharmony_ci * @param { Array<WebCustomScheme> } schemes - Configuration of web custom scheme. 446561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 446661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 446761847f8eSopenharmony_ci * @throws { BusinessError } 17100020 - Failed to register custom schemes. 446861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 446961847f8eSopenharmony_ci * @atomicservice 447061847f8eSopenharmony_ci * @since 12 447161847f8eSopenharmony_ci */ 447261847f8eSopenharmony_ci static customizeSchemes(schemes: Array<WebCustomScheme>): void; 447361847f8eSopenharmony_ci 447461847f8eSopenharmony_ci /** 447561847f8eSopenharmony_ci * Get certificate for the current website. 447661847f8eSopenharmony_ci * @returns { Promise<Array<cert.X509Cert>> } the promise of the current website's certificate. 447761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 447861847f8eSopenharmony_ci * The WebviewController must be associated with a web component. 447961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 448061847f8eSopenharmony_ci * @since 10 448161847f8eSopenharmony_ci */ 448261847f8eSopenharmony_ci /** 448361847f8eSopenharmony_ci * Get certificate for the current website. 448461847f8eSopenharmony_ci * @returns { Promise<Array<cert.X509Cert>> } the promise of the current website's certificate. 448561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 448661847f8eSopenharmony_ci * The WebviewController must be associated with a web component. 448761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 448861847f8eSopenharmony_ci * @atomicservice 448961847f8eSopenharmony_ci * @since 11 449061847f8eSopenharmony_ci */ 449161847f8eSopenharmony_ci getCertificate(): Promise<Array<cert.X509Cert>>; 449261847f8eSopenharmony_ci 449361847f8eSopenharmony_ci /** 449461847f8eSopenharmony_ci * Get certificate for the current website. 449561847f8eSopenharmony_ci * @param {AsyncCallback<Array<cert.X509Cert>>} callback - the callback of getCertificate. 449661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 449761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 449861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 449961847f8eSopenharmony_ci * The WebviewController must be associated with a web component. 450061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 450161847f8eSopenharmony_ci * @since 10 450261847f8eSopenharmony_ci */ 450361847f8eSopenharmony_ci /** 450461847f8eSopenharmony_ci * Get certificate for the current website. 450561847f8eSopenharmony_ci * @param {AsyncCallback<Array<cert.X509Cert>>} callback - the callback of getCertificate. 450661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 450761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 450861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 450961847f8eSopenharmony_ci * The WebviewController must be associated with a web component. 451061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 451161847f8eSopenharmony_ci * @atomicservice 451261847f8eSopenharmony_ci * @since 11 451361847f8eSopenharmony_ci */ 451461847f8eSopenharmony_ci getCertificate(callback: AsyncCallback<Array<cert.X509Cert>>): void; 451561847f8eSopenharmony_ci 451661847f8eSopenharmony_ci /** 451761847f8eSopenharmony_ci * Set audio muted. 451861847f8eSopenharmony_ci * @param { boolean } mute - Set the audio muted or not. 451961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 452061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 452161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 452261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 452361847f8eSopenharmony_ci * @since 10 452461847f8eSopenharmony_ci */ 452561847f8eSopenharmony_ci /** 452661847f8eSopenharmony_ci * Set audio muted. 452761847f8eSopenharmony_ci * @param { boolean } mute - Set the audio muted or not. 452861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 452961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 453061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 453161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 453261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 453361847f8eSopenharmony_ci * @atomicservice 453461847f8eSopenharmony_ci * @since 11 453561847f8eSopenharmony_ci */ 453661847f8eSopenharmony_ci setAudioMuted(mute: boolean): void; 453761847f8eSopenharmony_ci 453861847f8eSopenharmony_ci /** 453961847f8eSopenharmony_ci * Prefetch the resources required by the page, but will not execute js or render the page. 454061847f8eSopenharmony_ci * @param { string } url - Which url to preresolve/preconnect. 454161847f8eSopenharmony_ci * @param { Array<WebHeader> } [additionalHeaders] - Additional HTTP request header of the URL. 454261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 454361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 454461847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 454561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 454661847f8eSopenharmony_ci * @since 10 454761847f8eSopenharmony_ci */ 454861847f8eSopenharmony_ci /** 454961847f8eSopenharmony_ci * Prefetch the resources required by the page, but will not execute js or render the page. 455061847f8eSopenharmony_ci * @param { string } url - Which url to preresolve/preconnect. 455161847f8eSopenharmony_ci * @param { Array<WebHeader> } [additionalHeaders] - Additional HTTP request header of the URL. 455261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 455361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 455461847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 455561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 455661847f8eSopenharmony_ci * @atomicservice 455761847f8eSopenharmony_ci * @since 11 455861847f8eSopenharmony_ci */ 455961847f8eSopenharmony_ci prefetchPage(url: string, additionalHeaders?: Array<WebHeader>): void; 456061847f8eSopenharmony_ci 456161847f8eSopenharmony_ci /** 456261847f8eSopenharmony_ci * Preresolve or Preconnect the url. This API can be called before loading the url to make loading faster. 456361847f8eSopenharmony_ci * @param { string } url - Which url to preresolve/preconnect. 456461847f8eSopenharmony_ci * @param { boolean } preconnectable - Indicates whether to preconnect. 456561847f8eSopenharmony_ci * @param { number } numSockets - If preconnectable is true, this parameter indicates the number of sockets to be preconnected. 456661847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 456761847f8eSopenharmony_ci * @throws { BusinessError } 171000013 - The number of preconnect sockets is invalid. 456861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 456961847f8eSopenharmony_ci * @since 10 457061847f8eSopenharmony_ci */ 457161847f8eSopenharmony_ci /** 457261847f8eSopenharmony_ci * Preresolve or Preconnect the url. This API can be called before loading the url to make loading faster. 457361847f8eSopenharmony_ci * @param { string } url - Which url to preresolve/preconnect. 457461847f8eSopenharmony_ci * @param { boolean } preconnectable - Indicates whether to preconnect. 457561847f8eSopenharmony_ci * @param { number } numSockets - If preconnectable is true, this parameter indicates the number of sockets to be preconnected. 457661847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 457761847f8eSopenharmony_ci * @throws { BusinessError } 171000013 - The number of preconnect sockets is invalid. 457861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 457961847f8eSopenharmony_ci * @atomicservice 458061847f8eSopenharmony_ci * @since 11 458161847f8eSopenharmony_ci */ 458261847f8eSopenharmony_ci static prepareForPageLoad(url: string, preconnectable: boolean, numSockets: number): void; 458361847f8eSopenharmony_ci 458461847f8eSopenharmony_ci /** 458561847f8eSopenharmony_ci * Set custom user agent. 458661847f8eSopenharmony_ci * @param { string } userAgent - User custom agent information. 458761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 458861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 458961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 459061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 459161847f8eSopenharmony_ci * @since 10 459261847f8eSopenharmony_ci */ 459361847f8eSopenharmony_ci /** 459461847f8eSopenharmony_ci * Set custom user agent. 459561847f8eSopenharmony_ci * @param { string } userAgent - User custom agent information. 459661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 459761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 459861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 459961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 460061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 460161847f8eSopenharmony_ci * @crossplatform 460261847f8eSopenharmony_ci * @atomicservice 460361847f8eSopenharmony_ci * @since 11 460461847f8eSopenharmony_ci */ 460561847f8eSopenharmony_ci setCustomUserAgent(userAgent: string): void; 460661847f8eSopenharmony_ci 460761847f8eSopenharmony_ci /** 460861847f8eSopenharmony_ci * Get custom user agent. 460961847f8eSopenharmony_ci * @returns { string } Get custom User agent information. 461061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 461161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 461261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 461361847f8eSopenharmony_ci * @since 10 461461847f8eSopenharmony_ci */ 461561847f8eSopenharmony_ci /** 461661847f8eSopenharmony_ci * Get custom user agent. 461761847f8eSopenharmony_ci * @returns { string } Get custom User agent information. 461861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 461961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 462061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 462161847f8eSopenharmony_ci * @crossplatform 462261847f8eSopenharmony_ci * @atomicservice 462361847f8eSopenharmony_ci * @since 11 462461847f8eSopenharmony_ci */ 462561847f8eSopenharmony_ci getCustomUserAgent(): string; 462661847f8eSopenharmony_ci 462761847f8eSopenharmony_ci /** 462861847f8eSopenharmony_ci * Set web engine socket connection timeout. 462961847f8eSopenharmony_ci * @param { number } timeout - Socket connection timeout. 463061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 463161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 463261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 463361847f8eSopenharmony_ci * @atomicservice 463461847f8eSopenharmony_ci * @since 11 463561847f8eSopenharmony_ci */ 463661847f8eSopenharmony_ci static setConnectionTimeout(timeout: number): void; 463761847f8eSopenharmony_ci 463861847f8eSopenharmony_ci /** 463961847f8eSopenharmony_ci * Set delegate for download. 464061847f8eSopenharmony_ci * Used to notify the progress of the download triggered from web. 464161847f8eSopenharmony_ci * @param { WebDownloadDelegate } delegate - Delegate used for download triggered from web. 464261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 464361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 464461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 464561847f8eSopenharmony_ci * @atomicservice 464661847f8eSopenharmony_ci * @since 11 464761847f8eSopenharmony_ci */ 464861847f8eSopenharmony_ci setDownloadDelegate(delegate: WebDownloadDelegate): void; 464961847f8eSopenharmony_ci 465061847f8eSopenharmony_ci /** 465161847f8eSopenharmony_ci * Start a download. 465261847f8eSopenharmony_ci * @param { string } url - The download url. 465361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 465461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 465561847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 465661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 465761847f8eSopenharmony_ci * @atomicservice 465861847f8eSopenharmony_ci * @since 11 465961847f8eSopenharmony_ci */ 466061847f8eSopenharmony_ci startDownload(url: string): void; 466161847f8eSopenharmony_ci 466261847f8eSopenharmony_ci /** 466361847f8eSopenharmony_ci * Loads the URL use "POST" method with post data. 466461847f8eSopenharmony_ci * 466561847f8eSopenharmony_ci * @param { string } url - Request the URL use "POST" method. 466661847f8eSopenharmony_ci * @param { ArrayBuffer } postData - This data will passed to "POST" request. 466761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 466861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 466961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 467061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 467161847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 467261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 467361847f8eSopenharmony_ci * @atomicservice 467461847f8eSopenharmony_ci * @since 11 467561847f8eSopenharmony_ci */ 467661847f8eSopenharmony_ci postUrl(url: string, postData: ArrayBuffer): void; 467761847f8eSopenharmony_ci 467861847f8eSopenharmony_ci /** 467961847f8eSopenharmony_ci * Create the Web Print Document Adapter. 468061847f8eSopenharmony_ci * @param { string } jobName - The name of the currently printed document. 468161847f8eSopenharmony_ci * @returns { print.PrintDocumentAdapter } Return the Print Document Adapter. 468261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 468361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 468461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 468561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 468661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 468761847f8eSopenharmony_ci * @since 11 468861847f8eSopenharmony_ci */ 468961847f8eSopenharmony_ci createWebPrintDocumentAdapter(jobName: string): print.PrintDocumentAdapter; 469061847f8eSopenharmony_ci 469161847f8eSopenharmony_ci /** 469261847f8eSopenharmony_ci * Get the security level of the current page. 469361847f8eSopenharmony_ci * 469461847f8eSopenharmony_ci * @returns { SecurityLevel } the security level of current page. 469561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 469661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 469761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 469861847f8eSopenharmony_ci * @atomicservice 469961847f8eSopenharmony_ci * @since 11 470061847f8eSopenharmony_ci */ 470161847f8eSopenharmony_ci getSecurityLevel(): SecurityLevel; 470261847f8eSopenharmony_ci 470361847f8eSopenharmony_ci /** 470461847f8eSopenharmony_ci * Whether the incognito mode is set. 470561847f8eSopenharmony_ci * 470661847f8eSopenharmony_ci * @returns { boolean } {@code true} has been set the incognito mode; {@code false} otherwise. 470761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 470861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 470961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 471061847f8eSopenharmony_ci * @atomicservice 471161847f8eSopenharmony_ci * @since 11 471261847f8eSopenharmony_ci */ 471361847f8eSopenharmony_ci isIncognitoMode(): boolean; 471461847f8eSopenharmony_ci 471561847f8eSopenharmony_ci /** 471661847f8eSopenharmony_ci * Set whether scroll is allowed 471761847f8eSopenharmony_ci * 471861847f8eSopenharmony_ci * @param { boolean } enable - Set whether scrolling is allowed 471961847f8eSopenharmony_ci * @param { ScrollType } type - Enable scrolling type 472061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 472161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 472261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 472361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 472461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 472561847f8eSopenharmony_ci * @atomicservice 472661847f8eSopenharmony_ci * @since 12 472761847f8eSopenharmony_ci */ 472861847f8eSopenharmony_ci setScrollable(enable: boolean, type?: ScrollType): void; 472961847f8eSopenharmony_ci 473061847f8eSopenharmony_ci /** 473161847f8eSopenharmony_ci * Get whether scrolling is allowed. 473261847f8eSopenharmony_ci * @returns { boolean } Get scrolling is allowed information. 473361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 473461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 473561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 473661847f8eSopenharmony_ci * @atomicservice 473761847f8eSopenharmony_ci * @since 12 473861847f8eSopenharmony_ci */ 473961847f8eSopenharmony_ci getScrollable(): boolean; 474061847f8eSopenharmony_ci 474161847f8eSopenharmony_ci /** 474261847f8eSopenharmony_ci * Set whether print web page background. 474361847f8eSopenharmony_ci * 474461847f8eSopenharmony_ci * @param { boolean } enable - Set whether print web page background 474561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 474661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 474761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 474861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 474961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 475061847f8eSopenharmony_ci * @atomicservice 475161847f8eSopenharmony_ci * @since 12 475261847f8eSopenharmony_ci */ 475361847f8eSopenharmony_ci setPrintBackground(enable: boolean): void; 475461847f8eSopenharmony_ci 475561847f8eSopenharmony_ci /** 475661847f8eSopenharmony_ci * Get whether print web page background. 475761847f8eSopenharmony_ci * @returns { boolean } Get whether print web page background. 475861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 475961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 476061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 476161847f8eSopenharmony_ci * @atomicservice 476261847f8eSopenharmony_ci * @since 12 476361847f8eSopenharmony_ci */ 476461847f8eSopenharmony_ci getPrintBackground(): boolean; 476561847f8eSopenharmony_ci 476661847f8eSopenharmony_ci /** 476761847f8eSopenharmony_ci * Get the url of the last frame that calls the JavaScriptProxy. 476861847f8eSopenharmony_ci * This should be called on the UI thread. 476961847f8eSopenharmony_ci * 477061847f8eSopenharmony_ci * @returns { string } The url of the last frame that calls the JavaScriptProxy. 477161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 477261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 477361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 477461847f8eSopenharmony_ci * @atomicservice 477561847f8eSopenharmony_ci * @since 12 477661847f8eSopenharmony_ci */ 477761847f8eSopenharmony_ci getLastJavascriptProxyCallingFrameUrl(): string; 477861847f8eSopenharmony_ci 477961847f8eSopenharmony_ci /** 478061847f8eSopenharmony_ci * Start current camera. 478161847f8eSopenharmony_ci * 478261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 478361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 478461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 478561847f8eSopenharmony_ci * @atomicservice 478661847f8eSopenharmony_ci * @since 12 478761847f8eSopenharmony_ci */ 478861847f8eSopenharmony_ci startCamera(): void; 478961847f8eSopenharmony_ci 479061847f8eSopenharmony_ci /** 479161847f8eSopenharmony_ci * Stop current camera. 479261847f8eSopenharmony_ci * 479361847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 479461847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 479561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 479661847f8eSopenharmony_ci * @atomicservice 479761847f8eSopenharmony_ci * @since 12 479861847f8eSopenharmony_ci */ 479961847f8eSopenharmony_ci stopCamera(): void; 480061847f8eSopenharmony_ci 480161847f8eSopenharmony_ci /** 480261847f8eSopenharmony_ci * Close current camera. 480361847f8eSopenharmony_ci * 480461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 480561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 480661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 480761847f8eSopenharmony_ci * @atomicservice 480861847f8eSopenharmony_ci * @since 12 480961847f8eSopenharmony_ci */ 481061847f8eSopenharmony_ci closeCamera(): void; 481161847f8eSopenharmony_ci 481261847f8eSopenharmony_ci /** 481361847f8eSopenharmony_ci * Pauses all layout, parsing, and JavaScript timers for all WebViews. 481461847f8eSopenharmony_ci * 481561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 481661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 481761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 481861847f8eSopenharmony_ci * @atomicservice 481961847f8eSopenharmony_ci * @since 12 482061847f8eSopenharmony_ci */ 482161847f8eSopenharmony_ci static pauseAllTimers(): void; 482261847f8eSopenharmony_ci 482361847f8eSopenharmony_ci /** 482461847f8eSopenharmony_ci * Resumes all layout, parsing, and JavaScript timers for all WebViews. 482561847f8eSopenharmony_ci * 482661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 482761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 482861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 482961847f8eSopenharmony_ci * @atomicservice 483061847f8eSopenharmony_ci * @since 12 483161847f8eSopenharmony_ci */ 483261847f8eSopenharmony_ci static resumeAllTimers(): void; 483361847f8eSopenharmony_ci 483461847f8eSopenharmony_ci /** 483561847f8eSopenharmony_ci * Stop all audio and video playback on the web page. 483661847f8eSopenharmony_ci * 483761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 483861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 483961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 484061847f8eSopenharmony_ci * @atomicservice 484161847f8eSopenharmony_ci * @since 12 484261847f8eSopenharmony_ci */ 484361847f8eSopenharmony_ci stopAllMedia(): void; 484461847f8eSopenharmony_ci 484561847f8eSopenharmony_ci /** 484661847f8eSopenharmony_ci * Restart playback of all audio and video on the web page. 484761847f8eSopenharmony_ci * 484861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 484961847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 485061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 485161847f8eSopenharmony_ci * @atomicservice 485261847f8eSopenharmony_ci * @since 12 485361847f8eSopenharmony_ci */ 485461847f8eSopenharmony_ci resumeAllMedia(): void; 485561847f8eSopenharmony_ci 485661847f8eSopenharmony_ci /** 485761847f8eSopenharmony_ci * Pause all audio and video playback on the web page. 485861847f8eSopenharmony_ci * 485961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 486061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 486161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 486261847f8eSopenharmony_ci * @atomicservice 486361847f8eSopenharmony_ci * @since 12 486461847f8eSopenharmony_ci */ 486561847f8eSopenharmony_ci pauseAllMedia(): void; 486661847f8eSopenharmony_ci 486761847f8eSopenharmony_ci /** 486861847f8eSopenharmony_ci * Close fullscreen video. 486961847f8eSopenharmony_ci * 487061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 487161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 487261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 487361847f8eSopenharmony_ci * @atomicservice 487461847f8eSopenharmony_ci * @since 12 487561847f8eSopenharmony_ci */ 487661847f8eSopenharmony_ci closeAllMediaPresentations(): void; 487761847f8eSopenharmony_ci 487861847f8eSopenharmony_ci /** 487961847f8eSopenharmony_ci * View the playback status of all audio and video on the web page. 488061847f8eSopenharmony_ci * 488161847f8eSopenharmony_ci * @returns { MediaPlaybackState } The playback status of all audio and video. 488261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 488361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 488461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 488561847f8eSopenharmony_ci * @atomicservice 488661847f8eSopenharmony_ci * @since 12 488761847f8eSopenharmony_ci */ 488861847f8eSopenharmony_ci getMediaPlaybackState(): MediaPlaybackState; 488961847f8eSopenharmony_ci 489061847f8eSopenharmony_ci /** 489161847f8eSopenharmony_ci * Set web scheme handler for specific scheme. This is only used for related web component. 489261847f8eSopenharmony_ci * 489361847f8eSopenharmony_ci * @param { string } scheme - String value for url scheme. 489461847f8eSopenharmony_ci * @param { WebSchemeHandler } handler - Web scheme handler. 489561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 489661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 489761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 489861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 489961847f8eSopenharmony_ci * @atomicservice 490061847f8eSopenharmony_ci * @since 12 490161847f8eSopenharmony_ci */ 490261847f8eSopenharmony_ci setWebSchemeHandler(scheme: string, handler: WebSchemeHandler): void; 490361847f8eSopenharmony_ci 490461847f8eSopenharmony_ci /** 490561847f8eSopenharmony_ci * Clear all web scheme handlers for related web component. 490661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 490761847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 490861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 490961847f8eSopenharmony_ci * @atomicservice 491061847f8eSopenharmony_ci * @since 12 491161847f8eSopenharmony_ci */ 491261847f8eSopenharmony_ci clearWebSchemeHandler(): void; 491361847f8eSopenharmony_ci 491461847f8eSopenharmony_ci /** 491561847f8eSopenharmony_ci * Set web scheme handler for specific scheme. This is used for service worker. 491661847f8eSopenharmony_ci * @param { string } scheme - String value for url scheme. 491761847f8eSopenharmony_ci * @param { WebSchemeHandler } handler - Web scheme handler. 491861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 491961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 492061847f8eSopenharmony_ci * @atomicservice 492161847f8eSopenharmony_ci * @since 12 492261847f8eSopenharmony_ci */ 492361847f8eSopenharmony_ci static setServiceWorkerWebSchemeHandler(scheme: string, handler: WebSchemeHandler): void; 492461847f8eSopenharmony_ci 492561847f8eSopenharmony_ci /** 492661847f8eSopenharmony_ci * Clear all web service worker scheme handlers. 492761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 492861847f8eSopenharmony_ci * @atomicservice 492961847f8eSopenharmony_ci * @since 12 493061847f8eSopenharmony_ci */ 493161847f8eSopenharmony_ci static clearServiceWorkerWebSchemeHandler(): void; 493261847f8eSopenharmony_ci 493361847f8eSopenharmony_ci /** 493461847f8eSopenharmony_ci * Enable the ability to use Intelligent Tracking Prevention; default is disabled. 493561847f8eSopenharmony_ci * 493661847f8eSopenharmony_ci * @param { boolean } enable {@code true} enable Intelligent Tracking Prevention; {@code false} otherwise. 493761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 493861847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 493961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 494061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 494161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 494261847f8eSopenharmony_ci * @atomicservice 494361847f8eSopenharmony_ci * @since 12 494461847f8eSopenharmony_ci */ 494561847f8eSopenharmony_ci enableIntelligentTrackingPrevention(enable: boolean): void; 494661847f8eSopenharmony_ci 494761847f8eSopenharmony_ci /** 494861847f8eSopenharmony_ci * Get whether Intelligent Tracking Prevention is enabled. 494961847f8eSopenharmony_ci * 495061847f8eSopenharmony_ci * @returns { boolean } True if enable the Intelligent Tracking Prevention; else false. 495161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 495261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 495361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 495461847f8eSopenharmony_ci * @atomicservice 495561847f8eSopenharmony_ci * @since 12 495661847f8eSopenharmony_ci */ 495761847f8eSopenharmony_ci isIntelligentTrackingPreventionEnabled(): boolean; 495861847f8eSopenharmony_ci 495961847f8eSopenharmony_ci /** 496061847f8eSopenharmony_ci * Add bypassing hosts for Intelligent Tracking Prevention. 496161847f8eSopenharmony_ci * 496261847f8eSopenharmony_ci * @param { Array<string> } hostList - Hosts that bypass the Intelligent Tracking Prevention. 496361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 496461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 496561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 496661847f8eSopenharmony_ci * @atomicservice 496761847f8eSopenharmony_ci * @since 12 496861847f8eSopenharmony_ci */ 496961847f8eSopenharmony_ci static addIntelligentTrackingPreventionBypassingList(hostList: Array<string>): void; 497061847f8eSopenharmony_ci 497161847f8eSopenharmony_ci /** 497261847f8eSopenharmony_ci * Remove bypassing hosts for Intelligent Tracking Prevention. 497361847f8eSopenharmony_ci * 497461847f8eSopenharmony_ci * @param { Array<string> } hostList - Hosts needs to remove from bypass list. 497561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 497661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 497761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 497861847f8eSopenharmony_ci * @atomicservice 497961847f8eSopenharmony_ci * @since 12 498061847f8eSopenharmony_ci */ 498161847f8eSopenharmony_ci static removeIntelligentTrackingPreventionBypassingList(hostList: Array<string>): void; 498261847f8eSopenharmony_ci 498361847f8eSopenharmony_ci /** 498461847f8eSopenharmony_ci * Clear bypassing hosts for Intelligent Tracking Prevention. 498561847f8eSopenharmony_ci * 498661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 498761847f8eSopenharmony_ci * @atomicservice 498861847f8eSopenharmony_ci * @since 12 498961847f8eSopenharmony_ci */ 499061847f8eSopenharmony_ci static clearIntelligentTrackingPreventionBypassingList(): void; 499161847f8eSopenharmony_ci 499261847f8eSopenharmony_ci /** 499361847f8eSopenharmony_ci * Register a callback to intercept web pages playing media. 499461847f8eSopenharmony_ci * 499561847f8eSopenharmony_ci * @param { CreateNativeMediaPlayerCallback } callback - Called everytime when web pages try to play media. 499661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 499761847f8eSopenharmony_ci * @atomicservice 499861847f8eSopenharmony_ci * @since 12 499961847f8eSopenharmony_ci */ 500061847f8eSopenharmony_ci onCreateNativeMediaPlayer(callback: CreateNativeMediaPlayerCallback): void; 500161847f8eSopenharmony_ci 500261847f8eSopenharmony_ci /** 500361847f8eSopenharmony_ci * Set enable overall web caching 500461847f8eSopenharmony_ci * 500561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 500661847f8eSopenharmony_ci * @atomicservice 500761847f8eSopenharmony_ci * @since 12 500861847f8eSopenharmony_ci */ 500961847f8eSopenharmony_ci static enableWholeWebPageDrawing(): void; 501061847f8eSopenharmony_ci 501161847f8eSopenharmony_ci /** 501261847f8eSopenharmony_ci * Web page snapshot. 501361847f8eSopenharmony_ci * 501461847f8eSopenharmony_ci * @param { SnapshotInfo } info - The snapshot info. 501561847f8eSopenharmony_ci * @param { AsyncCallback<SnapshotResult> } callback - the callback of snapshot. 501661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 501761847f8eSopenharmony_ci * @atomicservice 501861847f8eSopenharmony_ci * @since 12 501961847f8eSopenharmony_ci */ 502061847f8eSopenharmony_ci webPageSnapshot(info: SnapshotInfo, callback: AsyncCallback<SnapshotResult>): void; 502161847f8eSopenharmony_ci 502261847f8eSopenharmony_ci /** 502361847f8eSopenharmony_ci * Prefetch the resources request and save it to the memory cache. Only support post request and its Content-Type 502461847f8eSopenharmony_ci * is application/x-www-form-urlencoded now. 502561847f8eSopenharmony_ci * You can prefetch no more than 6 resources. If you want to prefetch the seventh resource, you can clear one of 502661847f8eSopenharmony_ci * the prefetched resources that you won't use any more. Otherwise the oldest resource you prefetched will be 502761847f8eSopenharmony_ci * cleared. 502861847f8eSopenharmony_ci * @param { RequestInfo } request - The information of the request. 502961847f8eSopenharmony_ci * @param { Array<WebHeader> } [additionalHeaders] - Additional HTTP request header of the request. 503061847f8eSopenharmony_ci * @param { string } [cacheKey] - The key for memory cache. Default value is the url of the request. 503161847f8eSopenharmony_ci * Only support number and letters. 503261847f8eSopenharmony_ci * @param { number } [cacheValidTime] - The valid time of the cache for request, ranges greater than 0. 503361847f8eSopenharmony_ci * The unit is second. Default value is 300s. 503461847f8eSopenharmony_ci * The value of cacheValidTime must between 1 and 2147483647. 503561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter.Possible causes: 1. Mandatory parameters are left unspecified. 503661847f8eSopenharmony_ci * 2. Incorrect parameter types. 3. Parameter verification failed. 503761847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 503861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 503961847f8eSopenharmony_ci * @atomicservice 504061847f8eSopenharmony_ci * @since 12 504161847f8eSopenharmony_ci */ 504261847f8eSopenharmony_ci static prefetchResource(request: RequestInfo, additionalHeaders?: Array<WebHeader>, cacheKey?: string, 504361847f8eSopenharmony_ci cacheValidTime?: number): void; 504461847f8eSopenharmony_ci 504561847f8eSopenharmony_ci /** 504661847f8eSopenharmony_ci * Clear the resource that you prefetch to the memory cache using API{@link prefetchResource}. 504761847f8eSopenharmony_ci * @param { Array<string> } cacheKeyList - The keys for memory cache. 504861847f8eSopenharmony_ci * The key in cacheKeyList only support number and letters. 504961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 505061847f8eSopenharmony_ci * @atomicservice 505161847f8eSopenharmony_ci * @since 12 505261847f8eSopenharmony_ci */ 505361847f8eSopenharmony_ci static clearPrefetchedResource(cacheKeyList: Array<string>): void; 505461847f8eSopenharmony_ci 505561847f8eSopenharmony_ci /** 505661847f8eSopenharmony_ci * Set render process mode of the ArkWeb. 505761847f8eSopenharmony_ci * 505861847f8eSopenharmony_ci * @param { RenderProcessMode } mode - The render process mode for the ArkWeb. 505961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 506061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 506161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 506261847f8eSopenharmony_ci * @atomicservice 506361847f8eSopenharmony_ci * @since 12 506461847f8eSopenharmony_ci */ 506561847f8eSopenharmony_ci static setRenderProcessMode(mode: RenderProcessMode): void; 506661847f8eSopenharmony_ci 506761847f8eSopenharmony_ci /** 506861847f8eSopenharmony_ci * Get render process mode of the ArkWeb. 506961847f8eSopenharmony_ci * 507061847f8eSopenharmony_ci * @returns { RenderProcessMode } mode - The render process mode of the ArkWeb. 507161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 507261847f8eSopenharmony_ci * @atomicservice 507361847f8eSopenharmony_ci * @since 12 507461847f8eSopenharmony_ci */ 507561847f8eSopenharmony_ci static getRenderProcessMode(): RenderProcessMode; 507661847f8eSopenharmony_ci 507761847f8eSopenharmony_ci /** 507861847f8eSopenharmony_ci * Terminate render process associated with this controller of the ArkWeb. 507961847f8eSopenharmony_ci * 508061847f8eSopenharmony_ci * @returns { boolean } true if it was possible to terminate the render process, otherwise false. 508161847f8eSopenharmony_ci * Calling this on a not yet started, or an already terminated render will have no effect. 508261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 508361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 508461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 508561847f8eSopenharmony_ci * @since 12 508661847f8eSopenharmony_ci */ 508761847f8eSopenharmony_ci terminateRenderProcess(): boolean; 508861847f8eSopenharmony_ci 508961847f8eSopenharmony_ci /** 509061847f8eSopenharmony_ci * Compile javascript and generate code cache. 509161847f8eSopenharmony_ci * @param { string } url - Url of the javascript. Only support HTTP/HTTPS protocol and length no longer than 2048. 509261847f8eSopenharmony_ci * @param { string | Uint8Array } script - Javascript source code. script must not be empty. 509361847f8eSopenharmony_ci * @param { CacheOptions } cacheOptions - Generate code cache option. 509461847f8eSopenharmony_ci * @returns { Promise<number> } - The promise returned by the function. 509561847f8eSopenharmony_ci * 0 means generate code cache successfully, -1 means internal error. 509661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 509761847f8eSopenharmony_ci * Possible causes: 1. Mandatory parameters are left unspecified. 509861847f8eSopenharmony_ci * 2. Incorrect parameter types. 3. Parameter verification failed. 509961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 510061847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 510161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 510261847f8eSopenharmony_ci * @since 12 510361847f8eSopenharmony_ci */ 510461847f8eSopenharmony_ci precompileJavaScript(url: string, script: string | Uint8Array, cacheOptions: CacheOptions): Promise<number>; 510561847f8eSopenharmony_ci 510661847f8eSopenharmony_ci /** 510761847f8eSopenharmony_ci * Set IP address for host name. 510861847f8eSopenharmony_ci * 510961847f8eSopenharmony_ci * @param { string } hostName - Which host name to be resolved. 511061847f8eSopenharmony_ci * @param { string } address - Resolved IP address. 511161847f8eSopenharmony_ci * @param { number } aliveTime - The validity seconds for resolve cache. 511261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 511361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 511461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 511561847f8eSopenharmony_ci * @atomicservice 511661847f8eSopenharmony_ci * @since 12 511761847f8eSopenharmony_ci */ 511861847f8eSopenharmony_ci static setHostIP(hostName: string, address: string, aliveTime: number): void; 511961847f8eSopenharmony_ci 512061847f8eSopenharmony_ci /** 512161847f8eSopenharmony_ci * Clear the host name IP address. 512261847f8eSopenharmony_ci * 512361847f8eSopenharmony_ci * @param { string } hostName - Which host name to be cleared. 512461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 512561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 512661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 512761847f8eSopenharmony_ci * @atomicservice 512861847f8eSopenharmony_ci * @since 12 512961847f8eSopenharmony_ci */ 513061847f8eSopenharmony_ci static clearHostIP(hostName: string): void; 513161847f8eSopenharmony_ci 513261847f8eSopenharmony_ci /** 513361847f8eSopenharmony_ci * Warmup the registered service worker associated the url. 513461847f8eSopenharmony_ci * @param { string } url - The url. 513561847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 513661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 513761847f8eSopenharmony_ci * @atomicservice 513861847f8eSopenharmony_ci * @since 12 513961847f8eSopenharmony_ci */ 514061847f8eSopenharmony_ci static warmupServiceWorker(url: string): void; 514161847f8eSopenharmony_ci 514261847f8eSopenharmony_ci /** 514361847f8eSopenharmony_ci * Inject offline resources into cache. 514461847f8eSopenharmony_ci * 514561847f8eSopenharmony_ci * @param { Array<OfflineResourceMap> } resourceMaps - Array of offline resource info maps. 514661847f8eSopenharmony_ci * The count of array must between 1 and 30. 514761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 514861847f8eSopenharmony_ci * Possible causes: 1. Mandatory parameters are left unspecified. 514961847f8eSopenharmony_ci * 2. Incorrect parameter types. 3. Parameter verification failed. 515061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 515161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 515261847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 515361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 515461847f8eSopenharmony_ci * @since 12 515561847f8eSopenharmony_ci */ 515661847f8eSopenharmony_ci injectOfflineResources(resourceMaps: Array<OfflineResourceMap>): void; 515761847f8eSopenharmony_ci 515861847f8eSopenharmony_ci /** 515961847f8eSopenharmony_ci * Enable the ability to block Ads, disabled by default. 516061847f8eSopenharmony_ci * 516161847f8eSopenharmony_ci * @param { boolean } enable {@code true} Enable Ads block; {@code false} otherwise. 516261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 516361847f8eSopenharmony_ci * <br>2. Parameter string is too long. 3.Parameter verification failed. 516461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 516561847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 516661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 516761847f8eSopenharmony_ci * @atomicservice 516861847f8eSopenharmony_ci * @since 12 516961847f8eSopenharmony_ci */ 517061847f8eSopenharmony_ci enableAdsBlock(enable: boolean): void; 517161847f8eSopenharmony_ci 517261847f8eSopenharmony_ci /** 517361847f8eSopenharmony_ci * Get whether Ads block is enabled. 517461847f8eSopenharmony_ci * 517561847f8eSopenharmony_ci * @returns { boolean } True if the ability of AdsBlock is enabled; else false. 517661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 517761847f8eSopenharmony_ci * @atomicservice 517861847f8eSopenharmony_ci * @since 12 517961847f8eSopenharmony_ci */ 518061847f8eSopenharmony_ci isAdsBlockEnabled(): boolean; 518161847f8eSopenharmony_ci 518261847f8eSopenharmony_ci /** 518361847f8eSopenharmony_ci * Get whether Ads block is enabled for current Webpage. 518461847f8eSopenharmony_ci * 518561847f8eSopenharmony_ci * @returns { boolean } True if the ability of AdsBlock is enabled for current Webpage; else false. 518661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 518761847f8eSopenharmony_ci * @atomicservice 518861847f8eSopenharmony_ci * @since 12 518961847f8eSopenharmony_ci */ 519061847f8eSopenharmony_ci isAdsBlockEnabledForCurPage(): boolean; 519161847f8eSopenharmony_ci 519261847f8eSopenharmony_ci /** 519361847f8eSopenharmony_ci * Get the ID of the surface created by ArkWeb. This ID can be used for web page screenshots. 519461847f8eSopenharmony_ci * 519561847f8eSopenharmony_ci * @returns { string } The ID of the surface created by ArkWeb. 519661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 519761847f8eSopenharmony_ci * @atomicservice 519861847f8eSopenharmony_ci * @since 12 519961847f8eSopenharmony_ci */ 520061847f8eSopenharmony_ci getSurfaceId(): string; 520161847f8eSopenharmony_ci 520261847f8eSopenharmony_ci /** 520361847f8eSopenharmony_ci * Set the URL trust list for the ArkWeb. 520461847f8eSopenharmony_ci * When the URL trust list has been set, only the URLs in the list can be accessed. 520561847f8eSopenharmony_ci * 520661847f8eSopenharmony_ci * @param { string } urlTrustList - the URL trust list in JSON format. 520761847f8eSopenharmony_ci * An empty string means that all URLs are allowed to access. 520861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 520961847f8eSopenharmony_ci * <br>2. Parameter string is too long. 3.Parameter verification failed. 521061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 521161847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 521261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 521361847f8eSopenharmony_ci * @atomicservice 521461847f8eSopenharmony_ci * @since 12 521561847f8eSopenharmony_ci */ 521661847f8eSopenharmony_ci setUrlTrustList(urlTrustList: string): void; 521761847f8eSopenharmony_ci 521861847f8eSopenharmony_ci /** 521961847f8eSopenharmony_ci * Set a path list, allowing cross-origin request access any origin when the file scheme URLs access resources in this 522061847f8eSopenharmony_ci * path list. Also, When the path list is set, the file scheme URLs only allow access to resources within the path list. 522161847f8eSopenharmony_ci * Path in the path list must meet one of the following path formats(sub path and module name must be provided): 522261847f8eSopenharmony_ci * 522361847f8eSopenharmony_ci * 1. App bundle resource directory, like "/data/storage/el1/bundle/entry/resource/resfile". 522461847f8eSopenharmony_ci * You can get resource directory using Context.resourceDir in AbilityKit. 522561847f8eSopenharmony_ci * 2. A sub path of app files directory, like "/data/storage/el2/base/files/example/" 522661847f8eSopenharmony_ci * or "/data/storage/el2/base/haps/entry/files/example". 522761847f8eSopenharmony_ci * You can get app files directory using Context.filesDir in AbilityKit. 522861847f8eSopenharmony_ci * 522961847f8eSopenharmony_ci * @param { Array<string> } pathList - The path list allow universal access. 523061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 523161847f8eSopenharmony_ci * <br>2. Parameter string is too long. 3.Parameter verification failed. 523261847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 523361847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 523461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 523561847f8eSopenharmony_ci * @since 12 523661847f8eSopenharmony_ci */ 523761847f8eSopenharmony_ci setPathAllowingUniversalAccess(pathList: Array<string>): void; 523861847f8eSopenharmony_ci 523961847f8eSopenharmony_ci /** 524061847f8eSopenharmony_ci * Trim memory by different memory pressure level. 524161847f8eSopenharmony_ci * 524261847f8eSopenharmony_ci * @param { PressureLevel } level - The memory pressure level for the ArkWeb. 524361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 524461847f8eSopenharmony_ci * <br>2. Parameter string is too long. 3.Parameter verification failed. 524561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 524661847f8eSopenharmony_ci * @atomicservice 524761847f8eSopenharmony_ci * @since 14 524861847f8eSopenharmony_ci */ 524961847f8eSopenharmony_ci static trimMemoryByPressureLevel(level: PressureLevel): void; 525061847f8eSopenharmony_ci 525161847f8eSopenharmony_ci /** 525261847f8eSopenharmony_ci * Enable the BackForwardCache and indicate features that are allowed to enter BackForwardCache. 525361847f8eSopenharmony_ci * Default is disabled. 525461847f8eSopenharmony_ci * 525561847f8eSopenharmony_ci * @param { BackForwardCacheSupportedFeatures } features - The features that supports BackForwardCache. 525661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 525761847f8eSopenharmony_ci * @since 12 525861847f8eSopenharmony_ci */ 525961847f8eSopenharmony_ci static enableBackForwardCache(features: BackForwardCacheSupportedFeatures): void; 526061847f8eSopenharmony_ci 526161847f8eSopenharmony_ci /** 526261847f8eSopenharmony_ci * Configure the BackForwardCache. 526361847f8eSopenharmony_ci * 526461847f8eSopenharmony_ci * @param { BackForwardCacheOptions } options - The configuration of BackForwardCache. 526561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 526661847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 526761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 526861847f8eSopenharmony_ci * @since 12 526961847f8eSopenharmony_ci */ 527061847f8eSopenharmony_ci setBackForwardCacheOptions(options: BackForwardCacheOptions): void; 527161847f8eSopenharmony_ci 527261847f8eSopenharmony_ci /** 527361847f8eSopenharmony_ci * Get the scroll offset of the webpage in view port, the coordinates of the top left corner of the view port are X: 0, Y: 0. 527461847f8eSopenharmony_ci * And the unit is virtual pixel. 527561847f8eSopenharmony_ci * 527661847f8eSopenharmony_ci * @returns { ScrollOffset } scroll offset 527761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 527861847f8eSopenharmony_ci * @atomicservice 527961847f8eSopenharmony_ci * @since 13 528061847f8eSopenharmony_ci */ 528161847f8eSopenharmony_ci getScrollOffset(): ScrollOffset; 528261847f8eSopenharmony_ci 528361847f8eSopenharmony_ci /** 528461847f8eSopenharmony_ci * Scrolls by the specified delta position and returns a result indicating whether the scrolling operation was successful or not. 528561847f8eSopenharmony_ci * 528661847f8eSopenharmony_ci * @param { number } deltaX - the delta x of the position. 528761847f8eSopenharmony_ci * @param { number } deltaY - the delta y of the position. 528861847f8eSopenharmony_ci * @returns { boolean } true if the scroll operation is successful, otherwise false. 528961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 529061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 529161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. 529261847f8eSopenharmony_ci * The WebviewController must be associated with a Web component. 529361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 529461847f8eSopenharmony_ci * @since 12 529561847f8eSopenharmony_ci */ 529661847f8eSopenharmony_ci scrollByWithResult(deltaX: number, deltaY: number): boolean; 529761847f8eSopenharmony_ci } 529861847f8eSopenharmony_ci 529961847f8eSopenharmony_ci /** 530061847f8eSopenharmony_ci * Defines the state for download. 530161847f8eSopenharmony_ci * @enum {number} 530261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 530361847f8eSopenharmony_ci * @atomicservice 530461847f8eSopenharmony_ci * @since 11 530561847f8eSopenharmony_ci */ 530661847f8eSopenharmony_ci enum WebDownloadState { 530761847f8eSopenharmony_ci /** 530861847f8eSopenharmony_ci * The web download is in progress. 530961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 531061847f8eSopenharmony_ci * @atomicservice 531161847f8eSopenharmony_ci * @since 11 531261847f8eSopenharmony_ci */ 531361847f8eSopenharmony_ci IN_PROGRESS = 0, 531461847f8eSopenharmony_ci 531561847f8eSopenharmony_ci /** 531661847f8eSopenharmony_ci * The web download has been completed. 531761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 531861847f8eSopenharmony_ci * @atomicservice 531961847f8eSopenharmony_ci * @since 11 532061847f8eSopenharmony_ci */ 532161847f8eSopenharmony_ci COMPLETED, 532261847f8eSopenharmony_ci 532361847f8eSopenharmony_ci /** 532461847f8eSopenharmony_ci * The web download was canceled. 532561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 532661847f8eSopenharmony_ci * @atomicservice 532761847f8eSopenharmony_ci * @since 11 532861847f8eSopenharmony_ci */ 532961847f8eSopenharmony_ci CANCELED, 533061847f8eSopenharmony_ci 533161847f8eSopenharmony_ci /** 533261847f8eSopenharmony_ci * The web download was interrupted. 533361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 533461847f8eSopenharmony_ci * @atomicservice 533561847f8eSopenharmony_ci * @since 11 533661847f8eSopenharmony_ci */ 533761847f8eSopenharmony_ci INTERRUPTED, 533861847f8eSopenharmony_ci 533961847f8eSopenharmony_ci /** 534061847f8eSopenharmony_ci * The web download is pending. 534161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 534261847f8eSopenharmony_ci * @atomicservice 534361847f8eSopenharmony_ci * @since 11 534461847f8eSopenharmony_ci */ 534561847f8eSopenharmony_ci PENDING, 534661847f8eSopenharmony_ci 534761847f8eSopenharmony_ci /** 534861847f8eSopenharmony_ci * The web download has been paused. 534961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 535061847f8eSopenharmony_ci * @atomicservice 535161847f8eSopenharmony_ci * @since 11 535261847f8eSopenharmony_ci */ 535361847f8eSopenharmony_ci PAUSED, 535461847f8eSopenharmony_ci 535561847f8eSopenharmony_ci /** 535661847f8eSopenharmony_ci * Unknown state. 535761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 535861847f8eSopenharmony_ci * @atomicservice 535961847f8eSopenharmony_ci * @since 11 536061847f8eSopenharmony_ci */ 536161847f8eSopenharmony_ci UNKNOWN, 536261847f8eSopenharmony_ci } 536361847f8eSopenharmony_ci 536461847f8eSopenharmony_ci /** 536561847f8eSopenharmony_ci * Defines the error code for download. 536661847f8eSopenharmony_ci * @enum {number} 536761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 536861847f8eSopenharmony_ci * @atomicservice 536961847f8eSopenharmony_ci * @since 11 537061847f8eSopenharmony_ci */ 537161847f8eSopenharmony_ci enum WebDownloadErrorCode { 537261847f8eSopenharmony_ci /** 537361847f8eSopenharmony_ci * Unknown error. 537461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 537561847f8eSopenharmony_ci * @atomicservice 537661847f8eSopenharmony_ci * @since 11 537761847f8eSopenharmony_ci */ 537861847f8eSopenharmony_ci ERROR_UNKNOWN = 0, 537961847f8eSopenharmony_ci 538061847f8eSopenharmony_ci /** 538161847f8eSopenharmony_ci * Generic file operation failure. 538261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 538361847f8eSopenharmony_ci * @atomicservice 538461847f8eSopenharmony_ci * @since 11 538561847f8eSopenharmony_ci */ 538661847f8eSopenharmony_ci FILE_FAILED = 1, 538761847f8eSopenharmony_ci 538861847f8eSopenharmony_ci /** 538961847f8eSopenharmony_ci * The file cannot be accessed due to certain restrictions. 539061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 539161847f8eSopenharmony_ci * @atomicservice 539261847f8eSopenharmony_ci * @since 11 539361847f8eSopenharmony_ci */ 539461847f8eSopenharmony_ci FILE_ACCESS_DENIED = 2, 539561847f8eSopenharmony_ci 539661847f8eSopenharmony_ci /** 539761847f8eSopenharmony_ci * There is not enough disk space. 539861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 539961847f8eSopenharmony_ci * @atomicservice 540061847f8eSopenharmony_ci * @since 11 540161847f8eSopenharmony_ci */ 540261847f8eSopenharmony_ci FILE_NO_SPACE = 3, 540361847f8eSopenharmony_ci 540461847f8eSopenharmony_ci /** 540561847f8eSopenharmony_ci * The file name is too long. 540661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 540761847f8eSopenharmony_ci * @atomicservice 540861847f8eSopenharmony_ci * @since 11 540961847f8eSopenharmony_ci */ 541061847f8eSopenharmony_ci FILE_NAME_TOO_LONG = 5, 541161847f8eSopenharmony_ci 541261847f8eSopenharmony_ci /** 541361847f8eSopenharmony_ci * The file is too large. 541461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 541561847f8eSopenharmony_ci * @atomicservice 541661847f8eSopenharmony_ci * @since 11 541761847f8eSopenharmony_ci */ 541861847f8eSopenharmony_ci FILE_TOO_LARGE = 6, 541961847f8eSopenharmony_ci 542061847f8eSopenharmony_ci /** 542161847f8eSopenharmony_ci * Some temporary problems occurred, such as not enough memory, files in use, and too many files open at the same time. 542261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 542361847f8eSopenharmony_ci * @atomicservice 542461847f8eSopenharmony_ci * @since 11 542561847f8eSopenharmony_ci */ 542661847f8eSopenharmony_ci FILE_TRANSIENT_ERROR = 10, 542761847f8eSopenharmony_ci 542861847f8eSopenharmony_ci /** 542961847f8eSopenharmony_ci * The file is blocked from accessing because of some local policy. 543061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 543161847f8eSopenharmony_ci * @atomicservice 543261847f8eSopenharmony_ci * @since 11 543361847f8eSopenharmony_ci */ 543461847f8eSopenharmony_ci FILE_BLOCKED = 11, 543561847f8eSopenharmony_ci 543661847f8eSopenharmony_ci /** 543761847f8eSopenharmony_ci * When trying to resume the download, Found that the file is not long enough, maybe the file no longer exists. 543861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 543961847f8eSopenharmony_ci * @atomicservice 544061847f8eSopenharmony_ci * @since 11 544161847f8eSopenharmony_ci */ 544261847f8eSopenharmony_ci FILE_TOO_SHORT = 13, 544361847f8eSopenharmony_ci 544461847f8eSopenharmony_ci /** 544561847f8eSopenharmony_ci * Hash mismatch. 544661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 544761847f8eSopenharmony_ci * @atomicservice 544861847f8eSopenharmony_ci * @since 11 544961847f8eSopenharmony_ci */ 545061847f8eSopenharmony_ci FILE_HASH_MISMATCH = 14, 545161847f8eSopenharmony_ci 545261847f8eSopenharmony_ci /** 545361847f8eSopenharmony_ci * The file already exists. 545461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 545561847f8eSopenharmony_ci * @atomicservice 545661847f8eSopenharmony_ci * @since 11 545761847f8eSopenharmony_ci */ 545861847f8eSopenharmony_ci FILE_SAME_AS_SOURCE = 15, 545961847f8eSopenharmony_ci 546061847f8eSopenharmony_ci /** 546161847f8eSopenharmony_ci * Generic network error. 546261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 546361847f8eSopenharmony_ci * @atomicservice 546461847f8eSopenharmony_ci * @since 11 546561847f8eSopenharmony_ci */ 546661847f8eSopenharmony_ci NETWORK_FAILED = 20, 546761847f8eSopenharmony_ci 546861847f8eSopenharmony_ci /** 546961847f8eSopenharmony_ci * The network operation timed out. 547061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 547161847f8eSopenharmony_ci * @atomicservice 547261847f8eSopenharmony_ci * @since 11 547361847f8eSopenharmony_ci */ 547461847f8eSopenharmony_ci NETWORK_TIMEOUT = 21, 547561847f8eSopenharmony_ci 547661847f8eSopenharmony_ci /** 547761847f8eSopenharmony_ci * The network was disconnected. 547861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 547961847f8eSopenharmony_ci * @atomicservice 548061847f8eSopenharmony_ci * @since 11 548161847f8eSopenharmony_ci */ 548261847f8eSopenharmony_ci NETWORK_DISCONNECTED = 22, 548361847f8eSopenharmony_ci 548461847f8eSopenharmony_ci /** 548561847f8eSopenharmony_ci * Server down. 548661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 548761847f8eSopenharmony_ci * @atomicservice 548861847f8eSopenharmony_ci * @since 11 548961847f8eSopenharmony_ci */ 549061847f8eSopenharmony_ci NETWORK_SERVER_DOWN = 23, 549161847f8eSopenharmony_ci 549261847f8eSopenharmony_ci /** 549361847f8eSopenharmony_ci * Invalid network requests,may redirect to unsupported scheme or an invalid URL. 549461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 549561847f8eSopenharmony_ci * @atomicservice 549661847f8eSopenharmony_ci * @since 11 549761847f8eSopenharmony_ci */ 549861847f8eSopenharmony_ci NETWORK_INVALID_REQUEST = 24, 549961847f8eSopenharmony_ci 550061847f8eSopenharmony_ci /** 550161847f8eSopenharmony_ci * The server returned a generic error. 550261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 550361847f8eSopenharmony_ci * @atomicservice 550461847f8eSopenharmony_ci * @since 11 550561847f8eSopenharmony_ci */ 550661847f8eSopenharmony_ci SERVER_FAILED = 30, 550761847f8eSopenharmony_ci 550861847f8eSopenharmony_ci /** 550961847f8eSopenharmony_ci * The server does not support range requests. 551061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 551161847f8eSopenharmony_ci * @atomicservice 551261847f8eSopenharmony_ci * @since 11 551361847f8eSopenharmony_ci */ 551461847f8eSopenharmony_ci SERVER_NO_RANGE = 31, 551561847f8eSopenharmony_ci 551661847f8eSopenharmony_ci /** 551761847f8eSopenharmony_ci * The server does not have the requested data. 551861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 551961847f8eSopenharmony_ci * @atomicservice 552061847f8eSopenharmony_ci * @since 11 552161847f8eSopenharmony_ci */ 552261847f8eSopenharmony_ci SERVER_BAD_CONTENT = 33, 552361847f8eSopenharmony_ci 552461847f8eSopenharmony_ci /** 552561847f8eSopenharmony_ci * The server does not allow the file to be downloaded. 552661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 552761847f8eSopenharmony_ci * @atomicservice 552861847f8eSopenharmony_ci * @since 11 552961847f8eSopenharmony_ci */ 553061847f8eSopenharmony_ci SERVER_UNAUTHORIZED = 34, 553161847f8eSopenharmony_ci 553261847f8eSopenharmony_ci /** 553361847f8eSopenharmony_ci * Server certificate error. 553461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 553561847f8eSopenharmony_ci * @atomicservice 553661847f8eSopenharmony_ci * @since 11 553761847f8eSopenharmony_ci */ 553861847f8eSopenharmony_ci SERVER_CERT_PROBLEM = 35, 553961847f8eSopenharmony_ci 554061847f8eSopenharmony_ci /** 554161847f8eSopenharmony_ci * Server access forbidden. 554261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 554361847f8eSopenharmony_ci * @atomicservice 554461847f8eSopenharmony_ci * @since 11 554561847f8eSopenharmony_ci */ 554661847f8eSopenharmony_ci SERVER_FORBIDDEN = 36, 554761847f8eSopenharmony_ci 554861847f8eSopenharmony_ci /** 554961847f8eSopenharmony_ci * Server unreachable. 555061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 555161847f8eSopenharmony_ci * @atomicservice 555261847f8eSopenharmony_ci * @since 11 555361847f8eSopenharmony_ci */ 555461847f8eSopenharmony_ci SERVER_UNREACHABLE = 37, 555561847f8eSopenharmony_ci 555661847f8eSopenharmony_ci /** 555761847f8eSopenharmony_ci * The received data does not match content-length. 555861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 555961847f8eSopenharmony_ci * @atomicservice 556061847f8eSopenharmony_ci * @since 11 556161847f8eSopenharmony_ci */ 556261847f8eSopenharmony_ci SERVER_CONTENT_LENGTH_MISMATCH = 38, 556361847f8eSopenharmony_ci 556461847f8eSopenharmony_ci /** 556561847f8eSopenharmony_ci * An unexpected cross-origin redirect happened. 556661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 556761847f8eSopenharmony_ci * @atomicservice 556861847f8eSopenharmony_ci * @since 11 556961847f8eSopenharmony_ci */ 557061847f8eSopenharmony_ci SERVER_CROSS_ORIGIN_REDIRECT = 39, 557161847f8eSopenharmony_ci 557261847f8eSopenharmony_ci /** 557361847f8eSopenharmony_ci * User cancel. 557461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 557561847f8eSopenharmony_ci * @atomicservice 557661847f8eSopenharmony_ci * @since 11 557761847f8eSopenharmony_ci */ 557861847f8eSopenharmony_ci USER_CANCELED = 40, 557961847f8eSopenharmony_ci 558061847f8eSopenharmony_ci /** 558161847f8eSopenharmony_ci * User shut down the application. 558261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 558361847f8eSopenharmony_ci * @atomicservice 558461847f8eSopenharmony_ci * @since 11 558561847f8eSopenharmony_ci */ 558661847f8eSopenharmony_ci USER_SHUTDOWN = 41, 558761847f8eSopenharmony_ci 558861847f8eSopenharmony_ci /** 558961847f8eSopenharmony_ci * Application crash. 559061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 559161847f8eSopenharmony_ci * @atomicservice 559261847f8eSopenharmony_ci * @since 11 559361847f8eSopenharmony_ci */ 559461847f8eSopenharmony_ci CRASH = 50, 559561847f8eSopenharmony_ci } 559661847f8eSopenharmony_ci 559761847f8eSopenharmony_ci /** 559861847f8eSopenharmony_ci * Represents a download task, You can use this object to operate the corresponding download task. 559961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 560061847f8eSopenharmony_ci * @atomicservice 560161847f8eSopenharmony_ci * @since 11 560261847f8eSopenharmony_ci */ 560361847f8eSopenharmony_ci class WebDownloadItem { 560461847f8eSopenharmony_ci /** 560561847f8eSopenharmony_ci * Get guid. 560661847f8eSopenharmony_ci * @returns { string } - Returns the download's guid. 560761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 560861847f8eSopenharmony_ci * @atomicservice 560961847f8eSopenharmony_ci * @since 11 561061847f8eSopenharmony_ci */ 561161847f8eSopenharmony_ci getGuid(): string; 561261847f8eSopenharmony_ci 561361847f8eSopenharmony_ci /** 561461847f8eSopenharmony_ci * Get current speed, in bytes per second. 561561847f8eSopenharmony_ci * @returns { number } - Returns the current download speed. 561661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 561761847f8eSopenharmony_ci * @atomicservice 561861847f8eSopenharmony_ci * @since 11 561961847f8eSopenharmony_ci */ 562061847f8eSopenharmony_ci getCurrentSpeed(): number; 562161847f8eSopenharmony_ci 562261847f8eSopenharmony_ci /** 562361847f8eSopenharmony_ci * Get percent complete. 562461847f8eSopenharmony_ci * @returns { number } - Returns -1 if progress is unknown. 100 if the download is already complete. 562561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 562661847f8eSopenharmony_ci * @atomicservice 562761847f8eSopenharmony_ci * @since 11 562861847f8eSopenharmony_ci */ 562961847f8eSopenharmony_ci getPercentComplete(): number; 563061847f8eSopenharmony_ci 563161847f8eSopenharmony_ci /** 563261847f8eSopenharmony_ci * Get total bytes. 563361847f8eSopenharmony_ci * @returns { number } - Returns the total bytes received, -1 if the total size is unknown. 563461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 563561847f8eSopenharmony_ci * @atomicservice 563661847f8eSopenharmony_ci * @since 11 563761847f8eSopenharmony_ci */ 563861847f8eSopenharmony_ci getTotalBytes(): number; 563961847f8eSopenharmony_ci 564061847f8eSopenharmony_ci /** 564161847f8eSopenharmony_ci * Get state of the web download. 564261847f8eSopenharmony_ci * @returns { WebDownloadState } - Returns the current download state. 564361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 564461847f8eSopenharmony_ci * @atomicservice 564561847f8eSopenharmony_ci * @since 11 564661847f8eSopenharmony_ci */ 564761847f8eSopenharmony_ci getState(): WebDownloadState; 564861847f8eSopenharmony_ci 564961847f8eSopenharmony_ci /** 565061847f8eSopenharmony_ci * Get last error code of the web download. 565161847f8eSopenharmony_ci * @returns { WebDownloadErrorCode } - Returns the last error code. 565261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 565361847f8eSopenharmony_ci * @atomicservice 565461847f8eSopenharmony_ci * @since 11 565561847f8eSopenharmony_ci */ 565661847f8eSopenharmony_ci getLastErrorCode(): WebDownloadErrorCode; 565761847f8eSopenharmony_ci 565861847f8eSopenharmony_ci /** 565961847f8eSopenharmony_ci * Get http method of the web download request. 566061847f8eSopenharmony_ci * @returns { string } - Returns the http request method. 566161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 566261847f8eSopenharmony_ci * @atomicservice 566361847f8eSopenharmony_ci * @since 11 566461847f8eSopenharmony_ci */ 566561847f8eSopenharmony_ci getMethod(): string; 566661847f8eSopenharmony_ci 566761847f8eSopenharmony_ci /** 566861847f8eSopenharmony_ci * Get mime type of the web download. 566961847f8eSopenharmony_ci * @returns { string } - Returns the mimetype. 567061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 567161847f8eSopenharmony_ci * @atomicservice 567261847f8eSopenharmony_ci * @since 11 567361847f8eSopenharmony_ci */ 567461847f8eSopenharmony_ci getMimeType(): string; 567561847f8eSopenharmony_ci 567661847f8eSopenharmony_ci /** 567761847f8eSopenharmony_ci * Get url of the web download request. 567861847f8eSopenharmony_ci * @returns { string } - Returns the url. 567961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 568061847f8eSopenharmony_ci * @atomicservice 568161847f8eSopenharmony_ci * @since 11 568261847f8eSopenharmony_ci */ 568361847f8eSopenharmony_ci getUrl(): string; 568461847f8eSopenharmony_ci 568561847f8eSopenharmony_ci /** 568661847f8eSopenharmony_ci * Get suggested file name of the web download request. 568761847f8eSopenharmony_ci * @returns { string } - Returns the suggested file name. 568861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 568961847f8eSopenharmony_ci * @atomicservice 569061847f8eSopenharmony_ci * @since 11 569161847f8eSopenharmony_ci */ 569261847f8eSopenharmony_ci getSuggestedFileName(): string; 569361847f8eSopenharmony_ci 569461847f8eSopenharmony_ci /** 569561847f8eSopenharmony_ci * Start the web download. 569661847f8eSopenharmony_ci * Used in onBeforeDownload, If you want to start the current download, call this function. 569761847f8eSopenharmony_ci * @param { string } downloadPath - The content will be downloaded to this file. 569861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 569961847f8eSopenharmony_ci * <br>2. Parameter verification failed. 570061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 570161847f8eSopenharmony_ci * @atomicservice 570261847f8eSopenharmony_ci * @since 11 570361847f8eSopenharmony_ci */ 570461847f8eSopenharmony_ci start(downloadPath: string): void; 570561847f8eSopenharmony_ci 570661847f8eSopenharmony_ci /** 570761847f8eSopenharmony_ci * Cancel the web download. 570861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 570961847f8eSopenharmony_ci * @atomicservice 571061847f8eSopenharmony_ci * @since 11 571161847f8eSopenharmony_ci */ 571261847f8eSopenharmony_ci cancel(): void; 571361847f8eSopenharmony_ci 571461847f8eSopenharmony_ci /** 571561847f8eSopenharmony_ci * Pause the web download. 571661847f8eSopenharmony_ci * @throws { BusinessError } 17100019 - The download task is not started yet. 571761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 571861847f8eSopenharmony_ci * @atomicservice 571961847f8eSopenharmony_ci * @since 11 572061847f8eSopenharmony_ci */ 572161847f8eSopenharmony_ci pause(): void; 572261847f8eSopenharmony_ci 572361847f8eSopenharmony_ci /** 572461847f8eSopenharmony_ci * Resume the web download. 572561847f8eSopenharmony_ci * Use WebDownloadManager.resumeDownload to resume deserialized downloads. 572661847f8eSopenharmony_ci * WebDownloadItem.resume is only used to resume the currently paused download. 572761847f8eSopenharmony_ci * @throws { BusinessError } 17100016 - The download task is not paused. 572861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 572961847f8eSopenharmony_ci * @atomicservice 573061847f8eSopenharmony_ci * @since 11 573161847f8eSopenharmony_ci */ 573261847f8eSopenharmony_ci resume(): void; 573361847f8eSopenharmony_ci 573461847f8eSopenharmony_ci /** 573561847f8eSopenharmony_ci * Get received bytes. 573661847f8eSopenharmony_ci * @returns { number } - Returns the received bytes. 573761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 573861847f8eSopenharmony_ci * @atomicservice 573961847f8eSopenharmony_ci * @since 11 574061847f8eSopenharmony_ci */ 574161847f8eSopenharmony_ci getReceivedBytes(): number; 574261847f8eSopenharmony_ci 574361847f8eSopenharmony_ci /** 574461847f8eSopenharmony_ci * Get full path of the web download. 574561847f8eSopenharmony_ci * @returns { string } - Returns the full path of the download. 574661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 574761847f8eSopenharmony_ci * @atomicservice 574861847f8eSopenharmony_ci * @since 11 574961847f8eSopenharmony_ci */ 575061847f8eSopenharmony_ci getFullPath(): string; 575161847f8eSopenharmony_ci 575261847f8eSopenharmony_ci /** 575361847f8eSopenharmony_ci * Serialize web download to typed array. 575461847f8eSopenharmony_ci * @returns { Uint8Array } - Returns the serialized data. 575561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 575661847f8eSopenharmony_ci * @atomicservice 575761847f8eSopenharmony_ci * @since 11 575861847f8eSopenharmony_ci */ 575961847f8eSopenharmony_ci serialize(): Uint8Array; 576061847f8eSopenharmony_ci 576161847f8eSopenharmony_ci /** 576261847f8eSopenharmony_ci * Deserialize web download from typed array. 576361847f8eSopenharmony_ci * @param { Uint8Array } serializedData - The serialized data. 576461847f8eSopenharmony_ci * @returns { WebDownloadItem } - Deserialize the serialized data into a WebDownloadItem. 576561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 576661847f8eSopenharmony_ci * <br>2. Parameter verification failed. 576761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 576861847f8eSopenharmony_ci * @atomicservice 576961847f8eSopenharmony_ci * @since 11 577061847f8eSopenharmony_ci */ 577161847f8eSopenharmony_ci static deserialize(serializedData: Uint8Array): WebDownloadItem; 577261847f8eSopenharmony_ci } 577361847f8eSopenharmony_ci 577461847f8eSopenharmony_ci /** 577561847f8eSopenharmony_ci * The download state is notified through this delegate. 577661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 577761847f8eSopenharmony_ci * @atomicservice 577861847f8eSopenharmony_ci * @since 11 577961847f8eSopenharmony_ci */ 578061847f8eSopenharmony_ci class WebDownloadDelegate { 578161847f8eSopenharmony_ci /** 578261847f8eSopenharmony_ci * Callback will be triggered before web download start. 578361847f8eSopenharmony_ci * @param { Callback<WebDownloadItem> } callback - The callback of download will be start. 578461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 578561847f8eSopenharmony_ci * @atomicservice 578661847f8eSopenharmony_ci * @since 11 578761847f8eSopenharmony_ci */ 578861847f8eSopenharmony_ci onBeforeDownload(callback: Callback<WebDownloadItem>): void; 578961847f8eSopenharmony_ci 579061847f8eSopenharmony_ci /** 579161847f8eSopenharmony_ci * Callback will be triggered when web download is processing. 579261847f8eSopenharmony_ci * @param { Callback<WebDownloadItem> } callback - The callback of download did update. 579361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 579461847f8eSopenharmony_ci * @atomicservice 579561847f8eSopenharmony_ci * @since 11 579661847f8eSopenharmony_ci */ 579761847f8eSopenharmony_ci onDownloadUpdated(callback: Callback<WebDownloadItem>): void; 579861847f8eSopenharmony_ci 579961847f8eSopenharmony_ci /** 580061847f8eSopenharmony_ci * Callback will be triggered when web download is completed. 580161847f8eSopenharmony_ci * @param { Callback<WebDownloadItem> } callback - The callback of download did finish. 580261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 580361847f8eSopenharmony_ci * @atomicservice 580461847f8eSopenharmony_ci * @since 11 580561847f8eSopenharmony_ci */ 580661847f8eSopenharmony_ci onDownloadFinish(callback: Callback<WebDownloadItem>): void; 580761847f8eSopenharmony_ci 580861847f8eSopenharmony_ci /** 580961847f8eSopenharmony_ci * Callback will be triggered when web download is interrupted or canceled. 581061847f8eSopenharmony_ci * @param { Callback<WebDownloadItem> } callback - The callback of download did fail. 581161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 581261847f8eSopenharmony_ci * @atomicservice 581361847f8eSopenharmony_ci * @since 11 581461847f8eSopenharmony_ci */ 581561847f8eSopenharmony_ci onDownloadFailed(callback: Callback<WebDownloadItem>): void; 581661847f8eSopenharmony_ci } 581761847f8eSopenharmony_ci 581861847f8eSopenharmony_ci /** 581961847f8eSopenharmony_ci * You can trigger download manually through this interface, or resume failed or canceled downloads. 582061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 582161847f8eSopenharmony_ci * @atomicservice 582261847f8eSopenharmony_ci * @since 11 582361847f8eSopenharmony_ci */ 582461847f8eSopenharmony_ci class WebDownloadManager { 582561847f8eSopenharmony_ci /** 582661847f8eSopenharmony_ci * Set a delegate used to receive the progress of the download triggered from WebDownloadManager. 582761847f8eSopenharmony_ci * @param { WebDownloadDelegate } delegate - Delegate used for download triggered from WebDownloadManager. 582861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 582961847f8eSopenharmony_ci * @atomicservice 583061847f8eSopenharmony_ci * @since 11 583161847f8eSopenharmony_ci */ 583261847f8eSopenharmony_ci static setDownloadDelegate(delegate: WebDownloadDelegate): void; 583361847f8eSopenharmony_ci 583461847f8eSopenharmony_ci /** 583561847f8eSopenharmony_ci * Resume the canceled or failed download. 583661847f8eSopenharmony_ci * @param { WebDownloadItem } webDownloadItem - Download that need to be resume. 583761847f8eSopenharmony_ci * @throws { BusinessError } 17100018 - No WebDownloadDelegate has been set yet. 583861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 583961847f8eSopenharmony_ci * @atomicservice 584061847f8eSopenharmony_ci * @since 11 584161847f8eSopenharmony_ci */ 584261847f8eSopenharmony_ci static resumeDownload(webDownloadItem: WebDownloadItem): void; 584361847f8eSopenharmony_ci } 584461847f8eSopenharmony_ci 584561847f8eSopenharmony_ci /** 584661847f8eSopenharmony_ci * The http body stream of the request. 584761847f8eSopenharmony_ci * 584861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 584961847f8eSopenharmony_ci * @atomicservice 585061847f8eSopenharmony_ci * @since 12 585161847f8eSopenharmony_ci */ 585261847f8eSopenharmony_ci class WebHttpBodyStream { 585361847f8eSopenharmony_ci /** 585461847f8eSopenharmony_ci * Initialize data stream. 585561847f8eSopenharmony_ci * 585661847f8eSopenharmony_ci * @returns { Promise<void> } The promise of data stream is initialized. 585761847f8eSopenharmony_ci * @throws { BusinessError } 17100022 - Failed to initialize the HTTP body stream. 585861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 585961847f8eSopenharmony_ci * @atomicservice 586061847f8eSopenharmony_ci * @since 12 586161847f8eSopenharmony_ci */ 586261847f8eSopenharmony_ci initialize(): Promise<void>; 586361847f8eSopenharmony_ci /** 586461847f8eSopenharmony_ci * Read the data stream to the buffer. 586561847f8eSopenharmony_ci * 586661847f8eSopenharmony_ci * @param { number } size - Read size. 586761847f8eSopenharmony_ci * @returns { Promise<ArrayBuffer> } Read array buffer of result. 586861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 586961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 587061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 587161847f8eSopenharmony_ci * @atomicservice 587261847f8eSopenharmony_ci * @since 12 587361847f8eSopenharmony_ci */ 587461847f8eSopenharmony_ci read(size: number): Promise<ArrayBuffer>; 587561847f8eSopenharmony_ci /** 587661847f8eSopenharmony_ci * Get the total size of the data stream. When data is chunked, always return zero. 587761847f8eSopenharmony_ci * 587861847f8eSopenharmony_ci * @returns { number } Return size of data stream size. 587961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 588061847f8eSopenharmony_ci * @atomicservice 588161847f8eSopenharmony_ci * @since 12 588261847f8eSopenharmony_ci */ 588361847f8eSopenharmony_ci getSize(): number; 588461847f8eSopenharmony_ci /** 588561847f8eSopenharmony_ci * Get the current position of the data stream. 588661847f8eSopenharmony_ci * 588761847f8eSopenharmony_ci * @returns { number } Return position in post data stream. 588861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 588961847f8eSopenharmony_ci * @atomicservice 589061847f8eSopenharmony_ci * @since 12 589161847f8eSopenharmony_ci */ 589261847f8eSopenharmony_ci getPosition(): number; 589361847f8eSopenharmony_ci /** 589461847f8eSopenharmony_ci * Whether data stream is chunked. 589561847f8eSopenharmony_ci * 589661847f8eSopenharmony_ci * @returns { boolean } Whether data stream is chunked. 589761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 589861847f8eSopenharmony_ci * @atomicservice 589961847f8eSopenharmony_ci * @since 12 590061847f8eSopenharmony_ci */ 590161847f8eSopenharmony_ci isChunked(): boolean; 590261847f8eSopenharmony_ci /** 590361847f8eSopenharmony_ci * Whether all data stream has been consumed. For chunked uploads, 590461847f8eSopenharmony_ci * returns false until the first read attempt. 590561847f8eSopenharmony_ci * 590661847f8eSopenharmony_ci * @returns { boolean } Whether data stream has been consumed. 590761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 590861847f8eSopenharmony_ci * @atomicservice 590961847f8eSopenharmony_ci * @since 12 591061847f8eSopenharmony_ci */ 591161847f8eSopenharmony_ci isEof(): boolean; 591261847f8eSopenharmony_ci /** 591361847f8eSopenharmony_ci * Returns true if the upload data in the stream is entirely in memory, and all read requests will succeed 591461847f8eSopenharmony_ci * synchronously. Expected to return false for chunked requests. 591561847f8eSopenharmony_ci * 591661847f8eSopenharmony_ci * @returns { boolean } Whether the data stream is in memory. 591761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 591861847f8eSopenharmony_ci * @atomicservice 591961847f8eSopenharmony_ci * @since 12 592061847f8eSopenharmony_ci */ 592161847f8eSopenharmony_ci isInMemory(): boolean; 592261847f8eSopenharmony_ci } 592361847f8eSopenharmony_ci 592461847f8eSopenharmony_ci /** 592561847f8eSopenharmony_ci * Defines the resource type of request. 592661847f8eSopenharmony_ci * @enum {number} 592761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 592861847f8eSopenharmony_ci * @since 12 592961847f8eSopenharmony_ci */ 593061847f8eSopenharmony_ci enum WebResourceType { 593161847f8eSopenharmony_ci /** 593261847f8eSopenharmony_ci * Top level page. 593361847f8eSopenharmony_ci * 593461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 593561847f8eSopenharmony_ci * @since 12 593661847f8eSopenharmony_ci */ 593761847f8eSopenharmony_ci MAIN_FRAME = 0, 593861847f8eSopenharmony_ci 593961847f8eSopenharmony_ci /** 594061847f8eSopenharmony_ci * Frame or Iframe. 594161847f8eSopenharmony_ci * 594261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 594361847f8eSopenharmony_ci * @since 12 594461847f8eSopenharmony_ci */ 594561847f8eSopenharmony_ci SUB_FRAME = 1, 594661847f8eSopenharmony_ci 594761847f8eSopenharmony_ci /** 594861847f8eSopenharmony_ci * CSS stylesheet. 594961847f8eSopenharmony_ci * 595061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 595161847f8eSopenharmony_ci * @since 12 595261847f8eSopenharmony_ci */ 595361847f8eSopenharmony_ci STYLE_SHEET = 2, 595461847f8eSopenharmony_ci 595561847f8eSopenharmony_ci /** 595661847f8eSopenharmony_ci * External script. 595761847f8eSopenharmony_ci * 595861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 595961847f8eSopenharmony_ci * @since 12 596061847f8eSopenharmony_ci */ 596161847f8eSopenharmony_ci SCRIPT = 3, 596261847f8eSopenharmony_ci 596361847f8eSopenharmony_ci /** 596461847f8eSopenharmony_ci * Image (jpg/gif/png/etc). 596561847f8eSopenharmony_ci * 596661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 596761847f8eSopenharmony_ci * @since 12 596861847f8eSopenharmony_ci */ 596961847f8eSopenharmony_ci IMAGE = 4, 597061847f8eSopenharmony_ci 597161847f8eSopenharmony_ci /** 597261847f8eSopenharmony_ci * Font. 597361847f8eSopenharmony_ci * 597461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 597561847f8eSopenharmony_ci * @since 12 597661847f8eSopenharmony_ci */ 597761847f8eSopenharmony_ci FONT_RESOURCE = 5, 597861847f8eSopenharmony_ci 597961847f8eSopenharmony_ci /** 598061847f8eSopenharmony_ci * Some other subresource. This is the default type if the actual type is unknown. 598161847f8eSopenharmony_ci * 598261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 598361847f8eSopenharmony_ci * @since 12 598461847f8eSopenharmony_ci */ 598561847f8eSopenharmony_ci SUB_RESOURCE = 6, 598661847f8eSopenharmony_ci 598761847f8eSopenharmony_ci /** 598861847f8eSopenharmony_ci * Object (or embed) tag for a plugin, or a resource that a plugin requested. 598961847f8eSopenharmony_ci * 599061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 599161847f8eSopenharmony_ci * @since 12 599261847f8eSopenharmony_ci */ 599361847f8eSopenharmony_ci OBJECT = 7, 599461847f8eSopenharmony_ci 599561847f8eSopenharmony_ci /** 599661847f8eSopenharmony_ci * Media resource. 599761847f8eSopenharmony_ci * 599861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 599961847f8eSopenharmony_ci * @since 12 600061847f8eSopenharmony_ci */ 600161847f8eSopenharmony_ci MEDIA = 8, 600261847f8eSopenharmony_ci 600361847f8eSopenharmony_ci /** 600461847f8eSopenharmony_ci * Main resource of a dedicated worker. 600561847f8eSopenharmony_ci * 600661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 600761847f8eSopenharmony_ci * @since 12 600861847f8eSopenharmony_ci */ 600961847f8eSopenharmony_ci WORKER = 9, 601061847f8eSopenharmony_ci 601161847f8eSopenharmony_ci /** 601261847f8eSopenharmony_ci * Main resource of a shared worker. 601361847f8eSopenharmony_ci * 601461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 601561847f8eSopenharmony_ci * @since 12 601661847f8eSopenharmony_ci */ 601761847f8eSopenharmony_ci SHARED_WORKER = 10, 601861847f8eSopenharmony_ci 601961847f8eSopenharmony_ci /** 602061847f8eSopenharmony_ci * Explicitly requested prefetch. 602161847f8eSopenharmony_ci * 602261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 602361847f8eSopenharmony_ci * @since 12 602461847f8eSopenharmony_ci */ 602561847f8eSopenharmony_ci PREFETCH = 11, 602661847f8eSopenharmony_ci 602761847f8eSopenharmony_ci /** 602861847f8eSopenharmony_ci * Favicon. 602961847f8eSopenharmony_ci * 603061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 603161847f8eSopenharmony_ci * @since 12 603261847f8eSopenharmony_ci */ 603361847f8eSopenharmony_ci FAVICON = 12, 603461847f8eSopenharmony_ci 603561847f8eSopenharmony_ci /** 603661847f8eSopenharmony_ci * XMLHttpRequest. 603761847f8eSopenharmony_ci * 603861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 603961847f8eSopenharmony_ci * @since 12 604061847f8eSopenharmony_ci */ 604161847f8eSopenharmony_ci XHR = 13, 604261847f8eSopenharmony_ci 604361847f8eSopenharmony_ci /** 604461847f8eSopenharmony_ci * Ping request for <a ping>/sendBeacon. 604561847f8eSopenharmony_ci * 604661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 604761847f8eSopenharmony_ci * @since 12 604861847f8eSopenharmony_ci */ 604961847f8eSopenharmony_ci PING = 14, 605061847f8eSopenharmony_ci 605161847f8eSopenharmony_ci /** 605261847f8eSopenharmony_ci * The main resource of a service worker. 605361847f8eSopenharmony_ci * 605461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 605561847f8eSopenharmony_ci * @since 12 605661847f8eSopenharmony_ci */ 605761847f8eSopenharmony_ci SERVICE_WORKER = 15, 605861847f8eSopenharmony_ci 605961847f8eSopenharmony_ci /** 606061847f8eSopenharmony_ci * Report of Content Security Policy violations. 606161847f8eSopenharmony_ci * 606261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 606361847f8eSopenharmony_ci * @since 12 606461847f8eSopenharmony_ci */ 606561847f8eSopenharmony_ci CSP_REPORT = 16, 606661847f8eSopenharmony_ci 606761847f8eSopenharmony_ci /** 606861847f8eSopenharmony_ci * Resource that a plugin requested. 606961847f8eSopenharmony_ci * 607061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 607161847f8eSopenharmony_ci * @since 12 607261847f8eSopenharmony_ci */ 607361847f8eSopenharmony_ci PLUGIN_RESOURCE = 17, 607461847f8eSopenharmony_ci 607561847f8eSopenharmony_ci /** 607661847f8eSopenharmony_ci * A main-frame service worker navigation preload request. 607761847f8eSopenharmony_ci * 607861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 607961847f8eSopenharmony_ci * @since 12 608061847f8eSopenharmony_ci */ 608161847f8eSopenharmony_ci NAVIGATION_PRELOAD_MAIN_FRAME = 19, 608261847f8eSopenharmony_ci 608361847f8eSopenharmony_ci /** 608461847f8eSopenharmony_ci * A sub-frame service worker navigation preload request. 608561847f8eSopenharmony_ci * 608661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 608761847f8eSopenharmony_ci * @since 12 608861847f8eSopenharmony_ci */ 608961847f8eSopenharmony_ci NAVIGATION_PRELOAD_SUB_FRAME = 20, 609061847f8eSopenharmony_ci } 609161847f8eSopenharmony_ci 609261847f8eSopenharmony_ci /** 609361847f8eSopenharmony_ci * Defines the Web resource request used for scheme handler. 609461847f8eSopenharmony_ci * 609561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 609661847f8eSopenharmony_ci * @atomicservice 609761847f8eSopenharmony_ci * @since 12 609861847f8eSopenharmony_ci */ 609961847f8eSopenharmony_ci class WebSchemeHandlerRequest { 610061847f8eSopenharmony_ci /** 610161847f8eSopenharmony_ci * Gets request headers. 610261847f8eSopenharmony_ci * 610361847f8eSopenharmony_ci * @returns { Array<WebHeader> } Return the request headers. 610461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 610561847f8eSopenharmony_ci * @atomicservice 610661847f8eSopenharmony_ci * @since 12 610761847f8eSopenharmony_ci */ 610861847f8eSopenharmony_ci getHeader(): Array<WebHeader>; 610961847f8eSopenharmony_ci /** 611061847f8eSopenharmony_ci * Gets the request URL. 611161847f8eSopenharmony_ci * 611261847f8eSopenharmony_ci * @returns { string } Return the request URL. 611361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 611461847f8eSopenharmony_ci * @atomicservice 611561847f8eSopenharmony_ci * @since 12 611661847f8eSopenharmony_ci */ 611761847f8eSopenharmony_ci getRequestUrl(): string; 611861847f8eSopenharmony_ci /** 611961847f8eSopenharmony_ci * Get request method. 612061847f8eSopenharmony_ci * 612161847f8eSopenharmony_ci * @returns { string } Return the request method. 612261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 612361847f8eSopenharmony_ci * @atomicservice 612461847f8eSopenharmony_ci * @since 12 612561847f8eSopenharmony_ci */ 612661847f8eSopenharmony_ci getRequestMethod(): string; 612761847f8eSopenharmony_ci /** 612861847f8eSopenharmony_ci * Get referrer of request. 612961847f8eSopenharmony_ci * 613061847f8eSopenharmony_ci * @returns { string } Return referrer of request. 613161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 613261847f8eSopenharmony_ci * @atomicservice 613361847f8eSopenharmony_ci * @since 12 613461847f8eSopenharmony_ci */ 613561847f8eSopenharmony_ci getReferrer(): string; 613661847f8eSopenharmony_ci /** 613761847f8eSopenharmony_ci * Check whether the request is for getting the main frame. 613861847f8eSopenharmony_ci * 613961847f8eSopenharmony_ci * @returns { boolean } Whether request is main frame. 614061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 614161847f8eSopenharmony_ci * @atomicservice 614261847f8eSopenharmony_ci * @since 12 614361847f8eSopenharmony_ci */ 614461847f8eSopenharmony_ci isMainFrame(): boolean; 614561847f8eSopenharmony_ci /** 614661847f8eSopenharmony_ci * Check whether the request is associated with gesture. 614761847f8eSopenharmony_ci * 614861847f8eSopenharmony_ci * @returns { boolean } Whether request has user gesture. 614961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 615061847f8eSopenharmony_ci * @atomicservice 615161847f8eSopenharmony_ci * @since 12 615261847f8eSopenharmony_ci */ 615361847f8eSopenharmony_ci hasGesture(): boolean; 615461847f8eSopenharmony_ci /** 615561847f8eSopenharmony_ci * Get http body stream. 615661847f8eSopenharmony_ci * 615761847f8eSopenharmony_ci * @returns { WebHttpBodyStream | null } Return http body stream. If request has no http body stream, return null. 615861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 615961847f8eSopenharmony_ci * @atomicservice 616061847f8eSopenharmony_ci * @since 12 616161847f8eSopenharmony_ci */ 616261847f8eSopenharmony_ci getHttpBodyStream(): WebHttpBodyStream | null; 616361847f8eSopenharmony_ci /** 616461847f8eSopenharmony_ci * Get request's resource type. 616561847f8eSopenharmony_ci * 616661847f8eSopenharmony_ci * @returns { WebResourceType } Return the request's resource type. 616761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 616861847f8eSopenharmony_ci * @since 12 616961847f8eSopenharmony_ci */ 617061847f8eSopenharmony_ci getRequestResourceType(): WebResourceType; 617161847f8eSopenharmony_ci /** 617261847f8eSopenharmony_ci * Gets the URL of frame which trigger this request. 617361847f8eSopenharmony_ci * 617461847f8eSopenharmony_ci * @returns { string } Return the URL of frame which trigger this request. 617561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 617661847f8eSopenharmony_ci * @since 12 617761847f8eSopenharmony_ci */ 617861847f8eSopenharmony_ci getFrameUrl(): string; 617961847f8eSopenharmony_ci } 618061847f8eSopenharmony_ci 618161847f8eSopenharmony_ci /** 618261847f8eSopenharmony_ci * Defines the Web resource response used for scheme handler. 618361847f8eSopenharmony_ci * 618461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 618561847f8eSopenharmony_ci * @atomicservice 618661847f8eSopenharmony_ci * @since 12 618761847f8eSopenharmony_ci */ 618861847f8eSopenharmony_ci class WebSchemeHandlerResponse { 618961847f8eSopenharmony_ci /** 619061847f8eSopenharmony_ci * Constructor. 619161847f8eSopenharmony_ci * 619261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 619361847f8eSopenharmony_ci * @atomicservice 619461847f8eSopenharmony_ci * @since 12 619561847f8eSopenharmony_ci */ 619661847f8eSopenharmony_ci constructor(); 619761847f8eSopenharmony_ci /** 619861847f8eSopenharmony_ci * Set the resolved URL after redirects or changed as a result of HSTS. 619961847f8eSopenharmony_ci * 620061847f8eSopenharmony_ci * @param { string } url - Set response url for redirects. 620161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 620261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 620361847f8eSopenharmony_ci * @atomicservice 620461847f8eSopenharmony_ci * @since 12 620561847f8eSopenharmony_ci */ 620661847f8eSopenharmony_ci setUrl(url: string): void; 620761847f8eSopenharmony_ci /** 620861847f8eSopenharmony_ci * Get the resolved URL after redirects or changed as a result of HSTS. 620961847f8eSopenharmony_ci * 621061847f8eSopenharmony_ci * @returns { string } Return response url for redirects. 621161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 621261847f8eSopenharmony_ci * @atomicservice 621361847f8eSopenharmony_ci * @since 12 621461847f8eSopenharmony_ci */ 621561847f8eSopenharmony_ci getUrl(): string; 621661847f8eSopenharmony_ci /** 621761847f8eSopenharmony_ci * Set net error code. 621861847f8eSopenharmony_ci * @param { WebNetErrorList } code - Set net error code. 621961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 622061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 622161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 622261847f8eSopenharmony_ci * @atomicservice 622361847f8eSopenharmony_ci * @since 12 622461847f8eSopenharmony_ci */ 622561847f8eSopenharmony_ci setNetErrorCode(code: WebNetErrorList): void; 622661847f8eSopenharmony_ci /** 622761847f8eSopenharmony_ci * Get net error code. 622861847f8eSopenharmony_ci * 622961847f8eSopenharmony_ci * @returns { WebNetErrorList } Return response error code. 623061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 623161847f8eSopenharmony_ci * @atomicservice 623261847f8eSopenharmony_ci * @since 12 623361847f8eSopenharmony_ci */ 623461847f8eSopenharmony_ci getNetErrorCode(): WebNetErrorList; 623561847f8eSopenharmony_ci /** 623661847f8eSopenharmony_ci * Set http status code. 623761847f8eSopenharmony_ci * 623861847f8eSopenharmony_ci * @param { number } code - Http status code. 623961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 624061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 624161847f8eSopenharmony_ci * @atomicservice 624261847f8eSopenharmony_ci * @since 12 624361847f8eSopenharmony_ci */ 624461847f8eSopenharmony_ci setStatus(code: number): void; 624561847f8eSopenharmony_ci /** 624661847f8eSopenharmony_ci * Get http status code. 624761847f8eSopenharmony_ci * 624861847f8eSopenharmony_ci * @returns { number } Return http status code. 624961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 625061847f8eSopenharmony_ci * @atomicservice 625161847f8eSopenharmony_ci * @since 12 625261847f8eSopenharmony_ci */ 625361847f8eSopenharmony_ci getStatus(): number; 625461847f8eSopenharmony_ci /** 625561847f8eSopenharmony_ci * Set status text. 625661847f8eSopenharmony_ci * 625761847f8eSopenharmony_ci * @param { string } text - Status text. 625861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 625961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 626061847f8eSopenharmony_ci * @atomicservice 626161847f8eSopenharmony_ci * @since 12 626261847f8eSopenharmony_ci */ 626361847f8eSopenharmony_ci setStatusText(text: string): void; 626461847f8eSopenharmony_ci /** 626561847f8eSopenharmony_ci * Get status text. 626661847f8eSopenharmony_ci * 626761847f8eSopenharmony_ci * @returns { string } Return http status text. 626861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 626961847f8eSopenharmony_ci * @atomicservice 627061847f8eSopenharmony_ci * @since 12 627161847f8eSopenharmony_ci */ 627261847f8eSopenharmony_ci getStatusText(): string; 627361847f8eSopenharmony_ci /** 627461847f8eSopenharmony_ci * Set mime type. 627561847f8eSopenharmony_ci * 627661847f8eSopenharmony_ci * @param { string } type - Mime type. 627761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 627861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 627961847f8eSopenharmony_ci * @atomicservice 628061847f8eSopenharmony_ci * @since 12 628161847f8eSopenharmony_ci */ 628261847f8eSopenharmony_ci setMimeType(type: string): void; 628361847f8eSopenharmony_ci /** 628461847f8eSopenharmony_ci * Get mime type. 628561847f8eSopenharmony_ci * 628661847f8eSopenharmony_ci * @returns { string } Return mime type of response. 628761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 628861847f8eSopenharmony_ci * @atomicservice 628961847f8eSopenharmony_ci * @since 12 629061847f8eSopenharmony_ci */ 629161847f8eSopenharmony_ci getMimeType(): string; 629261847f8eSopenharmony_ci /** 629361847f8eSopenharmony_ci * Set the response encoding. 629461847f8eSopenharmony_ci * 629561847f8eSopenharmony_ci * @param { string } encoding - Encoding. 629661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 629761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 629861847f8eSopenharmony_ci * @atomicservice 629961847f8eSopenharmony_ci * @since 12 630061847f8eSopenharmony_ci */ 630161847f8eSopenharmony_ci setEncoding(encoding: string): void; 630261847f8eSopenharmony_ci /** 630361847f8eSopenharmony_ci * Get the response encoding. 630461847f8eSopenharmony_ci * 630561847f8eSopenharmony_ci * @returns { string } Return encoding of response. 630661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 630761847f8eSopenharmony_ci * @atomicservice 630861847f8eSopenharmony_ci * @since 12 630961847f8eSopenharmony_ci */ 631061847f8eSopenharmony_ci getEncoding(): string; 631161847f8eSopenharmony_ci /** 631261847f8eSopenharmony_ci * Set response hander value by name. 631361847f8eSopenharmony_ci * 631461847f8eSopenharmony_ci * @param { string } name - Header name. 631561847f8eSopenharmony_ci * @param { string } value - Header value. 631661847f8eSopenharmony_ci * @param { boolean } overwrite - Whether to overwrite. 631761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 631861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 631961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 632061847f8eSopenharmony_ci * @atomicservice 632161847f8eSopenharmony_ci * @since 12 632261847f8eSopenharmony_ci */ 632361847f8eSopenharmony_ci setHeaderByName(name: string, value: string, overwrite: boolean): void; 632461847f8eSopenharmony_ci /** 632561847f8eSopenharmony_ci * Get the header value by name from the response. 632661847f8eSopenharmony_ci * 632761847f8eSopenharmony_ci * @param { string } name - Header name. 632861847f8eSopenharmony_ci * @returns { string } Return header value by name. 632961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 633061847f8eSopenharmony_ci * @atomicservice 633161847f8eSopenharmony_ci * @since 12 633261847f8eSopenharmony_ci */ 633361847f8eSopenharmony_ci getHeaderByName(name: string): string 633461847f8eSopenharmony_ci } 633561847f8eSopenharmony_ci 633661847f8eSopenharmony_ci /** 633761847f8eSopenharmony_ci * Used to intercept url requests. Response headers and body can be sent through 633861847f8eSopenharmony_ci * WebResourceHandler. 633961847f8eSopenharmony_ci * 634061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 634161847f8eSopenharmony_ci * @atomicservice 634261847f8eSopenharmony_ci * @since 12 634361847f8eSopenharmony_ci */ 634461847f8eSopenharmony_ci class WebResourceHandler { 634561847f8eSopenharmony_ci /** 634661847f8eSopenharmony_ci * Pass response headers to intercepted requests. 634761847f8eSopenharmony_ci * 634861847f8eSopenharmony_ci * @param { WebSchemeHandlerResponse } response - Set response header to intercept. 634961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 635061847f8eSopenharmony_ci * @throws { BusinessError } 17100021 - The resource handler is invalid. 635161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 635261847f8eSopenharmony_ci * @atomicservice 635361847f8eSopenharmony_ci * @since 12 635461847f8eSopenharmony_ci */ 635561847f8eSopenharmony_ci didReceiveResponse(response: WebSchemeHandlerResponse): void; 635661847f8eSopenharmony_ci /** 635761847f8eSopenharmony_ci * Pass response body data to intercepted requests. 635861847f8eSopenharmony_ci * 635961847f8eSopenharmony_ci * @param { ArrayBuffer } data - Set response body to intercept. 636061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 636161847f8eSopenharmony_ci * @throws { BusinessError } 17100021 - The resource handler is invalid. 636261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 636361847f8eSopenharmony_ci * @atomicservice 636461847f8eSopenharmony_ci * @since 12 636561847f8eSopenharmony_ci */ 636661847f8eSopenharmony_ci didReceiveResponseBody(data: ArrayBuffer): void; 636761847f8eSopenharmony_ci /** 636861847f8eSopenharmony_ci * Notify that this request should be finished and there is no more data available. 636961847f8eSopenharmony_ci * 637061847f8eSopenharmony_ci * @throws { BusinessError } 17100021 - The resource handler is invalid. 637161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 637261847f8eSopenharmony_ci * @atomicservice 637361847f8eSopenharmony_ci * @since 12 637461847f8eSopenharmony_ci */ 637561847f8eSopenharmony_ci didFinish(): void; 637661847f8eSopenharmony_ci /** 637761847f8eSopenharmony_ci * Notify that this request should be failed. 637861847f8eSopenharmony_ci * 637961847f8eSopenharmony_ci * @param { WebNetErrorList } code - Set response error code to intercept. 638061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 638161847f8eSopenharmony_ci * @throws { BusinessError } 17100021 - The resource handler is invalid. 638261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 638361847f8eSopenharmony_ci * @atomicservice 638461847f8eSopenharmony_ci * @since 12 638561847f8eSopenharmony_ci */ 638661847f8eSopenharmony_ci didFail(code: WebNetErrorList): void; 638761847f8eSopenharmony_ci } 638861847f8eSopenharmony_ci 638961847f8eSopenharmony_ci /** 639061847f8eSopenharmony_ci * This class is used to intercept requests for a specified scheme. 639161847f8eSopenharmony_ci * 639261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 639361847f8eSopenharmony_ci * @atomicservice 639461847f8eSopenharmony_ci * @since 12 639561847f8eSopenharmony_ci */ 639661847f8eSopenharmony_ci class WebSchemeHandler { 639761847f8eSopenharmony_ci /** 639861847f8eSopenharmony_ci * Callback for handling the request. 639961847f8eSopenharmony_ci * 640061847f8eSopenharmony_ci * @param { function } callback - Callback of handling the request. If callback return false, 640161847f8eSopenharmony_ci * it means no interception. 640261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 640361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 640461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 640561847f8eSopenharmony_ci * @atomicservice 640661847f8eSopenharmony_ci * @since 12 640761847f8eSopenharmony_ci */ 640861847f8eSopenharmony_ci onRequestStart( 640961847f8eSopenharmony_ci callback: (request: WebSchemeHandlerRequest, handler: WebResourceHandler) => boolean): void; 641061847f8eSopenharmony_ci 641161847f8eSopenharmony_ci /** 641261847f8eSopenharmony_ci * Callback when the request is completed. 641361847f8eSopenharmony_ci * 641461847f8eSopenharmony_ci * @param { Callback<WebSchemeHandlerRequest> } callback - Callback of request is completed. 641561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Invalid input parameter. 641661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 641761847f8eSopenharmony_ci * @atomicservice 641861847f8eSopenharmony_ci * @since 12 641961847f8eSopenharmony_ci */ 642061847f8eSopenharmony_ci onRequestStop(callback: Callback<WebSchemeHandlerRequest>): void; 642161847f8eSopenharmony_ci } 642261847f8eSopenharmony_ci 642361847f8eSopenharmony_ci /** 642461847f8eSopenharmony_ci * Enum type supplied to {@link handleStatusChanged} for indicating the playback status. 642561847f8eSopenharmony_ci * @enum {number} 642661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 642761847f8eSopenharmony_ci * @atomicservice 642861847f8eSopenharmony_ci * @since 12 642961847f8eSopenharmony_ci */ 643061847f8eSopenharmony_ci enum PlaybackStatus { 643161847f8eSopenharmony_ci /** 643261847f8eSopenharmony_ci * Player status is paused. 643361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 643461847f8eSopenharmony_ci * @atomicservice 643561847f8eSopenharmony_ci * @since 12 643661847f8eSopenharmony_ci */ 643761847f8eSopenharmony_ci PAUSED = 0, 643861847f8eSopenharmony_ci /** 643961847f8eSopenharmony_ci * Player status is playing. 644061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 644161847f8eSopenharmony_ci * @atomicservice 644261847f8eSopenharmony_ci * @since 12 644361847f8eSopenharmony_ci */ 644461847f8eSopenharmony_ci PLAYING, 644561847f8eSopenharmony_ci } 644661847f8eSopenharmony_ci 644761847f8eSopenharmony_ci /** 644861847f8eSopenharmony_ci * Enum type supplied to {@link handleNetworkStateChanged} for indicating the native player network state. 644961847f8eSopenharmony_ci * @enum {number} 645061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 645161847f8eSopenharmony_ci * @atomicservice 645261847f8eSopenharmony_ci * @since 12 645361847f8eSopenharmony_ci */ 645461847f8eSopenharmony_ci enum NetworkState { 645561847f8eSopenharmony_ci /** 645661847f8eSopenharmony_ci * Player does not do any download tasks. 645761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 645861847f8eSopenharmony_ci * @atomicservice 645961847f8eSopenharmony_ci * @since 12 646061847f8eSopenharmony_ci */ 646161847f8eSopenharmony_ci EMPTY = 0, 646261847f8eSopenharmony_ci /** 646361847f8eSopenharmony_ci * Player downloads finished, waiting for next task. 646461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 646561847f8eSopenharmony_ci * @atomicservice 646661847f8eSopenharmony_ci * @since 12 646761847f8eSopenharmony_ci */ 646861847f8eSopenharmony_ci IDLE, 646961847f8eSopenharmony_ci /** 647061847f8eSopenharmony_ci * Player is downloading contents. 647161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 647261847f8eSopenharmony_ci * @atomicservice 647361847f8eSopenharmony_ci * @since 12 647461847f8eSopenharmony_ci */ 647561847f8eSopenharmony_ci LOADING, 647661847f8eSopenharmony_ci /** 647761847f8eSopenharmony_ci * Player downloads failed, due to network error. 647861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 647961847f8eSopenharmony_ci * @atomicservice 648061847f8eSopenharmony_ci * @since 12 648161847f8eSopenharmony_ci */ 648261847f8eSopenharmony_ci NETWORK_ERROR 648361847f8eSopenharmony_ci } 648461847f8eSopenharmony_ci 648561847f8eSopenharmony_ci /** 648661847f8eSopenharmony_ci * Enum type supplied to {@link handleReadyStateChanged} for indicating the native player network state. 648761847f8eSopenharmony_ci * @enum {number} 648861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 648961847f8eSopenharmony_ci * @atomicservice 649061847f8eSopenharmony_ci * @since 12 649161847f8eSopenharmony_ci */ 649261847f8eSopenharmony_ci enum ReadyState { 649361847f8eSopenharmony_ci /** 649461847f8eSopenharmony_ci * Player hasn't downloaded anything. 649561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 649661847f8eSopenharmony_ci * @atomicservice 649761847f8eSopenharmony_ci * @since 12 649861847f8eSopenharmony_ci */ 649961847f8eSopenharmony_ci HAVE_NOTHING = 0, 650061847f8eSopenharmony_ci /** 650161847f8eSopenharmony_ci * Player has downloaded metadata. 650261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 650361847f8eSopenharmony_ci * @atomicservice 650461847f8eSopenharmony_ci * @since 12 650561847f8eSopenharmony_ci */ 650661847f8eSopenharmony_ci HAVE_METADATA, 650761847f8eSopenharmony_ci /** 650861847f8eSopenharmony_ci * Player has played all downloaded media data. 650961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 651061847f8eSopenharmony_ci * @atomicservice 651161847f8eSopenharmony_ci * @since 12 651261847f8eSopenharmony_ci */ 651361847f8eSopenharmony_ci HAVE_CURRENT_DATA, 651461847f8eSopenharmony_ci /** 651561847f8eSopenharmony_ci * The buffered media data is not enough, and will cause jank. 651661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 651761847f8eSopenharmony_ci * @atomicservice 651861847f8eSopenharmony_ci * @since 12 651961847f8eSopenharmony_ci */ 652061847f8eSopenharmony_ci HAVE_FUTURE_DATA, 652161847f8eSopenharmony_ci /** 652261847f8eSopenharmony_ci * The buffered media data is enough. 652361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 652461847f8eSopenharmony_ci * @atomicservice 652561847f8eSopenharmony_ci * @since 12 652661847f8eSopenharmony_ci */ 652761847f8eSopenharmony_ci HAVE_ENOUGH_DATA, 652861847f8eSopenharmony_ci } 652961847f8eSopenharmony_ci 653061847f8eSopenharmony_ci /** 653161847f8eSopenharmony_ci * Enum type supplied to {@link handleError} for indicating the error type of native media player. 653261847f8eSopenharmony_ci * @enum {number} 653361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 653461847f8eSopenharmony_ci * @atomicservice 653561847f8eSopenharmony_ci * @since 12 653661847f8eSopenharmony_ci */ 653761847f8eSopenharmony_ci enum MediaError { 653861847f8eSopenharmony_ci /** 653961847f8eSopenharmony_ci * Network error 654061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 654161847f8eSopenharmony_ci * @atomicservice 654261847f8eSopenharmony_ci * @since 12 654361847f8eSopenharmony_ci */ 654461847f8eSopenharmony_ci NETWORK_ERROR = 1, 654561847f8eSopenharmony_ci /** 654661847f8eSopenharmony_ci * Media format error, such as not a valid file. 654761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 654861847f8eSopenharmony_ci * @atomicservice 654961847f8eSopenharmony_ci * @since 12 655061847f8eSopenharmony_ci */ 655161847f8eSopenharmony_ci FORMAT_ERROR, 655261847f8eSopenharmony_ci /** 655361847f8eSopenharmony_ci * Decode error, such as decoder doesn't support this format. 655461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 655561847f8eSopenharmony_ci * @atomicservice 655661847f8eSopenharmony_ci * @since 12 655761847f8eSopenharmony_ci */ 655861847f8eSopenharmony_ci DECODE_ERROR 655961847f8eSopenharmony_ci } 656061847f8eSopenharmony_ci 656161847f8eSopenharmony_ci /** 656261847f8eSopenharmony_ci * The native media player status handler. 656361847f8eSopenharmony_ci * Apps should use this class to handle native media player's status. 656461847f8eSopenharmony_ci * 656561847f8eSopenharmony_ci * @typedef NativeMediaPlayerHandler 656661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 656761847f8eSopenharmony_ci * @atomicservice 656861847f8eSopenharmony_ci * @since 12 656961847f8eSopenharmony_ci */ 657061847f8eSopenharmony_ci interface NativeMediaPlayerHandler { 657161847f8eSopenharmony_ci 657261847f8eSopenharmony_ci /** 657361847f8eSopenharmony_ci * Handle native media player playback status. 657461847f8eSopenharmony_ci * 657561847f8eSopenharmony_ci * @param { PlaybackStatus } status - Playback status of native media player. 657661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 657761847f8eSopenharmony_ci * @atomicservice 657861847f8eSopenharmony_ci * @since 12 657961847f8eSopenharmony_ci */ 658061847f8eSopenharmony_ci handleStatusChanged(status: PlaybackStatus): void 658161847f8eSopenharmony_ci 658261847f8eSopenharmony_ci /** 658361847f8eSopenharmony_ci * Handle native media player volume. 658461847f8eSopenharmony_ci * volume: float 658561847f8eSopenharmony_ci * value range: [0 - 1.0] 658661847f8eSopenharmony_ci * 658761847f8eSopenharmony_ci * @param { number } volume - Current volume of native media player. 658861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 658961847f8eSopenharmony_ci * @atomicservice 659061847f8eSopenharmony_ci * @since 12 659161847f8eSopenharmony_ci */ 659261847f8eSopenharmony_ci handleVolumeChanged(volume: number): void 659361847f8eSopenharmony_ci 659461847f8eSopenharmony_ci /** 659561847f8eSopenharmony_ci * Handle native media player muted status. 659661847f8eSopenharmony_ci * 659761847f8eSopenharmony_ci * @param { boolean } muted - Current mute status of native media player. 659861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 659961847f8eSopenharmony_ci * @atomicservice 660061847f8eSopenharmony_ci * @since 12 660161847f8eSopenharmony_ci */ 660261847f8eSopenharmony_ci handleMutedChanged(muted: boolean): void 660361847f8eSopenharmony_ci 660461847f8eSopenharmony_ci /** 660561847f8eSopenharmony_ci * Handle playback rate of native media player. 660661847f8eSopenharmony_ci * playbackRate: float 660761847f8eSopenharmony_ci * value range: [0 - infinity] 660861847f8eSopenharmony_ci * 660961847f8eSopenharmony_ci * @param { number } playbackRate - Current playback rate of native media player. 661061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 661161847f8eSopenharmony_ci * @atomicservice 661261847f8eSopenharmony_ci * @since 12 661361847f8eSopenharmony_ci */ 661461847f8eSopenharmony_ci handlePlaybackRateChanged(playbackRate: number): void 661561847f8eSopenharmony_ci 661661847f8eSopenharmony_ci /** 661761847f8eSopenharmony_ci * Handle duration time of media. 661861847f8eSopenharmony_ci * duration: float 661961847f8eSopenharmony_ci * value range: [0 - infinity] 662061847f8eSopenharmony_ci * 662161847f8eSopenharmony_ci * @param { number } duration - Duration time (in seconds) of media. 662261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 662361847f8eSopenharmony_ci * @atomicservice 662461847f8eSopenharmony_ci * @since 12 662561847f8eSopenharmony_ci */ 662661847f8eSopenharmony_ci handleDurationChanged(duration: number): void 662761847f8eSopenharmony_ci 662861847f8eSopenharmony_ci /** 662961847f8eSopenharmony_ci * Handle current playing time of media. 663061847f8eSopenharmony_ci * currentPlayTime: float 663161847f8eSopenharmony_ci * value range: [0 - duration] 663261847f8eSopenharmony_ci * 663361847f8eSopenharmony_ci * @param { number } currentPlayTime - Current playing time (in seconds) of media. 663461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 663561847f8eSopenharmony_ci * @atomicservice 663661847f8eSopenharmony_ci * @since 12 663761847f8eSopenharmony_ci */ 663861847f8eSopenharmony_ci handleTimeUpdate(currentPlayTime: number): void 663961847f8eSopenharmony_ci 664061847f8eSopenharmony_ci /** 664161847f8eSopenharmony_ci * Handle buffered end time of media. 664261847f8eSopenharmony_ci * bufferedEndTime: float 664361847f8eSopenharmony_ci * value range: [0 - duration] 664461847f8eSopenharmony_ci * 664561847f8eSopenharmony_ci * @param { number } bufferedEndTime - Buffered end time (in seconds) of media. 664661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 664761847f8eSopenharmony_ci * @atomicservice 664861847f8eSopenharmony_ci * @since 12 664961847f8eSopenharmony_ci */ 665061847f8eSopenharmony_ci handleBufferedEndTimeChanged(bufferedEndTime: number): void 665161847f8eSopenharmony_ci 665261847f8eSopenharmony_ci /** 665361847f8eSopenharmony_ci * Handle native player ended event. 665461847f8eSopenharmony_ci * 665561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 665661847f8eSopenharmony_ci * @atomicservice 665761847f8eSopenharmony_ci * @since 12 665861847f8eSopenharmony_ci */ 665961847f8eSopenharmony_ci handleEnded(): void 666061847f8eSopenharmony_ci 666161847f8eSopenharmony_ci /** 666261847f8eSopenharmony_ci * Handle network state of native media player. 666361847f8eSopenharmony_ci * 666461847f8eSopenharmony_ci * @param { NetworkState } state - Network state of native media player. 666561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 666661847f8eSopenharmony_ci * @atomicservice 666761847f8eSopenharmony_ci * @since 12 666861847f8eSopenharmony_ci */ 666961847f8eSopenharmony_ci handleNetworkStateChanged(state: NetworkState): void 667061847f8eSopenharmony_ci 667161847f8eSopenharmony_ci /** 667261847f8eSopenharmony_ci * Handle ready state of native media player. 667361847f8eSopenharmony_ci * 667461847f8eSopenharmony_ci * @param { ReadyState } state - Ready state of native media player. 667561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 667661847f8eSopenharmony_ci * @atomicservice 667761847f8eSopenharmony_ci * @since 12 667861847f8eSopenharmony_ci */ 667961847f8eSopenharmony_ci handleReadyStateChanged(state: ReadyState): void 668061847f8eSopenharmony_ci 668161847f8eSopenharmony_ci /** 668261847f8eSopenharmony_ci * Handle native media player fullscreen state changed event. 668361847f8eSopenharmony_ci * 668461847f8eSopenharmony_ci * @param { boolean } fullscreen - Fullscreen state of native media player. 668561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 668661847f8eSopenharmony_ci * @atomicservice 668761847f8eSopenharmony_ci * @since 12 668861847f8eSopenharmony_ci */ 668961847f8eSopenharmony_ci handleFullscreenChanged(fullscreen: boolean): void 669061847f8eSopenharmony_ci 669161847f8eSopenharmony_ci /** 669261847f8eSopenharmony_ci * Handle native media player seeking state. 669361847f8eSopenharmony_ci * 669461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 669561847f8eSopenharmony_ci * @atomicservice 669661847f8eSopenharmony_ci * @since 12 669761847f8eSopenharmony_ci */ 669861847f8eSopenharmony_ci handleSeeking(): void 669961847f8eSopenharmony_ci 670061847f8eSopenharmony_ci /** 670161847f8eSopenharmony_ci * Handle native media player seek finished state. 670261847f8eSopenharmony_ci * 670361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 670461847f8eSopenharmony_ci * @atomicservice 670561847f8eSopenharmony_ci * @since 12 670661847f8eSopenharmony_ci */ 670761847f8eSopenharmony_ci handleSeekFinished(): void 670861847f8eSopenharmony_ci 670961847f8eSopenharmony_ci /** 671061847f8eSopenharmony_ci * Handle native media player error event. 671161847f8eSopenharmony_ci * 671261847f8eSopenharmony_ci * @param { MediaError } error - Error type of native media player. 671361847f8eSopenharmony_ci * @param { string } errorMessage - Description of current error. 671461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 671561847f8eSopenharmony_ci * @atomicservice 671661847f8eSopenharmony_ci * @since 12 671761847f8eSopenharmony_ci */ 671861847f8eSopenharmony_ci handleError(error: MediaError, errorMessage: string): void 671961847f8eSopenharmony_ci 672061847f8eSopenharmony_ci /** 672161847f8eSopenharmony_ci * Handle size of video. 672261847f8eSopenharmony_ci * 672361847f8eSopenharmony_ci * @param { number } width - Width of video. 672461847f8eSopenharmony_ci * @param { number } height - Height of video. 672561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 672661847f8eSopenharmony_ci * @atomicservice 672761847f8eSopenharmony_ci * @since 12 672861847f8eSopenharmony_ci */ 672961847f8eSopenharmony_ci handleVideoSizeChanged(width: number, height: number): void 673061847f8eSopenharmony_ci } 673161847f8eSopenharmony_ci 673261847f8eSopenharmony_ci /** 673361847f8eSopenharmony_ci * The scenarios for suspending the media player. 673461847f8eSopenharmony_ci * @enum {number} 673561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 673661847f8eSopenharmony_ci * @since 12 673761847f8eSopenharmony_ci */ 673861847f8eSopenharmony_ci enum SuspendType { 673961847f8eSopenharmony_ci /** 674061847f8eSopenharmony_ci * Page enters the BackForwardCache. 674161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 674261847f8eSopenharmony_ci * @since 12 674361847f8eSopenharmony_ci */ 674461847f8eSopenharmony_ci ENTER_BACK_FORWARD_CACHE = 0, 674561847f8eSopenharmony_ci 674661847f8eSopenharmony_ci /** 674761847f8eSopenharmony_ci * Page enters background. 674861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 674961847f8eSopenharmony_ci * @since 12 675061847f8eSopenharmony_ci */ 675161847f8eSopenharmony_ci ENTER_BACKGROUND, 675261847f8eSopenharmony_ci 675361847f8eSopenharmony_ci /** 675461847f8eSopenharmony_ci * Cleanup when the number of paused media player over limit. 675561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 675661847f8eSopenharmony_ci * @since 12 675761847f8eSopenharmony_ci */ 675861847f8eSopenharmony_ci AUTO_CLEANUP 675961847f8eSopenharmony_ci } 676061847f8eSopenharmony_ci 676161847f8eSopenharmony_ci /** 676261847f8eSopenharmony_ci * The bridge between web core and native media player. 676361847f8eSopenharmony_ci * Apps should implements this interface, and pass an instance to web core. 676461847f8eSopenharmony_ci * Then web core can control native media player by this bridge. 676561847f8eSopenharmony_ci * 676661847f8eSopenharmony_ci * @typedef NativeMediaPlayerBridge 676761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 676861847f8eSopenharmony_ci * @atomicservice 676961847f8eSopenharmony_ci * @since 12 677061847f8eSopenharmony_ci */ 677161847f8eSopenharmony_ci interface NativeMediaPlayerBridge { 677261847f8eSopenharmony_ci /** 677361847f8eSopenharmony_ci * Notify native media player that the rect of video tag has changed. 677461847f8eSopenharmony_ci * 677561847f8eSopenharmony_ci * @param { number } x - The x position of video tag in web component. 677661847f8eSopenharmony_ci * @param { number } y - The y position of video tag in web component. 677761847f8eSopenharmony_ci * @param { number } width - The width of video tag. 677861847f8eSopenharmony_ci * @param { number } height - The height of video tag. 677961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 678061847f8eSopenharmony_ci * @atomicservice 678161847f8eSopenharmony_ci * @since 12 678261847f8eSopenharmony_ci */ 678361847f8eSopenharmony_ci updateRect(x: number, y: number, width: number, height: number): void 678461847f8eSopenharmony_ci 678561847f8eSopenharmony_ci /** 678661847f8eSopenharmony_ci * Request to play. 678761847f8eSopenharmony_ci * 678861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 678961847f8eSopenharmony_ci * @atomicservice 679061847f8eSopenharmony_ci * @since 12 679161847f8eSopenharmony_ci */ 679261847f8eSopenharmony_ci play(): void 679361847f8eSopenharmony_ci 679461847f8eSopenharmony_ci /** 679561847f8eSopenharmony_ci * Request to pause. 679661847f8eSopenharmony_ci * 679761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 679861847f8eSopenharmony_ci * @atomicservice 679961847f8eSopenharmony_ci * @since 12 680061847f8eSopenharmony_ci */ 680161847f8eSopenharmony_ci pause(): void 680261847f8eSopenharmony_ci 680361847f8eSopenharmony_ci /** 680461847f8eSopenharmony_ci * Request to fast forward / back forward to targetTime. 680561847f8eSopenharmony_ci * targetTime: float 680661847f8eSopenharmony_ci * value range: [0 - duration] 680761847f8eSopenharmony_ci * 680861847f8eSopenharmony_ci * @param { number } targetTime - The target time (in seconds) to FF/BF to. 680961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 681061847f8eSopenharmony_ci * @atomicservice 681161847f8eSopenharmony_ci * @since 12 681261847f8eSopenharmony_ci */ 681361847f8eSopenharmony_ci seek(targetTime: number): void 681461847f8eSopenharmony_ci 681561847f8eSopenharmony_ci /** 681661847f8eSopenharmony_ci * Request to change volume of native media player. 681761847f8eSopenharmony_ci * volume: float 681861847f8eSopenharmony_ci * value range: [0 - 1.0] 681961847f8eSopenharmony_ci * 682061847f8eSopenharmony_ci * @param { number } volume - The volume of native media player. 682161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 682261847f8eSopenharmony_ci * @atomicservice 682361847f8eSopenharmony_ci * @since 12 682461847f8eSopenharmony_ci */ 682561847f8eSopenharmony_ci setVolume(volume: number): void 682661847f8eSopenharmony_ci 682761847f8eSopenharmony_ci /** 682861847f8eSopenharmony_ci * Request to mute native media player. 682961847f8eSopenharmony_ci * 683061847f8eSopenharmony_ci * @param { boolean } muted - Should mute native media player. 683161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 683261847f8eSopenharmony_ci * @atomicservice 683361847f8eSopenharmony_ci * @since 12 683461847f8eSopenharmony_ci */ 683561847f8eSopenharmony_ci setMuted(muted: boolean): void 683661847f8eSopenharmony_ci 683761847f8eSopenharmony_ci /** 683861847f8eSopenharmony_ci * Request to change playback rate of native media player. 683961847f8eSopenharmony_ci * playbackRate: float 684061847f8eSopenharmony_ci * value range: [0 - 10.0] 684161847f8eSopenharmony_ci * 684261847f8eSopenharmony_ci * @param { number } playbackRate - The playback rate of native media player. 684361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 684461847f8eSopenharmony_ci * @atomicservice 684561847f8eSopenharmony_ci * @since 12 684661847f8eSopenharmony_ci */ 684761847f8eSopenharmony_ci setPlaybackRate(playbackRate: number): void 684861847f8eSopenharmony_ci 684961847f8eSopenharmony_ci /** 685061847f8eSopenharmony_ci * Request to release native media player. 685161847f8eSopenharmony_ci * 685261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 685361847f8eSopenharmony_ci * @atomicservice 685461847f8eSopenharmony_ci * @since 12 685561847f8eSopenharmony_ci */ 685661847f8eSopenharmony_ci release(): void 685761847f8eSopenharmony_ci 685861847f8eSopenharmony_ci /** 685961847f8eSopenharmony_ci * Request to enter fullscreen. 686061847f8eSopenharmony_ci * 686161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 686261847f8eSopenharmony_ci * @atomicservice 686361847f8eSopenharmony_ci * @since 12 686461847f8eSopenharmony_ci */ 686561847f8eSopenharmony_ci enterFullscreen(): void 686661847f8eSopenharmony_ci 686761847f8eSopenharmony_ci /** 686861847f8eSopenharmony_ci * Request to exit fullscreen. 686961847f8eSopenharmony_ci * 687061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 687161847f8eSopenharmony_ci * @atomicservice 687261847f8eSopenharmony_ci * @since 12 687361847f8eSopenharmony_ci */ 687461847f8eSopenharmony_ci exitFullscreen(): void 687561847f8eSopenharmony_ci 687661847f8eSopenharmony_ci /** 687761847f8eSopenharmony_ci * Resume the native media player. 687861847f8eSopenharmony_ci * 687961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 688061847f8eSopenharmony_ci * @since 12 688161847f8eSopenharmony_ci */ 688261847f8eSopenharmony_ci resumePlayer?(): void 688361847f8eSopenharmony_ci 688461847f8eSopenharmony_ci /** 688561847f8eSopenharmony_ci * Suspend to release native media player, not the NativeMediaPlayerBridge. The 688661847f8eSopenharmony_ci * embedder should save the status of player when release the native media player 688761847f8eSopenharmony_ci * through NativeMediaPlayerBridge. 688861847f8eSopenharmony_ci * 688961847f8eSopenharmony_ci * @param { SuspendType } type - The scenario for suspending the media player. 689061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 689161847f8eSopenharmony_ci * @since 12 689261847f8eSopenharmony_ci */ 689361847f8eSopenharmony_ci suspendPlayer?(type: SuspendType): void 689461847f8eSopenharmony_ci } 689561847f8eSopenharmony_ci 689661847f8eSopenharmony_ci /** 689761847f8eSopenharmony_ci * Enum type for indicating the media type of native media player. 689861847f8eSopenharmony_ci * @enum {number} 689961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 690061847f8eSopenharmony_ci * @atomicservice 690161847f8eSopenharmony_ci * @since 12 690261847f8eSopenharmony_ci */ 690361847f8eSopenharmony_ci enum MediaType { 690461847f8eSopenharmony_ci /** 690561847f8eSopenharmony_ci * Media type is video. 690661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 690761847f8eSopenharmony_ci * @atomicservice 690861847f8eSopenharmony_ci * @since 12 690961847f8eSopenharmony_ci */ 691061847f8eSopenharmony_ci VIDEO = 0, 691161847f8eSopenharmony_ci /** 691261847f8eSopenharmony_ci * Media type is audio. 691361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 691461847f8eSopenharmony_ci * @atomicservice 691561847f8eSopenharmony_ci * @since 12 691661847f8eSopenharmony_ci */ 691761847f8eSopenharmony_ci AUDIO 691861847f8eSopenharmony_ci } 691961847f8eSopenharmony_ci 692061847f8eSopenharmony_ci /** 692161847f8eSopenharmony_ci * Enum type for indicating the media source type of native media player. 692261847f8eSopenharmony_ci * @enum {number} 692361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 692461847f8eSopenharmony_ci * @atomicservice 692561847f8eSopenharmony_ci * @since 12 692661847f8eSopenharmony_ci */ 692761847f8eSopenharmony_ci enum SourceType { 692861847f8eSopenharmony_ci /** 692961847f8eSopenharmony_ci * Source type is URL. 693061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 693161847f8eSopenharmony_ci * @atomicservice 693261847f8eSopenharmony_ci * @since 12 693361847f8eSopenharmony_ci */ 693461847f8eSopenharmony_ci URL = 0, 693561847f8eSopenharmony_ci /** 693661847f8eSopenharmony_ci * Source type is blob. 693761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 693861847f8eSopenharmony_ci * @atomicservice 693961847f8eSopenharmony_ci * @since 12 694061847f8eSopenharmony_ci */ 694161847f8eSopenharmony_ci MSE 694261847f8eSopenharmony_ci } 694361847f8eSopenharmony_ci 694461847f8eSopenharmony_ci /** 694561847f8eSopenharmony_ci * Media source information. Uri and format. 694661847f8eSopenharmony_ci * 694761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 694861847f8eSopenharmony_ci * @atomicservice 694961847f8eSopenharmony_ci * @since 12 695061847f8eSopenharmony_ci */ 695161847f8eSopenharmony_ci class MediaSourceInfo { 695261847f8eSopenharmony_ci /** 695361847f8eSopenharmony_ci * Source type, most time is URL. 695461847f8eSopenharmony_ci * @type { SourceType } 695561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 695661847f8eSopenharmony_ci * @since 12 695761847f8eSopenharmony_ci */ 695861847f8eSopenharmony_ci type: SourceType; 695961847f8eSopenharmony_ci 696061847f8eSopenharmony_ci /** 696161847f8eSopenharmony_ci * Media source, most time is Uri. 696261847f8eSopenharmony_ci * @type { string } 696361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 696461847f8eSopenharmony_ci * @atomicservice 696561847f8eSopenharmony_ci * @since 12 696661847f8eSopenharmony_ci */ 696761847f8eSopenharmony_ci source: string; 696861847f8eSopenharmony_ci 696961847f8eSopenharmony_ci /** 697061847f8eSopenharmony_ci * Media format, such as mp4, webm, m3u8 etc. 697161847f8eSopenharmony_ci * @type { string } 697261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 697361847f8eSopenharmony_ci * @atomicservice 697461847f8eSopenharmony_ci * @since 12 697561847f8eSopenharmony_ci */ 697661847f8eSopenharmony_ci format: string; 697761847f8eSopenharmony_ci } 697861847f8eSopenharmony_ci 697961847f8eSopenharmony_ci /** 698061847f8eSopenharmony_ci * Rectangle definition. 698161847f8eSopenharmony_ci * 698261847f8eSopenharmony_ci * @typedef RectEvent 698361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 698461847f8eSopenharmony_ci * @since 12 698561847f8eSopenharmony_ci */ 698661847f8eSopenharmony_ci interface RectEvent { 698761847f8eSopenharmony_ci /** 698861847f8eSopenharmony_ci * X coordinator of top left point. 698961847f8eSopenharmony_ci * 699061847f8eSopenharmony_ci * @type { number } 699161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 699261847f8eSopenharmony_ci * @since 12 699361847f8eSopenharmony_ci */ 699461847f8eSopenharmony_ci x: number; 699561847f8eSopenharmony_ci /** 699661847f8eSopenharmony_ci * Y coordinator of top left point. 699761847f8eSopenharmony_ci * 699861847f8eSopenharmony_ci * @type { number } 699961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 700061847f8eSopenharmony_ci * @since 12 700161847f8eSopenharmony_ci */ 700261847f8eSopenharmony_ci y: number; 700361847f8eSopenharmony_ci /** 700461847f8eSopenharmony_ci * Width of this rectangle. 700561847f8eSopenharmony_ci * 700661847f8eSopenharmony_ci * @type { number } 700761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 700861847f8eSopenharmony_ci * @since 12 700961847f8eSopenharmony_ci */ 701061847f8eSopenharmony_ci width: number; 701161847f8eSopenharmony_ci /** 701261847f8eSopenharmony_ci * Height of this rectangle. 701361847f8eSopenharmony_ci * 701461847f8eSopenharmony_ci * @type { number } 701561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 701661847f8eSopenharmony_ci * @since 12 701761847f8eSopenharmony_ci */ 701861847f8eSopenharmony_ci height: number; 701961847f8eSopenharmony_ci } 702061847f8eSopenharmony_ci 702161847f8eSopenharmony_ci /** 702261847f8eSopenharmony_ci * Surface information. 702361847f8eSopenharmony_ci * 702461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 702561847f8eSopenharmony_ci * @atomicservice 702661847f8eSopenharmony_ci * @since 12 702761847f8eSopenharmony_ci */ 702861847f8eSopenharmony_ci class NativeMediaPlayerSurfaceInfo { 702961847f8eSopenharmony_ci /** 703061847f8eSopenharmony_ci * Id of surface. 703161847f8eSopenharmony_ci * @type { string } 703261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 703361847f8eSopenharmony_ci * @atomicservice 703461847f8eSopenharmony_ci * @since 12 703561847f8eSopenharmony_ci */ 703661847f8eSopenharmony_ci id: string; 703761847f8eSopenharmony_ci 703861847f8eSopenharmony_ci /** 703961847f8eSopenharmony_ci * Surface rect info. 704061847f8eSopenharmony_ci * @type { RectEvent } 704161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 704261847f8eSopenharmony_ci * @since 12 704361847f8eSopenharmony_ci */ 704461847f8eSopenharmony_ci rect: RectEvent; 704561847f8eSopenharmony_ci } 704661847f8eSopenharmony_ci 704761847f8eSopenharmony_ci /** 704861847f8eSopenharmony_ci * Enum type for indicating the preload type. 704961847f8eSopenharmony_ci * @enum {number} 705061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 705161847f8eSopenharmony_ci * @atomicservice 705261847f8eSopenharmony_ci * @since 12 705361847f8eSopenharmony_ci */ 705461847f8eSopenharmony_ci enum Preload { 705561847f8eSopenharmony_ci /** 705661847f8eSopenharmony_ci * Doesn't do preload. 705761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 705861847f8eSopenharmony_ci * @atomicservice 705961847f8eSopenharmony_ci * @since 12 706061847f8eSopenharmony_ci */ 706161847f8eSopenharmony_ci NONE = 0, 706261847f8eSopenharmony_ci /** 706361847f8eSopenharmony_ci * Only preload metadata. 706461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 706561847f8eSopenharmony_ci * @atomicservice 706661847f8eSopenharmony_ci * @since 12 706761847f8eSopenharmony_ci */ 706861847f8eSopenharmony_ci METADATA, 706961847f8eSopenharmony_ci /** 707061847f8eSopenharmony_ci * Preload enough data to ensure playing is smooth. 707161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 707261847f8eSopenharmony_ci * @atomicservice 707361847f8eSopenharmony_ci * @since 12 707461847f8eSopenharmony_ci */ 707561847f8eSopenharmony_ci AUTO 707661847f8eSopenharmony_ci } 707761847f8eSopenharmony_ci 707861847f8eSopenharmony_ci /** 707961847f8eSopenharmony_ci * Media information. 708061847f8eSopenharmony_ci * 708161847f8eSopenharmony_ci * @typedef MediaInfo 708261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 708361847f8eSopenharmony_ci * @atomicservice 708461847f8eSopenharmony_ci * @since 12 708561847f8eSopenharmony_ci */ 708661847f8eSopenharmony_ci interface MediaInfo { 708761847f8eSopenharmony_ci /** 708861847f8eSopenharmony_ci * Id of media element. 708961847f8eSopenharmony_ci * @type { string } 709061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 709161847f8eSopenharmony_ci * @since 12 709261847f8eSopenharmony_ci */ 709361847f8eSopenharmony_ci embedID: string, 709461847f8eSopenharmony_ci /** 709561847f8eSopenharmony_ci * Media type : Video or Audio. 709661847f8eSopenharmony_ci * @type { MediaType } 709761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 709861847f8eSopenharmony_ci * @atomicservice 709961847f8eSopenharmony_ci * @since 12 710061847f8eSopenharmony_ci */ 710161847f8eSopenharmony_ci mediaType: MediaType, 710261847f8eSopenharmony_ci /** 710361847f8eSopenharmony_ci * Media source list, player should choose an appropriate one to play. 710461847f8eSopenharmony_ci * @type { MediaSourceInfo[] } 710561847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 710661847f8eSopenharmony_ci * @atomicservice 710761847f8eSopenharmony_ci * @since 12 710861847f8eSopenharmony_ci */ 710961847f8eSopenharmony_ci mediaSrcList: MediaSourceInfo[], 711061847f8eSopenharmony_ci /** 711161847f8eSopenharmony_ci * Surface to render media content on. 711261847f8eSopenharmony_ci * @type { NativeMediaPlayerSurfaceInfo } 711361847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 711461847f8eSopenharmony_ci * @atomicservice 711561847f8eSopenharmony_ci * @since 12 711661847f8eSopenharmony_ci */ 711761847f8eSopenharmony_ci surfaceInfo: NativeMediaPlayerSurfaceInfo, 711861847f8eSopenharmony_ci /** 711961847f8eSopenharmony_ci * Should show media controls. 712061847f8eSopenharmony_ci * @type { boolean } 712161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 712261847f8eSopenharmony_ci * @atomicservice 712361847f8eSopenharmony_ci * @since 12 712461847f8eSopenharmony_ci */ 712561847f8eSopenharmony_ci controlsShown: boolean, 712661847f8eSopenharmony_ci /** 712761847f8eSopenharmony_ci * Limit media controls items. 712861847f8eSopenharmony_ci * Such as 'nodownload', 'nofullscreen', 'noremoteplayback' 712961847f8eSopenharmony_ci * @type { string[] } 713061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 713161847f8eSopenharmony_ci * @atomicservice 713261847f8eSopenharmony_ci * @since 12 713361847f8eSopenharmony_ci */ 713461847f8eSopenharmony_ci controlList: string[], 713561847f8eSopenharmony_ci /** 713661847f8eSopenharmony_ci * Player should be muted; 713761847f8eSopenharmony_ci * @type { boolean } 713861847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 713961847f8eSopenharmony_ci * @atomicservice 714061847f8eSopenharmony_ci * @since 12 714161847f8eSopenharmony_ci */ 714261847f8eSopenharmony_ci muted: boolean, 714361847f8eSopenharmony_ci /** 714461847f8eSopenharmony_ci * Player should show poster before media first frame shown. 714561847f8eSopenharmony_ci * @type { string } 714661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 714761847f8eSopenharmony_ci * @atomicservice 714861847f8eSopenharmony_ci * @since 12 714961847f8eSopenharmony_ci */ 715061847f8eSopenharmony_ci posterUrl: string, 715161847f8eSopenharmony_ci /** 715261847f8eSopenharmony_ci * Preload type. 715361847f8eSopenharmony_ci * @type { Preload } 715461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 715561847f8eSopenharmony_ci * @atomicservice 715661847f8eSopenharmony_ci * @since 12 715761847f8eSopenharmony_ci */ 715861847f8eSopenharmony_ci preload: Preload, 715961847f8eSopenharmony_ci /** 716061847f8eSopenharmony_ci * Header information of a media network request. 716161847f8eSopenharmony_ci * @type { Record<string, string> } 716261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 716361847f8eSopenharmony_ci * @since 12 716461847f8eSopenharmony_ci */ 716561847f8eSopenharmony_ci headers: Record<string, string>, 716661847f8eSopenharmony_ci /** 716761847f8eSopenharmony_ci * The information list of attributes of media tag. 716861847f8eSopenharmony_ci * @type { Record<string, string> } 716961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 717061847f8eSopenharmony_ci * @since 12 717161847f8eSopenharmony_ci */ 717261847f8eSopenharmony_ci attributes: Record<string, string>, 717361847f8eSopenharmony_ci } 717461847f8eSopenharmony_ci 717561847f8eSopenharmony_ci /** 717661847f8eSopenharmony_ci * The callback of creating a native media player. 717761847f8eSopenharmony_ci * 717861847f8eSopenharmony_ci * @typedef { function } 717961847f8eSopenharmony_ci * @param { NativeMediaPlayerHandler } handler - callback information of onCreateNativeMediaPlayer. 718061847f8eSopenharmony_ci * @param { MediaInfo } mediaInfo - callback information of onCreateNativeMediaPlayer. 718161847f8eSopenharmony_ci * @returns { NativeMediaPlayerBridge } Returns whether the app takes over the media. 718261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 718361847f8eSopenharmony_ci * @atomicservice 718461847f8eSopenharmony_ci * @since 12 718561847f8eSopenharmony_ci */ 718661847f8eSopenharmony_ci type CreateNativeMediaPlayerCallback = 718761847f8eSopenharmony_ci (handler: NativeMediaPlayerHandler, mediaInfo: MediaInfo) => NativeMediaPlayerBridge; 718861847f8eSopenharmony_ci 718961847f8eSopenharmony_ci /** 719061847f8eSopenharmony_ci * This class is used to set adblock config. 719161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 719261847f8eSopenharmony_ci * @atomicservice 719361847f8eSopenharmony_ci * @since 12 719461847f8eSopenharmony_ci */ 719561847f8eSopenharmony_ci class AdsBlockManager { 719661847f8eSopenharmony_ci /** 719761847f8eSopenharmony_ci * set Ads Block ruleset file, containing easylist rules. 719861847f8eSopenharmony_ci * @param {string} rulesFile - absolute file path contains app customized ads block rules. 719961847f8eSopenharmony_ci * @param {boolean} replace - (@code true)replace internal rules;(@code false) add to internal rules. 720061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 720161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 720261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 720361847f8eSopenharmony_ci * @atomicservice 720461847f8eSopenharmony_ci * @since 12 720561847f8eSopenharmony_ci */ 720661847f8eSopenharmony_ci static setAdsBlockRules(rulesFile: string, replace: boolean): void; 720761847f8eSopenharmony_ci 720861847f8eSopenharmony_ci /** 720961847f8eSopenharmony_ci * Add items to Ads Block Disallow list. 721061847f8eSopenharmony_ci * @param { Array<string> } domainSuffixes - list of domain suffix, if web page url matches someone in the list, 721161847f8eSopenharmony_ci * Ads Block will be disallowed for the web page. 721261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 721361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 721461847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 721561847f8eSopenharmony_ci * @atomicservice 721661847f8eSopenharmony_ci * @since 12 721761847f8eSopenharmony_ci */ 721861847f8eSopenharmony_ci static addAdsBlockDisallowedList(domainSuffixes: Array<string>): void; 721961847f8eSopenharmony_ci 722061847f8eSopenharmony_ci /** 722161847f8eSopenharmony_ci * Add items to Ads Block Allow list. 722261847f8eSopenharmony_ci * By default, ads block is allowed for all pages unless they are added to the 722361847f8eSopenharmony_ci * disallow list. The priority of allowlist is higher than the disallowlist. It is 722461847f8eSopenharmony_ci * used to re-enable ads block on the page that matches disallow list. 722561847f8eSopenharmony_ci * @param { Array<string> } domainSuffixes - list of domain suffix, if web page url matches someone in the list, 722661847f8eSopenharmony_ci * Ads Block will be allowed for the web page. 722761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 722861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 722961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 723061847f8eSopenharmony_ci * @atomicservice 723161847f8eSopenharmony_ci * @since 12 723261847f8eSopenharmony_ci */ 723361847f8eSopenharmony_ci static addAdsBlockAllowedList(domainSuffixes: Array<string>): void; 723461847f8eSopenharmony_ci 723561847f8eSopenharmony_ci /** 723661847f8eSopenharmony_ci * remove items from Ads Block Disallowed list. 723761847f8eSopenharmony_ci * @param { Array<string> } domainSuffixes - list of domain suffix needed be removed from disallow list 723861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 723961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 724061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 724161847f8eSopenharmony_ci * @atomicservice 724261847f8eSopenharmony_ci * @since 12 724361847f8eSopenharmony_ci */ 724461847f8eSopenharmony_ci static removeAdsBlockDisallowedList(domainSuffixes: Array<string>): void; 724561847f8eSopenharmony_ci 724661847f8eSopenharmony_ci /** 724761847f8eSopenharmony_ci * remove items from Ads Block Allowed list. 724861847f8eSopenharmony_ci * @param { Array<string> } domainSuffixes - list of domain suffix needed be removed from allow list 724961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 725061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 725161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 725261847f8eSopenharmony_ci * @atomicservice 725361847f8eSopenharmony_ci * @since 12 725461847f8eSopenharmony_ci */ 725561847f8eSopenharmony_ci static removeAdsBlockAllowedList(domainSuffixes: Array<string>): void; 725661847f8eSopenharmony_ci 725761847f8eSopenharmony_ci /** 725861847f8eSopenharmony_ci * clear Ads Block Disallowed list. 725961847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 726061847f8eSopenharmony_ci * @atomicservice 726161847f8eSopenharmony_ci * @since 12 726261847f8eSopenharmony_ci */ 726361847f8eSopenharmony_ci static clearAdsBlockDisallowedList(): void; 726461847f8eSopenharmony_ci 726561847f8eSopenharmony_ci /** 726661847f8eSopenharmony_ci * clear Ads Block Allowed list. 726761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 726861847f8eSopenharmony_ci * @atomicservice 726961847f8eSopenharmony_ci * @since 12 727061847f8eSopenharmony_ci */ 727161847f8eSopenharmony_ci static clearAdsBlockAllowedList(): void; 727261847f8eSopenharmony_ci } 727361847f8eSopenharmony_ci 727461847f8eSopenharmony_ci /** 727561847f8eSopenharmony_ci * This class is used to enable back forward cache supported features. 727661847f8eSopenharmony_ci * 727761847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 727861847f8eSopenharmony_ci * @since 12 727961847f8eSopenharmony_ci */ 728061847f8eSopenharmony_ci class BackForwardCacheSupportedFeatures { 728161847f8eSopenharmony_ci /** 728261847f8eSopenharmony_ci * Whether cache the pages that use native embed. 728361847f8eSopenharmony_ci * Default is false; 728461847f8eSopenharmony_ci * 728561847f8eSopenharmony_ci * @type { boolean } 728661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 728761847f8eSopenharmony_ci * @since 12 728861847f8eSopenharmony_ci */ 728961847f8eSopenharmony_ci nativeEmbed: boolean; 729061847f8eSopenharmony_ci 729161847f8eSopenharmony_ci /** 729261847f8eSopenharmony_ci * Whether cache the pages that use media take over. 729361847f8eSopenharmony_ci * Default is false; 729461847f8eSopenharmony_ci * 729561847f8eSopenharmony_ci * @type { boolean } 729661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 729761847f8eSopenharmony_ci * @since 12 729861847f8eSopenharmony_ci */ 729961847f8eSopenharmony_ci mediaTakeOver: boolean; 730061847f8eSopenharmony_ci 730161847f8eSopenharmony_ci /** 730261847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 730361847f8eSopenharmony_ci * @since 12 730461847f8eSopenharmony_ci */ 730561847f8eSopenharmony_ci constructor(); 730661847f8eSopenharmony_ci } 730761847f8eSopenharmony_ci 730861847f8eSopenharmony_ci /** 730961847f8eSopenharmony_ci * This class is used to set back forward cache options. 731061847f8eSopenharmony_ci * 731161847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 731261847f8eSopenharmony_ci * @since 12 731361847f8eSopenharmony_ci */ 731461847f8eSopenharmony_ci class BackForwardCacheOptions { 731561847f8eSopenharmony_ci /** 731661847f8eSopenharmony_ci * Set the maximum size of pages that can cache. 731761847f8eSopenharmony_ci * Default is 1, max is 50. 731861847f8eSopenharmony_ci * 731961847f8eSopenharmony_ci * @type { number } 732061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 732161847f8eSopenharmony_ci * @since 12 732261847f8eSopenharmony_ci */ 732361847f8eSopenharmony_ci size: number; 732461847f8eSopenharmony_ci 732561847f8eSopenharmony_ci /** 732661847f8eSopenharmony_ci * Set the lifetime in seconds in the BackForwardCache. 732761847f8eSopenharmony_ci * Default is 600. 732861847f8eSopenharmony_ci * 732961847f8eSopenharmony_ci * @type { number } 733061847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 733161847f8eSopenharmony_ci * @since 12 733261847f8eSopenharmony_ci */ 733361847f8eSopenharmony_ci timeToLive: number; 733461847f8eSopenharmony_ci 733561847f8eSopenharmony_ci /** 733661847f8eSopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 733761847f8eSopenharmony_ci * @since 12 733861847f8eSopenharmony_ci */ 733961847f8eSopenharmony_ci constructor(); 734061847f8eSopenharmony_ci } 734161847f8eSopenharmony_ci 734261847f8eSopenharmony_ci} 734361847f8eSopenharmony_ci 734461847f8eSopenharmony_ciexport default webview; 7345