diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 33f6824f2c91d3e87976caa96f2932001990595e..8166823391fa829d937cc16ea24e976aa851fbfd 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1355,6 +1355,17 @@ type OnFullScreenEnterCallback = (event: FullScreenEnterEvent) => void; */ type MouseInfoCallback = (event: NativeEmbedMouseInfo) => void; +/** + * The callback when the param element which is a child item of the object element has changed. + * + * @typedef { function } OnNativeEmbedObjectParamChangeCallback + * @param { NativeEmbedParamDataInfo } event - callback information of param element. + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ +type OnNativeEmbedObjectParamChangeCallback = (event: NativeEmbedParamDataInfo) => void; + /** * Enum type supplied to {@link renderExitReason} when onRenderExited being called. * @@ -5478,6 +5489,133 @@ declare interface NativeEmbedMouseInfo { result?: EventResult; } +/** + * Enum type supplied to {@link NativeEmbedParamItem} when onNativeEmbedObjectParamChange being called. + * + * @enum { number } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ +declare enum NativeEmbedParamStatus { + /** + * The param element is created. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + ADD = 0, + + /** + * The param element is updated. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + UPDATE = 1, + + /** + *The param element is deleted. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + DELETE = 2, +} + +/** + * Defines the information of param element. + * + * @typedef NativeEmbedParamItem + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ +declare interface NativeEmbedParamItem { + /** + * The status of the param. + * + * @type { NativeEmbedParamStatus } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + status: NativeEmbedParamStatus; + + /** + * The id attribute of the param element. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + id: string; + + /** + * The name attribute of the param element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + name?: string; + + /** + * The value attribute of the param element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + value?: string; +} + +/** + * Defines the param data info. + * + * @typedef NativeEmbedParamDataInfo + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ +declare interface NativeEmbedParamDataInfo { + /** + * The native embed id. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + embedId: string; + + /** + * The id attribute of the object element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + objectAttributeId?: string; + + /** + * The param element array + * + * @type { ?Array } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + paramItems?: Array; +} + /** * Defines the first content paint rendering of web page. * @@ -7344,6 +7482,34 @@ declare interface SelectionMenuOptionsExt { previewMenuOptions?: PreviewMenuOptions; } +/** + * Enum type supplied to {@link rotateRenderEffect} for setting the effect of rotation. + * + * @enum { number } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ +declare enum WebRotateEffect { + /** + * The content area is drawn in top-left of the node. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + TOPLEFT_EFFECT = 0, + + /** + * Scale the content area to cover the node. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + RESIZE_COVER_EFFECT = 1 +} + /** * Defines the Web attribute functions. * @@ -10134,6 +10300,17 @@ declare class WebAttribute extends CommonMethod { */ onNativeEmbedMouseEvent(callback: MouseInfoCallback): WebAttribute; + /** + * Triggered when the param element which is a child item of the object element has changed. + * + * @param { OnNativeEmbedObjectParamChangeCallback } callback - callback Triggered when the param element has changed. + * @returns { WebAttribute } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + onNativeEmbedObjectParamChange(callback: OnNativeEmbedObjectParamChangeCallback): WebAttribute; + /** * Called to set copy option * @@ -10461,6 +10638,17 @@ declare class WebAttribute extends CommonMethod { * @since 20 */ gestureFocusMode(mode: GestureFocusMode): WebAttribute; + + /** + * Set up the effect of web roation + * + * @param { WebRotateEffect } effect - The effect of roation. + * @returns { WebAttribute } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + * @arkts 1.1&1.2 + */ + rotateRenderEffect(effect: WebRotateEffect): WebAttribute; } /**