提交 cd2b3edf 编写于 作者: G ge-yafang

update docs

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 159299f7
...@@ -90,6 +90,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat ...@@ -90,6 +90,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat
} }
] ]
*/ */
``` ```
2. Obtain the device operation permissions. 2. Obtain the device operation permissions.
......
...@@ -1864,7 +1864,7 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -1864,7 +1864,7 @@ Obtains the area where this window cannot be displayed, for example, the system
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ---- |----------------------------------| -- | ------------------------------------------------------------ | | ---- |----------------------------------| -- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | Yes| Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch. **TYPE_SYSTEM_GESTURE** indicates the gesture area. **TYPE_KEYBOARD** indicates the soft keyboard area.| | type | [AvoidAreaType](#avoidareatype7) | Yes| Type of the area. |
**Return value** **Return value**
...@@ -2500,7 +2500,7 @@ Disables listening for window size changes. ...@@ -2500,7 +2500,7 @@ Disables listening for window size changes.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------------------------------------- | | -------- | ----------------------------- | ---- | -------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'windowSizeChange'**, indicating the window size change event.| | type | string | Yes | Event type. The value is fixed at **'windowSizeChange'**, indicating the window size change event.|
| callback | Callback&lt;[Size](#size)&gt; | No | Callback used to return the window size. | | callback | Callback&lt;[Size](#size7)&gt; | No | Callback used to return the window size. |
**Example** **Example**
...@@ -3006,7 +3006,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re ...@@ -3006,7 +3006,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ---------- | ------------------------- | -- | ----------- | | ---------- | ------------------------- | -- | ----------- |
| colorSpace | [ColorSpace](#colorspace) | Yes| Color space to set.| | colorSpace | [ColorSpace](#colorspace8) | Yes| Color space to set.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result. |
**Error codes** **Error codes**
...@@ -3045,7 +3045,7 @@ Sets a color space for this window. This API uses a promise to return the result ...@@ -3045,7 +3045,7 @@ Sets a color space for this window. This API uses a promise to return the result
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ---------- | ------------------------- | -- | ------------- | | ---------- | ------------------------- | -- | ------------- |
| colorSpace | [ColorSpace](#colorspace) | Yes| Color space to set.| | colorSpace | [ColorSpace](#colorspace8) | Yes| Color space to set.|
**Return value** **Return value**
...@@ -3088,7 +3088,7 @@ Obtains the color space of this window. ...@@ -3088,7 +3088,7 @@ Obtains the color space of this window.
| Type| Description| | Type| Description|
| ------------------------- | ------------- | | ------------------------- | ------------- |
| [ColorSpace](#colorspace) | Color space obtained.| | [ColorSpace](#colorspace8) | Color space obtained.|
**Error codes** **Error codes**
...@@ -4631,7 +4631,7 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -4631,7 +4631,7 @@ Obtains the area where this window cannot be displayed, for example, the system
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch. **TYPE_SYSTEM_GESTURE** indicates the gesture area. **TYPE_KEYBOARD** indicates the soft keyboard area. | | type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. |
| callback | AsyncCallback&lt;[AvoidArea](#avoidarea7)&gt; | Yes | Callback used to return the area. | | callback | AsyncCallback&lt;[AvoidArea](#avoidarea7)&gt; | Yes | Callback used to return the area. |
**Example** **Example**
...@@ -4664,7 +4664,7 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -4664,7 +4664,7 @@ Obtains the area where this window cannot be displayed, for example, the system
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | -------------------------------- | --------- | ------------------------------------------------------------ | | ---- | -------------------------------- | --------- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch. **TYPE_SYSTEM_GESTURE** indicates the gesture area. **TYPE_KEYBOARD** indicates the soft keyboard area. | | type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. |
**Return value** **Return value**
...@@ -5239,7 +5239,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re ...@@ -5239,7 +5239,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------------------------- | --------- | ----------------------------------- | | ---------- | ------------------------- | --------- | ----------------------------------- |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color space to set. | | colorSpace | [ColorSpace](#colorspace8) | Yes | Color space to set. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -5271,7 +5271,7 @@ Sets a color space for this window. This API uses a promise to return the result ...@@ -5271,7 +5271,7 @@ Sets a color space for this window. This API uses a promise to return the result
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------------------------- | --------- | ------------------- | | ---------- | ------------------------- | --------- | ------------------- |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color space to set. | | colorSpace | [ColorSpace](#colorspace8) | Yes | Color space to set. |
**Return value** **Return value**
...@@ -5307,7 +5307,7 @@ Obtains the color space of this window. This API uses an asynchronous callback t ...@@ -5307,7 +5307,7 @@ Obtains the color space of this window. This API uses an asynchronous callback t
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ |
| callback | AsyncCallback&lt;[ColorSpace](#colorspace)&gt; | Yes | Callback used to return the result. When the color space is obtained successfully, **err** is **undefined**, and **data** is the current color space. | | callback | AsyncCallback&lt;[ColorSpace](#colorspace8)&gt; | Yes | Callback used to return the result. When the color space is obtained successfully, **err** is **undefined**, and **data** is the current color space. |
**Example** **Example**
...@@ -5338,7 +5338,7 @@ Obtains the color space of this window. This API uses a promise to return the re ...@@ -5338,7 +5338,7 @@ Obtains the color space of this window. This API uses a promise to return the re
| Type | Description | | Type | Description |
| ---------------------------------------- | ----------------------------------------------- | | ---------------------------------------- | ----------------------------------------------- |
| Promise&lt;[ColorSpace](#colorspace)&gt; | Promise used to return the current color space. | | Promise&lt;[ColorSpace](#colorspace8)&gt; | Promise used to return the current color space. |
**Example** **Example**
......
...@@ -47,7 +47,7 @@ You can create a subwindow, such as a dialog box, and set its properties. ...@@ -47,7 +47,7 @@ You can create a subwindow, such as a dialog box, and set its properties.
- Call **window.createWindow** to create a subwindow. - Call **window.createWindow** to create a subwindow.
- Call **window.findWindow** to find an available subwindow. - Call **window.findWindow** to find an available subwindow.
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
let windowClass = null; let windowClass = null;
...@@ -70,7 +70,7 @@ You can create a subwindow, such as a dialog box, and set its properties. ...@@ -70,7 +70,7 @@ You can create a subwindow, such as a dialog box, and set its properties.
console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data));
windowClass = data; windowClass = data;
}); });
``` ```
2. Set the properties of the subwindow. 2. Set the properties of the subwindow.
......
...@@ -1864,7 +1864,7 @@ getWindowAvoidArea(type: AvoidAreaType): AvoidArea ...@@ -1864,7 +1864,7 @@ getWindowAvoidArea(type: AvoidAreaType): AvoidArea
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---- |----------------------------------| -- | ------------------------------------------------------------ | | ---- |----------------------------------| -- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | | type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。 |
**返回值:** **返回值:**
...@@ -2500,7 +2500,7 @@ off(type: 'windowSizeChange', callback?: Callback&lt;Size&gt;): void ...@@ -2500,7 +2500,7 @@ off(type: 'windowSizeChange', callback?: Callback&lt;Size&gt;): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | -------------------------------------------------------- | | -------- | ----------------------------- | ---- | -------------------------------------------------------- |
| type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | | type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 |
| callback | Callback&lt;[Size](#size)&gt; | 否 | 回调函数。返回当前的窗口尺寸。 | | callback | Callback&lt;[Size](#size7)&gt; | 否 | 回调函数。返回当前的窗口尺寸。 |
**示例:** **示例:**
...@@ -3006,7 +3006,7 @@ setWindowColorSpace(colorSpace:ColorSpace, callback: AsyncCallback&lt;void&gt;): ...@@ -3006,7 +3006,7 @@ setWindowColorSpace(colorSpace:ColorSpace, callback: AsyncCallback&lt;void&gt;):
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------- | -- | ----------- | | ---------- | ------------------------- | -- | ----------- |
| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | | colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:** **错误码:**
...@@ -3045,7 +3045,7 @@ setWindowColorSpace(colorSpace:ColorSpace): Promise&lt;void&gt; ...@@ -3045,7 +3045,7 @@ setWindowColorSpace(colorSpace:ColorSpace): Promise&lt;void&gt;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------- | -- | ------------- | | ---------- | ------------------------- | -- | ------------- |
| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | | colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 |
**返回值:** **返回值:**
...@@ -3088,7 +3088,7 @@ getWindowColorSpace(): ColorSpace ...@@ -3088,7 +3088,7 @@ getWindowColorSpace(): ColorSpace
| 类型 | 说明 | | 类型 | 说明 |
| ------------------------- | ------------- | | ------------------------- | ------------- |
| [ColorSpace](#colorspace) | 当前色域模式。 | | [ColorSpace](#colorspace8) | 当前色域模式。 |
**错误码:** **错误码:**
...@@ -4615,7 +4615,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7), callback: AsyncCallback&lt; ...@@ -4615,7 +4615,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7), callback: AsyncCallback&lt;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- |-----------------------------------------------| ---- | ------------------------------------------------------------ | | -------- |-----------------------------------------------| ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | | type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。|
| callback | AsyncCallback&lt;[AvoidArea](#avoidarea7)&gt; | 是 | 回调函数。返回窗口内容规避区域。 | | callback | AsyncCallback&lt;[AvoidArea](#avoidarea7)&gt; | 是 | 回调函数。返回窗口内容规避区域。 |
**示例:** **示例:**
...@@ -4647,7 +4647,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7)): Promise&lt;[AvoidArea](#av ...@@ -4647,7 +4647,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7)): Promise&lt;[AvoidArea](#av
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ |----------------------------------| ---- | ------------------------------------------------------------ | | ------ |----------------------------------| ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | | type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。 |
**返回值:** **返回值:**
...@@ -5205,7 +5205,7 @@ setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback&lt;void&gt;): void ...@@ -5205,7 +5205,7 @@ setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback&lt;void&gt;): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------- | ---- | ------------ | | ---------- | ------------------------- | ---- | ------------ |
| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | | colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -5236,7 +5236,7 @@ setColorSpace(colorSpace:ColorSpace): Promise&lt;void&gt; ...@@ -5236,7 +5236,7 @@ setColorSpace(colorSpace:ColorSpace): Promise&lt;void&gt;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------- | ---- | -------------- | | ---------- | ------------------------- | ---- | -------------- |
| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | | colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 |
**返回值:** **返回值:**
...@@ -5271,7 +5271,7 @@ getColorSpace(callback: AsyncCallback&lt;ColorSpace&gt;): void ...@@ -5271,7 +5271,7 @@ getColorSpace(callback: AsyncCallback&lt;ColorSpace&gt;): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------------- | ---- | ---------------------------------------------------------- | | -------- | ---------------------------------------------- | ---- | ---------------------------------------------------------- |
| callback | AsyncCallback&lt;[ColorSpace](#colorspace)&gt; | 是 | 回调函数。当获取成功,err为undefined,data为当前色域模式。 | | callback | AsyncCallback&lt;[ColorSpace](#colorspace8)&gt; | 是 | 回调函数。当获取成功,err为undefined,data为当前色域模式。 |
**示例:** **示例:**
...@@ -5301,7 +5301,7 @@ getColorSpace(): Promise&lt;ColorSpace&gt; ...@@ -5301,7 +5301,7 @@ getColorSpace(): Promise&lt;ColorSpace&gt;
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ------------------------------- | | ---------------------------------------- | ------------------------------- |
| Promise&lt;[ColorSpace](#colorspace)&gt; | Promise对象。返回当前色域模式。 | | Promise&lt;[ColorSpace](#colorspace8)&gt; | Promise对象。返回当前色域模式。 |
**示例:** **示例:**
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
- 可以通过`window.createWindow`接口创建子窗口。 - 可以通过`window.createWindow`接口创建子窗口。
- 也可以通过`window.findWindow`接口来查找已经创建的窗口从而得到子窗口。 - 也可以通过`window.findWindow`接口来查找已经创建的窗口从而得到子窗口。
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
let windowClass = null; let windowClass = null;
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data));
windowClass = data; windowClass = data;
}); });
``` ```
2. 设置子窗口属性。 2. 设置子窗口属性。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册