fix docs of js interfaces.

Signed-off-by: zengqingyu <zengqingyu3@huawei.com>
Change-Id: I3f7be2cae4b25a800af10f0e2e9dc57dd83c1434
This commit is contained in:
zengqingyu 2022-04-01 17:46:29 +08:00
parent 17102e9a8a
commit e1b36a5236
2 changed files with 39 additions and 39 deletions

View File

@ -16,153 +16,153 @@
import { AsyncCallback, Callback } from './basic';
/**
* interface of display manager
* Interface of display manager.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @since 7
*/
declare namespace display {
/**
* get the default display
* Obtain the default display.
* @since 7
*/
function getDefaultDisplay(callback: AsyncCallback<Display>): void;
/**
* get the default display
* Obtain the default display.
* @since 7
*/
function getDefaultDisplay(): Promise<Display>;
/**
* get all displays
* Obtain all displays.
* @since 7
*/
function getAllDisplay(callback: AsyncCallback<Array<Display>>): void;
/**
* get all displays
* Obtain all displays.
* @since 7
*/
function getAllDisplay(): Promise<Array<Display>>;
/**
* register the callback of display change
* Register the callback for display changes.
* @param type: type of callback
* @since 7
*/
function on(type: 'add' | 'remove' | 'change', callback: Callback<number>): void;
/**
* unregister the callback of display change
* Unregister the callback for display changes.
* @param type: type of callback
* @since 7
*/
function off(type: 'add' | 'remove' | 'change', callback?: Callback<number>): void;
/**
* the state of display
* Enumerates the display states.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @since 7
*/
enum DisplayState {
/**
* unknown
* Unknown.
*/
STATE_UNKNOWN = 0,
/**
* screen off
* Screen off.
*/
STATE_OFF,
/**
* screen on
* Screen on.
*/
STATE_ON,
/**
* doze, but it will update for some important system messages
* Doze, but it will update for some important system messages.
*/
STATE_DOZE,
/**
* doze and not update
* Doze and not update.
*/
STATE_DOZE_SUSPEND,
/**
* VR node
* VR node.
*/
STATE_VR,
/**
* screen on and not update
* Screen on and not update.
*/
STATE_ON_SUSPEND,
}
/**
* Properties of display, it couldn't update automatically
* Define properties of the display. They cannot be updated automatically.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @since 7
*/
interface Display {
/**
* display id
* Display ID.
*/
id: number;
/**
* display name
* Display name.
*/
name: string;
/**
* the display is alive
* The display is alive.
*/
alive: boolean;
/**
* the state of display
* The state of display.
*/
state: DisplayState;
/**
* refresh rate, unit: Hz
* Refresh rate, in Hz.
*/
refreshRate: number;
/**
* the rotation degrees of the display
* Rotation degrees of the display.
*/
rotation: number;
/**
* the width of display, unit: pixel
* Display width, in pixels.
*/
width: number;
/**
* the height of display, unit: pixel
* Display height, in pixels.
*/
height: number;
/**
* indicates the display resolution.
* Display resolution.
*/
densityDPI: number;
/**
* indicates the display density in pixels. The value of a low-resolution display is 1.0
* Display density, in pixels. The value for a low-resolution display is 1.0.
*/
densityPixels: number;
/**
* indicates the text scale density of a display.
* Text scale density of the display.
*/
scaledDensity: number;
/**
* the DPI on X-axis.
* DPI on the x-axis.
*/
xDPI: number;
/**
* the DPI on Y-axis.
* DPI on the y-axis.
*/
yDPI: number;
}

View File

@ -17,14 +17,14 @@ import { AsyncCallback, ErrorCallback } from './basic';
import image from './@ohos.multimedia.image';
/**
* interface for screenshot
* Declares the screenshot APIs.
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @systemapi Hide this for inner system use.
* @since 7
*/
declare namespace screenshot {
/**
* Takes a screenshot and saves it as a PixelMap object
* Takes a screenshot and saves it as a PixelMap object.
* @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters
* @permission ohos.permission.CAPTURE_SCREEN
* @since 7
@ -32,7 +32,7 @@ declare namespace screenshot {
function save(options?: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>): void;
/**
* Takes a screenshot and saves it as a PixelMap object
* Takes a screenshot and saves it as a PixelMap object.
* @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters
* @permission ohos.permission.CAPTURE_SCREEN
* @since 7
@ -40,7 +40,7 @@ declare namespace screenshot {
function save(options?: ScreenshotOptions): Promise<image.PixelMap>;
/**
* Describes the region of the screen to capture
* Describes the region of the screen to capture.
* @since 7
*/
interface Rect {
@ -51,7 +51,7 @@ declare namespace screenshot {
}
/**
* Describes the size of the screen region to capture
* Describes the size of the screen region to capture.
* @since 7
*/
interface Size {
@ -60,24 +60,24 @@ declare namespace screenshot {
}
/**
* Describes screenshot options
* Describes screenshot options.
* @since 7
*/
interface ScreenshotOptions {
/**
* Region of the screen to capture. If this parameter is null, the full screen will be captured
* Region of the screen to capture. If this parameter is null, the full screen will be captured.
*/
screenRect?: Rect;
/**
* Region of the screen to capture. If this parameter is null, the full screen will be captured
* Region of the screen to capture. If this parameter is null, the full screen will be captured.
*/
imageSize?: Size;
/**
* Rotation angle of the screenshot. The value can be 0, 90, 180, or 270. The default value is 0
* Rotation angle of the screenshot. The value can be 0, 90, 180, or 270. The default value is 0.
*/
rotation?: number;
/**
* The specify screen to be captured.
* ID of the screen to be captured.
* @since 8
*/
displayId?: number;