From 5972dd973b03722f7949ca0da67a6ea61e4f9262 Mon Sep 17 00:00:00 2001 From: quguiren Date: Wed, 6 Aug 2025 14:55:59 +0800 Subject: [PATCH] add crossplatform Signed-off-by: quguiren --- api/application/ApplicationContext.d.ts | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index e4777379ad..988d517a9e 100644 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -599,6 +599,23 @@ declare class ApplicationContext extends Context { * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Sets the language for the application. + * + *

**NOTE**: + *
It can be called only by the main thread. + *

+ * + * @param { string } language - Target language. The list of supported languages can be obtained by + * calling getSystemLanguages(). + * @throws { BusinessError } 16000011 - The context does not exist. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @crossplatform + * @atomicservice + * @since 21 + * @arkts 1.1&1.2 + */ setLanguage(language: string): void; /** @@ -740,6 +757,22 @@ declare class ApplicationContext extends Context { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Sets the font for this application. + * + *

**NOTE**: + *
This API can be called only by the main thread. + *

+ * + * @param { string } font - Font, which can be registered by calling UIContext.registerFont. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @crossplatform + * @since 21 + * @arkts 1.1&1.2 + */ setFont(font: string): void; /** @@ -772,6 +805,23 @@ declare class ApplicationContext extends Context { * @since arkts {'1.1':'13', '1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Sets the scale ratio for the font size of this application. + * + *

**NOTE**: + *
It can be called only by the main thread. + *

+ * + * @param {number} fontSizeScale - Font scale ratio. The value is a non-negative number. When the application's + * {@link fontSizeScale} is set to followSystem and the value set here exceeds the value of + * fontSizeMaxScale, the value of fontSizeMaxScale takes effect. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @crossplatform + * @atomicservice + * @since 21 + * @arkts 1.1&1.2 + */ setFontSizeScale(fontSizeScale: number): void; /** -- Gitee