• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit BasicServicesKit
19 */
20
21import {AsyncCallback} from './@ohos.base';
22import image from './@ohos.multimedia.image';
23
24/**
25 * System wallpaper
26 *
27 * @namespace wallpaper
28 * @syscap SystemCapability.MiscServices.Wallpaper
29 * @since 7
30 */
31declare namespace wallpaper {
32  /**
33   * RgbaColor definition
34   *
35   * @typedef RgbaColor
36   * @syscap SystemCapability.MiscServices.Wallpaper
37   * @since 7
38   * @deprecated since 9
39   */
40  interface RgbaColor {
41    /**
42     * The range is 0 to 255.
43     *
44     * @syscap SystemCapability.MiscServices.Wallpaper
45     * @since 7
46     * @deprecated since 9
47     */
48    red: number;
49    /**
50     * The range is 0 to 255.
51     *
52     * @syscap SystemCapability.MiscServices.Wallpaper
53     * @since 7
54     * @deprecated since 9
55     */
56    green: number;
57    /**
58     * The range is 0 to 255.
59     *
60     * @syscap SystemCapability.MiscServices.Wallpaper
61     * @since 7
62     * @deprecated since 9
63     */
64    blue: number;
65    /**
66     * The range is 0 to 255.
67     *
68     * @syscap SystemCapability.MiscServices.Wallpaper
69     * @since 7
70     * @deprecated since 9
71     */
72    alpha: number;
73  }
74
75  /**
76   * Indicates wallpaper type.
77   *
78   * @enum { number } WallpaperType
79   * @syscap SystemCapability.MiscServices.Wallpaper
80   * @since 7
81   */
82  enum WallpaperType {
83    /**
84     * Indicates the home screen wallpaper.
85     *
86     * @syscap SystemCapability.MiscServices.Wallpaper
87     * @since 7
88     */
89    WALLPAPER_SYSTEM,
90    /**
91     * Indicates the lock screen wallpaper.
92     *
93     * @syscap SystemCapability.MiscServices.Wallpaper
94     * @since 7
95     */
96    WALLPAPER_LOCKSCREEN
97  }
98
99  /**
100   * Indicates the resource type of the wallpaper.
101   *
102   * @enum { number } WallpaperResourceType
103   * @syscap SystemCapability.MiscServices.Wallpaper
104   * @systemapi Hide this for inner system use.
105   * @since 10
106   */
107  enum WallpaperResourceType {
108    /**
109     * Indicates the default wallpaper resource.
110     *
111     * @syscap SystemCapability.MiscServices.Wallpaper
112     * @systemapi Hide this for inner system use.
113     * @since 10
114     */
115    DEFAULT,
116    /**
117     * Indicates the picture wallpaper resource.
118     *
119     * @syscap SystemCapability.MiscServices.Wallpaper
120     * @systemapi Hide this for inner system use.
121     * @since 10
122     */
123    PICTURE,
124    /**
125     * Indicates the video wallpaper resource.
126     *
127     * @syscap SystemCapability.MiscServices.Wallpaper
128     * @systemapi Hide this for inner system use.
129     * @since 10
130     */
131    VIDEO,
132    /**
133     * Indicates the package wallpaper resource.
134     *
135     * @syscap SystemCapability.MiscServices.Wallpaper
136     * @systemapi Hide this for inner system use.
137     * @since 10
138     */
139    PACKAGE
140  }
141
142  /**
143   * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
144   *
145   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
146   * @param { AsyncCallback<Array<RgbaColor>> } callback - the callback of getColors.
147   * @syscap SystemCapability.MiscServices.Wallpaper
148   * @since 7
149   * @deprecated since 9
150   */
151  function getColors(wallpaperType: WallpaperType, callback: AsyncCallback<Array<RgbaColor>>): void;
152
153  /**
154   * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
155   *
156   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
157   * @returns { Promise<Array<RgbaColor>> } the promise returned by the function.
158   * @syscap SystemCapability.MiscServices.Wallpaper
159   * @since 7
160   * @deprecated since 9
161   */
162  function getColors(wallpaperType: WallpaperType): Promise<Array<RgbaColor>>;
163
164  /**
165   * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
166   *
167   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
168   * @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
169   * @throws { BusinessError } 401 - parameter error.
170   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
171   * @syscap SystemCapability.MiscServices.Wallpaper
172   * @systemapi Hide this for inner system use.
173   * @since 9
174   */
175  function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
176
177  /**
178   * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID.
179   * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1.
180   *
181   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
182   * @param { AsyncCallback<number> } callback - the callback of getId.
183   * @syscap SystemCapability.MiscServices.Wallpaper
184   * @since 7
185   * @deprecated since 9
186   */
187  function getId(wallpaperType: WallpaperType, callback: AsyncCallback<number>): void;
188
189  /**
190   * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID.
191   * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1.
192   *
193   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
194   * @returns { Promise<number> } the promise returned by the function.
195   * @syscap SystemCapability.MiscServices.Wallpaper
196   * @since 7
197   * @deprecated since 9
198   */
199  function getId(wallpaperType: WallpaperType): Promise<number>;
200
201  /**
202   * Obtains a file of the wallpaper of the specified type. Returns the file descriptor.
203   * When usage is complete, the caller needs to close the file descriptor in time.
204   *
205   * @permission ohos.permission.GET_WALLPAPER
206   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
207   * @param { AsyncCallback<number> } callback - the callback of getFile.
208   * @syscap SystemCapability.MiscServices.Wallpaper
209   * @since 8
210   * @deprecated since 9
211   */
212  function getFile(wallpaperType: WallpaperType, callback: AsyncCallback<number>): void;
213
214  /**
215   * Obtains a file of the wallpaper of the specified type. Returns the file descriptor.
216   * When usage is complete, the caller needs to close the file descriptor in time.
217   *
218   * @permission ohos.permission.GET_WALLPAPER
219   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
220   * @returns { Promise<number> } the promise returned by the function.
221   * @syscap SystemCapability.MiscServices.Wallpaper
222   * @since 8
223   * @deprecated since 9
224   */
225  function getFile(wallpaperType: WallpaperType): Promise<number>;
226
227  /**
228   * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
229   *
230   * @param { AsyncCallback<number> } callback - the callback of getMinHeight.
231   * @syscap SystemCapability.MiscServices.Wallpaper
232   * @since 7
233   * @deprecated since 9
234   */
235  function getMinHeight(callback: AsyncCallback<number>): void;
236
237  /**
238   * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
239   *
240   * @returns { Promise<number> } the promise returned by the function.
241   * @syscap SystemCapability.MiscServices.Wallpaper
242   * @since 7
243   * @deprecated since 9
244   */
245  function getMinHeight(): Promise<number>;
246
247  /**
248   * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
249   *
250   * @returns { number } the number returned by the function.
251   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
252   * @syscap SystemCapability.MiscServices.Wallpaper
253   * @systemapi Hide this for inner system use.
254   * @since 9
255   */
256  function getMinHeightSync(): number;
257
258  /**
259   * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
260   *
261   * @param { AsyncCallback<number> } callback - the callback of getMinWidth.
262   * @syscap SystemCapability.MiscServices.Wallpaper
263   * @since 7
264   * @deprecated since 9
265   */
266  function getMinWidth(callback: AsyncCallback<number>): void;
267
268  /**
269   * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
270   *
271   * @returns { Promise<number> } the promise returned by the function.
272   * @syscap SystemCapability.MiscServices.Wallpaper
273   * @since 7
274   * @deprecated since 9
275   */
276  function getMinWidth(): Promise<number>;
277
278  /**
279   * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
280   *
281   * @returns { number } the number returned by the function.
282   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
283   * @syscap SystemCapability.MiscServices.Wallpaper
284   * @systemapi Hide this for inner system use.
285   * @since 9
286   */
287  function getMinWidthSync(): number;
288
289  /**
290   * Checks whether to allow the application to change the wallpaper for the current user.
291   * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise.
292   *
293   * @param { AsyncCallback<boolean> } callback - the callback of isChangePermitted.
294   * @syscap SystemCapability.MiscServices.Wallpaper
295   * @since 7
296   * @deprecated since 9
297   */
298  function isChangePermitted(callback: AsyncCallback<boolean>): void;
299
300  /**
301   * Checks whether to allow the application to change the wallpaper for the current user.
302   * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise.
303   *
304   * @returns { Promise<boolean> } the promise returned by the function.
305   * @syscap SystemCapability.MiscServices.Wallpaper
306   * @since 7
307   * @deprecated since 9
308   */
309  function isChangePermitted(): Promise<boolean>;
310
311  /**
312   * Checks whether a user is allowed to set wallpapers.
313   * Returns true if a user is allowed to set wallpapers. returns false otherwise.
314   *
315   * @param { AsyncCallback<boolean> } callback - the callback of isOperationAllowed.
316   * @syscap SystemCapability.MiscServices.Wallpaper
317   * @since 7
318   * @deprecated since 9
319   */
320  function isOperationAllowed(callback: AsyncCallback<boolean>): void;
321
322  /**
323   * Checks whether a user is allowed to set wallpapers.
324   * Returns true if a user is allowed to set wallpapers. returns false otherwise.
325   *
326   * @returns { Promise<boolean> } the promise returned by the function.
327   * @syscap SystemCapability.MiscServices.Wallpaper
328   * @since 7
329   * @deprecated since 9
330   */
331  function isOperationAllowed(): Promise<boolean>;
332
333  /**
334   * Removes a wallpaper of the specified type and restores the default one.
335   *
336   * @permission ohos.permission.SET_WALLPAPER
337   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
338   * @param { AsyncCallback<void> } callback - the callback of reset.
339   * @syscap SystemCapability.MiscServices.Wallpaper
340   * @since 7
341   * @deprecated since 9
342   */
343  function reset(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
344
345  /**
346   * Removes a wallpaper of the specified type and restores the default one.
347   *
348   * @permission ohos.permission.SET_WALLPAPER
349   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
350   * @returns { Promise<void> } the promise returned by the function.
351   * @syscap SystemCapability.MiscServices.Wallpaper
352   * @since 7
353   * @deprecated since 9
354   */
355  function reset(wallpaperType: WallpaperType): Promise<void>;
356
357  /**
358   * Removes a wallpaper of the specified type and restores the default one.
359   *
360   * @permission ohos.permission.SET_WALLPAPER
361   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
362   * @param { AsyncCallback<void> } callback - the callback of restore.
363   * @throws { BusinessError } 401 - parameter error.
364   * @throws { BusinessError } 201 - permission denied.
365   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
366   * @syscap SystemCapability.MiscServices.Wallpaper
367   * @systemapi Hide this for inner system use.
368   * @since 9
369   */
370  function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
371
372  /**
373   * Removes a wallpaper of the specified type and restores the default one.
374   *
375   * @permission ohos.permission.SET_WALLPAPER
376   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
377   * @returns { Promise<void> } the promise returned by the function.
378   * @throws { BusinessError } 401 - parameter error.
379   * @throws { BusinessError } 201 - permission denied.
380   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
381   * @syscap SystemCapability.MiscServices.Wallpaper
382   * @systemapi Hide this for inner system use.
383   * @since 9
384   */
385  function restore(wallpaperType: WallpaperType): Promise<void>;
386
387  /**
388   * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
389   *
390   * @permission ohos.permission.SET_WALLPAPER
391   * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
392   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
393   * @param { AsyncCallback<void> } callback - the callback of setWallpaper.
394   * @syscap SystemCapability.MiscServices.Wallpaper
395   * @since 7
396   * @deprecated since 9
397   */
398  function setWallpaper(
399    source: string | image.PixelMap,
400    wallpaperType: WallpaperType,
401    callback: AsyncCallback<void>
402  ): void;
403
404  /**
405   * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
406   *
407   * @permission ohos.permission.SET_WALLPAPER
408   * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
409   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
410   * @returns { Promise<void> } the promise returned by the function.
411   * @syscap SystemCapability.MiscServices.Wallpaper
412   * @since 7
413   * @deprecated since 9
414   */
415  function setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
416
417  /**
418   * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
419   *
420   * @permission ohos.permission.SET_WALLPAPER
421   * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
422   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
423   * @param { AsyncCallback<void> } callback - the callback of setImage.
424   * @throws { BusinessError } 401 - parameter error.
425   * @throws { BusinessError } 201 - permission denied.
426   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
427   * @syscap SystemCapability.MiscServices.Wallpaper
428   * @systemapi Hide this for inner system use.
429   * @since 9
430   */
431  function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
432
433  /**
434   * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
435   *
436   * @permission ohos.permission.SET_WALLPAPER
437   * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
438   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
439   * @returns { Promise<void> } the promise returned by the function.
440   * @throws { BusinessError } 401 - parameter error.
441   * @throws { BusinessError } 201 - permission denied.
442   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
443   * @syscap SystemCapability.MiscServices.Wallpaper
444   * @systemapi Hide this for inner system use.
445   * @since 9
446   */
447  function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
448
449  /**
450   * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map.
451   *
452   * @permission ohos.permission.GET_WALLPAPER
453   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
454   * @param { AsyncCallback<image.PixelMap> } callback - the callback of getPixelMap.
455   * @syscap SystemCapability.MiscServices.Wallpaper
456   * @systemapi Hide this for inner system use.
457   * @since 7
458   * @deprecated since 9
459   */
460  function getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback<image.PixelMap>): void;
461
462  /**
463   * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map.
464   *
465   * @permission ohos.permission.GET_WALLPAPER
466   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
467   * @returns { Promise<image.PixelMap> } the promise returned by the function.
468   * @syscap SystemCapability.MiscServices.Wallpaper
469   * @systemapi Hide this for inner system use.
470   * @since 7
471   * @deprecated since 9
472   */
473  function getPixelMap(wallpaperType: WallpaperType): Promise<image.PixelMap>;
474
475  /**
476   * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map.
477   * Only the static wallpaper set by using setImage can be obtained.
478   * @permission ohos.permission.GET_WALLPAPER
479   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
480   * @param { AsyncCallback<image.PixelMap> } callback - the callback of getImage.
481   * @throws { BusinessError } 401 - parameter error.
482   * @throws { BusinessError } 201 - permission denied.
483   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
484   * @syscap SystemCapability.MiscServices.Wallpaper
485   * @systemapi Hide this for inner system use.
486   * @since 9
487   */
488  function getImage(wallpaperType: WallpaperType, callback: AsyncCallback<image.PixelMap>): void;
489
490  /**
491   * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map.
492   * Only the static wallpaper set by using setImage can be obtained.
493   * @permission ohos.permission.GET_WALLPAPER
494   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
495   * @returns { Promise<image.PixelMap> } the promise returned by the function.
496   * @throws { BusinessError } 401 - parameter error.
497   * @throws { BusinessError } 201 - permission denied.
498   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
499   * @syscap SystemCapability.MiscServices.Wallpaper
500   * @systemapi Hide this for inner system use.
501   * @since 9
502   */
503  function getImage(wallpaperType: WallpaperType): Promise<image.PixelMap>;
504
505  /**
506   * Sets live wallpaper of the specified type based on the uri path of the MP4 file.
507   *
508   * @permission ohos.permission.SET_WALLPAPER
509   * @param { string } source - indicates the uri path of the MP4 file.
510   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
511   * @param { AsyncCallback<void> } callback - the callback of setVideo.
512   * @throws { BusinessError } 401 - parameter error.
513   * @throws { BusinessError } 201 - permission denied.
514   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
515   * @syscap SystemCapability.MiscServices.Wallpaper
516   * @systemapi Hide this for inner system use.
517   * @since 10
518   */
519  function setVideo(source: string, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
520
521  /**
522   * Sets live wallpaper of the specified type based on the uri path of the MP4 file.
523   *
524   * @permission ohos.permission.SET_WALLPAPER
525   * @param { string } source - indicates the uri path of the MP4 file.
526   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
527   * @returns { Promise<void> } the promise returned by the function.
528   * @throws { BusinessError } 401 - parameter error.
529   * @throws { BusinessError } 201 - permission denied.
530   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
531   * @syscap SystemCapability.MiscServices.Wallpaper
532   * @systemapi Hide this for inner system use.
533   * @since 10
534   */
535  function setVideo(source: string, wallpaperType: WallpaperType): Promise<void>;
536
537  /**
538   * Sets wallpaper of the specified type based on the uri path of the custom wallpaper.
539   *
540   * @permission ohos.permission.SET_WALLPAPER
541   * @param { string } source - indicates the uri path of the custom wallpaper.
542   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
543   * @param { AsyncCallback<void> } callback - the callback of setCustomWallpaper.
544   * @throws { BusinessError } 401 - parameter error.
545   * @throws { BusinessError } 201 - permission denied.
546   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
547   * @syscap SystemCapability.MiscServices.Wallpaper
548   * @systemapi Hide this for inner system use.
549   * @since 10
550   */
551  function setCustomWallpaper(source: string, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
552
553  /**
554   * Sets wallpaper of the specified type based on the uri path of the custom wallpaper.
555   *
556   * @permission ohos.permission.SET_WALLPAPER
557   * @param { string } source - indicates the uri path of the custom wallpaper.
558   * @param { WallpaperType } wallpaperType - indicates the wallpaper type.
559   * @returns { Promise<void> } the promise returned by the function.
560   * @throws { BusinessError } 401 - parameter error.
561   * @throws { BusinessError } 201 - permission denied.
562   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
563   * @syscap SystemCapability.MiscServices.Wallpaper
564   * @systemapi Hide this for inner system use.
565   * @since 10
566   */
567  function setCustomWallpaper(source: string, wallpaperType: WallpaperType): Promise<void>;
568
569  /**
570   * Registers a listener for wallpaper color changes to receive notifications about the changes.
571   *
572   * @param { 'colorChange' } type - the incoming colorChange table open receiver pick a color change wallpaper wallpaper color changes.
573   * @param { function } callback - provides dominant colors of the wallpaper.
574   * @syscap SystemCapability.MiscServices.Wallpaper
575   * @since 7
576   * @deprecated since 9
577   */
578  function on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
579
580  /**
581   * Registers a listener for wallpaper changes to receive notifications about the changes.
582   *
583   * @param { 'wallpaperChange' } type - the incoming wallpaperChange table open receiver when the user modifies the wallpaper settings.
584   * @param { function } callback - wallpaperType indicates the wallpaper type.
585   * resourceType indicates the resource type of the wallpaper.
586   * uri indicates the wallpaper resource address.
587   * @throws { BusinessError } 401 - parameter error.
588   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
589   * @syscap SystemCapability.MiscServices.Wallpaper
590   * @systemapi Hide this for inner system use.
591   * @since 10
592   */
593  function on(
594    type: 'wallpaperChange',
595    callback: (wallpaperType: WallpaperType, resourceType: WallpaperResourceType, uri?: string) => void
596  ): void;
597
598  /**
599   * Unregisters a listener for wallpaper color changes.
600   *
601   * @param { 'colorChange' } type - incoming colorChange table delete receiver to pick up a color change wallpaper wallpaper color changes
602   * @param { function } callback - provides dominant colors of the wallpaper.
603   * @syscap SystemCapability.MiscServices.Wallpaper
604   * @since 7
605   * @deprecated since 9
606   */
607  function off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
608
609  /**
610   * Unregisters a listener for wallpaper changes.
611   *
612   * @param { 'wallpaperChange' } type - the incoming wallpaperChange table delete receiver when the user modifies the wallpaper settings.
613   * @param { function } callback - wallpaperType indicates the wallpaper type.
614   * resourceType indicates the resource type of the wallpaper.
615   * uri indicates the wallpaper resource address.
616   * @throws { BusinessError } 401 - parameter error.
617   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
618   * @syscap SystemCapability.MiscServices.Wallpaper
619   * @systemapi Hide this for inner system use.
620   * @since 10
621   */
622  function off(
623    type: 'wallpaperChange',
624    callback?: (wallpaperType: WallpaperType, resourceType: WallpaperResourceType, uri?: string) => void
625  ): void;
626}
627
628export default wallpaper;
629