!9923 Add interfaces for viewport-fit meta tag for web page.

Merge pull request !9923 from xuefuzhang/master
This commit is contained in:
openharmony_ci 2024-05-11 11:44:38 +00:00 committed by Gitee
commit ee64580b82
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -146,6 +146,17 @@ type OnRenderProcessNotRespondingCallback = (data : RenderProcessNotRespondingDa
*/
type OnRenderProcessRespondingCallback = () => void;
/**
* The callback of ViewportFit Changed.
*
* @typedef {function} OnViewportFitChangedCallback
* @param {ViewportFit} viewportFit - details of OnViewportFitChangedCallback.
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
type OnViewportFitChangedCallback = (viewportFit: ViewportFit) => void;
/**
* Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript.
*
@ -2433,6 +2444,45 @@ declare enum RenderMode {
SYNC_RENDER = 1,
}
/**
* Defines the viewport-fit type, related to {@link ViewportFit}.
*
* @enum { number }
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
declare enum ViewportFit {
/**
* No effect - the whole web page is viewable(default)
*
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
AUTO = 0,
/**
* The initial layout viewport and the visual viewport are set to the
* largest rectangle which is inscribe in the display of the device.
*
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
CONTAINS = 1,
/**
* The initial layout viewport and the visual viewport are set to the
* circumscribe rectangle of the physical screen of the device.
*
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
COVER = 2,
}
/**
* Defines the context menu param, related to {@link WebContextMenuParam} method.
*
@ -3618,7 +3668,7 @@ declare class EventResult {
/**
* Set whether the event is consumed.
*
*
* @param { boolean } result - True if the event is consumed.
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
@ -7110,6 +7160,17 @@ declare class WebAttribute extends CommonMethod<WebAttribute> {
* @since 12
*/
selectionMenuOptions(expandedMenuOptions: Array<ExpandedMenuItemOptions>): WebAttribute;
/**
* Triggered when the viewport-fit meta is detected for web page.
*
* @param { OnViewportFitChangedCallback } callback - The callback for onViewportFitChanged.
* @returns { WebAttribute }
* @syscap SystemCapability.Web.Webview.Core
* @atomicservice
* @since 12
*/
onViewportFitChanged(callback: OnViewportFitChangedCallback): WebAttribute;
}
/**