161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2024 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 Defines the atomicService web component 1861847f8eSopenharmony_ci * @kit ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { Callback } from '@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Declare Component AtomicServiceWeb. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 2761847f8eSopenharmony_ci * @atomicservice 2861847f8eSopenharmony_ci * @since 12 2961847f8eSopenharmony_ci */ 3061847f8eSopenharmony_ci@Component 3161847f8eSopenharmony_ciexport declare struct AtomicServiceWeb { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * The address of the web page to be displayed. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @type { ResourceStr } 3661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 3761847f8eSopenharmony_ci * @atomicservice 3861847f8eSopenharmony_ci * @since 12 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci src: ResourceStr; 4161847f8eSopenharmony_ci /** 4261847f8eSopenharmony_ci * Sets the controller of the AtomicServiceWeb. 4361847f8eSopenharmony_ci * 4461847f8eSopenharmony_ci * @type { AtomicServiceWebController } 4561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4661847f8eSopenharmony_ci * @atomicservice 4761847f8eSopenharmony_ci * @since 12 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci @ObjectLink 5061847f8eSopenharmony_ci controller: AtomicServiceWebController; 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * Sets how to load HTTP and HTTPS content. 5361847f8eSopenharmony_ci * 5461847f8eSopenharmony_ci * @type { ?MixedMode } 5561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 5661847f8eSopenharmony_ci * @atomicservice 5761847f8eSopenharmony_ci * @since 12 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci @Prop 6061847f8eSopenharmony_ci mixedMode?: MixedMode; 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Sets the dark mode of Web. 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @type { ?WebDarkMode } 6561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 6661847f8eSopenharmony_ci * @atomicservice 6761847f8eSopenharmony_ci * @since 12 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci @Prop 7061847f8eSopenharmony_ci darkMode?: WebDarkMode; 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * Sets whether to enable forced dark algorithm when the web is in dark mode. 7361847f8eSopenharmony_ci * 7461847f8eSopenharmony_ci * @type { ?boolean } 7561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 7661847f8eSopenharmony_ci * @atomicservice 7761847f8eSopenharmony_ci * @since 12 7861847f8eSopenharmony_ci */ 7961847f8eSopenharmony_ci @Prop 8061847f8eSopenharmony_ci forceDarkAccess?: boolean; 8161847f8eSopenharmony_ci /** 8261847f8eSopenharmony_ci * The navPathStack to control page route in Navigation and NavDestination. 8361847f8eSopenharmony_ci * 8461847f8eSopenharmony_ci * @type { ?NavPathStack } 8561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 8661847f8eSopenharmony_ci * @atomicservice 8761847f8eSopenharmony_ci * @since 12 8861847f8eSopenharmony_ci */ 8961847f8eSopenharmony_ci navPathStack?: NavPathStack; 9061847f8eSopenharmony_ci /** 9161847f8eSopenharmony_ci * The callback method to invoke after page is back or destroyed if postMessage() is called in H5 page. 9261847f8eSopenharmony_ci * 9361847f8eSopenharmony_ci * @type { ?Callback<OnMessageEvent> } 9461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 9561847f8eSopenharmony_ci * @atomicservice 9661847f8eSopenharmony_ci * @since 12 9761847f8eSopenharmony_ci */ 9861847f8eSopenharmony_ci onMessage?: Callback<OnMessageEvent>; 9961847f8eSopenharmony_ci /** 10061847f8eSopenharmony_ci * Triggered when the web page receives a web resource loading error. 10161847f8eSopenharmony_ci * 10261847f8eSopenharmony_ci * @type { ?Callback<OnErrorReceiveEvent> } 10361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 10461847f8eSopenharmony_ci * @atomicservice 10561847f8eSopenharmony_ci * @since 12 10661847f8eSopenharmony_ci */ 10761847f8eSopenharmony_ci onErrorReceive?: Callback<OnErrorReceiveEvent>; 10861847f8eSopenharmony_ci /** 10961847f8eSopenharmony_ci * Triggered when the web page receives a web resource loading HTTP error. 11061847f8eSopenharmony_ci * 11161847f8eSopenharmony_ci * @type { ?Callback<OnHttpErrorReceiveEvent> } 11261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 11361847f8eSopenharmony_ci * @atomicservice 11461847f8eSopenharmony_ci * @since 12 11561847f8eSopenharmony_ci */ 11661847f8eSopenharmony_ci onHttpErrorReceive?: Callback<OnHttpErrorReceiveEvent>; 11761847f8eSopenharmony_ci /** 11861847f8eSopenharmony_ci * Triggered at the begin of web page loading. 11961847f8eSopenharmony_ci * 12061847f8eSopenharmony_ci * @type { ?Callback<OnPageBeginEvent> } 12161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 12261847f8eSopenharmony_ci * @atomicservice 12361847f8eSopenharmony_ci * @since 12 12461847f8eSopenharmony_ci */ 12561847f8eSopenharmony_ci onPageBegin?: Callback<OnPageBeginEvent>; 12661847f8eSopenharmony_ci /** 12761847f8eSopenharmony_ci * Triggered at the end of web page loading. 12861847f8eSopenharmony_ci * 12961847f8eSopenharmony_ci * @type { ?Callback<OnPageEndEvent> } 13061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 13161847f8eSopenharmony_ci * @atomicservice 13261847f8eSopenharmony_ci * @since 12 13361847f8eSopenharmony_ci */ 13461847f8eSopenharmony_ci onPageEnd?: Callback<OnPageEndEvent>; 13561847f8eSopenharmony_ci /** 13661847f8eSopenharmony_ci * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 13761847f8eSopenharmony_ci * This callback can not use the interface about manipulating web pages. 13861847f8eSopenharmony_ci * 13961847f8eSopenharmony_ci * @type { ?Callback<void> } 14061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 14161847f8eSopenharmony_ci * @atomicservice 14261847f8eSopenharmony_ci * @since 12 14361847f8eSopenharmony_ci */ 14461847f8eSopenharmony_ci onControllerAttached?: Callback<void>; 14561847f8eSopenharmony_ci /** 14661847f8eSopenharmony_ci * Triggered when the resources loading is intercepted. 14761847f8eSopenharmony_ci * 14861847f8eSopenharmony_ci * @type { ?OnLoadInterceptCallback } 14961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 15061847f8eSopenharmony_ci * @atomicservice 15161847f8eSopenharmony_ci * @since 12 15261847f8eSopenharmony_ci */ 15361847f8eSopenharmony_ci onLoadIntercept?: OnLoadInterceptCallback; 15461847f8eSopenharmony_ci /** 15561847f8eSopenharmony_ci * Triggered when the page loading progress changes. 15661847f8eSopenharmony_ci * 15761847f8eSopenharmony_ci * @type { ?Callback<OnProgressChangeEvent> } 15861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 15961847f8eSopenharmony_ci * @atomicservice 16061847f8eSopenharmony_ci * @since 12 16161847f8eSopenharmony_ci */ 16261847f8eSopenharmony_ci onProgressChange?: Callback<OnProgressChangeEvent>; 16361847f8eSopenharmony_ci} 16461847f8eSopenharmony_ci 16561847f8eSopenharmony_ci/** 16661847f8eSopenharmony_ci * Message event after page is back or destroyed if postMessage() is called in H5 page. 16761847f8eSopenharmony_ci * 16861847f8eSopenharmony_ci * @typedef OnMessageEvent 16961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17061847f8eSopenharmony_ci * @atomicservice 17161847f8eSopenharmony_ci * @since 12 17261847f8eSopenharmony_ci */ 17361847f8eSopenharmony_ciexport declare interface OnMessageEvent { 17461847f8eSopenharmony_ci /** 17561847f8eSopenharmony_ci * The message data list. 17661847f8eSopenharmony_ci * 17761847f8eSopenharmony_ci * @type { object[] } 17861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17961847f8eSopenharmony_ci * @atomicservice 18061847f8eSopenharmony_ci * @since 12 18161847f8eSopenharmony_ci */ 18261847f8eSopenharmony_ci data: object[]; 18361847f8eSopenharmony_ci} 18461847f8eSopenharmony_ci 18561847f8eSopenharmony_ci/** 18661847f8eSopenharmony_ci * Error receive event when the web page receives a web resource loading error. 18761847f8eSopenharmony_ci * 18861847f8eSopenharmony_ci * @typedef OnErrorReceiveEvent 18961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 19061847f8eSopenharmony_ci * @atomicservice 19161847f8eSopenharmony_ci * @since 12 19261847f8eSopenharmony_ci */ 19361847f8eSopenharmony_ciexport declare interface OnErrorReceiveEvent { 19461847f8eSopenharmony_ci /** 19561847f8eSopenharmony_ci * Web resource request of event. 19661847f8eSopenharmony_ci * 19761847f8eSopenharmony_ci * @type { WebResourceRequest } 19861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 19961847f8eSopenharmony_ci * @atomicservice 20061847f8eSopenharmony_ci * @since 12 20161847f8eSopenharmony_ci */ 20261847f8eSopenharmony_ci request: WebResourceRequest; 20361847f8eSopenharmony_ci 20461847f8eSopenharmony_ci /** 20561847f8eSopenharmony_ci * Web resource error of event. 20661847f8eSopenharmony_ci * 20761847f8eSopenharmony_ci * @type { WebResourceError } 20861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 20961847f8eSopenharmony_ci * @atomicservice 21061847f8eSopenharmony_ci * @since 12 21161847f8eSopenharmony_ci */ 21261847f8eSopenharmony_ci error: WebResourceError; 21361847f8eSopenharmony_ci} 21461847f8eSopenharmony_ci 21561847f8eSopenharmony_ci/** 21661847f8eSopenharmony_ci * Http error receive event when the web page receives a web resource loading HTTP error. 21761847f8eSopenharmony_ci * 21861847f8eSopenharmony_ci * @typedef OnHttpErrorReceiveEvent 21961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 22061847f8eSopenharmony_ci * @atomicservice 22161847f8eSopenharmony_ci * @since 12 22261847f8eSopenharmony_ci */ 22361847f8eSopenharmony_ciexport declare interface OnHttpErrorReceiveEvent { 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Web resource request of event. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @type { WebResourceRequest } 22861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 22961847f8eSopenharmony_ci * @atomicservice 23061847f8eSopenharmony_ci * @since 12 23161847f8eSopenharmony_ci */ 23261847f8eSopenharmony_ci request: WebResourceRequest; 23361847f8eSopenharmony_ci 23461847f8eSopenharmony_ci /** 23561847f8eSopenharmony_ci * Web resource response of event. 23661847f8eSopenharmony_ci * 23761847f8eSopenharmony_ci * @type { WebResourceResponse } 23861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 23961847f8eSopenharmony_ci * @atomicservice 24061847f8eSopenharmony_ci * @since 12 24161847f8eSopenharmony_ci */ 24261847f8eSopenharmony_ci response: WebResourceResponse; 24361847f8eSopenharmony_ci} 24461847f8eSopenharmony_ci 24561847f8eSopenharmony_ci/** 24661847f8eSopenharmony_ci * Page begin event at the begin of web page loading. 24761847f8eSopenharmony_ci * 24861847f8eSopenharmony_ci * @typedef OnPageBeginEvent 24961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 25061847f8eSopenharmony_ci * @atomicservice 25161847f8eSopenharmony_ci * @since 12 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ciexport declare interface OnPageBeginEvent { 25461847f8eSopenharmony_ci /** 25561847f8eSopenharmony_ci * The url of page. 25661847f8eSopenharmony_ci * 25761847f8eSopenharmony_ci * @type { string } 25861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 25961847f8eSopenharmony_ci * @atomicservice 26061847f8eSopenharmony_ci * @since 12 26161847f8eSopenharmony_ci */ 26261847f8eSopenharmony_ci url: string; 26361847f8eSopenharmony_ci} 26461847f8eSopenharmony_ci 26561847f8eSopenharmony_ci/** 26661847f8eSopenharmony_ci * Page end event at the end of web page loading. 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @typedef OnPageEndEvent 26961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 27061847f8eSopenharmony_ci * @atomicservice 27161847f8eSopenharmony_ci * @since 12 27261847f8eSopenharmony_ci */ 27361847f8eSopenharmony_ciexport declare interface OnPageEndEvent { 27461847f8eSopenharmony_ci /** 27561847f8eSopenharmony_ci * The url of page. 27661847f8eSopenharmony_ci * 27761847f8eSopenharmony_ci * @type { string } 27861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 27961847f8eSopenharmony_ci * @atomicservice 28061847f8eSopenharmony_ci * @since 12 28161847f8eSopenharmony_ci */ 28261847f8eSopenharmony_ci url: string; 28361847f8eSopenharmony_ci} 28461847f8eSopenharmony_ci 28561847f8eSopenharmony_ci/** 28661847f8eSopenharmony_ci * Load intercept event when the resources loading is intercepted. 28761847f8eSopenharmony_ci * 28861847f8eSopenharmony_ci * @typedef OnLoadInterceptEvent 28961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 29061847f8eSopenharmony_ci * @atomicservice 29161847f8eSopenharmony_ci * @since 12 29261847f8eSopenharmony_ci */ 29361847f8eSopenharmony_ciexport declare interface OnLoadInterceptEvent { 29461847f8eSopenharmony_ci /** 29561847f8eSopenharmony_ci * Web resource request of event. 29661847f8eSopenharmony_ci * 29761847f8eSopenharmony_ci * @type { WebResourceRequest } 29861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 29961847f8eSopenharmony_ci * @atomicservice 30061847f8eSopenharmony_ci * @since 12 30161847f8eSopenharmony_ci */ 30261847f8eSopenharmony_ci data: WebResourceRequest; 30361847f8eSopenharmony_ci} 30461847f8eSopenharmony_ci 30561847f8eSopenharmony_ci/** 30661847f8eSopenharmony_ci * Progress change event when the page loading progress changes. 30761847f8eSopenharmony_ci * 30861847f8eSopenharmony_ci * @typedef OnProgressChangeEvent 30961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 31061847f8eSopenharmony_ci * @atomicservice 31161847f8eSopenharmony_ci * @since 12 31261847f8eSopenharmony_ci */ 31361847f8eSopenharmony_ciexport declare interface OnProgressChangeEvent { 31461847f8eSopenharmony_ci /** 31561847f8eSopenharmony_ci * The new progress of the page. 31661847f8eSopenharmony_ci * 31761847f8eSopenharmony_ci * @type { number } 31861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 31961847f8eSopenharmony_ci * @atomicservice 32061847f8eSopenharmony_ci * @since 12 32161847f8eSopenharmony_ci */ 32261847f8eSopenharmony_ci newProgress: number; 32361847f8eSopenharmony_ci} 32461847f8eSopenharmony_ci 32561847f8eSopenharmony_ci/** 32661847f8eSopenharmony_ci * Provides methods for controlling the AtomicServiceWeb controller. 32761847f8eSopenharmony_ci * 32861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 32961847f8eSopenharmony_ci * @atomicservice 33061847f8eSopenharmony_ci * @since 12 33161847f8eSopenharmony_ci */ 33261847f8eSopenharmony_ci@Observed 33361847f8eSopenharmony_ciexport declare class AtomicServiceWebController { 33461847f8eSopenharmony_ci /** 33561847f8eSopenharmony_ci * Gets the default user agent. 33661847f8eSopenharmony_ci * 33761847f8eSopenharmony_ci * @returns { string } Return user agent information. 33861847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 33961847f8eSopenharmony_ci * AtomicServiceWeb component. 34061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 34161847f8eSopenharmony_ci * @atomicservice 34261847f8eSopenharmony_ci * @since 12 34361847f8eSopenharmony_ci */ 34461847f8eSopenharmony_ci getUserAgent(): string; 34561847f8eSopenharmony_ci 34661847f8eSopenharmony_ci /** 34761847f8eSopenharmony_ci * Get custom user agent. 34861847f8eSopenharmony_ci * 34961847f8eSopenharmony_ci * @returns { string } Get custom User agent information. 35061847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 35161847f8eSopenharmony_ci * AtomicServiceWeb component. 35261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 35361847f8eSopenharmony_ci * @atomicservice 35461847f8eSopenharmony_ci * @since 12 35561847f8eSopenharmony_ci */ 35661847f8eSopenharmony_ci getCustomUserAgent(): string; 35761847f8eSopenharmony_ci 35861847f8eSopenharmony_ci /** 35961847f8eSopenharmony_ci * Set custom user agent. 36061847f8eSopenharmony_ci * 36161847f8eSopenharmony_ci * @param { string } userAgent - User custom agent information. 36261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 36361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 36461847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 36561847f8eSopenharmony_ci * AtomicServiceWeb component. 36661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 36761847f8eSopenharmony_ci * @atomicservice 36861847f8eSopenharmony_ci * @since 12 36961847f8eSopenharmony_ci */ 37061847f8eSopenharmony_ci setCustomUserAgent(userAgent: string): void; 37161847f8eSopenharmony_ci 37261847f8eSopenharmony_ci /** 37361847f8eSopenharmony_ci * Refreshes the current URL. 37461847f8eSopenharmony_ci * 37561847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 37661847f8eSopenharmony_ci * AtomicServiceWeb component. 37761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 37861847f8eSopenharmony_ci * @atomicservice 37961847f8eSopenharmony_ci * @since 12 38061847f8eSopenharmony_ci */ 38161847f8eSopenharmony_ci refresh(): void; 38261847f8eSopenharmony_ci 38361847f8eSopenharmony_ci /** 38461847f8eSopenharmony_ci * Goes forward in the history of the web page. 38561847f8eSopenharmony_ci * 38661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 38761847f8eSopenharmony_ci * AtomicServiceWeb component. 38861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 38961847f8eSopenharmony_ci * @atomicservice 39061847f8eSopenharmony_ci * @since 12 39161847f8eSopenharmony_ci */ 39261847f8eSopenharmony_ci forward(): void; 39361847f8eSopenharmony_ci 39461847f8eSopenharmony_ci /** 39561847f8eSopenharmony_ci * Goes back in the history of the web page. 39661847f8eSopenharmony_ci * 39761847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 39861847f8eSopenharmony_ci * AtomicServiceWeb component. 39961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 40061847f8eSopenharmony_ci * @atomicservice 40161847f8eSopenharmony_ci * @since 12 40261847f8eSopenharmony_ci */ 40361847f8eSopenharmony_ci backward(): void; 40461847f8eSopenharmony_ci 40561847f8eSopenharmony_ci /** 40661847f8eSopenharmony_ci * Checks whether the web page can go forward. 40761847f8eSopenharmony_ci * 40861847f8eSopenharmony_ci * @returns { boolean } True if the web page can go forward else false. 40961847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 41061847f8eSopenharmony_ci * AtomicServiceWeb component. 41161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 41261847f8eSopenharmony_ci * @atomicservice 41361847f8eSopenharmony_ci * @since 12 41461847f8eSopenharmony_ci */ 41561847f8eSopenharmony_ci accessForward(): boolean; 41661847f8eSopenharmony_ci 41761847f8eSopenharmony_ci /** 41861847f8eSopenharmony_ci * Checks whether the web page can go back. 41961847f8eSopenharmony_ci * 42061847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 42161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 42261847f8eSopenharmony_ci * AtomicServiceWeb component. 42361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 42461847f8eSopenharmony_ci * @atomicservice 42561847f8eSopenharmony_ci * @since 12 42661847f8eSopenharmony_ci */ 42761847f8eSopenharmony_ci accessBackward(): boolean; 42861847f8eSopenharmony_ci 42961847f8eSopenharmony_ci /** 43061847f8eSopenharmony_ci * Checks whether the web page can go back or forward the given number of steps. 43161847f8eSopenharmony_ci * 43261847f8eSopenharmony_ci * @param { number } step - The number of steps. 43361847f8eSopenharmony_ci * @returns { boolean } True if the web page can go back else false. 43461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 43561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 43661847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 43761847f8eSopenharmony_ci * AtomicServiceWeb component. 43861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 43961847f8eSopenharmony_ci * @atomicservice 44061847f8eSopenharmony_ci * @since 12 44161847f8eSopenharmony_ci */ 44261847f8eSopenharmony_ci accessStep(step: number): boolean; 44361847f8eSopenharmony_ci 44461847f8eSopenharmony_ci /** 44561847f8eSopenharmony_ci * Loads the URL. 44661847f8eSopenharmony_ci * 44761847f8eSopenharmony_ci * @param { string | Resource } url - The URL to load. 44861847f8eSopenharmony_ci * @param { Array<WebHeader> } [headers] - Additional HTTP request header for URL. 44961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 45061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 45161847f8eSopenharmony_ci * @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a 45261847f8eSopenharmony_ci * AtomicServiceWeb component. 45361847f8eSopenharmony_ci * @throws { BusinessError } 17100002 - Invalid url. 45461847f8eSopenharmony_ci * @throws { BusinessError } 17100003 - Invalid resource path or file type. 45561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 45661847f8eSopenharmony_ci * @atomicservice 45761847f8eSopenharmony_ci * @since 12 45861847f8eSopenharmony_ci */ 45961847f8eSopenharmony_ci loadUrl(url: string | Resource, headers?: Array<WebHeader>): void; 46061847f8eSopenharmony_ci} 46161847f8eSopenharmony_ci 46261847f8eSopenharmony_ci/** 46361847f8eSopenharmony_ci * Defines the Web's request/response header. 46461847f8eSopenharmony_ci * 46561847f8eSopenharmony_ci * @typedef WebHeader 46661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 46761847f8eSopenharmony_ci * @atomicservice 46861847f8eSopenharmony_ci * @since 12 46961847f8eSopenharmony_ci */ 47061847f8eSopenharmony_ciexport declare interface WebHeader { 47161847f8eSopenharmony_ci /** 47261847f8eSopenharmony_ci * Gets the key of the request/response header. 47361847f8eSopenharmony_ci * 47461847f8eSopenharmony_ci * @type { string } 47561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 47661847f8eSopenharmony_ci * @atomicservice 47761847f8eSopenharmony_ci * @since 12 47861847f8eSopenharmony_ci */ 47961847f8eSopenharmony_ci headerKey: string; 48061847f8eSopenharmony_ci 48161847f8eSopenharmony_ci /** 48261847f8eSopenharmony_ci * Gets the value of the request/response header. 48361847f8eSopenharmony_ci * 48461847f8eSopenharmony_ci * @type { string } 48561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 48661847f8eSopenharmony_ci * @atomicservice 48761847f8eSopenharmony_ci * @since 12 48861847f8eSopenharmony_ci */ 48961847f8eSopenharmony_ci headerValue: string; 49061847f8eSopenharmony_ci} 49161847f8eSopenharmony_ci 49261847f8eSopenharmony_ci/** 49361847f8eSopenharmony_ci * Callback for OnLoadIntercept 49461847f8eSopenharmony_ci * 49561847f8eSopenharmony_ci * @typedef { function } OnLoadIntercept Function. 49661847f8eSopenharmony_ci * @param { OnLoadInterceptEvent } event - the load intercept event when the resources loading is intercepted. 49761847f8eSopenharmony_ci * @returns { boolean } True if the load is intercepted else false. 49861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 49961847f8eSopenharmony_ci * @atomicservice 50061847f8eSopenharmony_ci * @since 12 50161847f8eSopenharmony_ci */ 50261847f8eSopenharmony_ciexport type OnLoadInterceptCallback = (event: OnLoadInterceptEvent) => boolean; 503