diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index 5573e454c5281105c379cbd5f4dbc62048ed0d54..24ace0e1b462cd71f9de909dff95fd40e2d33da8 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -62,7 +62,7 @@ declare namespace screen { * * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string * type and cannot be empty. - * @param { Callback } callback Callback used to return the screen ID. This parameter is callable. + * @param { Callback } callback Callback used to return the screen ID. This parameter is callable. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -71,14 +71,14 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback): void; + function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback): void; /** * Unregister the callback for screen changes. * * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string * type and cannot be empty. - * @param { Callback } callback Callback used to return the screen ID. If this parameter is specified, it must + * @param { Callback } callback Callback used to return the screen ID. If this parameter is specified, it must * be a callback. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -88,14 +88,14 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback): void; + function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback): void; /** * Make screens as expand-screen * * @param { Array } options Parameters for expanding the screen. The options must be valid, and make * sure it's type of Array. - * @param { AsyncCallback } callback callback used to return the group ID of the expanded screens. It must + * @param { AsyncCallback } callback callback used to return the group ID of the expanded screens. It must * be a callback. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -105,14 +105,14 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function makeExpand(options: Array, callback: AsyncCallback): void; + function makeExpand(options: Array, callback: AsyncCallback): void; /** * Make screens as expand-screen * * @param { Array } options Parameters for expanding the screen. The options must be valid, and make * sure it's type of Array. - * @returns { Promise } used to return the group ID of the expanded screens + * @returns { Promise } used to return the group ID of the expanded screens * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -121,12 +121,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function makeExpand(options: Array): Promise; + function makeExpand(options: Array): Promise; /** * Stop expand screens * - * @param { Array } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not + * @param { Array } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not * exceed 1000. * @param { AsyncCallback } callback used to return the result * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -137,12 +137,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 10 */ - function stopExpand(expandScreen: Array, callback: AsyncCallback): void; + function stopExpand(expandScreen: Array, callback: AsyncCallback): void; /** * Stop expand screens * - * @param { Array } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not + * @param { Array } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not * exceed 1000. * @returns { Promise } promise used to return the result * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -153,14 +153,14 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 10 */ - function stopExpand(expandScreen: Array): Promise; + function stopExpand(expandScreen: Array): Promise; /** * Make screens as mirror-screen * - * @param { number } mainScreen ID of the primary screen. It's type should be int. - * @param { Array } mirrorScreen IDs of secondary screens - * @param { AsyncCallback } callback Callback used to return the group ID of the secondary screens + * @param { long } mainScreen ID of the primary screen. It's type should be int. + * @param { Array } mirrorScreen IDs of secondary screens + * @param { AsyncCallback } callback Callback used to return the group ID of the secondary screens * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -170,14 +170,14 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function makeMirror(mainScreen: number, mirrorScreen: Array, callback: AsyncCallback): void; + function makeMirror(mainScreen: long, mirrorScreen: Array, callback: AsyncCallback): void; /** * Make screens as mirror-screen * - * @param { number } mainScreen ID of the primary screen. It's type should be int. - * @param { Array } mirrorScreen IDs of secondary screens - * @returns { Promise } Promise used to return the group ID of the secondary screens + * @param { long } mainScreen ID of the primary screen. It's type should be int. + * @param { Array } mirrorScreen IDs of secondary screens + * @returns { Promise } Promise used to return the group ID of the secondary screens * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -187,27 +187,27 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function makeMirror(mainScreen: number, mirrorScreen: Array): Promise; + function makeMirror(mainScreen: long, mirrorScreen: Array): Promise; /** * Make screens as mirror-screen * - * @param { number } mainScreen ID of the primary screen. It's type should be int. - * @param { Array } mirrorScreen IDs of secondary screens + * @param { long } mainScreen ID of the primary screen. It's type should be int. + * @param { Array } mirrorScreen IDs of secondary screens * @param { Rect } mainScreenRegion mirror screen region - * @returns { Promise } Promise used to return the group ID of the secondary screens + * @returns { Promise } Promise used to return the group ID of the secondary screens * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 1400001 - Invalid display or screen. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 19 */ - function makeMirrorWithRegion(mainScreen: number, mirrorScreen: Array, mainScreenRegion: Rect): Promise; + function makeMirrorWithRegion(mainScreen: long, mirrorScreen: Array, mainScreenRegion: Rect): Promise; /** * Stop mirror screens * - * @param { Array } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not + * @param { Array } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not * exceed 1000. * @param { AsyncCallback } callback used to return the result * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -218,12 +218,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 10 */ - function stopMirror(mirrorScreen: Array, callback: AsyncCallback): void; + function stopMirror(mirrorScreen: Array, callback: AsyncCallback): void; /** * Stop mirror screens * - * @param { Array } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not + * @param { Array } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not * exceed 1000. * @returns { Promise } promise used to return the result * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -234,13 +234,13 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 10 */ - function stopMirror(mirrorScreen: Array): Promise; + function stopMirror(mirrorScreen: Array): Promise; /** * Make screens as unique-screen * - * @param { Array } uniqueScreen IDs of the unique screens. It's type should be int. - * @returns { Promise> } Promise used to return the display IDs of unique screens. + * @param { Array } uniqueScreen IDs of the unique screens. It's type should be int. + * @returns { Promise> } Promise used to return the display IDs of unique screens. * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. 3. Parameter verification failed. @@ -251,7 +251,7 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 18 */ - function makeUnique(uniqueScreen: Array): Promise>; + function makeUnique(uniqueScreen: Array): Promise>; /** * Create virtual screen. if surfaceId is valid, this permission is necessary. @@ -290,7 +290,7 @@ declare namespace screen { /** * Destroy virtual screen. * - * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { long } screenId Indicates the screen id of the virtual screen. * @param { AsyncCallback } callback Callback used to return the result. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -300,12 +300,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function destroyVirtualScreen(screenId: number, callback: AsyncCallback): void; + function destroyVirtualScreen(screenId: long, callback: AsyncCallback): void; /** * Destroy virtual screen. * - * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { long } screenId Indicates the screen id of the virtual screen. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -315,13 +315,13 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function destroyVirtualScreen(screenId: number): Promise; + function destroyVirtualScreen(screenId: long): Promise; /** * Set surface for the virtual screen. * * @permission ohos.permission.CAPTURE_SCREEN - * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { long } screenId Indicates the screen id of the virtual screen. * @param { string } surfaceId Indicates the surface id. * @param { AsyncCallback } callback Callback used to return the result * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -333,13 +333,13 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function setVirtualScreenSurface(screenId: number, surfaceId: string, callback: AsyncCallback): void; + function setVirtualScreenSurface(screenId: long, surfaceId: string, callback: AsyncCallback): void; /** * Set surface for the virtual screen. * * @permission ohos.permission.CAPTURE_SCREEN - * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { long } screenId Indicates the screen id of the virtual screen. * @param { string } surfaceId Indicates the surface id. * @returns { Promise } Promise that returns no value * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -351,12 +351,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise; + function setVirtualScreenSurface(screenId: long, surfaceId: string): Promise; /** * Set privacy mask image for the screen. * - * @param { number } screenId Indicates the screen id of the screen. + * @param { long } screenId Indicates the screen id of the screen. * @param { image.PixelMap } image Indicates the privacy mask image. This parameter is optional. If not provided, * the mask image will be cleared; * @returns { Promise } Promise that returns no value @@ -370,7 +370,7 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 19 */ - function setScreenPrivacyMaskImage(screenId: number, image?: image.PixelMap): Promise; + function setScreenPrivacyMaskImage(screenId: long, image?: image.PixelMap): Promise; /** * Get screen rotation lock status. @@ -425,8 +425,8 @@ declare namespace screen { /** * Set multi screen mode(mirror/extend). * - * @param { number } primaryScreenId - primary screen id. - * @param { number } secondaryScreenId - secondary screen id. + * @param { long } primaryScreenId - primary screen id. + * @param { long } secondaryScreenId - secondary screen id. * @param { MultiScreenMode } secondaryScreenMode - secondary screen mode. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. @@ -437,7 +437,7 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 13 */ - function setMultiScreenMode(primaryScreenId: number, secondaryScreenId: number, + function setMultiScreenMode(primaryScreenId: long, secondaryScreenId: long, secondaryScreenMode: MultiScreenMode): Promise; /** @@ -498,32 +498,32 @@ declare namespace screen { /** * Screen id * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 13 */ - id: number; + id: long; /** * The start coordinate X of the screen origin * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 13 */ - startX: number; + startX: long; /** * The start coordinate Y of the screen origin * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 13 */ - startY: number; + startY: long; } /** @@ -538,32 +538,32 @@ declare namespace screen { /** * Screen id * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - screenId: number; + screenId: long; /** * The start coordinate X of the screen origin * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - startX: number; + startX: long; /** * The start coordinate Y of the screen origin * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - startY: number; + startY: long; } /** @@ -588,32 +588,32 @@ declare namespace screen { /** * Indicates the width of the virtual screen. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - width: number; + width: long; /** * Indicates the height of the virtual screen. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - height: number; + height: long; /** * Indicates the density of the virtual screen. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ - density: number; + density: double; /** * Indicates the surface id of the virtual screen. @@ -690,26 +690,26 @@ declare namespace screen { /** * Screen id * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - readonly id: number; + readonly id: long; /** * Group id * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - readonly parent: number; + readonly parent: long; /** * Mode supported by the screen @@ -726,14 +726,14 @@ declare namespace screen { /** * Currently active mode * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - readonly activeModeIndex: number; + readonly activeModeIndex: long; /** * Orientation of the screen @@ -804,7 +804,7 @@ declare namespace screen { /** * Set the active mode of the screen. * - * @param { number } modeIndex Index of the mode to set. + * @param { long } modeIndex Index of the mode to set. * @param { AsyncCallback } callback Callback used to return the result. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -814,12 +814,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - setScreenActiveMode(modeIndex: number, callback: AsyncCallback): void; + setScreenActiveMode(modeIndex: long, callback: AsyncCallback): void; /** * Sets the active mode of the screen. * - * @param { number } modeIndex Index of the mode to set. + * @param { long } modeIndex Index of the mode to set. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -829,12 +829,12 @@ declare namespace screen { * @systemapi Hide this for inner system use. * @since 9 */ - setScreenActiveMode(modeIndex: number): Promise; + setScreenActiveMode(modeIndex: long): Promise; /** * Set display density of the screen * - * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. + * @param { long } densityDpi Pixel density. The value ranges from 80 to 640. * @param { AsyncCallback } callback Callback used to return the result. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -845,12 +845,12 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - setDensityDpi(densityDpi: number, callback: AsyncCallback): void; + setDensityDpi(densityDpi: long, callback: AsyncCallback): void; /** * Set display density of the screen * - * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. + * @param { long } densityDpi Pixel density. The value ranges from 80 to 640. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -861,7 +861,7 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - setDensityDpi(densityDpi: number): Promise; + setDensityDpi(densityDpi: long): Promise; } /** @@ -938,46 +938,46 @@ declare namespace screen { /** * Mode id * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - id: number; + id: long; /** * Indicates the width of the screen * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: long; /** * Indicates the height of the screen * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: long; /** * Indicates the refreshRate of the screen * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - refreshRate: number; + refreshRate: long; } /** @@ -992,42 +992,42 @@ declare namespace screen { /** * The X-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 19 */ - left: number; + left: long; /** * The Y-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 19 */ - top: number; + top: long; /** * Width of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 19 */ - width: number; + width: long; /** * Height of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 19 */ - height: number; + height: long; } }