From 5fb7cc25e6f14fd4b419093b0f8bac1c719d5f21 Mon Sep 17 00:00:00 2001 From: FredTT Date: Wed, 18 Jun 2025 18:27:11 +0800 Subject: [PATCH] add interface Signed-off-by: FredTT --- api/@internal/component/ets/common.d.ts | 85 +++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 0a2d2edefc..85cd6b0772 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -18199,6 +18199,68 @@ declare interface MenuMaskType { backgroundBlurStyle?: BlurStyle; } +/** + * Defines the scaling mode for custom preview of contextMenu. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +declare enum PreviewScaleMode { + /** + * Automatically resize preview based on the layout area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + AUTO = 0, + + /** + * Maintain original size of preview content without scaling. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + CONSTANT = 1, + + /** + * Maintain aspect ratio to scale preview. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + MAINTAIN = 2, +} + +/** + * Defines the available layout area. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +declare enum AvailableLayoutArea { + /** + * Size of safe area. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + SAFE_AREA = 0, +} + /** * Defines the context menu options. * @@ -18710,6 +18772,29 @@ declare interface ContextMenuOptions { * @since 20 */ onWillDisappear?: Callback; + + /** + * Defines the scaling mode for custom preview of contextMenu. + * + * @type { ?PreviewScaleMode } + * @default PreviewScaleMode.AUTO + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + previewScaleMode?: PreviewScaleMode; + + /** + * Defines the available layout area of preview. + * + * @type { ?AvailableLayoutArea } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + availableLayoutArea?: AvailableLayoutArea; } /** -- Gitee