From c1c466a72608b048441338f2342f79a0cbba4035 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Thu, 13 Apr 2023 15:18:33 +0800 Subject: [PATCH] Update doc (16384) Signed-off-by: ester.zhou --- .../reference/apis/js-apis-wallpaper.md | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-wallpaper.md b/en/application-dev/reference/apis/js-apis-wallpaper.md index 28866930fd..0563c2741b 100644 --- a/en/application-dev/reference/apis/js-apis-wallpaper.md +++ b/en/application-dev/reference/apis/js-apis-wallpaper.md @@ -26,13 +26,15 @@ Enumerates the wallpaper types. | WALLPAPER_LOCKSCREEN | 1 |Lock screen wallpaper.| -## RgbaColor9+ +## RgbaColor(deprecated) Defines the RGBA color space for the wallpaper. -**System capability**: SystemCapability.MiscServices.Wallpaper +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. -**System API**: This is a system API. +**System capability**: SystemCapability.MiscServices.Wallpaper | Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | @@ -56,13 +58,13 @@ Obtains the main color information of the wallpaper of the specified type. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** | Type| Description| | -------- | -------- | -| Array<[RgbaColor](#rgbacolor)> | Promise used to return the main color information of the wallpaper.| +| Array<[RgbaColor](#rgbacolordeprecated)> | Promise used to return the main color information of the wallpaper.| **Example** @@ -135,7 +137,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<void> | Yes| Callback used to return the result. If the wallpaper is reset, **err** is **undefined**. Otherwise, **err** is an error object.| **Example** @@ -166,7 +168,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -201,7 +203,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| URI of a JPEG or PNG file, or pixel map of a PNG file.| -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<void> | Yes| Callback used to return the result. If the wallpaper is set, **err** is **undefined**. Otherwise, **err** is an error object.| **Example** @@ -256,7 +258,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| URI of a JPEG or PNG file, or pixel map of a PNG file.| -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -311,7 +313,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses an | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | Yes| Callback used to return the result. If the operation is successful, the pixel map of the wallpaper is returned. Otherwise, error information is returned.| **Example** @@ -343,7 +345,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses a p | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -378,7 +380,7 @@ Subscribes to the wallpaper color change event. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | type | string | Yes| Type of the event to subscribe to. The value **'colorChange'** indicates subscribing to the wallpaper color change event.| -| callback | function | Yes| Callback triggered when the wallpaper color changes. The wallpaper type and main colors are returned.
- colors
Main color information of the wallpaper. For details, see [RgbaColor](#rgbacolor).
- wallpaperType
Wallpaper type.| +| callback | function | Yes| Callback triggered when the wallpaper color changes. The wallpaper type and main colors are returned.
- colors
Main color information of the wallpaper. For details, see [RgbaColor](#rgbacolordeprecated).
- wallpaperType
Wallpaper type.| **Example** @@ -410,7 +412,7 @@ Unsubscribes from the wallpaper color change event. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | type | string | Yes| Type of the event to unsubscribe from. The value **'colorChange'** indicates unsubscribing from the wallpaper color change event.| -| callback | function | No| Callback for the wallpaper color change event. If this parameter is not set, this API unsubscribes from all callbacks corresponding to **type**.
- colors
Main color information of the wallpaper. For details, see [RgbaColor](#rgbacolor).
- wallpaperType
Wallpaper type.| +| callback | function | No| Callback for the wallpaper color change event. If this parameter is not set, this API unsubscribes from all callbacks corresponding to **type**.
- colors
Main color information of the wallpaper. For details, see [RgbaColor](#rgbacolordeprecated).
- wallpaperType
Wallpaper type.| **Example** @@ -455,8 +457,8 @@ Obtains the main color information of the wallpaper of the specified type. This | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| -| callback | AsyncCallback<Array<[RgbaColor](#rgbacolor)>> | Yes| Callback used to return the main color information of the wallpaper.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| +| callback | AsyncCallback<Array<[RgbaColor](#rgbacolordeprecated)>> | Yes| Callback used to return the main color information of the wallpaper.| **Example** @@ -486,13 +488,13 @@ Obtains the main color information of the wallpaper of the specified type. This | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** | Type| Description| | -------- | -------- | -| Promise<Array<[RgbaColor](#rgbacolor)>> | Promise used to return the main color information of the wallpaper.| +| Promise<Array<[RgbaColor](#rgbacolordeprecated)>> | Promise used to return the main color information of the wallpaper.| **Example** @@ -520,7 +522,7 @@ Obtains the ID of the wallpaper of the specified type. This API uses an asynchro | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<number> | Yes| Callback used to return the wallpaper ID. If the wallpaper of the specified type is configured, a number greater than or equal to **0** is returned. Otherwise, **-1** is returned. The value ranges from -1 to (2^31-1).| **Example** @@ -551,7 +553,7 @@ Obtains the ID of the wallpaper of the specified type. This API uses a promise t | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -819,7 +821,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<void> | Yes| Callback used to return the result. If the wallpaper is reset, **err** is **undefined**. Otherwise, **err** is an error object.| **Example** @@ -852,7 +854,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -889,7 +891,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| URI of a JPEG or PNG file, or pixel map of a PNG file.| -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<void> | Yes| Callback used to return the result. If the wallpaper is set, **err** is **undefined**. Otherwise, **err** is an error object.| **Example** @@ -946,7 +948,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| URI of a JPEG or PNG file, or pixel map of a PNG file.| -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -1004,7 +1006,7 @@ Obtains the wallpaper of the specified type. This API uses an asynchronous callb | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<number> | Yes| Callback used to return the result. If the operation is successful, the file descriptor ID to the wallpaper is returned. Otherwise, error information is returned.| **Example** @@ -1037,7 +1039,7 @@ Obtains the wallpaper of the specified type. This API uses a promise to return t | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** @@ -1075,7 +1077,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses an | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| | callback | AsyncCallback<image.PixelMap> | Yes| Callback used to return the result. If the operation is successful, the pixel map of the wallpaper is returned. Otherwise, error information is returned.| **Example** @@ -1110,7 +1112,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses a p | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| wallpaperType | [WallpaperType](#wallpapertype) | Yes| Wallpaper type.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| **Return value** -- GitLab