diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md index c5de47b81e6b928a7d26909a54aa9ba798078417..48c1cbf8ba92a32af0f45917ca9f03708ae6e30c 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md @@ -8,7 +8,7 @@ | Name | Type | Readable| Writable| Description | | ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ | -| events | Array\ | Yes | No | Name of the common event to publish. | +| events | Array\ | Yes | No | Common events to subscribe to. | | publisherPermission | string | Yes | No | Permissions required for publishers to publish the common event. | | publisherDeviceId | string | Yes | No | Device ID. The value must be the ID of a device on the same network. | | userId | number | Yes | No | User ID. The value must be an existing user ID in the system. If this parameter is not specified, the default value, which is the ID of the current user, will be used. | diff --git a/en/application-dev/reference/apis/js-apis-system-parameter.md b/en/application-dev/reference/apis/js-apis-system-parameter.md index fceb893eb40373ad0f4cff2faa34c10018ccb3b8..aab6d05c91656e7b386499302e2ab11b021ba937 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameter.md +++ b/en/application-dev/reference/apis/js-apis-system-parameter.md @@ -30,13 +30,13 @@ Obtains the value of the system parameter with the specified key. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** or any custom value. | **Return value** | Type| Description| | -------- | -------- | -| string | Value of the system parameter. If the specified key does not exist, the default value is returned. If no default value has been set, an empty string will be returned.| +| string | Value of the system parameter.
If the specified key exists, the set value is returned.
If the specified key does not exist and **def** is set to a valid value, the set value is returned. If the specified key does not exist and **def** is set to an invalid value (such as **undefined**) or is not set, an empty string is returned. | **Example** @@ -44,7 +44,7 @@ Obtains the value of the system parameter with the specified key. try { var info = systemparameter.getSync("const.ohos.apiversion"); console.log(JSON.stringify(info)); -}catch(e){ +} catch(e) { console.log("getSync unexpected error: " + e); } ``` @@ -74,7 +74,7 @@ try { } else { console.log(" get test.parameter.key value err:" + err.code) }}); -}catch(e){ +} catch(e) { console.log("get unexpected error: " + e); } ``` @@ -106,7 +106,7 @@ try { console.log(" get test.parameter.key value err:" + err.code) } }); -}catch(e){ +} catch(e) { console.log("get unexpected error:" + e) } ``` @@ -124,7 +124,7 @@ Obtains the value of the system parameter with the specified key. This API uses | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** or any custom value. | **Return value** @@ -142,7 +142,7 @@ try { }).catch(function (err) { console.log("get test.parameter.key error: " + err.code); }); -}catch(e){ +} catch(e) { console.log("get unexpected error: " + e); } ``` @@ -172,7 +172,7 @@ Sets a value for the system parameter with the specified key. ```ts try { systemparameter.setSync("test.parameter.key", "default"); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` @@ -207,7 +207,7 @@ try { } else { console.log("set test.parameter.key value err:" + err.code) }}); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` @@ -247,7 +247,7 @@ try { }).catch(function (err) { console.log(" set test.parameter.key error: " + err.code); }); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` diff --git a/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md b/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md index 12f2d8448418cac174e471bee660900ceee0b8de..dabeb1bad7572458974e0330990f745c285bae0e 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md +++ b/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md @@ -29,13 +29,13 @@ Obtains the value of the system parameter with the specified key. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** or any custom value. | **Return value** | Type| Description| | -------- | -------- | -| string | Value of the system parameter. If the specified key does not exist, the default value is returned. If no default value has been set, an empty string will be returned.| +| string | Value of the system parameter.
If the specified key exists, the set value is returned.
If the specified key does not exist and **def** is set to a valid value, the set value is returned. If the specified key does not exist and **def** is set to an invalid value (such as **undefined**) or is not set, an exception is thrown. | **Example** @@ -43,7 +43,7 @@ Obtains the value of the system parameter with the specified key. try { var info = systemparameter.getSync("const.ohos.apiversion"); console.log(JSON.stringify(info)); -}catch(e){ +} catch(e) { console.log("getSync unexpected error: " + e); } ``` @@ -73,7 +73,7 @@ try { } else { console.log(" get test.parameter.key value err:" + err.code) }}); -}catch(e){ +} catch(e) { console.log("get unexpected error: " + e); } ``` @@ -105,7 +105,7 @@ try { console.log(" get test.parameter.key value err:" + err.code) } }); -}catch(e){ +} catch(e) { console.log("get unexpected error:" + e) } ``` @@ -123,7 +123,7 @@ Obtains the value of the system parameter with the specified key. This API uses | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** or any custom value. | **Return value** @@ -141,7 +141,7 @@ try { }).catch(function (err) { console.log("get test.parameter.key error: " + err.code); }); -}catch(e){ +} catch(e) { console.log("get unexpected error: " + e); } ``` @@ -166,7 +166,7 @@ Sets a value for the system parameter with the specified key. ```ts try { systemparameter.setSync("test.parameter.key", "default"); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` @@ -197,7 +197,7 @@ try { } else { console.log("set test.parameter.key value err:" + err.code) }}); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` @@ -233,7 +233,7 @@ try { }).catch(function (err) { console.log(" set test.parameter.key error: " + err.code); }); -}catch(e){ +} catch(e) { console.log("set unexpected error: " + e); } ``` diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-background.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-background.md index 8d3208442cc40edfd53d623a125c03d979b0af80..dc70be06327ffc45da2153ff8e7b0a3445bae16f 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-background.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-background.md @@ -14,7 +14,7 @@ You can set the background for a component. | backgroundImage | src: [ResourceStr](ts-types.md#resourcestr),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | **src**: image address, which can be the address of an Internet or a local image or a Base64 encoded image. SVG images are not supported.
**repeat**: whether the background image is repeated. By default, the background image is not repeated. If the set image has a transparent background and **backgroundColor** is set, the image is overlaid on the background color.
Since API version 9, this API is supported in ArkTS widgets.| | backgroundImageSize | {
width?: [Length](ts-types.md#length),
height?: [Length](ts-types.md#length)
} \| [ImageSize](ts-appendix-enums.md#imagesize) | Width and height of the background image. If the input is a **{width: Length, height: Length}** object and only one attribute is set, the other attribute is the set value multiplied by the original aspect ratio of the image. By default, the original image aspect ratio remains unchanged.
The value range of **width** and **height** is [0, +∞).
Default value: **ImageSize.Auto**
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
A value less than 0 evaluates to the value **0**. If **height** is set but **width** is not, the image width is adjusted based on the original aspect ratio of the image.| | backgroundImagePosition | [Position](ts-types.md#position8) \| [Alignment](ts-appendix-enums.md#alignment) | Position of the background image in the component, that is, the coordinates relative to the upper left corner of the component.
Default value:
{
x: 0,
y: 0
}
When **x** and **y** are set in percentage, the offset is calculated based on the width and height of the component.
Since API version 9, this API is supported in ArkTS widgets.| -| backgroundBlurStyle9+ | value:[BlurStyle](ts-appendix-enums.md#blurstyle9),
options10+?:[BackgroundBlurStyleOptions](#backgroundblurstyleoptions10) | Background blur style applied between the content and the background.
**value**: settings of the background blur style, including the blur radius, mask color, mask opacity, and saturation.
**options**: background blur options. Optional.
This API is supported in ArkTS widgets.| +| backgroundBlurStyle9+ | value:[BlurStyle](ts-appendix-enums.md#blurstyle9),
options10+?:[BackgroundBlurStyleOptions](#backgroundblurstyleoptions10) | Background blur style applied between the content and the background.
**value**: settings of the background blur style, including the blur radius, mask color, mask opacity, saturation, and brightness.
**options**: background blur options. Optional.
This API is supported in ArkTS widgets.| ## BackgroundBlurStyleOptions10+ @@ -22,6 +22,7 @@ You can set the background for a component. | --------------------------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | colorMode10+ | [ThemeColorMode](ts-appendix-enums.md#themecolormode10) | No | Color mode used for the background blur.
Default value: **ThemeColorMode.System**| | adaptiveColor10+ | [AdaptiveColor](ts-appendix-enums.md#adaptivecolor10) | No | Adaptive color mode.
Default value: **AdaptiveColor.Default**| +| scale10+ | number | No | Blurredness of the background material. This API is a system API.
Default value: **1.0**
Value range: [0.0, 1.0]
| ## Example @@ -109,7 +110,7 @@ struct BackgroundBlurStyleDemo { } .width('50%') .height('50%') - .backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT }) + .backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 }) .position({ x: '15%', y: '30%' }) } .height('100%') diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-click-effect.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-click-effect.md index ffcc737568abcbe244bef30a33e78248161bc8a4..cf4f1c12a7848c5a1b96211404bb8a4978a25f51 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-click-effect.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-click-effect.md @@ -9,16 +9,16 @@ You can set the click effect for a component to define how it behaves when click ### Attributes -| Name | Type | Description | -| ----------- | ------------------- | ------------------------------------------------------------ | -| clickEffect | [ClickEffect](#clickeffect) \| null | Click effect of the component.
**NOTE**
The click effect is revoked when this attribute is set to **null**.| +| Name | Type | Description | +| ----------- | ------------------------------------------- | ------------------------------------------------------------ | +| clickEffect | [ClickEffect](#clickeffect) \| null | Click effect of the component.
**NOTE**
You can remove the click effect by setting this attribute to **undefined** or **null**.
Avoid using this attribute in scenarios where the component size dynamically changes.
This attribute is not supported when the component cannot trigger a universal event.| ### ClickEffect | Name | Type | Mandatory| Description | | ----- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | -| level | [ClickEffectLevel](ts-appendix-enums.md#clickeffectlevel10) | Yes | Click effect of the component.
Default value: **ClickEffectLevel.LIGHT**| -| scale | number | No | Zoom ratio. This parameter works based on the setting of **ClickEffectLevel**.
**NOTE**
The default value of this parameter varies by the value of **level**.
- If **level** is set to **ClickEffectLevel.LIGHT**, the default value is **0.90**.
- If **level** is set to **ClickEffectLevel.MIDDLE** or **ClickEffectLevel.HEAVY**, the default value is **0.95**. | +| level | [ClickEffectLevel](ts-appendix-enums.md#clickeffectlevel10) | Yes | Click effect of the component.
**NOTE**
If **level** is set to **undefined** or **null**, the click effect corresponding to **ClickEffectLevel.LIGHT** will be used. For details about the zoom ratio, see the description of **scale**.| +| scale | number | No | Zoom ratio. This parameter works based on the setting of **ClickEffectLevel**.
**NOTE**
The default value of this parameter varies by the value of **level**.
- If **level** is set to **ClickEffectLevel.LIGHT**, the default value is **0.90**.
- If **level** is set to **ClickEffectLevel.MIDDLE** or **ClickEffectLevel.HEAVY**, the default value is **0.95**.
- If **level** is set to **undefined** or **null** (both of which evaluate to **ClickEffectLevel.LIGHT**), the default value is **0.90**.
If **scale** is set to **undefined** or **null**, the default zoom ratio for the set level will be used. | ### Example