diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 8461c5cb6e89323cfe25480c180a3b8a0e9cbb2b..cade1c4e78a3cc93e679895d5ba882fa44091f78 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1355,6 +1355,16 @@ 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 + */ +type OnNativeEmbedObjectParamChangeCallback = (event: NativeEmbedParamDataInfo) => void; + /** * Enum type supplied to {@link renderExitReason} when onRenderExited being called. * @@ -5491,6 +5501,120 @@ declare interface NativeEmbedMouseInfo { result?: EventResult; } +/** + * Enum type supplied to {@link NativeEmbedParamItem} when onNativeEmbedObjectParamChange being called. + * + * @enum { number } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ +declare enum NativeEmbedParamStatus { + /** + * The param element is created. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + ADD = 0, + + /** + * The param element is updated. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + UPDATE = 1, + + /** + *The param element is deleted. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + DELETE = 2, +} + +/** + * Defines the information of param element. + * + * @typedef NativeEmbedParamItem + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ +declare interface NativeEmbedParamItem { + /** + * The status of the param. + * + * @type { NativeEmbedParamStatus } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + status: NativeEmbedParamStatus; + + /** + * The id attribute of the param element. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + id: string; + + /** + * The name attribute of the param element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + name?: string; + + /** + * The value attribute of the param element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + value?: string; +} + +/** + * Defines the param data info. + * + * @typedef NativeEmbedParamDataInfo + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ +declare interface NativeEmbedParamDataInfo { + /** + * The native embed id. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + embedId: string; + + /** + * The id attribute of the object element. + * + * @type { ?string } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + objectAttributeId?: string; + + /** + * The param element array + * + * @type { ?Array } + * @syscap SystemCapability.Web.Webview.Core + * @since 21 + */ + paramItems?: Array; +} + /** * Provides detailed information about the first meaningful paint. * @@ -10221,6 +10345,16 @@ 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 + */ + onNativeEmbedObjectParamChange(callback: OnNativeEmbedObjectParamChangeCallback): WebAttribute; + /** * Called to set copy option *