From 7179614cba4b3e300b432e1b5517af0e3b2099cc Mon Sep 17 00:00:00 2001 From: DDDDD Date: Mon, 1 Sep 2025 09:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E5=B1=82=E6=B8=B2=E6=9F=93object?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=94=AF=E6=8C=81=E4=BC=A0=E9=80=92param?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DDDDD --- api/@internal/component/ets/web.d.ts | 149 +++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 84c89035da..82b66f4efd 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. * @@ -5482,6 +5493,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. * @@ -10226,6 +10364,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 * -- Gitee