From 31f90405ada020ad53981108bd60def71c0d022e Mon Sep 17 00:00:00 2001 From: hid06197980 <2089450903@qq.com> Date: Mon, 21 Jul 2025 19:08:30 +0800 Subject: [PATCH] number to int/long/double.d.ts change xxx Signed-off-by: hid06197980 <2089450903@qq.com> --- api/@ohos.display.d.ts | 204 +++++++++++++++++++------------------- api/@ohos.screen.d.ts | 184 +++++++++++++++++----------------- api/@ohos.screenshot.d.ts | 36 +++---- 3 files changed, 212 insertions(+), 212 deletions(-) diff --git a/api/@ohos.display.d.ts b/api/@ohos.display.d.ts index d4f7b43605..8469e030d3 100644 --- a/api/@ohos.display.d.ts +++ b/api/@ohos.display.d.ts @@ -116,7 +116,7 @@ declare namespace display { /** * Obtain the target display. * - * @param { number } displayId Display id to query. This parameter should be greater than or equal to 0. + * @param { long } displayId Display id to query. This parameter should be greater than or equal to 0. * @returns { Display } the result of display * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -127,7 +127,7 @@ declare namespace display { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function getDisplayByIdSync(displayId: number): Display; + export function getDisplayByIdSync(displayId: long): Display; /** * Obtain all displays. @@ -206,7 +206,7 @@ declare namespace display { /** * Check whether there is a privacy window on the current display. * - * @param { number } displayId Display id to query. This parameter should be greater than or equal to 0. + * @param { long } displayId Display id to query. This parameter should be greater than or equal to 0. * @returns { boolean } true means there is a privacy window on the current display * @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. @@ -217,13 +217,13 @@ declare namespace display { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function hasPrivateWindow(displayId: number): boolean; + export function hasPrivateWindow(displayId: long): boolean; /** * Register the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -233,7 +233,7 @@ declare namespace display { * Register the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -244,7 +244,7 @@ declare namespace display { * Register the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -253,13 +253,13 @@ declare namespace display { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ - export function on(type: 'add' | 'remove' | 'change', callback: Callback): void; + export function on(type: 'add' | 'remove' | 'change', callback: Callback): void; /** * Unregister the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change event - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -269,7 +269,7 @@ declare namespace display { * Unregister the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change event - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -280,7 +280,7 @@ declare namespace display { * Unregister the callback for display changes. * * @param { 'add' | 'remove' | 'change' } type the event of display change event - * @param { Callback } callback the display id of changed + * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -289,7 +289,7 @@ declare namespace display { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ - export function off(type: 'add' | 'remove' | 'change', callback?: Callback): void; + export function off(type: 'add' | 'remove' | 'change', callback?: Callback): void; /** * Register the callback for private mode changes. @@ -673,7 +673,7 @@ declare namespace display { * * @permission ohos.permission.ACCESS_VIRTUAL_SCREEN * @param { VirtualScreenConfig } config Indicates the options of the virtual screen. - * @returns { Promise } Promise used to return the created virtual screen id + * @returns { Promise } Promise used to return the created virtual screen id * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -682,13 +682,13 @@ declare namespace display { * @syscap SystemCapability.Window.SessionManager * @since 16 */ - function createVirtualScreen(config: VirtualScreenConfig): Promise; + function createVirtualScreen(config: VirtualScreenConfig): Promise; /** * Destroy virtual screen. * * @permission ohos.permission.ACCESS_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 } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -699,13 +699,13 @@ declare namespace display { * @syscap SystemCapability.Window.SessionManager * @since 16 */ - function destroyVirtualScreen(screenId: number): Promise; + function destroyVirtualScreen(screenId: long): Promise; /** * Set surface for the virtual screen. * * @permission ohos.permission.ACCESS_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 { 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. @@ -717,13 +717,13 @@ declare namespace display { * @syscap SystemCapability.Window.SessionManager * @since 16 */ - function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise; + function setVirtualScreenSurface(screenId: long, surfaceId: string): Promise; /** * Make screen as unique-screen * * @permission ohos.permission.ACCESS_VIRTUAL_SCREEN - * @param { number } screenId Indicates the unique screen id. It's type should be int. + * @param { long } screenId Indicates the unique screen id. It's type should be int. * @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. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -734,12 +734,12 @@ declare namespace display { * @syscap SystemCapability.Window.SessionManager * @since 16 */ - function makeUnique(screenId: number): Promise; + function makeUnique(screenId: long): Promise; /** * Add the list of window ids to the block list which won't display on the virtual screen * - * @param { Array } windowIds - The list of window ids that do not want to display on the virtual screen + * @param { Array } windowIds - The list of window ids that do not want to display on the virtual screen * @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. 3. Parameter verification failed. @@ -749,12 +749,12 @@ declare namespace display { * @systemapi Hide this for inner system use. * @since 18 */ - function addVirtualScreenBlocklist(windowIds: Array): Promise; + function addVirtualScreenBlocklist(windowIds: Array): Promise; /** * Remove the list of window ids from the block list which won't display on the virtual screen * - * @param { Array } windowIds - The list of window ids that want to display on the virtual screen + * @param { Array } windowIds - The list of window ids that want to display on the virtual screen * @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. 3. Parameter verification failed. @@ -764,13 +764,13 @@ declare namespace display { * @systemapi Hide this for inner system use. * @since 18 */ - function removeVirtualScreenBlocklist(windowIds: Array): Promise; + function removeVirtualScreenBlocklist(windowIds: Array): Promise; /** * Convert global coordinates to relative coordinates. * * @param { Position } position - The global coordinates to be converted. - * @param { number } [displayId] - The optional display id indicate the display relative to. + * @param { long } [displayId] - The optional display id indicate the display relative to. * If not specified,use the display where the coodinates are located. * @returns { RelativePosition } The relative coordinates. * @throws { BusinessError } 801 - Capability not supported. @@ -780,7 +780,7 @@ declare namespace display { * @atomicservice * @since 20 */ - function convertGlobalToRelativeCoordinate(position: Position, displayId?: number): RelativePosition; + function convertGlobalToRelativeCoordinate(position: Position, displayId?: long): RelativePosition; /** * Convert relative coordinates to global coordinates. @@ -816,31 +816,31 @@ declare namespace display { /** * Indicates the width of the virtual screen. * - * @type { number } + * @type { long } * @syscap SystemCapability.Window.SessionManager * @since arkts {'1.1':'16', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: long; /** * Indicates the height of the virtual screen. * - * @type { number } + * @type { long } * @syscap SystemCapability.Window.SessionManager * @since arkts {'1.1':'16', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: long; /** * Indicates the density of the virtual screen. * - * @type { number } + * @type { double } * @syscap SystemCapability.Window.SessionManager * @since 16 */ - density: number; + density: double; /** * Indicates the surface id of the virtual screen. @@ -1439,7 +1439,7 @@ declare namespace display { /** * The display ID is used to identify the screen where the crease is located. * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.Window.SessionManager * @since 10 @@ -1447,14 +1447,14 @@ declare namespace display { /** * The display ID is used to identify the screen where the crease is located. * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - readonly displayId: number; + readonly displayId: long; /** * Crease Region. @@ -1497,74 +1497,74 @@ declare namespace display { /** * The X-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ /** * The X-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - left: number; + left: int; /** * The Y-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ /** * The Y-axis coordinate of the upper left vertex of the rectangle, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - top: number; + top: int; /** * Width of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ /** * Width of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: long; /** * Height of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ /** * Height of the rectangle, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: long; } /** @@ -1748,26 +1748,26 @@ declare namespace display { /** * Display physical width, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - physicalWidth: number; + physicalWidth: long; /** * Display physical height, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - physicalHeight: number; + physicalHeight: long; } /** @@ -1799,14 +1799,14 @@ declare namespace display { /** * Display ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Display ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @since 10 @@ -1814,14 +1814,14 @@ declare namespace display { /** * Display ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - id: number; + id: long; /** * Display name. @@ -1880,25 +1880,25 @@ declare namespace display { /** * Refresh rate, in Hz. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Refresh rate, in Hz. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - refreshRate: number; + refreshRate: long; /** * Rotation degrees of the display. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ @@ -1909,25 +1909,25 @@ declare namespace display { * The value 2 indicates that the screen of the display rotates clockwise by 180°. * The value 3 indicates that the screen of the display rotates clockwise by 270°. * - * @type { number } + * @type { LineAndPositionSetting } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - rotation: number; + rotation: long; /** * Display width, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Display width, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @since 10 @@ -1935,26 +1935,26 @@ declare namespace display { /** * Display width, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: int; /** * Display height, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Display height, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @since 10 @@ -1962,50 +1962,50 @@ declare namespace display { /** * Display height, in pixels. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: int; /** * Display available width, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - availableWidth: number; + availableWidth: long; /** * Display available height, in pixels. * - * @type { number } + * @type { long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - availableHeight: number; + availableHeight: long; /** * Display resolution, that is, the number of pixels per inch. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Display resolution, that is, the number of pixels per inch. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @since 11 @@ -2013,14 +2013,14 @@ declare namespace display { /** * Display resolution, that is, the number of pixels per inch. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - densityDPI: number; + densityDPI: double; /** * Display orientation. @@ -2045,33 +2045,33 @@ declare namespace display { /** * Display density, in pixels. which is the scaling coefficient between physical pixels and logical pixels. The value for a low-resolution display is 1.0. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Display density, in pixels. which is the scaling coefficient between physical pixels and logical pixels. The value for a low-resolution display is 1.0. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - densityPixels: number; + densityPixels: double; /** * Text scale density of the display. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * Text scale density of the display. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @since 11 @@ -2079,26 +2079,26 @@ declare namespace display { /** * Text scale density of the display. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - scaledDensity: number; + scaledDensity: double; /** * DPI on the x-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * DPI on the x-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 @@ -2106,26 +2106,26 @@ declare namespace display { /** * DPI on the x-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ - xDPI: number; + xDPI: double; /** * DPI on the y-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ /** * DPI on the y-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 @@ -2133,13 +2133,13 @@ declare namespace display { /** * DPI on the y-axis. * - * @type { number } + * @type { double } * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since 20 */ - yDPI: number; + yDPI: double; /** * The shape of screen @@ -2198,22 +2198,22 @@ declare namespace display { /** * Coordinates of the top-left corner of the display relative to the main display. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 19 */ - x?: number; + x?: int; /** * Coordinates of the top-left corner of the display relative to the main display. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 19 */ - y?: number; + y?: int; /** * All supported refresh rates. @@ -2366,20 +2366,20 @@ declare namespace display { /** * Indicates the x-axis coordinates * - * @type { number } + * @type { int } * @syscap SystemCapability.Window.SessionManager * @since 20 */ - x: number; + x: int; /** * Indicates the y-axis coordinates * - * @type { number } + * @type { int } * @syscap SystemCapability.Window.SessionManager * @since 20 */ - y: number; + y: int; } /** @@ -2393,11 +2393,11 @@ declare namespace display { /** * Indicates the display. * - * @type { number } + * @type { long } * @syscap SystemCapability.Window.SessionManager * @since 20 */ - displayId: number; + displayId: long; /** * Indicates the coordinates relative to the display. diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index 5573e454c5..24ace0e1b4 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; } } diff --git a/api/@ohos.screenshot.d.ts b/api/@ohos.screenshot.d.ts index 3154ecec70..3480e7dce5 100644 --- a/api/@ohos.screenshot.d.ts +++ b/api/@ohos.screenshot.d.ts @@ -166,46 +166,46 @@ declare namespace screenshot { /** * The X-axis coordinate of the upper left vertex of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - left: number; + left: int; /** * The Y-axis coordinate of the upper left vertex of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - top: number; + top: int; /** * Width of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: int; /** * Height of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: int; } /** @@ -221,24 +221,24 @@ declare namespace screenshot { /** * Defines the width property. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'7', '1.2':'20'} * @arkts 1.1&1.2 */ - width: number; + width: int; /** * Defines the height property. * - * @type { number } + * @type { int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'7', '1.2':'20'} * @arkts 1.1&1.2 */ - height: number; + height: int; } /** @@ -253,12 +253,12 @@ declare namespace screenshot { /** * ID of the screen to be captured. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 14 */ - displayId?: number; + displayId?: long; } /** @@ -294,23 +294,23 @@ declare namespace screenshot { /** * Rotation angle of the screenshot. The value can be 0, 90, 180, or 270. The default value is 0. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'7', '1.2':'20'} * @arkts 1.1&1.2 */ - rotation?: number; + rotation?: int; /** * ID of the screen to be captured. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since arkts {'1.1':'8', '1.2':'20'} * @arkts 1.1&1.2 */ - displayId?: number; + displayId?: long; /** * The capture action is need notification. * -- Gitee