提交 c7c15466 编写于 作者: W wuzhihuitmac

Merge branch 'master' of gitee.com:openharmony/docs into wzh

Change-Id: If3f7866f92bec0216f759ff39040d2e93dcf143f
...@@ -314,6 +314,8 @@ Stops synchronizing the remote mission list. This API uses a promise to return t ...@@ -314,6 +314,8 @@ Stops synchronizing the remote mission list. This API uses a promise to return t
Defines the callbacks that can be registered as a mission status listener. Defines the callbacks that can be registered as a mission status listener.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
...@@ -326,6 +328,8 @@ Defines the callbacks that can be registered as a mission status listener. ...@@ -326,6 +328,8 @@ Defines the callbacks that can be registered as a mission status listener.
Defines the parameters required for mission synchronization. Defines the parameters required for mission synchronization.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
...@@ -338,6 +342,8 @@ Defines the parameters required for mission synchronization. ...@@ -338,6 +342,8 @@ Defines the parameters required for mission synchronization.
Defines the parameters required for registering a listener. Defines the parameters required for registering a listener.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
......
...@@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set ...@@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> WebGL complies with the OpenGL protocol and does not support multi-thread calling.
## Invoking Method ## Invoking Method
...@@ -90,7 +92,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0); ...@@ -90,7 +92,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
WebGLContextAttributes WebGLContextAttributes
| Name| Type| Mandatory| | Name| Type| Mandatory|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| alpha | boolean | No| | alpha | boolean | No|
| depth | boolean | No| | depth | boolean | No|
...@@ -107,7 +109,7 @@ WebGLContextAttributes ...@@ -107,7 +109,7 @@ WebGLContextAttributes
WebGLActiveInfo WebGLActiveInfo
| Name| Type| Mandatory| | Name| Type| Mandatory|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| size | GLint | Yes| | size | GLint | Yes|
| type | GLenum | Yes| | type | GLenum | Yes|
...@@ -118,7 +120,7 @@ WebGLActiveInfo ...@@ -118,7 +120,7 @@ WebGLActiveInfo
WebGLShaderPrecisionFormat WebGLShaderPrecisionFormat
| Name| Type| Mandatory| | Name| Type| Mandatory|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| rangeMin | GLint | Yes| | rangeMin | GLint | Yes|
| rangeMax | GLint | Yes| | rangeMax | GLint | Yes|
...@@ -132,7 +134,7 @@ WebGLRenderingContextBase ...@@ -132,7 +134,7 @@ WebGLRenderingContextBase
### Attributes ### Attributes
| Name| Type| Mandatory| | Name| Type| Mandatory|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| DEPTH_BUFFER_BIT | GLenum | Yes| | DEPTH_BUFFER_BIT | GLenum | Yes|
| STENCIL_BUFFER_BIT | GLenum | Yes| | STENCIL_BUFFER_BIT | GLenum | Yes|
...@@ -435,7 +437,7 @@ WebGLRenderingContextBase ...@@ -435,7 +437,7 @@ WebGLRenderingContextBase
### Methods ### Methods
| Method| Return Value Type| | Method| Return Value Type|
| -------- | -------- | | -------- | -------- |
| getContextAttributes() | WebGLContextAttributes \| null | | getContextAttributes() | WebGLContextAttributes \| null |
| isContextLost() | boolean | | isContextLost() | boolean |
...@@ -561,14 +563,14 @@ WebGLRenderingContextBase ...@@ -561,14 +563,14 @@ WebGLRenderingContextBase
WebGLRenderingContextOverloads WebGLRenderingContextOverloads
| Method| Return Value Type| | Method| Return Value Type|
| -------- | -------- | | -------- | -------- |
| bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void | | bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void |
| bufferData(target: GLenum, data: BufferSource \| null, usage: GLenum) | void | | bufferData(target: GLenum, data: BufferSource \| null, usage: GLenum) | void |
| bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) | void | | bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) | void |
| compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) | void | | compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) | void |
| compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) | void | | compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) | void |
| readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void; | | readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void |
| texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void | | texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void |
| texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) | void | | texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) | void |
| texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void | | texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView \| null) | void |
......
...@@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set ...@@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> WebGL2 complies with the OpenGL protocol and does not support multi-thread calling.
## Invoking Method ## Invoking Method
......
...@@ -182,12 +182,12 @@ The table below provides only the sites for downloading the latest OpenHarmony L ...@@ -182,12 +182,12 @@ The table below provides only the sites for downloading the latest OpenHarmony L
| Hi3516 solution-Linux (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz.sha256) | | Hi3516 solution-Linux (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz.sha256) |
| RELEASE-NOTES | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - | | RELEASE-NOTES | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - |
| **Source code of the Latest Release**| **Version Information**| **Site**| **SHA-256 Verification Code**| | **Source code of the Latest Release**| **Version Information**| **Site**| **SHA-256 Verification Code**|
| Full code base (for mini, small, and standard systems)| 3.2 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/code-v3.2-Beta1.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/code-v3.2-Beta1.tar.gz.sha256)| | Full code base (for mini, small, and standard systems)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz.sha256)|
| RK3568 standard system solution (binary)| 3.2 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)| | RK3568 standard system solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)|
| Hi3861 solution (binary)| 3.2 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_pegasus.tar.gz.sha256) | | Hi3861 solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz.sha256) |
| Hi3516 solution-LiteOS (binary)| 3.2 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_taurus.tar.gz.sha256)| | Hi3516 solution-LiteOS (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_LiteOS.tar.gz.sha256)|
| Hi3516 solution-Linux (binary)| 3.2 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta1/hispark_taurus_linux.tar.gz.sha256)| | Hi3516 solution-Linux (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_Linux.tar.gz.sha256)|
| RELEASE-NOTES | 3.2 Beta1 | [Download](../../release-notes/OpenHarmony-v3.2-beta1.md)| - | | RELEASE-NOTES | 3.2 Beta2 | [Download](../../release-notes/OpenHarmony-v3.2-beta2.md)| - |
| **Compiler Toolchain**| **Version Information**| **Site**| **SHA-256 Verification Code**| | **Compiler Toolchain**| **Version Information**| **Site**| **SHA-256 Verification Code**|
| Compiler toolchain| - | [Download](https://repo.huaweicloud.com/openharmony/os/2.0/tool_chain/)| - | | Compiler toolchain| - | [Download](https://repo.huaweicloud.com/openharmony/os/2.0/tool_chain/)| - |
...@@ -197,7 +197,7 @@ The table below provides only the sites for downloading the latest OpenHarmony L ...@@ -197,7 +197,7 @@ The table below provides only the sites for downloading the latest OpenHarmony L
> >
> The image repository is synchronized at 23:00 (UTC +8:00) every day. > The image repository is synchronized at 23:00 (UTC +8:00) every day.
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to GitHub. For details, see [Adding a new SSH key to your GitHub account](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).\) Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to GitHub. For details, see [Adding a new SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).\)
``` ```
repo init -u git@github.com:openharmony/manifest.git -b master --no-repo-verify repo init -u git@github.com:openharmony/manifest.git -b master --no-repo-verify
......
此差异已折叠。
# OpenHarmony Release Notes # OpenHarmony Release Notes
## OpenHarmony 3.x Releases ## OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Beta2 (2022-07-30)](OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](OpenHarmony-v3.2-beta1.md) - [OpenHarmony v3.2 Beta1 (2022-05-31)](OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md) - [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1 Release (2022-03-30)](OpenHarmony-v3.1-release.md) - [OpenHarmony v3.1 Release (2022-03-30)](OpenHarmony-v3.1-release.md)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
- [Glossary](glossary.md) - [Glossary](glossary.md)
- OpenHarmony Release Notes - OpenHarmony Release Notes
- OpenHarmony 3.x Releases - OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Beta2 (2022-07-30)](release-notes/OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](release-notes/OpenHarmony-v3.2-beta1.md) - [OpenHarmony v3.2 Beta1 (2022-05-31)](release-notes/OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](release-notes/OpenHarmony-v3.1.1-release.md) - [OpenHarmony v3.1.1 Release (2022-05-31)](release-notes/OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md) - [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md)
...@@ -123,6 +124,9 @@ ...@@ -123,6 +124,9 @@
- [JS API Differences](release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md) - [JS API Differences](release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md)
- [Native API Differences](release-notes/api-change/v2.2-beta2/native-apidiff-v2.2-beta2.md) - [Native API Differences](release-notes/api-change/v2.2-beta2/native-apidiff-v2.2-beta2.md)
- ChangeLog - ChangeLog
- OpenHamrony 3.2 Beta2
- [Updates Between OpenHarmony 3.2 Beta2 and OpenHarmony 3.2 Beta1](release-notes/changelog/v3.2-beta2/changelog-v3.2-beta2.md)
- [Adaptation Guide for the Application Sandbox](release-notes/changelog/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.1 Beta - OpenHarmony 3.1 Beta
- [Updates Between OpenHarmony 3.1 Beta and OpenHarmony 3.0](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md) - [Updates Between OpenHarmony 3.1 Beta and OpenHarmony 3.0](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony Third-Party Components - OpenHarmony Third-Party Components
......
# I18n开发指导 # I18n开发指导
本模块提供系统相关的或者增强的国际化能力,包括区域管理、电话号码处理、日历等,相关接口为ECMA 402标准中未定义的补充接口。 本模块提供系统相关的或者增强的国际化能力,包括区域管理、电话号码处理、日历等,相关接口为ECMA 402标准中未定义的补充接口。更多接口和使用方式请见[I18N](../reference/apis/js-apis-i18n.md)
[Intl](intl-guidelines.md)模块提供了ECMA 402标准定义的基础国际化接口,与本模块共同使用可提供完整地国际化支持能力。 [Intl](intl-guidelines.md)模块提供了ECMA 402标准定义的基础国际化接口,与本模块共同使用可提供完整地国际化支持能力。
## 获取系统语言区域信息 ## 获取系统语言区域信息
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
## 获取日历信息 ## 获取日历信息
调用日历[Calendar](../reference/apis/js-apis-intl.md)相关接口来获取日历的相关信息,例如获取日历的本地化显示、一周起始日、一年中第一周的最小天数等。 调用日历[Calendar](../reference/apis/js-apis-i18n.md#calendar8)相关接口来获取日历的相关信息,例如获取日历的本地化显示、一周起始日、一年中第一周的最小天数等。
### 接口说明 ### 接口说明
...@@ -111,7 +112,7 @@ ...@@ -111,7 +112,7 @@
调用getCalendar方法获取指定locale和type的时区对象(i18n为导入的模块)。其中,type表示合法的日历类型,目前合法的日历类型包括:"buddhist", "chinese", "coptic", "ethiopic", "hebrew", "gregory", "indian", "islamic_civil", "islamic_tbla", "islamic_umalqura", "japanese", "persian"。当type没有给出时,采用区域默认的日历类型。 调用getCalendar方法获取指定locale和type的时区对象(i18n为导入的模块)。其中,type表示合法的日历类型,目前合法的日历类型包括:"buddhist", "chinese", "coptic", "ethiopic", "hebrew", "gregory", "indian", "islamic_civil", "islamic_tbla", "islamic_umalqura", "japanese", "persian"。当type没有给出时,采用区域默认的日历类型。
```js ```js
var calendar = i18n.getCalendar("zh-CN", "gregory); var calendar = i18n.getCalendar("zh-CN", "gregory");
``` ```
2. 设置日历对象的时间。 2. 设置日历对象的时间。
...@@ -177,7 +178,7 @@ ...@@ -177,7 +178,7 @@
## 电话号码格式化 ## 电话号码格式化
调用电话号码格式化[PhoneNumberFormat](../reference/apis/js-apis-intl.md)的接口,实现对针对不同国家电话号码的格式化以及判断电话号码格式是否正确的功能。 调用电话号码格式化[PhoneNumberFormat](../reference/apis/js-apis-i18n.md#phonenumberformat8)的接口,实现对针对不同国家电话号码的格式化以及判断电话号码格式是否正确的功能。
### 接口说明 ### 接口说明
...@@ -194,7 +195,7 @@ ...@@ -194,7 +195,7 @@
调用PhoneNumberFormat的构造函数来实例化电话号码格式化对象,需要传入电话号码的国家代码及格式化选项。其中,格式化选项是可选的,包括style选项,该选项的取值包括:"E164", "INTERNATIONAL", "NATIONAL", "RFC3966"。 调用PhoneNumberFormat的构造函数来实例化电话号码格式化对象,需要传入电话号码的国家代码及格式化选项。其中,格式化选项是可选的,包括style选项,该选项的取值包括:"E164", "INTERNATIONAL", "NATIONAL", "RFC3966"。
```js ```js
var phoneNumberFormat = new i18n.PhoneNubmerFormat("CN", {type: "E164"}); var phoneNumberFormat = new i18n.PhoneNumberFormat("CN", {type: "E164"});
``` ```
2. 判断电话号码格式是否正确。 2. 判断电话号码格式是否正确。
...@@ -227,7 +228,7 @@ ...@@ -227,7 +228,7 @@
1. 度量衡单位转换。 1. 度量衡单位转换。
调用[unitConvert](../reference/apis/js-apis-intl.md)方法实现度量衡单位转换,并进行格式化显示的功能。 调用[unitConvert](../reference/apis/js-apis-i18n.md#unitconvert8)方法实现度量衡单位转换,并进行格式化显示的功能。
```js ```js
var fromUnit = {unit: "cup", measureSystem: "US"}; var fromUnit = {unit: "cup", measureSystem: "US"};
...@@ -240,7 +241,7 @@ ...@@ -240,7 +241,7 @@
## 字母表索引 ## 字母表索引
调用字母表索引[IndexUtil](../reference/apis/js-apis-intl.md)的接口可以获取不同Locale的字母表索引,以及实现计算字符串所属索引的功能。 调用字母表索引[IndexUtil](../reference/apis/js-apis-i18n.md#indexutil8)的接口可以获取不同Locale的字母表索引,以及实现计算字符串所属索引的功能。
### 接口说明 ### 接口说明
...@@ -259,7 +260,7 @@ ...@@ -259,7 +260,7 @@
```js ```js
var indexUtil = getInstance("zh-CN"); var indexUtil = i18n.getInstance("zh-CN");
``` ```
2. 获取索引列表。 2. 获取索引列表。
...@@ -289,7 +290,7 @@ ...@@ -289,7 +290,7 @@
## 获取文本断点位置 ## 获取文本断点位置
当文本比较长无法在一行进行显示时,调用文本断点[BreakIterator8](../reference/apis/js-apis-intl.md)的接口,来获取文本可以断行的位置。 当文本比较长无法在一行进行显示时,调用文本断点[BreakIterator8](../reference/apis/js-apis-i18n.md#breakiterator8)的接口,来获取文本可以断行的位置。
### 接口说明 ### 接口说明
......
# Intl开发指导 # Intl开发指导
本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。 本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。更多接口和使用方式请见[Intl](../reference/apis/js-apis-intl.md)
[I18N](i18n-guidelines.md)模块提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。 [I18N](i18n-guidelines.md)模块提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。
## 设置区域信息 ## 设置区域信息
调用[Locale](../reference/apis/js-apis-intl.md)的相关接口实现最大化区域信息或最小化区域信息。 调用[Locale](../reference/apis/js-apis-intl.md#locale)的相关接口实现最大化区域信息或最小化区域信息。
### 接口说明 ### 接口说明
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
1. 实例化Locale对象。 1. 实例化Locale对象。
使用Locale的构造函数创建Locale对象,该方法接收一个表示Locale的字符串及可选的[属性](../reference/apis/js-apis-intl.md)列表(intl为导入的模块名)。 使用Locale的构造函数创建Locale对象,该方法接收一个表示Locale的字符串及可选的[属性](../reference/apis/js-apis-intl.md#localeoptions)列表(intl为导入的模块名)。
表示Locale的字符串参数可以分为以下四部分:语言、脚本、地区、扩展参数。各个部分按照顺序使用中划线“-”进行连接。 表示Locale的字符串参数可以分为以下四部分:语言、脚本、地区、扩展参数。各个部分按照顺序使用中划线“-”进行连接。
- 语言:必选,使用2个或3个小写英文字母表示(可参考ISO-639标准),例如英文使用“en”表示,中文使用“zh”表示。 - 语言:必选,使用2个或3个小写英文字母表示(可参考ISO-639标准),例如英文使用“en”表示,中文使用“zh”表示。
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
```js ```js
var locale = "zh-CN"; var locale = "zh-CN";
var options = {caseFirst: false, calendar: "chinese", collation: pinyin}; var options = {caseFirst: false, calendar: "chinese", collation: "pinyin"};
var localeObj = new intl.Locale(locale, options); var localeObj = new intl.Locale(locale, options);
``` ```
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
## 格式化日期时间 ## 格式化日期时间
调用日期时间格式化[DateTimeFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的日期格式化以及时间段格式化功能。 调用日期时间格式化[DateTimeFormat](../reference/apis/js-apis-intl.md#datetimeformat)的接口,实现针对特定Locale的日期格式化以及时间段格式化功能。
### 接口说明 ### 接口说明
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
var dateTimeFormat = new intl.DateTimeFormat(); var dateTimeFormat = new intl.DateTimeFormat();
``` ```
另一种方法是使用开发者提供的Locale和格式化参数来创建日期时间格式化对象。其中,格式化参数是可选的,完整的格式化参数列表见[DateTimeOptions](../reference/apis/js-apis-intl.md)。 另一种方法是使用开发者提供的Locale和格式化参数来创建日期时间格式化对象。其中,格式化参数是可选的,完整的格式化参数列表见[DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions)。
```js ```js
var options = {dateStyle: "full", timeStyle: "full"}; var options = {dateStyle: "full", timeStyle: "full"};
...@@ -104,18 +105,19 @@ ...@@ -104,18 +105,19 @@
使用DateTimeFormat的format方法对一个Date对象进行格式化,该方法会返回一个字符串作为格式化的结果。 使用DateTimeFormat的format方法对一个Date对象进行格式化,该方法会返回一个字符串作为格式化的结果。
```js ```js
Date date = new Date(); var date = new Date();
var formatResult = dateTimeFormat.format(date); var formatResult = dateTimeFormat.format(date);
``` ```
3. 格式化时间段。 3. 格式化时间段。
使用DateTimeFormat的formatRange方法对一个时间段进行格式化。该方法需要传入两个Date对象,分别表示时间段的起止时间,返回一个字符串作为格式化的结果。 使用DateTimeFormat的formatRange方法对一个时间段进行格式化。该方法需要传入两个Date对象,分别表示时间段的起止日期,返回一个字符串作为格式化的结果。
```js ```js
Date startDate = new Date(); var startDate = new Date(2021, 11, 17, 3, 24, 0);
Date endDate = new Date(); var endDate = new Date(2021, 11, 18, 3, 24, 0);
var formatResult = dateTimeFormat.formatRange(startDate, endDate); var datefmt = new Intl.DateTimeFormat("en-GB");
datefmt.formatRange(startDate, endDate);
``` ```
4. 访问日期时间格式化对象的相关属性。 4. 访问日期时间格式化对象的相关属性。
...@@ -128,7 +130,7 @@ ...@@ -128,7 +130,7 @@
## 数字格式化 ## 数字格式化
调用数字格式化[NumberFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的数字格式化功能。 调用数字格式化[NumberFormat](../reference/apis/js-apis-intl.md#numberformat)的接口,实现针对特定Locale的数字格式化功能。
### 接口说明 ### 接口说明
...@@ -149,7 +151,7 @@ ...@@ -149,7 +151,7 @@
var numberFormat = new intl.NumberFormat(); var numberFormat = new intl.NumberFormat();
``` ```
另一种方法是使用开发者提供的Locale和格式化参数来创建数字格式化对象。其中,格式化参数是可选的,完整的格式化参数列表参见[NumberOptions](../reference/apis/js-apis-intl.md)。 另一种方法是使用开发者提供的Locale和格式化参数来创建数字格式化对象。其中,格式化参数是可选的,完整的格式化参数列表参见[NumberOptions](../reference/apis/js-apis-intl.md#numberoptions)。
```js ```js
var options = {compactDisplay: "short", notation: "compact"}; var options = {compactDisplay: "short", notation: "compact"};
...@@ -175,7 +177,7 @@ ...@@ -175,7 +177,7 @@
## 字符串排序 ## 字符串排序
不同区域的用户对于字符串排序具有不同的需求。调用字符串排序[Collator](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的字符串排序功能。 不同区域的用户对于字符串排序具有不同的需求。调用字符串排序[Collator](../reference/apis/js-apis-intl.md#collator8)的接口,实现针对特定Locale的字符串排序功能。
### 接口说明 ### 接口说明
...@@ -196,7 +198,7 @@ ...@@ -196,7 +198,7 @@
var collator = new intl.Collator(); var collator = new intl.Collator();
``` ```
另一种方法是使用开发者提供的Locale和其他相关参数来创建Collator对象,完整的参数列表参见[CollatorOptions](../reference/apis/js-apis-intl.md)。 另一种方法是使用开发者提供的Locale和其他相关参数来创建Collator对象,完整的参数列表参见[CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions8)。
```js ```js
var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"}); var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"});
...@@ -204,7 +206,7 @@ ...@@ -204,7 +206,7 @@
2. 比较字符串。 2. 比较字符串。
使用Collator的compare方法对传入的两个字符串进行比较。该方法返回一个数值作为比较的结果,返回-1表示第一个字符串小于第二个字符串,返回1表示第一个字符大于第二个字符串,返回0表示两个字符串相同。 使用Collator的compare方法对传入的两个字符串进行比较。该方法返回一个数值作为比较的结果,返回-1表示第一个字符串小于第二个字符串,返回1表示第一个字符大于第二个字符串,返回0表示两个字符串相同。基于两个字符串的比较结果,开发者可以字符串集合进行排序。
```js ```js
var str1 = "first string"; var str1 = "first string";
...@@ -222,7 +224,7 @@ ...@@ -222,7 +224,7 @@
## 判定单复数类别 ## 判定单复数类别
在一些语言的语法中,当数字后面存在名词时,名词需要根据数字的值采用不同的形式。调用单复数[PluralRules](../reference/apis/js-apis-intl.md)的接口,可以实现针对特定Locale计算数字单复数类别的功能,从而选择合适的名词单复数表示。 在一些语言的语法中,当数字后面存在名词时,名词需要根据数字的值采用不同的形式。调用单复数[PluralRules](../reference/apis/js-apis-intl.md#pluralrules8)的接口,可以实现针对特定Locale计算数字单复数类别的功能,从而选择合适的名词单复数表示。
### 接口说明 ### 接口说明
...@@ -243,10 +245,10 @@ ...@@ -243,10 +245,10 @@
var pluralRules = new intl.PluralRules(); var pluralRules = new intl.PluralRules();
``` ```
另一种方法是使用开发者提供的Locale和其他相关参数来创建单复数对象。完整的参数列表参见[PluralRulesOptions](../reference/apis/js-apis-intl.md)。 另一种方法是使用开发者提供的Locale和其他相关参数来创建单复数对象。完整的参数列表参见[PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions8)。
```js ```js
var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"}); var pluralRules = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"});
``` ```
2. 计算数字单复数类别。 2. 计算数字单复数类别。
...@@ -260,7 +262,7 @@ ...@@ -260,7 +262,7 @@
## 相对时间格式化 ## 相对时间格式化
调用相对时间格式化[RelativeTimeFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的相对时间格式化功能。 调用相对时间格式化[RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8)的接口,实现针对特定Locale的相对时间格式化功能。
### 接口说明 ### 接口说明
...@@ -282,7 +284,7 @@ ...@@ -282,7 +284,7 @@
var relativeTimeFormat = new intl.RelativeTimeFormat(); var relativeTimeFormat = new intl.RelativeTimeFormat();
``` ```
另一种方法是使用开发者提供的Locale和格式化参数来创建相对时间格式化对象。其中,格式化参数是可选的,完整的参数列表参见[ RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md)。 另一种方法是使用开发者提供的Locale和格式化参数来创建相对时间格式化对象。其中,格式化参数是可选的,完整的参数列表参见[ RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md#relativetimeformatinputoptions8)。
``` ```
var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"}); var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
...@@ -310,7 +312,7 @@ ...@@ -310,7 +312,7 @@
4. 访问相对时间格式化对象的相关属性。 4. 访问相对时间格式化对象的相关属性。
RelativeTimeFormat的resolvedOptions方法会返回一个对象,该对象包含了RelativeTimeFormat对象的所有相关属性及其值,完整的属性列表参见[ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md)。 RelativeTimeFormat的resolvedOptions方法会返回一个对象,该对象包含了RelativeTimeFormat对象的所有相关属性及其值,完整的属性列表参见[ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md#relativetimeformatresolvedoptions8)。
```js ```js
var options = numberFormat.resolvedOptions(); var options = numberFormat.resolvedOptions();
......
...@@ -21,15 +21,15 @@ Ability是系统调度应用的最小单元,是能够完成一个独立功能 ...@@ -21,15 +21,15 @@ Ability是系统调度应用的最小单元,是能够完成一个独立功能
OpenHarmony中提供的接口,部分是仅供OEM厂商使用的system api,普通应用无法使用。 OpenHarmony中提供的接口,部分是仅供OEM厂商使用的system api,普通应用无法使用。
普通应用即应用APL等级为normal的应用。默认情况下,应用的等级都为normal应用。
APL等级的详细说明及如何将应用的APL等级声明为normal以上,请参考[访问控制开发概述-应用APL等级说明](../../security/accesstoken-overview.md#应用apl等级说明)
针对这种情况,在文档中会进行系统接口的声明: 针对这种情况,在文档中会进行系统接口的声明:
- 如果某个模块的接口均为system api,会在文档开头说明:该模块接口为系统接口。 - 如果某个模块的接口均为system api,会在文档开头说明:该模块接口为系统接口。
- 如果某个接口为system api,会在具体的接口描述中说明:此接口为系统接口。 - 如果某个接口为system api,会在具体的接口描述中说明:此接口为系统接口。
普通应用即应用APL等级为normal的应用。默认情况下,应用的等级都为normal应用。
APL等级的详细说明及如何将应用的APL等级声明为normal以上,请参考[访问控制开发概述-应用APL等级说明](../../security/accesstoken-overview.md#应用apl等级说明)
## 权限说明 ## 权限说明
默认情况下,应用只能访问有限的系统资源。但某些情况下,应用为了扩展功能的诉求,需要访问额外的系统或其他应用的数据(包括用户个人数据)、功能。具体可参考[访问控制开发概述](../../security/accesstoken-overview.md) 默认情况下,应用只能访问有限的系统资源。但某些情况下,应用为了扩展功能的诉求,需要访问额外的系统或其他应用的数据(包括用户个人数据)、功能。具体可参考[访问控制开发概述](../../security/accesstoken-overview.md)
......
...@@ -16,7 +16,8 @@ import wifi from '@ohos.wifi'; ...@@ -16,7 +16,8 @@ import wifi from '@ohos.wifi';
enableWifi(): boolean enableWifi(): boolean
使能WLAN。 使能WLAN。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -33,7 +34,8 @@ enableWifi(): boolean ...@@ -33,7 +34,8 @@ enableWifi(): boolean
disableWifi(): boolean disableWifi(): boolean
去使能WLAN。 去使能WLAN。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -197,6 +199,8 @@ WLAN热点信息。 ...@@ -197,6 +199,8 @@ WLAN热点信息。
WLAN热点信息。 WLAN热点信息。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| **参数名** | **类型** | **读写属性** | **说明** | | **参数名** | **类型** | **读写属性** | **说明** |
...@@ -242,7 +246,8 @@ getScanInfosSync():  Array<[WifiScanInfo](#wifiscaninfo)> ...@@ -242,7 +246,8 @@ getScanInfosSync():  Array<[WifiScanInfo](#wifiscaninfo)>
addDeviceConfig(config: WifiDeviceConfig): Promise<number> addDeviceConfig(config: WifiDeviceConfig): Promise<number>
添加网络配置,使用Promise异步回调。 添加网络配置,使用Promise异步回调。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG
...@@ -271,20 +276,22 @@ WLAN配置信息。 ...@@ -271,20 +276,22 @@ WLAN配置信息。
| preSharedKey | string | 只读 | 热点的密钥。 | | preSharedKey | string | 只读 | 热点的密钥。 |
| isHiddenSsid | boolean | 只读 | 是否是隐藏网络。 | | isHiddenSsid | boolean | 只读 | 是否是隐藏网络。 |
| securityType | [WifiSecurityType](#wifisecuritytype) | 只读 | 加密类型。 | | securityType | [WifiSecurityType](#wifisecuritytype) | 只读 | 加密类型。 |
| creatorUid | number | 只读 | 创建用户的ID,仅系统应用可用。 | | creatorUid | number | 只读 | 创建用户的ID<br /> **系统接口:** 此接口为系统接口。 |
| disableReason | number | 只读 | 禁用原因,仅系统应用可用。 | | disableReason | number | 只读 | 禁用原因<br /> **系统接口:** 此接口为系统接口。 |
| netId | number | 只读 | 分配的网络ID, 仅系统应用可用。 | | netId | number | 只读 | 分配的网络ID<br /> **系统接口:** 此接口为系统接口。 |
| randomMacType | number | 只读 | 随机MAC类型,仅系统应用可用。 | | randomMacType | number | 只读 | 随机MAC类型<br /> **系统接口:** 此接口为系统接口。 |
| randomMacAddr | string | 只读 | 随机MAC地址,仅系统应用可用。 | | randomMacAddr | string | 只读 | 随机MAC地址<br /> **系统接口:** 此接口为系统接口。 |
| ipType | [IpType](#iptype7) | 只读 | IP地址类型,仅系统应用可用。 | | ipType | [IpType](#iptype7) | 只读 | IP地址类型<br /> **系统接口:** 此接口为系统接口。 |
| staticIp | [IpConfig](#ipconfig7) | 只读 | 静态IP配置信息,仅系统应用可用。 | | staticIp | [IpConfig](#ipconfig7) | 只读 | 静态IP配置信息<br /> **系统接口:** 此接口为系统接口。 |
| eapConfig<sup>9+</sup> | [WifiEapConfig](#wifieapconfig9) | 只读 | 可扩展身份验证协议配置,仅系统应用可用。 | | eapConfig<sup>9+</sup> | [WifiEapConfig](#wifieapconfig9) | 只读 | 可扩展身份验证协议配置<br /> **系统接口:** 此接口为系统接口。 |
## IpType<sup>7+</sup> ## IpType<sup>7+</sup>
表示IP类型的枚举。 表示IP类型的枚举。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| 名称 | 默认值 | 说明 | | 名称 | 默认值 | 说明 |
...@@ -298,6 +305,8 @@ WLAN配置信息。 ...@@ -298,6 +305,8 @@ WLAN配置信息。
IP配置信息。 IP配置信息。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| **参数名** | **类型** | **读写属性** | **说明** | | **参数名** | **类型** | **读写属性** | **说明** |
...@@ -312,6 +321,8 @@ IP配置信息。 ...@@ -312,6 +321,8 @@ IP配置信息。
可扩展身份验证协议配置信息。 可扩展身份验证协议配置信息。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| **参数名** | **类型** | **读写属性** | **说明** | | **参数名** | **类型** | **读写属性** | **说明** |
...@@ -335,6 +346,8 @@ IP配置信息。 ...@@ -335,6 +346,8 @@ IP配置信息。
表示EAP认证方式的枚举。 表示EAP认证方式的枚举。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| 名称 | 默认值 | 说明 | | 名称 | 默认值 | 说明 |
...@@ -354,6 +367,8 @@ IP配置信息。 ...@@ -354,6 +367,8 @@ IP配置信息。
表示第二阶段认证方式的枚举。 表示第二阶段认证方式的枚举。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| 名称 | 默认值 | 说明 | | 名称 | 默认值 | 说明 |
...@@ -373,7 +388,8 @@ IP配置信息。 ...@@ -373,7 +388,8 @@ IP配置信息。
addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;number&gt;): void addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;number&gt;): void
添加网络配置,使用callback异步回调。 添加网络配置,使用callback异步回调。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG
...@@ -556,7 +572,7 @@ getCandidateConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt; ...@@ -556,7 +572,7 @@ getCandidateConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt;
## wifi.connectToCandidateConfig<sup>9+</sup> ## wifi.connectToCandidateConfig<sup>9+</sup>
connectToCandidateConfig(networkId: number): boolean connectToCandidateConfig(networkId: number): void
连接到候选网络。 连接到候选网络。
...@@ -569,18 +585,14 @@ connectToCandidateConfig(networkId: number): boolean ...@@ -569,18 +585,14 @@ connectToCandidateConfig(networkId: number): boolean
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| networkId | number | 是 | 候选网络配置的ID。 | | networkId | number | 是 | 候选网络配置的ID。 |
**返回值:**
| **类型** | **说明** |
| -------- | -------- |
| boolean | true:操作成功,&nbsp;false:操作失败。 |
## wifi.connectToNetwork ## wifi.connectToNetwork
connectToNetwork(networkId: number): boolean connectToNetwork(networkId: number): boolean
连接到指定网络。 连接到指定网络。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -602,10 +614,10 @@ connectToNetwork(networkId: number): boolean ...@@ -602,10 +614,10 @@ connectToNetwork(networkId: number): boolean
connectToDevice(config: WifiDeviceConfig): boolean connectToDevice(config: WifiDeviceConfig): boolean
连接到指定网络。 连接到指定网络。
此接口为系统接口。
**需要权限:** **系统接口:** 此接口为系统接口。
ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG 和 ohos.permissio.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG 和 ohos.permissio.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**系统能力:** **系统能力:**
SystemCapability.Communication.WiFi.STA SystemCapability.Communication.WiFi.STA
...@@ -626,10 +638,10 @@ connectToDevice(config: WifiDeviceConfig): boolean ...@@ -626,10 +638,10 @@ connectToDevice(config: WifiDeviceConfig): boolean
disconnect(): boolean disconnect(): boolean
连接到指定网络。 连接到指定网络。
此接口为系统接口。
**需要权限:** **系统接口:** 此接口为系统接口。
ohos.permission.SET_WIFI_INFO 和 ohos.permissio.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**系统能力:** **系统能力:**
SystemCapability.Communication.WiFi.STA SystemCapability.Communication.WiFi.STA
...@@ -723,19 +735,19 @@ getLinkedInfo(callback: AsyncCallback&lt;WifiLinkedInfo&gt;): void ...@@ -723,19 +735,19 @@ getLinkedInfo(callback: AsyncCallback&lt;WifiLinkedInfo&gt;): void
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ssid | string | 只读 | 热点的SSID,编码格式为UTF-8。 | | ssid | string | 只读 | 热点的SSID,编码格式为UTF-8。 |
| bssid | string | 只读 | 热点的BSSID。 | | bssid | string | 只读 | 热点的BSSID。 |
| networkId | number | 只读 | 网络配置ID, 仅系统应用可用。 | | networkId | number | 只读 | 网络配置ID<br /> **系统接口:** 此接口为系统接口。 |
| rssi | number | 只读 | 热点的信号强度(dBm)。 | | rssi | number | 只读 | 热点的信号强度(dBm)。 |
| band | number | 只读 | WLAN接入点的频段。 | | band | number | 只读 | WLAN接入点的频段。 |
| linkSpeed | number | 只读 | WLAN接入点的速度。 | | linkSpeed | number | 只读 | WLAN接入点的速度。 |
| frequency | number | 只读 | WLAN接入点的频率。 | | frequency | number | 只读 | WLAN接入点的频率。 |
| isHidden | boolean | 只读 | WLAN接入点是否是隐藏网络。 | | isHidden | boolean | 只读 | WLAN接入点是否是隐藏网络。 |
| isRestricted | boolean | 只读 | WLAN接入点是否限制数据量。 | | isRestricted | boolean | 只读 | WLAN接入点是否限制数据量。 |
| chload | number | 只读 | 连接负载,值越大表示负载约高,仅系统应用可用。 | | chload | number | 只读 | 连接负载,值越大表示负载约高<br /> **系统接口:** 此接口为系统接口。 |
| snr | number | 只读 | 信噪比,仅系统应用可用。 | | snr | number | 只读 | 信噪比<br /> **系统接口:** 此接口为系统接口。 |
| macType<sup>9+</sup> | number | 只读 | MAC地址类型。 | | macType<sup>9+</sup> | number | 只读 | MAC地址类型。 |
| macAddress | string | 只读 | 设备的MAC地址。 | | macAddress | string | 只读 | 设备的MAC地址。 |
| ipAddress | number | 只读 | WLAN连接的IP地址。 | | ipAddress | number | 只读 | WLAN连接的IP地址。 |
| suppState | [SuppState](#suppstate) | 只读 | 请求状态,仅系统应用可用。| | suppState | [SuppState](#suppstate) | 只读 | 请求状态<br /> **系统接口:** 此接口为系统接口。 |
| connState | [ConnState](#connstate) | 只读 | WLAN连接状态。 | | connState | [ConnState](#connstate) | 只读 | WLAN连接状态。 |
...@@ -761,6 +773,8 @@ getLinkedInfo(callback: AsyncCallback&lt;WifiLinkedInfo&gt;): void ...@@ -761,6 +773,8 @@ getLinkedInfo(callback: AsyncCallback&lt;WifiLinkedInfo&gt;): void
表示请求状态的枚举。 表示请求状态的枚举。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.STA **系统能力:** SystemCapability.Communication.WiFi.STA
| 名称 | 默认值 | 说明 | | 名称 | 默认值 | 说明 |
...@@ -800,7 +814,8 @@ isConnected(): boolean ...@@ -800,7 +814,8 @@ isConnected(): boolean
getSupportedFeatures(): number getSupportedFeatures(): number
查询设备支持的特性。 查询设备支持的特性。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO **需要权限:** ohos.permission.GET_WIFI_INFO
...@@ -854,7 +869,8 @@ isFeatureSupported(featureId: number): boolean ...@@ -854,7 +869,8 @@ isFeatureSupported(featureId: number): boolean
getDeviceMacAddress(): string[] getDeviceMacAddress(): string[]
获取设备的MAC地址。 获取设备的MAC地址。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_LOCAL_MAC 和 ohos.permission.GET_WIFI_INFO,仅系统应用可用。 **需要权限:** ohos.permission.GET_WIFI_LOCAL_MAC 和 ohos.permission.GET_WIFI_INFO,仅系统应用可用。
...@@ -920,7 +936,8 @@ getCountryCode(): string ...@@ -920,7 +936,8 @@ getCountryCode(): string
reassociate(): boolean reassociate(): boolean
重新关联网络。 重新关联网络。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -937,7 +954,8 @@ reassociate(): boolean ...@@ -937,7 +954,8 @@ reassociate(): boolean
reconnect(): boolean reconnect(): boolean
重新连接网络。 重新连接网络。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -954,7 +972,8 @@ reconnect(): boolean ...@@ -954,7 +972,8 @@ reconnect(): boolean
getDeviceConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt; getDeviceConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt;
获取网络配置。 获取网络配置。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.LOCATION 和 ohos.permission.GET_WIFI_CONFIG **需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.LOCATION 和 ohos.permission.GET_WIFI_CONFIG
...@@ -968,10 +987,11 @@ getDeviceConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt; ...@@ -968,10 +987,11 @@ getDeviceConfigs(): &nbsp;Array&lt;[WifiDeviceConfig](#wifideviceconfig)&gt;
## wifi.updateNetwork<sup>7+</sup> ## wifi.updateNetwork<sup>7+</sup>
updateNetwork(config: WifiDeviceConfig): boolean updateNetwork(config: WifiDeviceConfig): number
更新网络配置。 更新网络配置。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.SET_WIFI_CONFIG
...@@ -985,7 +1005,7 @@ updateNetwork(config: WifiDeviceConfig): boolean ...@@ -985,7 +1005,7 @@ updateNetwork(config: WifiDeviceConfig): boolean
**返回值:** **返回值:**
| **类型** | **说明** | | **类型** | **说明** |
| -------- | -------- | | -------- | -------- |
| boolean | true:操作成功,&nbsp;false:操作失败。 | | number | 返回更新的网络配置ID,如果值为-1表示更新失败。 |
## wifi.disableNetwork<sup>7+</sup> ## wifi.disableNetwork<sup>7+</sup>
...@@ -993,7 +1013,8 @@ updateNetwork(config: WifiDeviceConfig): boolean ...@@ -993,7 +1013,8 @@ updateNetwork(config: WifiDeviceConfig): boolean
disableNetwork(netId: number): boolean disableNetwork(netId: number): boolean
去使能网络配置。 去使能网络配置。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -1015,7 +1036,8 @@ disableNetwork(netId: number): boolean ...@@ -1015,7 +1036,8 @@ disableNetwork(netId: number): boolean
removeAllNetwork(): boolean removeAllNetwork(): boolean
移除所有网络配置。 移除所有网络配置。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -1032,7 +1054,8 @@ removeAllNetwork(): boolean ...@@ -1032,7 +1054,8 @@ removeAllNetwork(): boolean
removeDevice(id: number): boolean removeDevice(id: number): boolean
移除指定的网络配置。 移除指定的网络配置。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。 **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
...@@ -1054,7 +1077,8 @@ removeDevice(id: number): boolean ...@@ -1054,7 +1077,8 @@ removeDevice(id: number): boolean
enableHotspot(): boolean enableHotspot(): boolean
使能热点。 使能热点。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。 **需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。
...@@ -1071,7 +1095,8 @@ enableHotspot(): boolean ...@@ -1071,7 +1095,8 @@ enableHotspot(): boolean
disableHotspot(): boolean disableHotspot(): boolean
去使能热点。 去使能热点。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。 **需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。
...@@ -1088,7 +1113,8 @@ disableHotspot(): boolean ...@@ -1088,7 +1113,8 @@ disableHotspot(): boolean
isHotspotDualBandSupported(): boolean isHotspotDualBandSupported(): boolean
热点是否支持双频。 热点是否支持双频。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。 **需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。
...@@ -1105,7 +1131,8 @@ isHotspotDualBandSupported(): boolean ...@@ -1105,7 +1131,8 @@ isHotspotDualBandSupported(): boolean
isHotspotActive(): boolean isHotspotActive(): boolean
热点是否已使能。 热点是否已使能。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO **需要权限:** ohos.permission.GET_WIFI_INFO
...@@ -1122,7 +1149,8 @@ isHotspotActive(): boolean ...@@ -1122,7 +1149,8 @@ isHotspotActive(): boolean
setHotspotConfig(config: HotspotConfig): boolean setHotspotConfig(config: HotspotConfig): boolean
设置热点配置信息。 设置热点配置信息。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.GET_WIFI_CONFIG **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.GET_WIFI_CONFIG
...@@ -1143,6 +1171,8 @@ setHotspotConfig(config: HotspotConfig): boolean ...@@ -1143,6 +1171,8 @@ setHotspotConfig(config: HotspotConfig): boolean
热点配置信息。 热点配置信息。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.AP.Core **系统能力:** SystemCapability.Communication.WiFi.AP.Core
| **参数名** | **类型** | **读写属性** | **说明** | | **参数名** | **类型** | **读写属性** | **说明** |
...@@ -1159,7 +1189,8 @@ setHotspotConfig(config: HotspotConfig): boolean ...@@ -1159,7 +1189,8 @@ setHotspotConfig(config: HotspotConfig): boolean
getHotspotConfig(): HotspotConfig getHotspotConfig(): HotspotConfig
获取热点配置信息。 获取热点配置信息。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.GET_WIFI_CONFIG **需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.GET_WIFI_CONFIG
...@@ -1176,7 +1207,8 @@ getHotspotConfig(): HotspotConfig ...@@ -1176,7 +1207,8 @@ getHotspotConfig(): HotspotConfig
getStations(): &nbsp;Array&lt;[StationInfo](#stationinfo7)&gt; getStations(): &nbsp;Array&lt;[StationInfo](#stationinfo7)&gt;
获取连接的设备。 获取连接的设备。
此接口为系统接口。
**系统接口:** 此接口为系统接口。
**需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.LOCATION 和 ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。 **需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.LOCATION 和 ohos.permission.MANAGE_WIFI_HOTSPOT,仅系统应用可用。
...@@ -1192,6 +1224,8 @@ getStations(): &nbsp;Array&lt;[StationInfo](#stationinfo7)&gt; ...@@ -1192,6 +1224,8 @@ getStations(): &nbsp;Array&lt;[StationInfo](#stationinfo7)&gt;
接入的设备信息。 接入的设备信息。
**系统接口:** 此接口为系统接口。
**系统能力:** SystemCapability.Communication.WiFi.AP.Core **系统能力:** SystemCapability.Communication.WiFi.AP.Core
| **参数名** | **类型** | **读写属性** | **说明** | | **参数名** | **类型** | **读写属性** | **说明** |
...@@ -1594,7 +1628,7 @@ deletePersistentGroup(netId: number): boolean ...@@ -1594,7 +1628,7 @@ deletePersistentGroup(netId: number): boolean
删除永久组。 删除永久组。
**需要权限:** ohos.permission.GET_WIFI_INFO **需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION
**系统能力:** SystemCapability.Communication.WiFi.P2P **系统能力:** SystemCapability.Communication.WiFi.P2P
...@@ -1611,7 +1645,8 @@ deletePersistentGroup(netId: number): boolean ...@@ -1611,7 +1645,8 @@ deletePersistentGroup(netId: number): boolean
## wifi.getP2pGroups<sup>9+</sup> ## wifi.getP2pGroups<sup>9+</sup>
此接口为系统接口。
**系统接口:** 此接口为系统接口。
getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt; getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;
...@@ -1667,10 +1702,10 @@ getP2pGroups(callback: AsyncCallback&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;): void ...@@ -1667,10 +1702,10 @@ getP2pGroups(callback: AsyncCallback&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;): void
setDeviceName(devName: string): boolean setDeviceName(devName: string): boolean
设置设备名称。 设置设备名称。
此接口为系统接口。
**需要权限:** **系统接口:** 此接口为系统接口。
ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**需要权限:** ohos.permission.SET_WIFI_INFO 和 ohos.permission.MANAGE_WIFI_CONNECTION,仅系统应用可用。
**系统能力:** SystemCapability.Communication.WiFi.P2P **系统能力:** SystemCapability.Communication.WiFi.P2P
......
文件模式从 100755 更改为 100644
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册