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 4433d25b5..3ec892681 100644 --- a/api/@ohos.arkui.UIContext.d.ts +++ b/api/@ohos.arkui.UIContext.d.ts @@ -3130,6 +3130,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.