From a82d0d8f3008cf2afbc29aa93a79c7649f243bee Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Fri, 15 Aug 2025 18:25:10 +0800 Subject: [PATCH] wallpaper 1.2 Signed-off-by: qianyong325 --- api/@ohos.WallpaperExtensionAbility.d.ts | 16 ++- api/@ohos.wallpaper.d.ts | 155 ++++++++++++++--------- 2 files changed, 108 insertions(+), 63 deletions(-) diff --git a/api/@ohos.WallpaperExtensionAbility.d.ts b/api/@ohos.WallpaperExtensionAbility.d.ts index 463fb536a1..8e10faf64d 100644 --- a/api/@ohos.WallpaperExtensionAbility.d.ts +++ b/api/@ohos.WallpaperExtensionAbility.d.ts @@ -24,7 +24,8 @@ * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ declare class WallpaperExtensionAbility { /** @@ -34,20 +35,22 @@ declare class WallpaperExtensionAbility { * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onCreate(want: object): void; /** * The onWallpaperChange callback is triggered when the user modifies the wallpaper settings. * - * @param { number } wallpaperType - Indicates the wallpaper type. + * @param { int } wallpaperType - Indicates the wallpaper type. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - onWallpaperChange(wallpaperType: number): void; + onWallpaperChange(wallpaperType: int): void; /** * Called once to destroy the extension ability. @@ -55,7 +58,8 @@ declare class WallpaperExtensionAbility { * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onDestroy(): void; } diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index 300cd16ce5..6803e3b64c 100644 --- a/api/@ohos.wallpaper.d.ts +++ b/api/@ohos.wallpaper.d.ts @@ -34,68 +34,76 @@ declare namespace wallpaper { * * @typedef RgbaColor * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 * @deprecated since 9 */ interface RgbaColor { /** * The range is 0 to 255. * - * @type { number } + * @type { long } * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 * @deprecated since 9 */ - red: number; + red: long; /** * The range is 0 to 255. * - * @type { number } + * @type { long } * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 * @deprecated since 9 */ - green: number; + green: long; /** * The range is 0 to 255. * - * @type { number } + * @type { long } * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 * @deprecated since 9 */ - blue: number; + blue: long; /** * The range is 0 to 255. * - * @type { number } + * @type { long } * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 * @deprecated since 9 */ - alpha: number; + alpha: long; } /** * Indicates wallpaper type. * - * @enum { number } WallpaperType + * @enum { int } WallpaperType * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ enum WallpaperType { /** * Indicates the home screen wallpaper. * * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ WALLPAPER_SYSTEM, /** * Indicates the lock screen wallpaper. * * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ WALLPAPER_LOCKSCREEN } @@ -106,7 +114,8 @@ declare namespace wallpaper { * @typedef WallpaperInfo * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ interface WallpaperInfo { /** @@ -115,7 +124,8 @@ declare namespace wallpaper { * @type { FoldState } * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ foldState: FoldState; /** @@ -124,7 +134,8 @@ declare namespace wallpaper { * @type { RotateState } * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ rotateState: RotateState; /** @@ -133,7 +144,8 @@ declare namespace wallpaper { * @type { string } * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ source: string; } @@ -141,10 +153,11 @@ declare namespace wallpaper { /** * Define the folding state of wallpaper * - * @enum { number } FoldState + * @enum { int } FoldState * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ enum FoldState { /** @@ -152,7 +165,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ NORMAL = 0, /** @@ -160,7 +174,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ UNFOLD_ONCE_STATE = 1, /** @@ -168,7 +183,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ UNFOLD_TWICE_STATE = 2 } @@ -176,10 +192,11 @@ declare namespace wallpaper { /** * Define the rotation state of wallpaper * - * @enum { number } RotateState + * @enum { int } RotateState * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ enum RotateState { /** @@ -187,7 +204,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ PORTRAIT = 0, /** @@ -195,7 +213,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ LANDSCAPE = 1 } @@ -203,10 +222,11 @@ declare namespace wallpaper { /** * Indicates the resource type of the wallpaper. * - * @enum { number } WallpaperResourceType + * @enum { int } WallpaperResourceType * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ enum WallpaperResourceType { /** @@ -214,7 +234,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ DEFAULT, /** @@ -222,7 +243,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ PICTURE, /** @@ -230,7 +252,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ VIDEO, /** @@ -238,7 +261,8 @@ declare namespace wallpaper { * * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ PACKAGE } @@ -275,7 +299,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getColorsSync(wallpaperType: WallpaperType): Array; @@ -352,13 +377,14 @@ declare namespace wallpaper { /** * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. * - * @returns { number } the number returned by the function. + * @returns { int } the number returned by the function. * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getMinHeightSync(): number; + function getMinHeightSync(): int; /** * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. @@ -383,13 +409,14 @@ declare namespace wallpaper { /** * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. * - * @returns { number } the number returned by the function. + * @returns { int } the number returned by the function. * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getMinWidthSync(): number; + function getMinWidthSync(): int; /** * Checks whether to allow the application to change the wallpaper for the current user. @@ -471,7 +498,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; @@ -487,7 +515,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function restore(wallpaperType: WallpaperType): Promise; @@ -534,7 +563,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; @@ -551,7 +581,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; @@ -593,7 +624,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getImage(wallpaperType: WallpaperType, callback: AsyncCallback): void; @@ -609,7 +641,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getImage(wallpaperType: WallpaperType): Promise; @@ -626,7 +659,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function setVideo(source: string, wallpaperType: WallpaperType, callback: AsyncCallback): void; @@ -643,7 +677,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function setVideo(source: string, wallpaperType: WallpaperType): Promise; @@ -660,7 +695,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ function setCustomWallpaper(source: string, wallpaperType: WallpaperType, callback: AsyncCallback): void; @@ -677,7 +713,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ function setCustomWallpaper(source: string, wallpaperType: WallpaperType): Promise; @@ -704,7 +741,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function on( type: 'wallpaperChange', @@ -734,7 +772,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function off( type: 'wallpaperChange', @@ -757,7 +796,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ function setAllWallpapers(wallpaperInfos: Array, wallpaperType: WallpaperType): Promise; @@ -778,7 +818,8 @@ declare namespace wallpaper { * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.Wallpaper * @systemapi Hide this for inner system use. - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ function getWallpaperByState(wallpaperType: WallpaperType, foldState: FoldState, rotateState: RotateState): Promise; } -- Gitee