From 6b052b8e8b08672c3af326f44887cda58f7526c6 Mon Sep 17 00:00:00 2001 From: zzzsilenc Date: Tue, 24 May 2022 15:13:55 +0800 Subject: [PATCH] js sdk xcomponent element Signed-off-by: zzzsilenc --- api/common/full/viewmodel.d.ts | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/api/common/full/viewmodel.d.ts b/api/common/full/viewmodel.d.ts index 1dad55169e..0b8bfb34fe 100644 --- a/api/common/full/viewmodel.d.ts +++ b/api/common/full/viewmodel.d.ts @@ -2419,6 +2419,31 @@ export interface DivElement extends Element { getScrollOffset(): ScrollOffset; } +export interface XComponentElement extends Element { + /** + * get the id of surface created by XComponent. + * @since 8 + * @systemapi + */ + getXComponentSurfaceId(); + + /** + * get the context of native XComponent. + * @since 8 + */ + getXComponentContext(); + + /** + * set the surface size created by XComponent. + * @since 8 + * @systemapi + */ + setXComponentSurfaceSize(value: { + surfaceWidth: number; + surfaceHeight: number; + }); +} + /** * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 4 @@ -2513,7 +2538,8 @@ export interface ViewModel { TextAreaElement & PickerElement & VideoElement & - DivElement; + DivElement & + XComponentElement; /** * Obtains the root ViewModel instance. @@ -2587,7 +2613,8 @@ export interface ElementReferences { TextAreaElement & PickerElement & VideoElement & - DivElement; + DivElement & + XComponentElement; } /** -- Gitee