diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index e9b1409593669ee6def84b22b4441bdb2b1e08ac..ecba4135af101c1af0196b4d0d412ccf4e306cc6 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -3326,30 +3326,6 @@ declare class WebContextMenuResult { * @since 11 */ selectAll(): void; - - /** - * Executes the redo operation related to this context menu. - * - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - redo(): void; - - /** - * Executes the undo operation related to this context menu. - * - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - undo(): void; - - /** - * Executes the paste and match style operation related to this context menu. - * - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - pasteAndMatchStyle(): void; } /** @@ -5430,42 +5406,6 @@ declare interface OnPageBeginEvent { url: string; } -/** - * Defines the triggered function at the begin of web page loading. - * - * @typedef OnLoadStartedEvent - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ -declare interface OnLoadStartedEvent { - /** - * The url to be loaded. - * - * @type { string } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - url: string; -} - -/** - * Defines the triggered function at the end of web page loading. - * - * @typedef OnLoadFinishedEvent - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ -declare interface OnLoadFinishedEvent { - /** - * The url to be loaded. - * - * @type { string } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - url: string; -} - /** * Defines the triggered function when the page loading progress changes. * @@ -5661,16 +5601,6 @@ declare interface OnBeforeUnloadEvent { * @since 18 */ result: JsResult; - - /** - * The isReload parameter is set to true when the page is refreshed; - * otherwise, it remains false. Default is false. - * - * @type { ?boolean } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - isReload?: boolean; } /** @@ -6798,24 +6728,6 @@ declare enum WebResponseType { LONG_PRESS = 1 } -/** - * Defines the options of preview menu - * - * @interface PreviewMenuOptions - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ -declare interface PreviewMenuOptions { - /** - * Defines the haptic feedback mode of preview menu. - * - * @type { ?HapticFeedbackMode } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - hapticFeedbackMode?: HapticFeedbackMode; -} - /** * Defines the selection menu options. * @@ -6859,15 +6771,6 @@ declare interface SelectionMenuOptionsExt { * @since 13 */ menuType?: MenuType; - - /** - * Defines the options of preview menu. - * - * @type { ?PreviewMenuOptions } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - previewMenuOptions?: PreviewMenuOptions; } /** @@ -7575,37 +7478,6 @@ declare class WebAttribute extends CommonMethod { */ onPageBegin(callback: Callback): WebAttribute; - /** - * Triggered at the begin of web page loading. This method is called once for each main frame load. Embedded frame - * changes, i.e. clicking a link whose target is an iframe and fragment navigations (navigations to #fragment_id) - * will not trigger this callback. - * - *

API Note:
- * Different from onPageBegin, onLoadStarted is triggered only once if the mainframe is automatically redirected - * before the page is completely loaded. OnPageBegin is triggered every navigation. - *

- * - * @param { Callback } callback The triggered function at the begin of web page loading. - * @returns { WebAttribute } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - onLoadStarted(callback: Callback): WebAttribute; - - /** - * Notify the host application that a page has finished loading. This method is called only for main frame. - * - *

API Note:
- * Different from onPageEnd, fragment navigation also triggers onLoadFinished. - *

- * - * @param { Callback } callback The triggered function at the end of web page loading. - * @returns { WebAttribute } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - onLoadFinished(callback: Callback): WebAttribute; - /** * Triggered when the page loading progress changes. * @@ -9816,37 +9688,6 @@ declare class WebAttribute extends CommonMethod { * @since 16 */ nativeEmbedOptions(options?: EmbedOptions): WebAttribute; - - /** - * Triggered when the web page is activated for window.open called by other web component. - * - * @param { Callback } callback the triggered function when the web page is activated for window.open called by other web component. - * @returns { WebAttribute } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - onActivateContent(callback: Callback): WebAttribute; - - /** - * Enable data detector. - * - * @param { boolean } enable - {@code true} means enable data detector in Web;{@code false} otherwise. - * The default value is false. - * @returns { WebAttribute } The attribute of the web. - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - enableDataDetector(enable: boolean): WebAttribute; - - /** - * Data detector with config. - * - * @param { TextDataDetectorConfig } config - The config of text data detector. - * @returns { WebAttribute } The attribute of the web. - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - dataDetectorConfig(config: TextDataDetectorConfig): WebAttribute; } /** @@ -10086,17 +9927,4 @@ declare interface EmbedOptions { * @since 16 */ supportDefaultIntrinsicSize?: boolean; - - /** - * Whether the {@link onNativeEmbedVisibilityChange} event supports display-related attributes - * of the embed element. - *
Default value is false. If true, the changes of the display-related attributes of the - * embed element will be reported through the {@link onNativeEmbedVisibilityChange} event. - * - * @type { ?boolean } - * @default false - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - supportCssDisplayChange?: boolean; } diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 39105c6de1a0b0cb4499b9d0e207d344c60e3aa7..112a2cb88f067e29487784eadb72361ffae2cd63 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -3521,31 +3521,6 @@ declare namespace webview { EVENT } - /** - * Enum type supplied to {@link getAttachState} for indicating the attach state of controller. - * - * @enum { number } - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - enum ControllerAttachState { - /** - * Indicates webviewController is not attached a web component. - * - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - UNATTACHED = 0, - - /** - * Indicates webviewController is attached a web component. - * - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - ATTACHED = 1 - } - /** * Provides methods for controlling the web controller. * @syscap SystemCapability.Web.Webview.Core @@ -6283,85 +6258,6 @@ declare namespace webview { * @since 18 */ getLastHitTest(): HitTestValue; - - /** - * Set the default User-Agent for the application. - * - *

API Note:
- * Unlike setCustomUserAgent, which only takes effect in the current web context, the - * priority for pages loaded in the web is as follows: - * 1. The User-Agent set by setCustomUserAgent is used first. - * 2. If not set, it will check whether a specific User-Agent has been - * assigned to the current page via setUserAgentForHosts. - * 3. If no specific User-Agent is assigned, the application will fall back - * to using the User-Agent set by setAppCustomUserAgent. - * 4. If the app's default User-Agent is also not specified, the web's default - * User-Agent will be used as the final fallback. - *

- * - * @param { string } userAgent - The User-Agent string. - * @static - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - static setAppCustomUserAgent(userAgent: string) : void; - - /** - * Set the User-Agent to be used for specified hosts, with a maximum of 20,000 hosts. - *

API Note:
- * Setting the same host list multiple times for the same User-Agent will override - * the previous settings. That is, if you want to cancel certain hosts from using - * the specified User-Agent, you need to reset the host list for that User-Agent. - *

- * - * @param { string } userAgent - The User-Agent string. - * @param { Array } hosts - The hosts to which the User-Agent apply. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. 3. Parameter verification failed. - * @static - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - static setUserAgentForHosts(userAgent: string, hosts : Array) : void; - - /** - * Get whether webviewController is attached to a web component. - * @returns { ControllerAttachState } the attach state of controller - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - getAttachState(): ControllerAttachState; - - /** - * Register the callback for controller attach state change. - * - * @param { 'controllerAttachStateChange' } type the event of controller attach state change. - * @param { Callback } callback Callback used to return the controller attach state. - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - on(type: 'controllerAttachStateChange', callback: Callback): void; - - /** - * Unregister the callback for controller attach state change. - * - * @param { 'controllerAttachStateChange' } type the event of controller attach state change. - * @param { Callback } callback Callback used to return the controller attach state. - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - off(type: 'controllerAttachStateChange', callback?: Callback): void; - - - /** - * Wait for the controller to attach a web component until timeout. - * - * @param { number } timeout - the wait timeout, if timeout reach, promise will return, the unit is millisecond. - * @returns { Promise } Promise used to return the state of attach. - * @syscap SystemCapability.Web.Webview.Core - * @since 20 - */ - waitForAttached(timeout: number): Promise; } /**