From 01bf5c8803aa61f10178cabf326ca514076c55ad Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 28 Aug 2024 10:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E6=8E=A5=E5=8F=A3=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- api/@internal/component/ets/enums.d.ts | 92 ++++++++++++++++++++++++++ api/@ohos.arkui.UIContext.d.ts | 20 ++++++ 2 files changed, 112 insertions(+) diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index c28798e18..db46717e3 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -9728,3 +9728,95 @@ declare enum AccessibilityHoverType { */ HOVER_CANCEL = 3, } + +/** + * Type of window width breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum WidthBreakpoint { + /** + * Window width < 320vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XS = 0, + + /** + * Window width >= 320vp and < 600vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_SM = 1, + + /** + * Window width >= 600vp and < 840vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_MD = 2, + + /** + * Window width >= 840vp and < 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_LG = 3, + + /** + * Window width >= 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XL = 4, +} + +/** + * Type of window height breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum HeightBreakpoint { + /** + * Window aspectRatio < 0.8 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_SM = 0, + + /** + * Window aspectRatio >= 0.8 and < 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_MD = 1, + + /** + * Window aspectRatio >= 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_LG = 2, +} \ No newline at end of file diff --git a/api/@ohos.arkui.UIContext.d.ts b/api/@ohos.arkui.UIContext.d.ts index 5c8b185a3..5ca4a7b20 100644 --- a/api/@ohos.arkui.UIContext.d.ts +++ b/api/@ohos.arkui.UIContext.d.ts @@ -3110,6 +3110,26 @@ export class UIContext { * @since 12 */ getWindowName(): string | undefined; + + /** + * Get the width breakpoint of current window. + * + * @returns { WidthBreakpoint } The width breakpoint of current window. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + getWindowWidthBreakpoint(): WidthBreakpoint; + + /** + * Get the height breakpoint of current window. + * + * @returns { HeightBreakpoint } The height breakpoint of current window. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + getWindowHeightBreakpoint(): HeightBreakpoint; /** * Open the BindSheet.