diff --git a/en/application-dev/ability/fa-dataability.md b/en/application-dev/ability/fa-dataability.md index 81e67af18e17fb12682a2f21decd80d10ac79a9c..faad709b280730f5f96c79a905fe6385f04fce62 100644 --- a/en/application-dev/ability/fa-dataability.md +++ b/en/application-dev/ability/fa-dataability.md @@ -1,9 +1,12 @@ # Data Ability Development + ## When to Use + A Data ability helps applications manage access to data stored by themselves and other applications. It also provides APIs for sharing data with other applications either on the same device or across devices. Data ability providers can customize data access-related APIs such as data inserting, deleting, updating, and querying, as well as file opening, and share data with other applications through these open APIs. + ## Available APIs **Table 1** Data ability lifecycle APIs @@ -18,7 +21,7 @@ Data ability providers can customize data access-related APIs such as data inser |denormalizeUri?(uri: string, callback: AsyncCallback\): void|Converts a normalized URI generated by **normalizeUri** into a denormalized URI.| |insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback\): void|Inserts a data record into the database.| |openFile?(uri: string, mode: string, callback: AsyncCallback\): void|Opens a file.| -|getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback\>): void|Obtains the MIME type of a file.| +|getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void|Obtains the MIME type of a file.| |getType?(uri: string, callback: AsyncCallback\): void|Obtains the MIME type matching the data specified by the URI.| |executeBatch?(ops: Array\, callback: AsyncCallback\>): void|Operates data in the database in batches.| |call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback\): void|Calls a custom API.| @@ -115,7 +118,7 @@ Import the basic dependency packages and obtain the URI string for communicating The basic dependency packages include: - @ohos.ability.featureAbility -- @ohos.data.dataability +- @ohos.data.dataAbility - @ohos.data.rdb #### Data Ability API Development @@ -129,7 +132,7 @@ The basic dependency packages include: import featureAbility from '@ohos.ability.featureAbility' import ohos_data_ability from '@ohos.data.dataAbility' import ohos_data_rdb from '@ohos.data.rdb' - + var urivar = "dataability:///com.ix.DataAbility" var DAHelper = featureAbility.acquireDataAbilityHelper( urivar diff --git a/en/application-dev/ability/figures/page-ability-lifecycle.png b/en/application-dev/ability/figures/page-ability-lifecycle.png index edb49acd0647f3af7355ceda987c5ca812866128..b35954967bb9c733725da2f0700481932619ae45 100644 Binary files a/en/application-dev/ability/figures/page-ability-lifecycle.png and b/en/application-dev/ability/figures/page-ability-lifecycle.png differ diff --git a/en/application-dev/ability/stage-ability.md b/en/application-dev/ability/stage-ability.md index 936e1c1b8942f52ec0b470ae851a10cdf0e82011..7f08aa3d19d29d1857e36791e7ca28ea99e62bce 100644 --- a/en/application-dev/ability/stage-ability.md +++ b/en/application-dev/ability/stage-ability.md @@ -1,19 +1,19 @@ # Ability Development ## When to Use -Unlike the FA model, the [stage model](stage-brief.md) requires you to declare the application package structure in the `module.json` and `app.json` files during application development. For details about the configuration file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). To develop abilities based on the stage model, implement the following logic: -- Create abilities for an application that involves screen viewing and human-machine interaction. You must implement the following scenarios: ability lifecycle callbacks, obtaining ability configuration, requesting permissions, and notifying environment changes. +Ability development in the [stage model](stage-brief.md) is significantly different from that in the FA model. The stage model requires you to declare the application package structure in the `module.json` and `app.json` files during application development. For details about the configuration file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). To develop an ability based on the stage model, implement the following logic: +- Create an ability that supports screen viewing and human-machine interaction. You must implement the following scenarios: ability lifecycle callbacks, obtaining ability configuration, requesting permissions, and notifying environment changes. - Start an ability. You need to implement ability startup on the same device, on a remote device, or with a specified UI page. - Call abilities. For details, see [Call Development](stage-call.md). - Connect to and disconnect from a Service Extension ability. For details, see [Service Extension Ability Development](stage-serviceextension.md). - Continue the ability on another device. For details, see [Ability Continuation Development](stage-ability-continuation.md). ### Launch Type -The ability supports three launch types: singleton, multi-instance, and instance-specific. Each launch type, specified by `launchType` in the `module.json` file, specifies the action that can be performed when the ability is started. +An ability can be launched in the **standard**, **singleton**, or **specified** mode, as configured by `launchType` in the `module.json` file. Depending on the launch type, the action performed when the ability is started differs, as described below. -| Launch Type | Description |Description | +| Launch Type | Description |Action | | ----------- | ------- |---------------- | | standard | Multi-instance | A new instance is started each time an ability starts.| -| singleton | Singleton | Only one instance exists in the system. If an instance already exists when an ability is started, that instance is reused.| +| singleton | Singleton | The ability has only one instance in the system. If an instance already exists when an ability is started, that instance is reused.| | specified | Instance-specific| The internal service of an ability determines whether to create multiple instances during running.| By default, the singleton mode is used. The following is an example of the `module.json` file: @@ -58,7 +58,7 @@ To create Page abilities for an application in the stage model, you must impleme ``` import AbilityStage from "@ohos.application.AbilityStage" ``` -2. Implement the `AbilityStage` class. +2. Implement the `AbilityStage` class. The default relative path generated by the APIs is **entry\src\main\ets\Application\AbilityStage.ts**. ```ts export default class MyAbilityStage extends AbilityStage { onCreate() { @@ -70,7 +70,7 @@ To create Page abilities for an application in the stage model, you must impleme ```js import Ability from '@ohos.application.Ability' ``` -4. Implement the lifecycle callbacks of the `Ability` class. +4. Implement the lifecycle callbacks of the `Ability` class. The default relative path generated by the APIs is **entry\src\main\ets\MainAbility\MainAbility.ts**. In the `onWindowStageCreate(windowStage)` API, use `loadContent` to set the application page to be loaded. For details about how to use the `Window` APIs, see [Window Development](../windowmanager/window-guidelines.md). ```ts @@ -78,29 +78,29 @@ To create Page abilities for an application in the stage model, you must impleme onCreate(want, launchParam) { console.log("MainAbility onCreate") } - + onDestroy() { console.log("MainAbility onDestroy") } - + onWindowStageCreate(windowStage) { console.log("MainAbility onWindowStageCreate") - - windowStage.loadContent("pages/index").then((data) => { - console.log("MainAbility load content succeed with data: " + JSON.stringify(data)) + + windowStage.loadContent("pages/index").then(() => { + console.log("MainAbility load content succeed") }).catch((error) => { console.error("MainAbility load content failed with error: "+ JSON.stringify(error)) }) } - + onWindowStageDestroy() { console.log("MainAbility onWindowStageDestroy") } - + onForeground() { console.log("MainAbility onForeground") } - + onBackground() { console.log("MainAbility onBackground") } @@ -140,14 +140,14 @@ export default class MainAbility extends Ability { console.log("MainAbility ability name" + abilityInfo.name) let config = this.context.config - console.log("MyAbilityStage config language" + config.language) + console.log("MainAbility config language" + config.language) } } ``` ### Requesting Permissions -If an application needs to obtain user privacy information or use system capabilities, for example, obtaining location information or using the camera to take photos or record videos, it must request the permission from consumers. During application development, you need to specify the involved sensitive permissions, declare the required permissions in `module.json`, and use the `requestPermissionsFromUser` API to request the permission from consumers in the form of a dialog box. The following uses the permissions for calendar access as an example. +If an application needs to obtain user privacy information or use system capabilities, for example, obtaining location information or using the camera to take photos or record videos, it must request the respective permission from consumers. During application development, you need to specify the involved sensitive permissions, declare the required permissions in `module.json`, and use the `requestPermissionsFromUser` API to request the permission from consumers in the form of a dialog box. The following uses the permission for calendar access as an example. -Declare the required permissions in the `module.json` file. +Declare the required permission in the `module.json` file. ```json "requestPermissions": [ { @@ -155,7 +155,7 @@ Declare the required permissions in the `module.json` file. } ] ``` -Request the permissions from consumers in the form of a dialog box: +Request the permission from consumers in the form of a dialog box: ```ts let context = this.context let permissions: Array = ['ohos.permission.READ_CALENDAR'] @@ -166,11 +166,11 @@ context.requestPermissionsFromUser(permissions).then((data) => { }) ``` ### Notifying of Environment Changes -Environment changes include changes of global configurations and ability configurations. Currently, the global configurations include the system language and color mode. The change of global configurations is generally triggered by the configuration item in **Settings** or the icon in **Control Panel**. The ability configuration is specific to a single `Ability` instance, including the display ID, screen resolution, and screen orientation. The configuration is related to the display where the ability is located, and the change is generally triggered by the window. For details on the configuration, see [Configuration](../reference/apis/js-apis-configuration.md). +Environment changes include changes of global configurations and ability configurations. Currently, the global configurations include the system language and color mode. The change of global configurations is generally triggered by configuration items in **Settings** or icons in **Control Panel**. The ability configuration is specific to a single `Ability` instance, including the display ID, screen resolution, and screen orientation. The configuration is related to the display where the ability is located, and the change is generally triggered by the window. For details on the configuration, see [Configuration](../reference/apis/js-apis-configuration.md). For an application in the stage model, when the configuration changes, its abilities are not restarted, but the `onConfigurationUpdated(config: Configuration)` callback is triggered. If the application needs to perform processing based on the change, you can overwrite `onConfigurationUpdated`. Note that the `Configuration` object in the callback contains all the configurations of the current ability, not only the changed configurations. -The following example shows the implement of the `onConfigurationUpdated` callback in the `AbilityStage` class. The callback is triggered when the system language and color mode are changed. +The following example shows the implementation of the `onConfigurationUpdated` callback in the `AbilityStage` class. The callback is triggered when the system language and color mode are changed. ```ts import Ability from '@ohos.application.Ability' import ConfigurationConstant from '@ohos.application.ConfigurationConstant' @@ -184,7 +184,7 @@ export default class MyAbilityStage extends AbilityStage { } ``` -The following example shows the implement of the `onConfigurationUpdated` callback in the `Ability` class. The callback is triggered when the system language, color mode, or display parameters (such as the direction and density) change. +The following example shows the implementation of the `onConfigurationUpdated` callback in the `Ability` class. The callback is triggered when the system language, color mode, or display parameters (such as the direction and density) change. ```ts import Ability from '@ohos.application.Ability' import ConfigurationConstant from '@ohos.application.ConfigurationConstant' @@ -205,7 +205,7 @@ export default class MainAbility extends Ability { ``` ## Starting an Ability ### Available APIs -The `Ability` class has the `context` attribute, which belongs to the `AbilityContext` class. The `AbilityContext` class has the `abilityInfo`, `currentHapModuleInfo`, and other attributes and the APIs used for starting abilities. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md). +The `Ability` class has the `context` attribute, which belongs to the `AbilityContext` class. The `AbilityContext` class has the `abilityInfo`, `currentHapModuleInfo`, and other attributes as well as the APIs used for starting abilities. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md). **Table 3** AbilityContext APIs |API|Description| @@ -227,17 +227,16 @@ var want = { "bundleName": "com.example.MyApplication", "abilityName": "MainAbility" }; -context.startAbility(want).then((data) => { - console.log("Succeed to start ability with data: " + JSON.stringify(data)) +context.startAbility(want).then(() => { + console.log("Succeed to start ability") }).catch((error) => { console.error("Failed to start ability with error: "+ JSON.stringify(error)) }) ``` ### Starting an Ability on a Remote Device -This feature applies only to system applications, since the `getTrustedDeviceListSync` API of the `DeviceManager` class is open only to system applications. +>This feature applies only to system applications, since the `getTrustedDeviceListSync` API of the `DeviceManager` class is open only to system applications. In the cross-device scenario, you must specify the ID of the remote device. The sample code is as follows: - ```ts let context = this.context var want = { @@ -245,8 +244,8 @@ var want = { "bundleName": "com.example.MyApplication", "abilityName": "MainAbility" }; -context.startAbility(want).then((data) => { - console.log("Succeed to start remote ability with data: " + JSON.stringify(data)) +context.startAbility(want).then(() => { + console.log("Succeed to start remote ability") }).catch((error) => { console.error("Failed to start remote ability with error: " + JSON.stringify(error)) }) @@ -268,9 +267,9 @@ function getRemoteDeviceId() { } } ``` -Request the permission `ohos.permission.DISTRIBUTED_DATASYNC ` from consumers. This permission is used for data synchronization. For details about the sample code for requesting the permission, see [Requesting Permissions](##requesting-permissions). +Request the permission `ohos.permission.DISTRIBUTED_DATASYNC` from consumers. This permission is used for data synchronization. For details about the sample code for requesting the permission, see [Requesting Permissions](##requesting-permissions). ### Starting an Ability with the Specified Page -If the launch type of an ability is set to `singleton` and the ability has been started, the `onNewWant` callback is triggered when the ability is started again. You can pass start options through the `want`. For example, to start an ability with the specified page, use the `uri` or `parameters` parameter in the `want` to pass the page information. Currently, the ability in the stage model cannot directly use the `router` capability. You must pass the start options to the custom component and invoke the `router` method to display the specified page during the custom component lifecycle management. The sample code is as follows: +If the launch type of an ability is set to `singleton` and the ability has been started, the `onNewWant` callback rather than the `onCreate` callback is triggered when the ability is started again. You can pass start options through the `want`. For example, to start an ability with the specified page, use the `uri` or `parameters` parameter in the `want` to pass the page information. Currently, the ability in the stage model cannot directly use the `router` capability. You must pass the start options to the custom component and invoke the `router` method to display the specified page during the custom component lifecycle management. The sample code is as follows: When using `startAbility` to start an ability again, use the `uri` parameter in the `want` to pass the page information. ```ts @@ -312,7 +311,7 @@ struct Index { console.info('Index onPageShow') let newWant = globalThis.newWant if (newWant.hasOwnProperty("uri")) { - router.push({ uri: newWant.uri }); + router.push({ url: newWant.uri }); globalThis.newWant = undefined } } diff --git a/en/application-dev/ability/stage-serviceextension.md b/en/application-dev/ability/stage-serviceextension.md index a41526e05223b4f944f0977b715a548aa994bb12..b6fc349d0902889502e10502ca850af295b2ecc0 100644 --- a/en/application-dev/ability/stage-serviceextension.md +++ b/en/application-dev/ability/stage-serviceextension.md @@ -26,7 +26,7 @@ OpenHarmony does not support creation of a Service Extension ability for third-p 1. Create a Service Extension ability. -2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined and override the lifecycle callbacks of the base class. The code sample is as follows: +2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined (**entry\src\main\ets\ServiceExtAbility\ServiceExtAbility.ts** by default) and override the lifecycle callbacks of the base class. The code sample is as follows: ```js import rpc from '@ohos.rpc' diff --git a/en/application-dev/device/sensor-guidelines.md b/en/application-dev/device/sensor-guidelines.md index f47656b4d744f1303356fd3ee601b43becfadec6..dcfffc55a6400f21c9180ee3306af16ae8713119 100644 --- a/en/application-dev/device/sensor-guidelines.md +++ b/en/application-dev/device/sensor-guidelines.md @@ -37,7 +37,7 @@ "reqPermissions":[ { "name":"ohos.permission.ACCELEROMETER", - "reason"":"", + "reason":"", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -45,7 +45,7 @@ }, { "name":"ohos.permission.GYROSCOPE", - "reason"":"", + "reason":"", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -53,7 +53,7 @@ }, { "name":"ohos.permission.ACTIVITY_MOTION", - "reason"":"ACTIVITY_MOTION_TEST", + "reason":"ACTIVITY_MOTION_TEST", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -61,7 +61,7 @@ }, { "name":"ohos.permission.READ_HEALTH_DATA", - "reason"":"HEALTH_DATA_TEST", + "reason":"HEALTH_DATA_TEST", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 1cd0c63f96aee81a6dfbcc00422afa7a55292e6e..1dcdd4b837f3f5236871445eaa88140ad8732968 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -1141,8 +1141,8 @@ SystemCapability.BundleManager.BundleFramework **Example** ```js -let bundleName = com.example.myapplication; -let abilityName = com.example.myapplication.MainAbility; +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; bundle.getAbilityIcon(bundleName, abilityName) .then((data) => { console.info('Operation successful. Data: ' + JSON.stringify(data)); @@ -1176,8 +1176,8 @@ SystemCapability.BundleManager.BundleFramework **Example** ```js -let bundleName = com.example.myapplication; -let abilityName = com.example.myapplication.MainAbility; +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { if (err) { console.error('Operation failed. Cause: ' + JSON.stringify(err)); diff --git a/en/application-dev/reference/apis/js-apis-Context.md b/en/application-dev/reference/apis/js-apis-Context.md index 213f302466c5dfd0cabb76f4899665139dfe2e3d..9ceaca4f6f4c784172d6f6905d702b7970a67000 100644 --- a/en/application-dev/reference/apis/js-apis-Context.md +++ b/en/application-dev/reference/apis/js-apis-Context.md @@ -7,7 +7,7 @@ import featureAbility from '@ohos.ability.featureAbility' import bundle from '@ohos.bundle' ``` -The **Context** object is created in a **featureAbility** and returned through its **getContext()** API. Therefore, you must import the **@ohos.ability.featureAbility** package before using the Context module. An example is as follows: +The **Context** object is created in a **featureAbility** and returned through its **getContext()** API. Therefore, you must import the **@ohos.ability.featureAbility** package before using the **Context** module. An example is as follows: ```js import featureAbility from '@ohos.ability.featureAbility' @@ -27,9 +27,9 @@ If this API is called for the first time, a root directory will be created. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | -------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the local root directory.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the local root directory.| **Example** @@ -55,8 +55,8 @@ If this API is called for the first time, a root directory will be created. **Return value** -| Type | Description | -| ---------------- | ---------------------- | +| Type | Description | +| ---------------- | ----------- | | Promise\ | Promise used to return the local root directory.| **Example** @@ -81,11 +81,11 @@ Verifies whether a specific PID and UID have the given permission. This API uses **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | --------------------------------------- | ---- | ------------------------------------- | -| permission | string | Yes | Name of the permission to verify. | -| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. | -| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| +| Name | Type | Mandatory | Description | +| ---------- | --------------------------------------- | ---- | -------------------- | +| permission | string | Yes | Name of the permission to verify. | +| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. | +| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.| **Example** @@ -110,10 +110,10 @@ Verifies whether the current PID and UID have the given permission. This API use **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ---------------------- | ---- | ------------------------------------- | -| permission | string | Yes | Name of the permission to verify. | -| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| +| Name | Type | Mandatory | Description | +| ---------- | ---------------------- | ---- | -------------------- | +| permission | string | Yes | Name of the permission to verify. | +| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.| **Example** @@ -133,16 +133,16 @@ Verifies whether a specific PID and UID have the given permission. This API uses **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | --------------------------------------- | ---- | ---------------- | -| permission | string | Yes | Name of the permission to verify.| -| options | [PermissionOptions](#permissionoptions) | No | Permission options. | +| Name | Type | Mandatory | Description | +| ---------- | --------------------------------------- | ---- | -------- | +| permission | string | Yes | Name of the permission to verify.| +| options | [PermissionOptions](#permissionoptions) | No | Permission options. | **Return value** -| Type | Description | -| ---------------- | ----------------------------------------------------------- | -| Promise\ | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| +| Type | Description | +| ---------------- | ---------------------------------- | +| Promise\ | Promise used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.| **Example** @@ -168,11 +168,11 @@ Requests certain permissions from the system. This API uses an asynchronous call **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- | -| permissions | Array\ | Yes | Permissions to request. This parameter cannot be **null**. | -| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.| -| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Permission request result. | +| Name | Type | Mandatory | Description | +| -------------- | ---------------------------------------- | ---- | ----------------------------------- | +| permissions | Array\ | Yes | Permissions to request. This parameter cannot be **null**. | +| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.| +| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Callback used to return the permission request result. | **Example** @@ -193,6 +193,44 @@ context.requestPermissionsFromUser( ``` +## Context.requestPermissionsFromUser7+ + +requestPermissionsFromUser(permissions: Array\, requestCode: number): Promise\<[PermissionRequestResult](#permissionrequestresult7)> + +Requests certain permissions from the system. This API uses a promise to return the result. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------------- | ------------------- | ----- | -------------------------------------------- | +| permissions | Array\ | Yes | Permissions to request. This parameter cannot be **null**. | +| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------- | ---------------- | +| Promise\<[PermissionRequestResult](#permissionrequestresult7)> | Promise used to return the permission request result.| + +**Example** + +```js +import featureAbility from '@ohos.ability.featureAbility' +var context = featureAbility.getContext(); +context.requestPermissionsFromUser( + ["com.example.permission1", + "com.example.permission2", + "com.example.permission3", + "com.example.permission4", + "com.example.permission5"], + 1).then((data)=>{ + console.info("====>requestdata====>" + JSON.stringify(data)); + }); +``` + + ## Context.getApplicationInfo @@ -204,9 +242,9 @@ Obtains information about the current application. This API uses an asynchronous **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------- | ---- | ------------------------ | -| callback | AsyncCallback\ | Yes | Callback used to return the application information.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------------- | ---- | ------------ | +| callback | AsyncCallback\ | Yes | Callback used to return the application information.| **Example** @@ -228,8 +266,8 @@ Obtains information about the current application. This API uses a promise to re **Return value** -| Type | Description | -| ------------------------- | ------------------ | +| Type | Description | +| ------------------------- | --------- | | Promise\ | Promise used to return the application information.| **Example** @@ -249,15 +287,15 @@ context.getApplicationInfo().then((data) => { getBundleName(callback: AsyncCallback\): void -Obtains the bundle name of the current ability. This API uses an asynchronous callback to return the result. +Obtains the bundle name of this ability. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ----------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ------------------ | +| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.| **Example** @@ -273,14 +311,14 @@ context.getBundleName() getBundleName(): Promise\ -Obtains the bundle name of the current ability. This API uses a promise to return the result. +Obtains the bundle name of this ability. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** -| Type | Description | -| ---------------- | ------------------------- | +| Type | Description | +| ---------------- | ---------------- | | Promise\ | Promise used to return the bundle name.| **Example** @@ -306,9 +344,9 @@ Obtains information about the current process, including the PID and process nam **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------------- | ---- | -------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the process information.| +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ---------- | +| callback | AsyncCallback\ | Yes | Callback used to return the process information.| **Example** @@ -330,8 +368,8 @@ Obtains information about the current process, including the PID and process nam **Return value** -| Type | Description | -| --------------------- | -------------- | +| Type | Description | +| --------------------- | ------- | | Promise\ | Promise used to return the process information.| **Example** @@ -351,7 +389,7 @@ context.getProcessInfo().then((data) => { getElementName(callback: AsyncCallback\): void -Obtains the **ohos.bundle.ElementName** object of the current ability. This API uses an asynchronous callback to return the result. +Obtains the **ohos.bundle.ElementName** object of this ability. This API uses an asynchronous callback to return the result. This API is available only to Page abilities. @@ -359,9 +397,9 @@ This API is available only to Page abilities. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------------- | ---- | ---------------------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the **ohos.bundle.ElementName** object.| +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | -------------------------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the **ohos.bundle.ElementName** object.| **Example** @@ -377,7 +415,7 @@ context.getElementName() getElementName(): Promise\ -Obtains the **ohos.bundle.ElementName** object of the current ability. This API uses a promise to return the result. +Obtains the **ohos.bundle.ElementName** object of this ability. This API uses a promise to return the result. This API is available only to Page abilities. @@ -385,8 +423,8 @@ This API is available only to Page abilities. **Return value** -| Type | Description | -| --------------------- | ------------------------------------------ | +| Type | Description | +| --------------------- | ------------------------------------ | | Promise\ | Promise used to return the **ohos.bundle.ElementName** object.| **Example** @@ -410,9 +448,9 @@ Obtains the name of the current process. This API uses an asynchronous callback **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | -------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the process name.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ---------- | +| callback | AsyncCallback\ | Yes | Callback used to return the process name.| **Example** @@ -434,8 +472,8 @@ Obtains the name of the current process. This API uses a promise to return the r **Return value** -| Type | Description | -| ---------------- | -------------------- | +| Type | Description | +| ---------------- | ---------- | | Promise\ | Promise used to return the process name.| **Example** @@ -461,9 +499,9 @@ Obtains the bundle name of the calling ability. This API uses an asynchronous ca **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.| **Example** @@ -485,8 +523,8 @@ Obtains the bundle name of the calling ability. This API uses a promise to retur **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------- | -------------- | | Promise\ | Promise used to return the bundle name.| **Example** @@ -504,15 +542,15 @@ context.getCallingBundle().then((data) => { getCacheDir(callback: AsyncCallback\): void -Obtains the cache directory of the application on the internal storage. This API uses an asynchronous callback to return the result. +Obtains the cache directory of the application in the internal storage. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the cache directory.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | --------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the cache directory.| **Example** @@ -532,14 +570,14 @@ context.getCacheDir((err, data) => { getCacheDir(): Promise\ -Obtains the cache directory of the application on the internal storage. This API uses a promise to return the result. +Obtains the cache directory of the application in the internal storage. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------- | --------------- | | Promise\ | Promise used to return the cache directory.| **Example** @@ -557,15 +595,15 @@ context.getCacheDir().then((data) => { getFilesDir(callback: AsyncCallback\): void -Obtains the file directory of the application on the internal storage. This API uses an asynchronous callback to return the result. +Obtains the file directory of the application in the internal storage. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the file directory.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the file directory.| **Example** @@ -585,14 +623,14 @@ context.getFilesDir((err, data) => { getFilesDir(): Promise\ -Obtains the file directory of the application on the internal storage. This API uses a promise to return the result. +Obtains the file directory of the application in the internal storage. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------- | ------------------- | | Promise\ | Promise used to return the file directory.| **Example** @@ -618,9 +656,9 @@ If the distributed file path does not exist, the system will create one and retu **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | ---------------------------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path.| **Example** @@ -648,8 +686,8 @@ If the distributed file path does not exist, the system will create one and retu **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------- | ----------------------------------- | | Promise\ | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created.| **Example** @@ -672,9 +710,9 @@ Obtains the application type. This API uses an asynchronous callback to return t **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the application type.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------- | ---- | -------------------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the application type.| **Example** @@ -700,8 +738,8 @@ Obtains the application type. This API uses a promise to return the result. **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------- | ------------------ | | Promise\ | Promise used to return the application type.| **Example** @@ -724,9 +762,9 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------------------------------------- | +| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.| **Example** @@ -752,8 +790,8 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------------------------------- | ------------------ | | Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object.| **Example** @@ -776,9 +814,9 @@ Obtains the version information of the application. This API uses an asynchronou **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information.| **Example** @@ -804,8 +842,8 @@ Obtains the version information of the application. This API uses a promise to r **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------------------------------- | --------- | | Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information.| **Example** @@ -822,15 +860,15 @@ context.getAppVersionInfo().then((data) => { getAbilityInfo(callback: AsyncCallback\): void -Obtains information of the current ability. This API uses an asynchronous callback to return the result. +Obtains information about this ability. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------- | ---- | ------------------------- | -| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------------------------------------- | +| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes | Callback used to return the ability information.| **Example** @@ -850,14 +888,14 @@ context.getAbilityInfo((err, data) => { getAbilityInfo(): Promise\ -Obtains information of the current ability. This API uses a promise to return the result. +Obtains information about this ability. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** -| Type | Description | -| --------------- | ------------------------- | +| Type | Description | +| ---------------------------------------- | ------------------ | | Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information.| **Example** @@ -880,9 +918,9 @@ Obtains the context of the application. **Return value** -| Type | Description | -| --------- |------ | -| Context |Application context.| +| Type | Description | +| ------- | ---------- | +| Context | Application context.| **Example** @@ -895,48 +933,49 @@ var context = featureAbility.getContext().getApplicationContext(); **System capability**: SystemCapability.Ability.AbilityRuntime.Core -| Name| Readable/Writable| Type | Mandatory| Description | -| ---- | -------- | ------ | ---- | ------ | -| pid | Read-only | number | No | Process ID.| -| uid | Read-only | number | No | User ID.| +| Name | Readable/Writable| Type | Mandatory | Description | +| ---- | ---- | ------ | ---- | ----- | +| pid | Read-only | number | No | Process ID.| +| uid | Read-only | number | No | User ID.| ## PermissionRequestResult **System capability**: SystemCapability.Ability.AbilityRuntime.Core -| Name | Readable/Writable| Type | Mandatory| Description | -| ----------- | -------- | -------------- | ---- | ------------------ | -| requestCode | Read-only | number | Yes | Request code passed.| -| permissions | Read-only | Array\ | Yes | Permissions requested. | -| authResults | Read-only | Array\ | Yes | Permission request result. | +| Name | Readable/Writable| Type | Mandatory | Description | +| ----------- | ---- | -------------- | ---- | ---------- | +| requestCode | Read-only | number | Yes | Request code passed.| +| permissions | Read-only | Array\ | Yes | Permissions requested. | +| authResults | Read-only | Array\ | Yes | Permission request result. | ## HapModuleInfo Describes the HAP module information. -| Name | Type| Readable| Writable| Description| -| ------ | ------ | ------ | ------ | ------ | -| name | string | Yes | No | Module name. | -| description | string | Yes | No | Module description. | -| descriptionId | number | Yes | No | Module description ID. | -| icon | string | Yes | No | Module icon. | -| label | string | Yes | No | Module label. | -| labelId | number | Yes | No | Module label ID. | -| iconId | number | Yes | No | Module icon ID. | -| backgroundImg | string | Yes | No | Module background image. | -| supportedModes | number | Yes | No | Running modes supported by the module. | -| reqCapabilities | Array\ | Yes | No | Capabilities required for module running.| -| deviceTypes | Array\ | Yes | No | Device types supported by the module.| -| abilityInfo | Array\ | Yes | No | Ability information. | -| moduleName | string | Yes | No | Module name. | -| mainAbilityName | string | Yes | No | Name of the main ability. | -| installationFree | boolean | Yes | No | Whether installation-free is supported. | -| mainElementName | string | Yes| No| Information about the main ability.| +| Name | Type | Readable | Writable | Description | +| ---------------- | ------------------- | -------- | -------- | ----------------------------------------- | +| name | string | Yes | No | Module name. | +| description | string | Yes | No | Module description. | +| descriptionId | number | Yes | No | Module description ID. | +| icon | string | Yes | No | Module icon. | +| label | string | Yes | No | Module label. | +| labelId | number | Yes | No | Module label ID. | +| iconId | number | Yes | No | Module icon ID. | +| backgroundImg | string | Yes | No | Module background image. | +| supportedModes | number | Yes | No | Running modes supported by the module. | +| reqCapabilities | Array\ | Yes | No | Capabilities required for module running. | +| deviceTypes | Array\ | Yes | No | Device types supported by the module. | +| abilityInfo | Array\ | Yes | No | Ability information. | +| moduleName | string | Yes | No | Module name. | +| mainAbilityName | string | Yes | No | Name of the main ability. | +| installationFree | boolean | Yes | No | Whether installation-free is supported. | +| mainElementName | string | Yes | No | Information about the main ability. | ## AppVersionInfo -| Name | Type| Readable | Writable | Description| -| ------ | ------ | ------| ------ | ------ | -| appName | string | Yes | No | Module name. | -| versionCode | number | Yes | No | Module description. | -| versionName | string | Yes | No | Module description ID. | + +| Name | Type | Readable | Writable | Description | +| ----------- | ------ | ---- | ---- | ------- | +| appName | string | Yes | No | Module name. | +| versionCode | number | Yes | No | Module description.| +| versionName | string | Yes | No | Module description ID.| diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md index 3d1f09e0e427c20f01a450f9b2a093d12df1ac6a..ad9cd9a4d257370d94566ef43cd81af3bb6e163e 100644 --- a/en/application-dev/reference/apis/js-apis-ability-context.md +++ b/en/application-dev/reference/apis/js-apis-ability-context.md @@ -126,7 +126,7 @@ var options = { windowMode: 0, }; this.context.startAbility(want, options) -.then((data) => { +.then(() => { console.log('Operation successful.') }).catch((error) => { console.log('Operation failed.'); @@ -273,7 +273,7 @@ var options = { }; var accountId = 11; this.context.startAbility(want, accountId, options) -.then((data) => { +.then(() => { console.log('Operation successful.') }).catch((error) => { console.log('Operation failed.'); @@ -352,7 +352,7 @@ Starts an ability with **options** specified. This API uses a promise to return | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | want | [Want](js-apis-featureAbility.md#Want) | Yes| Information about the **Want** used for starting an ability.| -| options | StartOptions | Yes| Parameters used for starting the ability.| +| options | StartOptions | No | Parameters used for starting the ability.| **Return value** @@ -511,8 +511,8 @@ Terminates this ability. This API uses a promise to return the result. **Example** ```js -this.context.terminateSelf(want).then((data) => { - console.log('success:' + JSON.stringify(data)); +this.context.terminateSelf(want).then(() => { + console.log('success:'); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); @@ -571,7 +571,7 @@ this.context.terminateSelfWithResult( { want: {bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo"}, resultCode: 100 -}).then((result) => { +}).then(() => { console.log("terminateSelfWithResult") }) ``` @@ -595,7 +595,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to | Type| Description| | -------- | -------- | -| number | ID of the connection between the two abilities.| +| number | Result code of the ability connection.| **Example** ```js @@ -606,7 +606,7 @@ var want = { } var options = { onConnect: (elementName, remote) => { - console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' remote) + console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' + remote) }, onDisconnect: (elementName) => { console.log('connectAbility onDisconnect, elementName: ' + elementName) @@ -615,8 +615,8 @@ var options = { console.log('connectAbility onFailed, code: ' + code) } } -this.context.connectAbility(want, options) { - console.log('code: ' + code) +let result = this.context.connectAbility(want, options) { + console.log('code: ' + result) } ``` @@ -652,7 +652,7 @@ var want = { var accountId = 111; var options = { onConnect: (elementName, remote) => { - console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' remote) + console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' + remote) }, onDisconnect: (elementName) => { console.log('connectAbility onDisconnect, elementName: ' + elementName) @@ -768,8 +768,8 @@ Sets the label of the ability in the mission. This API uses a promise to return **Example** ```js -this.context.setMissionLabel("test").then((data) => { - console.log('success:' + JSON.stringify(data)); +this.context.setMissionLabel("test").then(() => { + console.log('success:'); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); diff --git a/en/application-dev/reference/apis/js-apis-application-Want.md b/en/application-dev/reference/apis/js-apis-application-Want.md index 3731cf8c99930e4bdf470946c5ad00067c142c21..b52bbbfb03c03b27b63bc137d0056af4f134327a 100644 --- a/en/application-dev/reference/apis/js-apis-application-Want.md +++ b/en/application-dev/reference/apis/js-apis-application-Want.md @@ -1,14 +1,13 @@ # Want -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** -> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. - -**Want** is the basic communication component of the system. +The **Want** module provides the basic communication component of the system. +> **NOTE** +> +> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import - ``` import Want from '@ohos.application.Want'; ``` @@ -20,11 +19,55 @@ import Want from '@ohos.application.Want'; | Name | Readable/Writable| Type | Mandatory| Description | | ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | | deviceId | Read only | string | No | ID of the device running the ability. | -| bundleName | Read only | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability.| -| abilityName | Read only | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability.| +| bundleName | Read only | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability.| +| abilityName | Read only | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability.| | uri | Read only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| -| type | Read only | string | No | MIME type, for example, **text/plain** or **image/***. | -| flags | Read only | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-featureAbility.md#flags).| +| type | Read only | string | No | MIME type, for example, **text/plain** or **image/***. | +| flags | Read only | number | No | How the **Want** object will be handled. For details, see [flags](js-apis-featureAbility.md#flags).| | action | Read only | string | No | Action option. | -| parameters | Read only | {[key: string]: any} | No | List of parameters in the **Want** object. | -| entities | Read only | Array\ | No | List of entities. | | +| parameters | Read only | {[key: string]: any} | No | List of parameters in the **Want** object. | +| entities | Read only | Array\ | No | List of entities. | +| extensionAbilityType9+ | Read only | bundle.ExtensionAbilityType | No | Type of the Extension ability. | +| extensionAbilityName9+ | Read only | string | No | Description of the Extension ability name in the **Want** object. | + +**Example** + +- Basic usage + + ```js + var want = { + "deviceId": "", // An empty deviceId indicates the local device. + "bundleName": "com.extreme.test", + "abilityName": "MainAbility", + "uri": "pages/second" // uri is optional and can be used to pass the destination URI. + }; + this.context.startAbility(want, (error) => { + // Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability. + console.log("error.code = " + error.code) + }) + ``` + +- Passing a file descriptor (FD) + + ```js + var fd; + try { + fd = fileio.openSync("/data/storage/el2/base/haps/pic.png"); + } catch(e) { + console.log("openSync fail:" + JSON.stringify(e)); + } + var want = { + "deviceId": "", // An empty deviceId indicates the local device. + "bundleName": "com.extreme.test", + "abilityName": "MainAbility", + "parameters": { + "keyFd":{"type":"FD", "value":fd} + } + }; + this.context.startAbility(want, (error) => { + // Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability. + console.log("error.code = " + error.code) + }) + ``` + + \ No newline at end of file diff --git a/en/application-dev/reference/apis/js-apis-application-ability.md b/en/application-dev/reference/apis/js-apis-application-ability.md index 75f75008aa73d07c618ddd1db2a0deac373f84d3..5a2236019b7fc888af15b2da38602df92d892f25 100644 --- a/en/application-dev/reference/apis/js-apis-application-ability.md +++ b/en/application-dev/reference/apis/js-apis-application-ability.md @@ -21,8 +21,8 @@ import Ability from '@ohos.application.Ability'; | Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | | context | [AbilityContext](js-apis-ability-context.md) | Yes| No| Context of an ability.| -| launchWant | [Want](js-apis-featureAbility.md#Want)| Yes| No| Parameters for starting the ability.| -| lastRequestWant | [Want](js-apis-featureAbility.md#Want)| Yes| No| Parameters used when the ability was started last time.| +| launchWant | [Want](js-apis-application-want.md)| Yes| No| Parameters for starting the ability.| +| lastRequestWant | [Want](js-apis-application-want.md)| Yes| No| Parameters used when the ability was started last time.| ## Ability.onCreate @@ -37,7 +37,7 @@ Called to initialize the service logic when an ability is created. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-featureAbility.md#Want)| Yes| Information related to this ability, including the ability name and bundle name.| + | want | [Want](js-apis-application-want.md)| Yes| Information related to this ability, including the ability name and bundle name.| | param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.| **Example** @@ -222,7 +222,7 @@ Called when the ability startup mode is set to singleton. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-featureAbility.md#Want)| Yes| Want parameters, such as the ability name and bundle name.| + | want | [Want](js-apis-application-want.md)| Yes| Want parameters, such as the ability name and bundle name.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md index 5f839cb6fcbe0109e4be2e9daa5f756ea786a1a0..cb7a8b6b093af914131be0dec737f8d130a4bc37 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md @@ -1,16 +1,16 @@ # AbilityInfo +Unless otherwise specified, ability information is obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the ability information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## AbilityInfo - **System capability**: SystemCapability.BundleManager.BundleFramework +**System capability**: SystemCapability.BundleManager.BundleFramework | Name | Type | Readable| Writable| Description | | --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- | @@ -23,22 +23,23 @@ Provides the ability information. | iconId | number | Yes | No | Ability icon ID. | | moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. | | process | string | Yes | No | Process in which the ability runs. If this parameter is not set, the bundle name is used.| -| targetAbility | string | Yes | No | Target ability that the ability alias points to. | -| backgroundModes | number | Yes | No | Background service mode of the ability. | +| targetAbility | string | Yes | No | Target ability that the ability alias points to. | +| backgroundModes | number | Yes | No | Background service mode of the ability. | | isVisible | boolean | Yes | No | Whether the ability can be called by other applications. | -| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | -| type | AbilityType | Yes | No | Ability type. | +| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | +| type | AbilityType | Yes | No | Ability type. | | orientation | DisplayOrientation | Yes | No | Ability display orientation. | | launchMode | LaunchMode | Yes | No | Ability launch mode. | -| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.| +| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_PERMISSION**.| | deviceTypes | Array\ | Yes | No | Device types supported by the ability. | | deviceCapabilities | Array\ | Yes | No | Device capabilities required for the ability. | -| readPermission | string | Yes | No | Permission required for reading the ability data. | -| writePermission | string | Yes | No | Permission required for writing data to the ability. | -| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. | -| uri | string | Yes | No | URI of the ability. | +| readPermission | string | Yes | No | Permission required for reading the ability data. | +| writePermission | string | Yes | No | Permission required for writing data to the ability. | +| applicationInfo | ApplicationInfo | Yes | No | Application configuration information.
The value is obtained by passing **GET_ABILITY_INFO_WITH_APPLICATION**.| +| uri | string | Yes | No | URI of the ability. | | labelId | number | Yes | No | Ability label ID. | -| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | -| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | Yes | No | Custom metadata of the ability. | -| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability. | +| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | +| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | Yes | No | Custom metadata of the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_METADATA**.| +| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_METADATA**.| | enabled8+ | boolean | Yes | No | Whether the ability is enabled. | + diff --git a/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md index e2be6e96f66acec4ba6caaf7d9aaf7891ee232ae..fb72c282c8d9e3e1845e0f27168c1a1f85c55e0e 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md @@ -1,38 +1,38 @@ # ApplicationInfo +The **ApplicationInfo** module provides application information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the application information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## ApplicationInfo **System capability**: SystemCapability.BundleManager.BundleFramework -| Name | Type | Readable| Writable| Description | -| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | -| name | string | Yes | No | Application name. | -| description | string | Yes | No | Application description. | -| descriptionId | number | Yes | No | Application description ID. | -| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | -| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | -| label | string | Yes | No | Application label. | -| labelId | string | Yes | No | Application label ID. | -| icon | string | Yes | No | Application icon. | -| iconId | string | Yes | No | Application icon ID. | -| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.| -| supportedModes | number | Yes | No | Running modes supported by the application. | -| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | -| permissions | Array\ | Yes | No | Permissions required for accessing the application. | -| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. | -| entryDir | string | Yes | No | Path for storing application files. | -| codePath8+ | string | Yes | No | Installation directory of the application. | -| metaData8+ | Map\> | Yes | No | Custom metadata of the application. | -| metadata9+ | Map\> | Yes | No | Metadata of the application. | -| removable8+ | boolean | Yes | No | Whether the application is removable. | -| accessTokenId8+ | number | Yes | No | Access token ID of the application. | -| uid8+ | number | Yes | No | UID of the application. | -| entityType8+ | string | Yes | No | Entity type of the application. | +| Name | Type | Readable| Writable| Description | +| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | +| name | string | Yes | No | Application name. | +| description | string | Yes | No | Application description. | +| descriptionId | number | Yes | No | Application description ID. | +| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | +| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | +| label | string | Yes | No | Application label. | +| labelId | string | Yes | No | Application label ID. | +| icon | string | Yes | No | Application icon. | +| iconId | string | Yes | No | Application icon ID. | +| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. | +| supportedModes | number | Yes | No | Running modes supported by the application. | +| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | +| permissions | Array\ | Yes | No | Permissions required for accessing the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_PERMISSION**.| +| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. | +| entryDir | string | Yes | No | Path for storing application files. | +| codePath8+ | string | Yes | No | Installation directory of the application. | +| metaData8+ | Map\> | Yes | No | Custom metadata of the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_METADATA**.| +| metadata9+ | Map\> | Yes | No | Metadata of the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_METADATA**.| +| removable8+ | boolean | Yes | No | Whether the application is removable. | +| accessTokenId8+ | number | Yes | No | Access token ID of the application. | +| uid8+ | number | Yes | No | UID of the application. | +| entityType8+ | string | Yes | No | Entity type of the application. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md index 6bdc0cb79fe91431780e39aabb1581e9a90ab7a2..2f5348529a0b27e4c594550f9f57219e534b2013 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md @@ -1,43 +1,45 @@ # BundleInfo +The **BundleInfo** module provides bundle information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the application bundle information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## BundleInfo **System capability**: SystemCapability.BundleManager.BundleFramework -| Name | Type | Readable| Writable| Description | -| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | -| name | string | Yes | No | Bundle name. | -| type | string | Yes | No | Bundle type. | -| appId | string | Yes | No | ID of the application to which the bundle belongs. | -| uid | number | Yes | No | UID of the application to which the bundle belongs. | -| installTime | number | Yes | No | Time when the HAP file was installed. | -| updateTime | number | Yes | No | Time when the HAP file was updated. | -| appInfo | ApplicationInfo | Yes | No | Application configuration information. | -| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information. | -| reqPermissions | Array\ | Yes | No | Permissions to request from the system for running the application. | -| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetail)> | Yes | No | Detailed information of the permissions to request from the system.| -| vendor | string | Yes | No | Vendor of the bundle. | -| versionCode | number | Yes | No | Version number of the bundle. | -| versionName | string | Yes | No | Version description of the bundle. | -| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | -| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | -| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | -| hapModuleInfos | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | No | Module configuration information. | -| entryModuleName | string | Yes | No | Name of the entry module. | -| cpuAbi | string | Yes | No | cpuAbi information of the bundle. | -| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. | -| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | -| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | -| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | -| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Extension ability information. | +| Name | Type | Readable| Writable| Description | +| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | +| name | string | Yes | No | Bundle name. | +| type | string | Yes | No | Bundle type. | +| appId | string | Yes | No | ID of the application to which the bundle belongs. | +| uid | number | Yes | No | UID of the application to which the bundle belongs. | +| installTime | number | Yes | No | Time when the HAP file was installed. | +| updateTime | number | Yes | No | Time when the HAP file was updated. | +| appInfo | ApplicationInfo | Yes | No | Application configuration information. | +| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information.
The value is obtained by passing **GET_BUNDLE_WITH_ABILITIES**.| +| reqPermissions | Array\ | Yes | No | Permissions to request from the system for running the application.
The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.| +| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetail)> | Yes | No | Detailed information of the permissions to request from the system.
The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.| +| vendor | string | Yes | No | Vendor of the bundle. | +| versionCode | number | Yes | No | Version number of the bundle. | +| versionName | string | Yes | No | Version description of the bundle. | +| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | +| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | +| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | +| hapModuleInfos | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | No | Module configuration information. | +| entryModuleName | string | Yes | No | Name of the entry module. | +| cpuAbi | string | Yes | No | CPU and ABI information of the bundle. | +| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. | +| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | +| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | +| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | +| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Extension ability information.
The value is obtained by passing **GET_BUNDLE_WITH_EXTENSION_ABILITY**.| + + ## ReqPermissionDetail @@ -51,6 +53,8 @@ Provides the detailed information of the permissions to request from the system. | reason | string | Yes | Yes | Reason for requesting the permission. | | usedScene | [UsedScene](#usedscene) | Yes | Yes | Application scenario and timing for using the permission.| + + ## UsedScene Describes the application scenario and timing for using the permission. diff --git a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md index cb2954372b4c4e02564bcfcff06408aac773a0a4..0ceee9af9b11189035dee2406e50d6b443581b8a 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md @@ -1,12 +1,12 @@ # ExtensionAbilityInfo +The **ExtensionAbilityInfo** module provides Extension ability information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **NOTE** > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the Extension ability information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## ExtensionAbilityInfo @@ -24,7 +24,7 @@ Provides the Extension ability information. | extensionAbilityType | bundle.ExtensionAbilityType | Yes | No | Type of the Extension ability. | | permissions | Array\ | Yes | No | Permissions required for other applications to call the Extension ability.| | applicationInfo | ApplicationInfo | Yes | No | Application information of the Extension ability. | -| metaData | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the Extension ability. | +| metadata | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the Extension ability. | | enabled | boolean | Yes | No | Whether the Extension ability is enabled. | -| readPermission | string | Yes | No | Permission required for reading the Extension ability data. | +| readPermission | string | Yes | No | Permission required for reading data from the Extension ability. | | writePermission | string | Yes | No | Permission required for writing data to the Extension ability. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md index 3ed697324f926887108288c3a665311e094b9b8c..58a9e46ead747d0004ce9730d602d63db6af1c70 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -1,12 +1,12 @@ # HapModuleInfo +The **HapModuleInfo** module provides module information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the HAP module information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## HapModuleInfo diff --git a/en/application-dev/reference/apis/js-apis-huks.md b/en/application-dev/reference/apis/js-apis-huks.md index 9611d7e68637b765327e81e9ed68db9e68ceb9ef..885fde56d55291c2922af84d177f7a64ba29cedc 100644 --- a/en/application-dev/reference/apis/js-apis-huks.md +++ b/en/application-dev/reference/apis/js-apis-huks.md @@ -1438,4 +1438,4 @@ Defines the **HuksResult** structure. | errorCode | number | Yes | Error code. | | outData | Uint8Array | No | Output data.| | properties | Array\ | No | Properties. | -| certChains | Array\ | No | Certificate chain. | +| certChains | Array\ | No | Reserved. | diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index 54f8280d96c6310f626e78d6d00d23ff8ebf15bf..2c5a40a58caa3804a260910005af85a27f2a67b8 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -60,7 +60,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a callbac let videoPlayer media.createVideoPlayer((error, video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoPlayer = video; console.info('video createVideoPlayer success'); } else { @@ -89,7 +89,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a promise let videoPlayer media.createVideoPlayer().then((video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoPlayer = video; console.info('video createVideoPlayer success'); } else { @@ -307,7 +307,7 @@ Seeks to the specified playback position. ```js audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof (seekDoneTime) == 'undefined') { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -380,7 +380,7 @@ function printfDescription(obj) { } audioPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { for (let i = 0; i < arrlist.length; i++) { printfDescription(arrlist[i]); } @@ -416,7 +416,7 @@ function printfDescription(obj) { } audioPlayer.getTrackDescription().then((arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { arrayDescription = arrlist; } else { console.log('audio getTrackDescription fail'); @@ -491,7 +491,7 @@ audioPlayer.on('reset', () => { // Set the 'reset' event callback. audioPlayer = undefined; }); audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof(seekDoneTime) == "undefined") { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -546,7 +546,7 @@ Subscribes to the 'timeUpdate' event. ```js audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof (seekDoneTime) == 'undefined') { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -595,7 +595,6 @@ Enumerates the audio playback states. You can obtain the state through the **sta | stopped | string | Audio playback is stopped. | | error8+ | string | Audio playback is in the error state. | - ## VideoPlayer8+ Provides APIs to manage and play video. Before calling an API of **VideoPlayer**, you must call [createVideoPlayer()](#mediacreatevideoplayer8) to create a [VideoPlayer](#videoplayer8) instance. @@ -635,7 +634,7 @@ Sets **SurfaceId**. This API uses a callback to return the result. ```js videoPlayer.setDisplaySurface(surfaceId, (err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setDisplaySurface success!'); } else { console.info('setDisplaySurface fail!'); @@ -691,7 +690,7 @@ Prepares for video playback. This API uses a callback to return the result. ```js videoPlayer.prepare((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('prepare success!'); } else { console.info('prepare fail!'); @@ -741,7 +740,7 @@ Starts to play video resources. This API uses a callback to return the result. ```js videoPlayer.play((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('play success!'); } else { console.info('play fail!'); @@ -791,7 +790,7 @@ Pauses video playback. This API uses a callback to return the result. ```js videoPlayer.pause((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('pause success!'); } else { console.info('pause fail!'); @@ -841,7 +840,7 @@ Stops video playback. This API uses a callback to return the result. ```js videoPlayer.stop((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('stop success!'); } else { console.info('stop fail!'); @@ -891,7 +890,7 @@ Switches the video resource to be played. This API uses a callback to return the ```js videoPlayer.reset((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('reset success!'); } else { console.info('reset fail!'); @@ -942,7 +941,7 @@ Seeks to the specified playback position. The next key frame at the specified po ```js videoPlayer.seek((seekTime, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -970,7 +969,7 @@ Seeks to the specified playback position. This API uses a callback to return the ```js videoPlayer.seek((seekTime, seekMode, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -1034,7 +1033,7 @@ Sets the volume. This API uses a callback to return the result. ```js videoPlayer.setVolume((vol, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setVolume success!'); } else { console.info('setVolume fail!'); @@ -1090,7 +1089,7 @@ Releases the video playback resource. This API uses a callback to return the res ```js videoPlayer.release((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('release success!'); } else { console.info('release fail!'); @@ -1148,7 +1147,7 @@ function printfDescription(obj) { } videoPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { for (let i = 0; i < arrlist.length; i++) { printfDescription(arrlist[i]); } @@ -1185,7 +1184,7 @@ function printfDescription(obj) { let arrayDescription; videoPlayer.getTrackDescription().then((arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { arrayDescription = arrlist; } else { console.log('video getTrackDescription fail'); @@ -1217,7 +1216,7 @@ Sets the video playback speed. This API uses a callback to return the result. ```js videoPlayer.setSpeed((speed:number, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setSpeed success!'); } else { console.info('setSpeed fail!'); @@ -1438,7 +1437,7 @@ function printfItemDescription(obj, key) { } audioPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { for (let i = 0; i < arrlist.length; i++) { printfItemDescription(arrlist[i], MD_KEY_TRACK_TYPE); // Print the MD_KEY_TRACK_TYPE value of each track. } diff --git a/en/application-dev/reference/apis/js-apis-medialibrary.md b/en/application-dev/reference/apis/js-apis-medialibrary.md index 239b5c894e85605e60753da4ddaca9e4a16fdf41..b66eeec85c124ac083b27859849a86e1a5f1d4c2 100644 --- a/en/application-dev/reference/apis/js-apis-medialibrary.md +++ b/en/application-dev/reference/apis/js-apis-medialibrary.md @@ -15,6 +15,8 @@ getMediaLibrary(context: Context): MediaLibrary Obtains a **MediaLibrary** instance, which is used to access and modify personal media data such as audios, videos, images, and documents. +This API can be used only in the stage model. + **System capability**: SystemCapability.Multimedia.MediaLibrary.Core **Parameters** @@ -29,7 +31,13 @@ Obtains a **MediaLibrary** instance, which is used to access and modify personal | ----------------------------- | :---- | | [MediaLibrary](#medialibrary) | **MediaLibrary** instance.| -**Example** +**Example (from API version 9)** + +``` +var media = mediaLibrary.getMediaLibrary(this.context); +``` + +**Example (API version 8)** ``` import featureAbility from '@ohos.ability.featureAbility'; @@ -43,7 +51,11 @@ getMediaLibrary(): MediaLibrary Obtains a **MediaLibrary** instance, which is used to access and modify personal media data such as audios, videos, images, and documents. -> **Note**: This API is no longer maintained since API version 8. You are advised to use [mediaLibrary.getMediaLibrary8+](#medialibrarygetmedialibrary8) instead. +This API can be used only in the FA model. + +> **NOTE** +> +> This API is no longer maintained since API version 8. You are advised to use [mediaLibrary.getMediaLibrary8+](#medialibrarygetmedialibrary8) instead. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -88,12 +100,14 @@ let imagesfetchOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', selectionArgs: [imageType.toString()], }; -mediaLibrary.getFileAssets(imagesfetchOp, (error, fetchFileResult) => { +media.getFileAssets(imagesfetchOp, (error, fetchFileResult) => { if (fetchFileResult != undefined) { console.info('mediaLibraryTest : ASSET_CALLBACK fetchFileResult success'); fetchFileResult.getAllObject((err, fileAssetList) => { if (fileAssetList != undefined) { - fileAssetList.forEach(getAllObjectInfo); + fileAssetList.forEach(function(getAllObjectInfo){ + console.info("getAllObjectInfo.displayName :" + getAllObjectInfo.displayName); + }); } }); } @@ -130,8 +144,8 @@ let imagesfetchOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', selectionArgs: [imageType.toString()], }; -mediaLibrary.getFileAssets(imagesfetchOp).then(function(fetchFileResult){ - console.info("getFileAssets successfully:"+ JSON.stringify(dir)); +media.getFileAssets(imagesfetchOp).then(function(fetchFileResult){ + console.info("getFileAssets successfully: image number is "+ fetchFileResult.getCount()); }).catch(function(err){ console.info("getFileAssets failed with error:"+ err); }); @@ -155,7 +169,7 @@ Subscribes to the media library changes. This API uses an asynchronous callback **Example** ``` -mediaLibrary.on('imageChange', () => { +media.on('imageChange', () => { // image file had changed, do something }) ``` @@ -177,7 +191,7 @@ Unsubscribes from the media library changes. This API uses an asynchronous callb **Example** ``` -mediaLibrary.off('imageChange', () => { +media.off('imageChange', () => { // stop listening success }) ``` @@ -209,7 +223,7 @@ async function example() { let mediaType = mediaLibrary.MediaType.IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; const path = await media.getPublicDirectory(DIR_IMAGE); - mediaLibrary.createAsset(mediaType, 'imageCallBack.jpg', path + 'myPicture/', (err, fileAsset) => { + media.createAsset(mediaType, 'imageCallBack.jpg', path + 'myPicture/', (err, fileAsset) => { if (fileAsset != undefined) { console.info('createAsset successfully, message = ' + err); } else { @@ -246,17 +260,12 @@ Creates a media asset. This API uses a promise to return the result. **Example** ``` -async function example() { - // Create an image file in promise mode. - let mediaType = mediaLibrary.MediaType.IMAGE; - let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; - const path = await media.getPublicDirectory(DIR_IMAGE); - mediaLibrary.createAsset(mediaType, "image01.jpg", path + 'myPicture/').then (function (asset) { - console.info("createAsset successfully:"+ JSON.stringify(asset)); - }).catch(function(err){ - console.info("createAsset failed with error:"+ err); - }); -} +let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA; +media.getPublicDirectory(DIR_CAMERA).then(function(dicResult){ + console.info("getPublicDirectory successfully:"+ JSON.stringify(dicResult)); +}).catch(function(err){ + console.info("getPublicDirectory failed with error:"+ err); +}); ``` ### getPublicDirectory8+ @@ -345,7 +354,7 @@ let AlbumNoArgsfetchOp = { selections: '', selectionArgs: [], }; -mediaLibrary.getAlbums(AlbumNoArgsfetchOp, (err, albumList) => { +media.getAlbums(AlbumNoArgsfetchOp, (err, albumList) => { if (albumList != undefined) { const album = albumList[0]; console.info('album.albumName = ' + album.albumName); @@ -385,7 +394,7 @@ let AlbumNoArgsfetchOp = { selections: '', selectionArgs: [], }; -mediaLibrary.getAlbums(AlbumNoArgsfetchOp).then(function(albumList){ +media.getAlbums(AlbumNoArgsfetchOp).then(function(albumList){ console.info("getAlbums successfully:"+ JSON.stringify(albumList)); }).catch(function(err){ console.info("getAlbums failed with error:"+ err); @@ -434,7 +443,6 @@ Call this API when you no longer need to use the APIs in the **MediaLibrary** in **Example** ``` -var media = mediaLibrary.getMediaLibrary(context); media.release() ``` @@ -444,7 +452,9 @@ storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback<string>) Stores a media asset. This API uses an asynchronous callback to return the URI that stores the media asset. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -480,7 +490,9 @@ storeMediaAsset(option: MediaAssetOption): Promise<string> Stores a media asset. This API uses a promise to return the URI that stores the media asset. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -519,7 +531,9 @@ startImagePreview(images: Array<string>, index: number, callback: AsyncCal Starts image preview, with the first image to preview specified. This API can be used to preview local images whose URIs start with **dataability://** or online images whose URIs start with **https://**. It uses an asynchronous callback to return the execution result. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. The **\** component can be used to render and display local and online images. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -561,7 +575,9 @@ startImagePreview(images: Array<string>, callback: AsyncCallback<void&g Starts image preview. This API can be used to preview local images whose URIs start with **dataability://** or online images whose URIs start with **https://**. It uses an asynchronous callback to return the execution result. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. The **\** component can be used to render and display local and online images. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -601,7 +617,9 @@ startImagePreview(images: Array<string>, index?: number): Promise<void& Starts image preview, with the first image to preview specified. This API can be used to preview local images whose URIs start with dataability:// or online images whose URIs start with https://. It uses a promise to return the execution result. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. The **\** component can be used to render and display local and online images. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -646,7 +664,9 @@ startMediaSelect(option: MediaSelectOption, callback: AsyncCallback<Array< Starts media selection. This API uses an asynchronous callback to return the list of URIs that store the selected media assets. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. You are advised to use the system app Gallery instead. Gallery is a built-in visual resource access application that provides features such as image and video management and browsing. For details about how to use Gallery, visit [OpenHarmony/applications_photos](https://gitee.com/openharmony/applications_photos). **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -661,7 +681,7 @@ Starts media selection. This API uses an asynchronous callback to return the lis ``` let option = { - type : "image", + type : "media", count : 2 }; mediaLibrary.getMediaLibrary().startMediaSelect(option, (err, value) => { @@ -681,7 +701,9 @@ startMediaSelect(option: MediaSelectOption): Promise<Array<string>> Starts media selection. This API uses a promise to return the list of URIs that store the selected media assets. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. You are advised to use the system app Gallery instead. Gallery is a built-in visual resource access application that provides features such as image and video management and browsing. For details about how to use Gallery, visit [OpenHarmony/applications_photos](https://gitee.com/openharmony/applications_photos). **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -701,7 +723,7 @@ Starts media selection. This API uses a promise to return the list of URIs that ``` let option = { - type : "image", + type : "media", count : 2 }; mediaLibrary.getMediaLibrary().startMediaSelect(option).then((value) => { @@ -740,7 +762,7 @@ Provides APIs for encapsulating file asset attributes. | width | number | Yes | No | Image width, in pixels. | | height | number | Yes | No | Image height, in pixels. | | orientation | number | Yes | Yes | Image display direction (clockwise rotation angle, for example, 0, 90, or 180, in degrees).| -| duration8+ | number | Yes | No | Duration, in ms. | +| duration8+ | number | Yes | No | Duration, in ms. | | albumId | number | Yes | No | ID of the album to which the file belongs. | | albumUri8+ | string | Yes | No | URI of the album to which the file belongs. | | albumName | string | Yes | No | Name of the album to which the file belongs. | @@ -766,6 +788,7 @@ Checks whether this file asset is a directory. This API uses an asynchronous cal ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -801,6 +824,7 @@ Checks whether this file asset is a directory. This API uses a promise to return ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -838,6 +862,7 @@ Commits the modification in this file asset to the database. This API uses an as ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -874,6 +899,7 @@ Commits the modification in this file asset to the database. This API uses a pro ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -894,7 +920,11 @@ open(mode: string, callback: AsyncCallback<number>): void Opens this file asset. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.READ_MEDIA (when **mode** is set to **r**) and ohos.permission.WRITE_MEDIA (when **mode** is set to **w**) +> **NOTE** +> +> Currently, the write operations are mutually exclusive. After the write operation is complete, you must call **close** to release the resource. + +**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -912,7 +942,7 @@ async function example() { let mediaType = mediaLibrary.MediaType.IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; const path = await media.getPublicDirectory(DIR_IMAGE); - asset = await media.createAsset(mediaType, "image00003.jpg", path); + const asset = await media.createAsset(mediaType, "image00003.jpg", path); asset.open('rw', (openError, fd) => { if(fd > 0){ asset.close(fd); @@ -929,7 +959,11 @@ open(mode: string): Promise<number> Opens this file asset. This API uses a promise to return the result. -**Required permissions**: ohos.permission.READ_MEDIA (when **mode** is set to **r**) and ohos.permission.WRITE_MEDIA (when **mode** is set to **w**) +> **NOTE** +> +> Currently, the write operations are mutually exclusive. After the write operation is complete, you must call **close** to release the resource. + +**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -937,7 +971,7 @@ Opens this file asset. This API uses a promise to return the result. | Name | Type | Mandatory | Description | | ---- | ------ | ---- | ----------------------------------- | -| mode | string | Yes | Mode of opening the file, for example, **r** (read-only), **w** (write-only), and **rw** (read-write).| +| mode | string | Yes | Mode of opening the file, for example, **'r'** (read-only), **'w'** (write-only), and **'rw'** (read-write).| **Return value** @@ -952,7 +986,7 @@ async function example() { let mediaType = mediaLibrary.MediaType.IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; const path = await media.getPublicDirectory(DIR_IMAGE); - asset = await media.createAsset(mediaType, "image00003.jpg", path); + const asset = await media.createAsset(mediaType, "image00003.jpg", path); asset.open('rw') .then((fd) => { console.info('File fd!' + fd); @@ -969,7 +1003,7 @@ close(fd: number, callback: AsyncCallback<void>): void Closes this file asset. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.READ_MEDIA (when **mode** is set to **r**) and ohos.permission.WRITE_MEDIA (when **mode** is set to **w**) +**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -984,6 +1018,7 @@ Closes this file asset. This API uses an asynchronous callback to return the res ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -993,13 +1028,19 @@ async function example() { }; const fetchFileResult = await media.getFileAssets(getImageOp); const asset = await fetchFileResult.getFirstObject(); - asset.close(fd, (closeErr) => { - if (closeErr != undefined) { - console.info('mediaLibraryTest : close : FAIL ' + closeErr.message); - console.info('mediaLibraryTest : ASSET_CALLBACK : FAIL'); - } else { - console.info("=======asset.close success====>"); - } + asset.open('rw').then((fd) => { + console.info('File fd!' + fd); + asset.close(fd, (closeErr) => { + if (closeErr != undefined) { + console.info('mediaLibraryTest : close : FAIL ' + closeErr.message); + console.info('mediaLibraryTest : ASSET_CALLBACK : FAIL'); + } else { + console.info("=======asset.close success====>"); + } + }); + }) + .catch((err) => { + console.info('File err!' + err); }); } ``` @@ -1010,7 +1051,7 @@ close(fd: number): Promise<void> Closes this file asset. This API uses a promise to return the result. -**Required permissions**: ohos.permission.READ_MEDIA (when **mode** is set to **'r'**) and ohos.permission.WRITE_MEDIA (when **mode** is set to **'w'**) +**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -1030,6 +1071,7 @@ Closes this file asset. This API uses a promise to return the result. ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1039,14 +1081,20 @@ async function example() { }; const fetchFileResult = await media.getFileAssets(getImageOp); const asset = await fetchFileResult.getFirstObject(); - asset.close(fd).then((closeErr) => { - if (closeErr != undefined) { - console.info('mediaLibraryTest : close : FAIL ' + closeErr.message); - console.info('mediaLibraryTest : ASSET_CALLBACK : FAIL'); + asset.open('rw').then((fd) => { + console.info('File fd!' + fd); + asset.close(fd).then((closeErr) => { + if (closeErr != undefined) { + console.info('mediaLibraryTest : close : FAIL ' + closeErr.message); + console.info('mediaLibraryTest : ASSET_CALLBACK : FAIL'); - } else { - console.info("=======asset.close success====>"); - } + } else { + console.info("=======asset.close success====>"); + } + }); + }) + .catch((err) => { + console.info('File err!' + err); }); } ``` @@ -1071,6 +1119,7 @@ Obtains the thumbnail of this file asset. This API uses an asynchronous callback ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1107,6 +1156,7 @@ Obtains the thumbnail of this file asset, with the thumbnail size passed. This A ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1114,6 +1164,7 @@ async function example() { order: fileKeyObj.DATE_ADDED + " DESC", extendArgs: "", }; + let size = { width: 720, height: 720 }; const fetchFileResult = await media.getFileAssets(getImageOp); const asset = await fetchFileResult.getFirstObject(); asset.getThumbnail(size, (err, pixelmap) => { @@ -1148,6 +1199,7 @@ Obtains the thumbnail of this file asset, with the thumbnail size passed. This A ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1155,6 +1207,7 @@ async function example() { order: fileKeyObj.DATE_ADDED + " DESC", extendArgs: "", }; + let size = { width: 720, height: 720 }; const fetchFileResult = await media.getFileAssets(getImageOp); const asset = await fetchFileResult.getFirstObject(); asset.getThumbnail(size) @@ -1188,6 +1241,7 @@ Favorites or unfavorites this file asset. This API uses an asynchronous callback ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1229,6 +1283,7 @@ Favorites or unfavorites this file asset. This API uses a promise to return the ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1266,6 +1321,7 @@ Checks whether this file asset is favorited. This API uses an asynchronous callb ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1305,6 +1361,7 @@ Checks whether this file asset is favorited. This API uses a promise to return t ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1345,6 +1402,7 @@ Files in the trash are not actually deleted. You can set **isTrash** to **false* ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1389,6 +1447,7 @@ Files in the trash are not actually deleted. You can set **isTrash** to **false* ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1426,6 +1485,7 @@ Checks whether this file asset is in the trash. This API uses an asynchronous ca ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1439,7 +1499,7 @@ async function example() { function isTrashCallBack(err, isTrash) { if (isTrash == true) { console.info('mediaLibraryTest : ASSET_CALLBACK ASSET_CALLBACK isTrash = ' + isTrash); - asset.trash(true, trashCallBack); + asset.trash(true, istrashCallBack); } else { console.info('mediaLibraryTest : ASSET_CALLBACK isTrash Unsuccessfull = ' + err); @@ -1470,6 +1530,7 @@ Checks whether this file asset is in the trash. This API uses a promise to retur ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1509,6 +1570,8 @@ Obtains the total number of files in the result set. ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey + let fileType = mediaLibrary.MediaType.FILE; let getFileCountOneOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', selectionArgs: [fileType.toString()], @@ -1538,6 +1601,7 @@ Checks whether the cursor is in the last row of the result set. ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1575,6 +1639,7 @@ Releases and invalidates this **FetchFileResult** instance. Other APIs in this i ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1605,6 +1670,7 @@ Obtains the first file asset in the result set. This API uses an asynchronous ca ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1613,12 +1679,12 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getFirstObject((err, value) => { + fetchFileResult.getFirstObject((err, fileAsset) => { if (err) { console.error('Failed '); return; } - console.log(value); + console.log('fileAsset.displayName : ' + fileAsset.displayName); }) } ``` @@ -1641,6 +1707,7 @@ Obtains the first file asset in the result set. This API uses a promise to retur ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1663,8 +1730,6 @@ async function example() { Obtains the next file asset in the result set. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.READ_MEDIA - **System capability**: SystemCapability.Multimedia.MediaLibrary.Core **Parameters** @@ -1677,6 +1742,7 @@ Obtains the next file asset in the result set. This API uses an asynchronous cal ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1685,12 +1751,12 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getNextObject((err, value) => { + fetchFileResult.getNextObject((err, fileAsset) => { if (err) { console.error('Failed '); return; } - console.log(value); + console.log('fileAsset.displayName : ' + fileAsset.displayName); }) } ``` @@ -1701,8 +1767,6 @@ async function example() { Obtains the next file asset in the result set. This API uses a promise to return the result. -**Required permissions**: ohos.permission.READ_MEDIA - **System capability**: SystemCapability.Multimedia.MediaLibrary.Core **Return value** @@ -1715,6 +1779,7 @@ Obtains the next file asset in the result set. This API uses a promise to return ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1725,7 +1790,7 @@ async function example() { let fetchFileResult = await media.getFileAssets(getImageOp); const fetchCount = fetchFileResult.getCount(); console.info('mediaLibraryTest : count:' + fetchCount); - fileAsset = await fetchFileResult.getNextObject(); + let fileAsset = await fetchFileResult.getNextObject(); } ``` @@ -1747,6 +1812,7 @@ Obtains the last file asset in the result set. This API uses an asynchronous cal ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1755,12 +1821,12 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getLastObject((err, value) => { + fetchFileResult.getLastObject((err, fileAsset) => { if (err) { console.error('Failed '); return; } - console.log(value); + console.log('fileAsset.displayName : ' + fileAsset.displayName); }) } ``` @@ -1783,6 +1849,7 @@ Obtains the last file asset in the result set. This API uses a promise to return ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1814,6 +1881,7 @@ Obtains a file asset with the specified index in the result set. This API uses a ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1822,12 +1890,12 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getPositionObject(0, (err, value) => { + fetchFileResult.getPositionObject(0, (err, fileAsset) => { if (err) { console.error('Failed '); return; } - console.log(value); + console.log('fileAsset.displayName : ' + fileAsset.displayName); }) } ``` @@ -1838,8 +1906,6 @@ getPositionObject(index: number): Promise<FileAsset> Obtains a file asset with the specified index in the result set. This API uses a promise to return the result. -**Required permissions**: ohos.permission.READ_MEDIA - **System capability**: SystemCapability.Multimedia.MediaLibrary.Core **Parameters** @@ -1858,6 +1924,7 @@ Obtains a file asset with the specified index in the result set. This API uses a ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1866,13 +1933,11 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getPositionObject(1, (err, value) => { - if (err) { - console.error('Failed '); - return; - } - console.log(value); - }) + fetchFileResult.getPositionObject(1) .then(function (fileAsset){ + console.log('[Demo] fileAsset.displayName : ' + fileAsset.displayName); + }).catch(function (err) { + console.info("[Demo] getFileAssets failed with error:" + err); + }); } ``` @@ -1882,8 +1947,6 @@ getAllObject(callback: AsyncCallback<Array<FileAsset>>): void Obtains all the file assets in the result set. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.READ_MEDIA - **System capability**: SystemCapability.Multimedia.MediaLibrary.Core **Parameters** @@ -1896,6 +1959,7 @@ Obtains all the file assets in the result set. This API uses an asynchronous cal ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -1904,12 +1968,12 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getAllObject((err, value) => { + fetchFileResult.getAllObject((err, fileAsset) => { if (err) { console.error('Failed '); return; } - console.log(value); + console.log('fileAsset.displayName : ' + fileAsset.displayName); }) } ``` @@ -1932,6 +1996,7 @@ Obtains all the file assets in the result set. This API uses a promise to return ``` async function example() { + let fileKeyObj = mediaLibrary.FileKey let imageType = mediaLibrary.MediaType.IMAGE; let getImageOp = { selections: fileKeyObj.MEDIA_TYPE + '= ?', @@ -2059,6 +2124,10 @@ async function example() { selections: '', selectionArgs: [], }; + let fileNoArgsfetchOp = { + selections: '', + selectionArgs: [], + } const albumList = await media.getAlbums(AlbumNoArgsfetchOp); const album = albumList[0]; album.getFileAssets(fileNoArgsfetchOp, getFileAssetsCallBack); @@ -2098,6 +2167,10 @@ async function example() { selections: '', selectionArgs: [], }; + let fileNoArgsfetchOp = { + selections: '', + selectionArgs: [], + } const albumList = await media.getAlbums(AlbumNoArgsfetchOp); const album = albumList[0]; album.getFileAssets(fileNoArgsfetchOp).then(function(albumFetchFileResult){ @@ -2111,8 +2184,9 @@ async function example() { ## PeerInfo8+ Describes information about a registered device. +This is a system API. -**System capability**: SystemCapability.Multimedia.MediaLibrary.Core +**System capability**: SystemCapability.Multimedia.MediaLibrary.DistributedCore | Name | Type | Readable| Writable| Description | | ---------- | -------------------------- | ---- | ---- | ---------------- | @@ -2129,12 +2203,12 @@ Enumerates media types. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core -| Name | Default Value| Description| -| ----- | ------ | ---- | -| FILE | 1 | File.| -| IMAGE | 3 | Image.| -| VIDEO | 4 | Video.| -| AUDIO | 5 | Audio.| +| Name | Description| +| ----- | ---- | +| FILE | File.| +| IMAGE | Image.| +| VIDEO | Video.| +| AUDIO | Audio.| ## FileKey8+ @@ -2157,7 +2231,7 @@ Enumerates key file information. | TITLE | title | Title in the file. | | ARTIST | artist | Artist of the file. | | AUDIOALBUM | audio_album | Audio album. | -| DURATION | duration | Duration, in seconds. | +| DURATION | duration | Duration, in ms. | | WIDTH | width | Image width, in pixels. | | HEIGHT | height | Image height, in pixels. | | ORIENTATION | orientation | Image display direction (clockwise rotation angle, for example, 0, 90, and 180, in degrees).| @@ -2170,30 +2244,31 @@ Enumerates directory types. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core -| Name | Default Value| Description | -| ------------- | ------ | ------------------ | -| DIR_CAMERA | 0 | Directory of camera files.| -| DIR_VIDEO | 1 | Directory of video files. | -| DIR_IMAGE | 2 | Directory of image files. | -| DIR_AUDIO | 3 | Directory of audio files. | -| DIR_DOCUMENTS | 4 | Directory of documents. | -| DIR_DOWNLOAD | 5 | Download directory. | +| Name | Description | +| ------------- | ------------------ | +| DIR_CAMERA | Directory of camera files.| +| DIR_VIDEO | Directory of video files. | +| DIR_IMAGE | Directory of image files. | +| DIR_AUDIO | Directory of audio files. | +| DIR_DOCUMENTS | Directory of documents. | +| DIR_DOWNLOAD | Download directory. | ## DeviceType8+ Enumerates device types. +This is a system API. -**System capability**: SystemCapability.Multimedia.MediaLibrary.Core +**System capability**: SystemCapability.Multimedia.MediaLibrary.DistributedCore -| Name | Default Value| Description | -| ------------ | ------ | ---------- | -| TYPE_UNKNOWN | 0 | Unknown.| -| TYPE_LAPTOP | 1 | Laptop.| -| TYPE_PHONE | 2 | Phone. | -| TYPE_TABLET | 3 | Tablet. | -| TYPE_WATCH | 4 | Smart watch. | -| TYPE_CAR | 5 | Vehicle-mounted device. | -| TYPE_TV | 6 | TV. | +| Name | Description | +| ------------ | ---------- | +| TYPE_UNKNOWN | Unknown.| +| TYPE_LAPTOP | Laptop.| +| TYPE_PHONE | Phone. | +| TYPE_TABLET | Tablet. | +| TYPE_WATCH | Smart watch. | +| TYPE_CAR | Vehicle-mounted device. | +| TYPE_TV | TV. | ## MediaFetchOptions7+ @@ -2203,9 +2278,9 @@ Describes options for fetching media files. | Name | Type | Readable| Writable| Mandatory| Description | | ----------------------- | ------------------- | ---- | ---- | ---- | ------------------------------------------------------------ | -| selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?',| +| selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR ' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?', | | selectionArgs | Array<string> | Yes | Yes | Yes | Value of the condition, which corresponds to the value of the condition column in **selections**.
Example:
selectionArgs: [mediaLibrary.MediaType.IMAGE.toString(), mediaLibrary.MediaType.VIDEO.toString()], | -| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:
Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " AESC"
Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC"| +| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:
Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " ASC"
Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC" | | uri8+ | string | Yes | Yes | No | File URI. | | networkId8+ | string | Yes | Yes | No | Network ID of the registered device. | | extendArgs8+ | string | Yes | Yes | No | Extended parameters for fetching the files. Currently, no extended parameters are available. | @@ -2213,6 +2288,7 @@ Describes options for fetching media files. ## Size8+ Describes the image size. +**System capability**: SystemCapability.Multimedia.MediaLibrary.Core | Name | Type | Readable | Writable | Description | | ------ | ------ | ---- | ---- | -------- | @@ -2223,7 +2299,9 @@ Describes the image size. Implements the media asset option. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core @@ -2238,7 +2316,9 @@ Implements the media asset option. Describes media selection option. -> **NOTE**
This API is deprecated since API version 9. +> **NOTE** +> +> This API is deprecated since API version 9. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index 3db58b1c88bc84c8201a377df426e215f5837e77..d258ac2b76fa3babf53469ee2518291919feb1dc 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -115,7 +115,7 @@ Returns to the previous page or a specified page. **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.| +| options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If no URL is set, the previous page is returned, and the page in the page stack is not reclaimed. It will be reclaimed after being popped up.| **Example** ```js diff --git a/en/application-dev/reference/apis/js-apis-webgl.md b/en/application-dev/reference/apis/js-apis-webgl.md index 95738321bc5717e97657191b416e3ceca220d75d..a205de94d8080753ed0305f56fb6fc5ce8534707 100644 --- a/en/application-dev/reference/apis/js-apis-webgl.md +++ b/en/application-dev/reference/apis/js-apis-webgl.md @@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set > **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. +> +> WebGL complies with the OpenGL protocol and does not support multi-thread calling. ## Invoking Method @@ -41,9 +43,9 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0); **Table 1** Type -| Name| Type| +| Name| Type| | -------- | -------- | -| GLenum | number | +| GLenum | number | | GLboolean | boolean | | GLbitfield | number | | GLbyte | number | @@ -56,7 +58,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0); | GLushort | number | | GLuint | number | | GLfloat | number | -| GLclampf | number | +| GLclampf | number | | TexImageSource | ImageData | | Float32List | array | | Int32List | array | @@ -79,7 +81,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0); | WebGLShader | | WebGLTexture | | WebGLUniformLocation | -| [WebGLActiveInfo](#webglactiveinfo) | +| [WebGLActiveInfo](#webglactiveinfo) | | [WebGLShaderPrecisionFormat](#webglshaderprecisionformat) | | [WebGLRenderingContextBase](#webglrenderingcontextbase) | | [WebGLRenderingContextOverloads](#webglrenderingcontextoverloads) | @@ -90,39 +92,39 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0); WebGLContextAttributes - | Name| Type| Mandatory| +| Name| Type| Mandatory| | -------- | -------- | -------- | -| alpha | boolean | No| -| depth | boolean | No| -| stencil | boolean | No| -| antialias | boolean | No| -| premultipliedAlpha | boolean | No| -| preserveDrawingBuffer | boolean | No| -| powerPreference | WebGLPowerPreference | No| -| failIfMajorPerformanceCaveat | boolean | No| -| desynchronized | boolean | No| +| alpha | boolean | No| +| depth | boolean | No| +| stencil | boolean | No| +| antialias | boolean | No| +| premultipliedAlpha | boolean | No| +| preserveDrawingBuffer | boolean | No| +| powerPreference | WebGLPowerPreference | No| +| failIfMajorPerformanceCaveat | boolean | No| +| desynchronized | boolean | No| ## WebGLActiveInfo WebGLActiveInfo - | Name| Type| Mandatory| +| Name| Type| Mandatory| | -------- | -------- | -------- | -| size | GLint | Yes| -| type | GLenum | Yes| -| name | string | Yes| +| size | GLint | Yes| +| type | GLenum | Yes| +| name | string | Yes| ## WebGLShaderPrecisionFormat WebGLShaderPrecisionFormat - | Name| Type| Mandatory| +| Name| Type| Mandatory| | -------- | -------- | -------- | -| rangeMin | GLint | Yes| -| rangeMax | GLint | Yes| -| precision | GLint | Yes| +| rangeMin | GLint | Yes| +| rangeMax | GLint | Yes| +| precision | GLint | Yes| ## WebGLRenderingContextBase @@ -132,455 +134,455 @@ WebGLRenderingContextBase ### Attributes - | Name| Type| Mandatory| +| Name| Type| Mandatory| | -------- | -------- | -------- | -| DEPTH_BUFFER_BIT | GLenum | Yes| -| STENCIL_BUFFER_BIT | GLenum | Yes| -| COLOR_BUFFER_BIT | GLenum | Yes| -| POINTS | GLenum | Yes| -| LINES | GLenum | Yes| -| LINE_LOOP | GLenum | Yes| -| LINE_STRIP | GLenum | Yes| -| TRIANGLES | GLenum | Yes| -| TRIANGLE_STRIP | GLenum | Yes| -| TRIANGLE_FAN | GLenum | Yes| -| ZERO | GLenum | Yes| -| ONE | GLenum | Yes| -| SRC_COLOR | GLenum | Yes| -| ONE_MINUS_SRC_COLOR | GLenum | Yes| -| SRC_ALPHA | GLenum | Yes| -| ONE_MINUS_SRC_ALPHA | GLenum | Yes| -| DST_ALPHA | GLenum | Yes| -| ONE_MINUS_DST_ALPHA | GLenum | Yes| -| DST_COLOR | GLenum | Yes| -| ONE_MINUS_DST_COLOR | GLenum | Yes| -| SRC_ALPHA_SATURATE | GLenum | Yes| -| FUNC_ADD | GLenum | Yes| -| BLEND_EQUATION | GLenum | Yes| -| BLEND_EQUATION_RGB | GLenum | Yes| -| BLEND_EQUATION_ALPHA | GLenum | Yes| -| FUNC_SUBTRACT | GLenum | Yes| -| FUNC_REVERSE_SUBTRACT | GLenum | Yes| -| BLEND_DST_RGB | GLenum | Yes| -| BLEND_SRC_RGB | GLenum | Yes| -| BLEND_DST_ALPHA | GLenum | Yes| -| BLEND_SRC_ALPHA | GLenum | Yes| -| CONSTANT_COLOR | GLenum | Yes| -| ONE_MINUS_CONSTANT_COLOR | GLenum | Yes| -| CONSTANT_ALPHA | GLenum | Yes| -| ONE_MINUS_CONSTANT_ALPHA | GLenum | Yes| -| BLEND_COLOR | GLenum | Yes| -| ARRAY_BUFFER | GLenum | Yes| -| ELEMENT_ARRAY_BUFFER | GLenum | Yes| -| ARRAY_BUFFER_BINDING | GLenum | Yes| -| ELEMENT_ARRAY_BUFFER_BINDING | GLenum | Yes| -| STREAM_DRAW | GLenum | Yes| -| STATIC_DRAW | GLenum | Yes| -| DYNAMIC_DRAW | GLenum | Yes| -| BUFFER_SIZE | GLenum | Yes| -| BUFFER_USAGE | GLenum | Yes| -| CURRENT_VERTEX_ATTRIB | GLenum | Yes| -| FRONT | GLenum | Yes| -| BACK | GLenum | Yes| -| FRONT_AND_BACK | GLenum | Yes| -| CULL_FACE | GLenum | Yes| -| BLEND | GLenum | Yes| -| DITHER | GLenum | Yes| -| STENCIL_TEST | GLenum | Yes| -| DEPTH_TEST | GLenum | Yes| -| SCISSOR_TEST | GLenum | Yes| -| POLYGON_OFFSET_FILL | GLenum | Yes| -| SAMPLE_ALPHA_TO_COVERAGE | GLenum | Yes| -| SAMPLE_COVERAGE | GLenum | Yes| -| NO_ERROR | GLenum | Yes| -| INVALID_ENUM | GLenum | Yes| -| INVALID_VALUE | GLenum | Yes| -| INVALID_OPERATION | GLenum | Yes| -| OUT_OF_MEMORY | GLenum | Yes| -| CW | GLenum | Yes| -| CCW | GLenum | Yes| -| LINE_WIDTH | GLenum | Yes| -| ALIASED_POINT_SIZE_RANGE | GLenum | Yes| -| ALIASED_LINE_WIDTH_RANGE | GLenum | Yes| -| CULL_FACE_MODE | GLenum | Yes| -| FRONT_FACE | GLenum | Yes| -| DEPTH_RANGE | GLenum | Yes| -| DEPTH_WRITEMASK | GLenum | Yes| -| DEPTH_CLEAR_VALUE | GLenum | Yes| -| DEPTH_FUNC | GLenum | Yes| -| STENCIL_CLEAR_VALUE | GLenum | Yes| -| STENCIL_FUNC | GLenum | Yes| -| STENCIL_FAIL | GLenum | Yes| -| STENCIL_PASS_DEPTH_FAIL | GLenum | Yes| -| STENCIL_PASS_DEPTH_PASS | GLenum | Yes| -| STENCIL_REF | GLenum | Yes| -| STENCIL_VALUE_MASK | GLenum | Yes| -| STENCIL_WRITEMASK | GLenum | Yes| -| STENCIL_BACK_FUNC | GLenum | Yes| -| STENCIL_BACK_FAIL | GLenum | Yes| -| STENCIL_BACK_PASS_DEPTH_FAIL | GLenum | Yes| -| STENCIL_BACK_PASS_DEPTH_PASS | GLenum | Yes| -| STENCIL_BACK_REF | GLenum | Yes| -| STENCIL_BACK_VALUE_MASK | GLenum | Yes| -| STENCIL_BACK_WRITEMASK | GLenum | Yes| -| VIEWPORT | GLenum | Yes| -| SCISSOR_BOX | GLenum | Yes| -| COLOR_CLEAR_VALUE | GLenum | Yes| -| COLOR_WRITEMASK | GLenum | Yes| -| UNPACK_ALIGNMENT | GLenum | Yes| -| PACK_ALIGNMENT | GLenum | Yes| -| MAX_TEXTURE_SIZE | GLenum | Yes| -| MAX_VIEWPORT_DIMS | GLenum | Yes| -| SUBPIXEL_BITS | GLenum | Yes| -| RED_BITS | GLenum | Yes| -| GREEN_BITS | GLenum | Yes| -| BLUE_BITS | GLenum | Yes| -| ALPHA_BITS | GLenum | Yes| -| DEPTH_BITS | GLenum | Yes| -| STENCIL_BITS | GLenum | Yes| -| POLYGON_OFFSET_UNITS | GLenum | Yes| -| POLYGON_OFFSET_FACTOR | GLenum | Yes| -| TEXTURE_BINDING_2D | GLenum | Yes| -| SAMPLE_BUFFERS | GLenum | Yes| -| SAMPLES | GLenum | Yes| -| SAMPLE_COVERAGE_VALUE | GLenum | Yes| -| SAMPLE_COVERAGE_INVERT | GLenum | Yes| -| COMPRESSED_TEXTURE_FORMATS | GLenum | Yes| -| DONT_CARE | GLenum | Yes| -| FASTEST | GLenum | Yes| -| NICEST | GLenum | Yes| -| GENERATE_MIPMAP_HINT | GLenum | Yes| -| BYTE | GLenum | Yes| -| UNSIGNED_BYTE | GLenum | Yes| -| SHORT | GLenum | Yes| -| UNSIGNED_SHORT | GLenum | Yes| -| INT | GLenum | Yes| -| UNSIGNED_INT | GLenum | Yes| -| FLOAT | GLenum | Yes| -| DEPTH_COMPONENT | GLenum | Yes| -| ALPHA | GLenum | Yes| -| RGB | GLenum | Yes| -| RGBA | GLenum | Yes| -| LUMINANCE | GLenum | Yes| -| LUMINANCE_ALPHA | GLenum | Yes| -| UNSIGNED_SHORT_4_4_4_4 | GLenum | Yes| -| UNSIGNED_SHORT_5_5_5_1 | GLenum | Yes| -| UNSIGNED_SHORT_5_6_5 | GLenum | Yes| -| FRAGMENT_SHADER | GLenum | Yes| -| VERTEX_SHADER | GLenum | Yes| -| MAX_VERTEX_ATTRIBS | GLenum | Yes| -| MAX_VERTEX_UNIFORM_VECTORS | GLenum | Yes| -| MAX_VARYING_VECTORS | GLenum | Yes| -| MAX_COMBINED_TEXTURE_IMAGE_UNITS | GLenum | Yes| -| MAX_VERTEX_TEXTURE_IMAGE_UNITS | GLenum | Yes| -| MAX_TEXTURE_IMAGE_UNITS | GLenum | Yes| -| MAX_FRAGMENT_UNIFORM_VECTORS | GLenum | Yes| -| SHADER_TYPE | GLenum | Yes| -| DELETE_STATUS | GLenum | Yes| -| LINK_STATUS | GLenum | Yes| -| VALIDATE_STATUS | GLenum | Yes| -| ATTACHED_SHADERS | GLenum | Yes| -| ACTIVE_UNIFORMS | GLenum | Yes| -| ACTIVE_ATTRIBUTES | GLenum | Yes| -| SHADING_LANGUAGE_VERSION | GLenum | Yes| -| CURRENT_PROGRAM | GLenum | Yes| -| NEVER | GLenum | Yes| -| LESS | GLenum | Yes| -| EQUAL | GLenum | Yes| -| LEQUAL | GLenum | Yes| -| GREATER | GLenum | Yes| -| NOTEQUAL | GLenum | Yes| -| GEQUAL | GLenum | Yes| -| ALWAYS | GLenum | Yes| -| KEEP | GLenum | Yes| -| REPLACE | GLenum | Yes| -| INCR | GLenum | Yes| -| DECR | GLenum | Yes| -| INVERT | GLenum | Yes| -| INCR_WRAP | GLenum | Yes| -| DECR_WRAP | GLenum | Yes| -| VENDOR | GLenum | Yes| -| RENDERER | GLenum | Yes| -| VERSION | GLenum | Yes| -| NEAREST | GLenum | Yes| -| LINEAR | GLenum | Yes| -| NEAREST_MIPMAP_NEAREST | GLenum | Yes| -| LINEAR_MIPMAP_NEAREST | GLenum | Yes| -| NEAREST_MIPMAP_LINEAR | GLenum | Yes| -| LINEAR_MIPMAP_LINEAR | GLenum | Yes| -| TEXTURE_MIN_FILTER | GLenum | Yes| -| TEXTURE_WRAP_S | GLenum | Yes| -| TEXTURE_WRAP_T | GLenum | Yes| -| TEXTURE_2D | GLenum | Yes| -| TEXTURE | GLenum | Yes| -| TEXTURE_CUBE_MAP | GLenum | Yes| -| TEXTURE_BINDING_CUBE_MAP | GLenum | Yes| -| TEXTURE_CUBE_MAP_POSITIVE_X | GLenum | Yes| -| TEXTURE_CUBE_MAP_NEGATIVE_X | GLenum | Yes| -| TEXTURE_CUBE_MAP_POSITIVE_Y | GLenum | Yes| -| TEXTURE_CUBE_MAP_NEGATIVE_Y | GLenum | Yes| -| TEXTURE_CUBE_MAP_POSITIVE_Z | GLenum | Yes| -| TEXTURE_CUBE_MAP_NEGATIVE_Z | GLenum | Yes| -| MAX_CUBE_MAP_TEXTURE_SIZE | GLenum | Yes| -| TEXTURE0 | GLenum | Yes| -| TEXTURE1 | GLenum | Yes| -| TEXTURE2 | GLenum | Yes| -| TEXTURE3 | GLenum | Yes| -| TEXTURE4 | GLenum | Yes| -| TEXTURE5 | GLenum | Yes| -| TEXTURE6 | GLenum | Yes| -| TEXTURE7 | GLenum | Yes| -| TEXTURE8 | GLenum | Yes| -| TEXTURE9 | GLenum | Yes| -| TEXTURE10 | GLenum | Yes| -| TEXTURE11 | GLenum | Yes| -| TEXTURE12 | GLenum | Yes| -| TEXTURE13 | GLenum | Yes| -| TEXTURE14 | GLenum | Yes| -| TEXTURE15 | GLenum | Yes| -| TEXTURE16 | GLenum | Yes| -| TEXTURE17 | GLenum | Yes| -| TEXTURE18 | GLenum | Yes| -| TEXTURE19 | GLenum | Yes| -| TEXTURE20 | GLenum | Yes| -| TEXTURE21 | GLenum | Yes| -| TEXTURE22 | GLenum | Yes| -| TEXTURE23 | GLenum | Yes| -| TEXTURE24 | GLenum | Yes| -| TEXTURE25 | GLenum | Yes| -| TEXTURE26 | GLenum | Yes| -| TEXTURE27 | GLenum | Yes| -| TEXTURE28 | GLenum | Yes| -| TEXTURE29 | GLenum | Yes| -| TEXTURE30 | GLenum | Yes| -| TEXTURE31 | GLenum | Yes| -| ACTIVE_TEXTURE | GLenum | Yes| -| REPEAT | GLenum | Yes| -| CLAMP_TO_EDGE | GLenum | Yes| -| MIRRORED_REPEAT | GLenum | Yes| -| FLOAT_VEC2 | GLenum | Yes| -| FLOAT_VEC3 | GLenum | Yes| -| FLOAT_VEC4 | GLenum | Yes| -| INT_VEC2 | GLenum | Yes| -| INT_VEC3 | GLenum | Yes| -| INT_VEC4 | GLenum | Yes| -| BOOL | GLenum | Yes| -| BOOL_VEC2 | GLenum | Yes| -| BOOL_VEC3 | GLenum | Yes| -| BOOL_VEC4 | GLenum | Yes| -| FLOAT_MAT2 | GLenum | Yes| -| FLOAT_MAT3 | GLenum | Yes| -| FLOAT_MAT4 | GLenum | Yes| -| SAMPLER_2D | GLenum | Yes| -| SAMPLER_CUBE | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_ENABLED | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_SIZE | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_STRIDE | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_TYPE | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_NORMALIZED | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_POINTER | GLenum | Yes| -| VERTEX_ATTRIB_ARRAY_BUFFER_BINDING | GLenum | Yes| -| IMPLEMENTATION_COLOR_READ_TYPE | GLenum | Yes| -| IMPLEMENTATION_COLOR_READ_FORMAT | GLenum | Yes| -| COMPILE_STATUS | GLenum | Yes| -| LOW_FLOAT | GLenum | Yes| -| MEDIUM_FLOAT | GLenum | Yes| -| HIGH_FLOAT | GLenum | Yes| -| LOW_INT | GLenum | Yes| -| MEDIUM_INT | GLenum | Yes| -| HIGH_INT | GLenum | Yes| -| FRAMEBUFFER | GLenum | Yes| -| RENDERBUFFER | GLenum | Yes| -| RGBA4 | GLenum | Yes| -| RGB5_A1 | GLenum | Yes| -| RGB565 | GLenum | Yes| -| DEPTH_COMPONENT16 | GLenum | Yes| -| STENCIL_INDEX8 | GLenum | Yes| -| DEPTH_STENCIL | GLenum | Yes| -| RENDERBUFFER_WIDTH | GLenum | Yes| -| RENDERBUFFER_HEIGHT | GLenum | Yes| -| RENDERBUFFER_INTERNAL_FORMAT | GLenum | Yes| -| RENDERBUFFER_RED_SIZE | GLenum | Yes| -| RENDERBUFFER_GREEN_SIZE | GLenum | Yes| -| RENDERBUFFER_BLUE_SIZE | GLenum | Yes| -| RENDERBUFFER_ALPHA_SIZE | GLenum | Yes| -| RENDERBUFFER_DEPTH_SIZE | GLenum | Yes| -| RENDERBUFFER_STENCIL_SIZE | GLenum | Yes| -| FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE | GLenum | Yes| -| FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL | GLenum | Yes| -| FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE | GLenum | Yes| -| COLOR_ATTACHMENT0 | GLenum | Yes| -| DEPTH_ATTACHMENT | GLenum | Yes| -| STENCIL_ATTACHMENT | GLenum | Yes| -| DEPTH_STENCIL_ATTACHMENT | GLenum | Yes| -| NONE | GLenum | Yes| -| FRAMEBUFFER_COMPLETE | GLenum | Yes| -| FRAMEBUFFER_INCOMPLETE_ATTACHMENT | GLenum | Yes| -| FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT | GLenum | Yes| -| FRAMEBUFFER_INCOMPLETE_DIMENSIONS | GLenum | Yes| -| FRAMEBUFFER_UNSUPPORTED | GLenum | Yes| -| FRAMEBUFFER_BINDING | GLenum | Yes| -| RENDERBUFFER_BINDING | GLenum | Yes| -| MAX_RENDERBUFFER_SIZE | GLenum | Yes| -| INVALID_FRAMEBUFFER_OPERATION | GLenum | Yes| -| UNPACK_FLIP_Y_WEBGL | GLenum | Yes| -| UNPACK_PREMULTIPLY_ALPHA_WEBGL | GLenum | Yes| -| CONTEXT_LOST_WEBGL | GLenum | Yes| -| UNPACK_COLORSPACE_CONVERSION_WEBGL | GLenum | Yes| -| BROWSER_DEFAULT_WEBGL | GLenum | Yes| -| canvas | HTMLCanvasElement \| OffscreenCanvas | Yes| -| drawingBufferWidth | GLsizei | Yes| -| drawingBufferHeight | GLsizei | Yes| +| DEPTH_BUFFER_BIT | GLenum | Yes| +| STENCIL_BUFFER_BIT | GLenum | Yes| +| COLOR_BUFFER_BIT | GLenum | Yes| +| POINTS | GLenum | Yes| +| LINES | GLenum | Yes| +| LINE_LOOP | GLenum | Yes| +| LINE_STRIP | GLenum | Yes| +| TRIANGLES | GLenum | Yes| +| TRIANGLE_STRIP | GLenum | Yes| +| TRIANGLE_FAN | GLenum | Yes| +| ZERO | GLenum | Yes| +| ONE | GLenum | Yes| +| SRC_COLOR | GLenum | Yes| +| ONE_MINUS_SRC_COLOR | GLenum | Yes| +| SRC_ALPHA | GLenum | Yes| +| ONE_MINUS_SRC_ALPHA | GLenum | Yes| +| DST_ALPHA | GLenum | Yes| +| ONE_MINUS_DST_ALPHA | GLenum | Yes| +| DST_COLOR | GLenum | Yes| +| ONE_MINUS_DST_COLOR | GLenum | Yes| +| SRC_ALPHA_SATURATE | GLenum | Yes| +| FUNC_ADD | GLenum | Yes| +| BLEND_EQUATION | GLenum | Yes| +| BLEND_EQUATION_RGB | GLenum | Yes| +| BLEND_EQUATION_ALPHA | GLenum | Yes| +| FUNC_SUBTRACT | GLenum | Yes| +| FUNC_REVERSE_SUBTRACT | GLenum | Yes| +| BLEND_DST_RGB | GLenum | Yes| +| BLEND_SRC_RGB | GLenum | Yes| +| BLEND_DST_ALPHA | GLenum | Yes| +| BLEND_SRC_ALPHA | GLenum | Yes| +| CONSTANT_COLOR | GLenum | Yes| +| ONE_MINUS_CONSTANT_COLOR | GLenum | Yes| +| CONSTANT_ALPHA | GLenum | Yes| +| ONE_MINUS_CONSTANT_ALPHA | GLenum | Yes| +| BLEND_COLOR | GLenum | Yes| +| ARRAY_BUFFER | GLenum | Yes| +| ELEMENT_ARRAY_BUFFER | GLenum | Yes| +| ARRAY_BUFFER_BINDING | GLenum | Yes| +| ELEMENT_ARRAY_BUFFER_BINDING | GLenum | Yes| +| STREAM_DRAW | GLenum | Yes| +| STATIC_DRAW | GLenum | Yes| +| DYNAMIC_DRAW | GLenum | Yes| +| BUFFER_SIZE | GLenum | Yes| +| BUFFER_USAGE | GLenum | Yes| +| CURRENT_VERTEX_ATTRIB | GLenum | Yes| +| FRONT | GLenum | Yes| +| BACK | GLenum | Yes| +| FRONT_AND_BACK | GLenum | Yes| +| CULL_FACE | GLenum | Yes| +| BLEND | GLenum | Yes| +| DITHER | GLenum | Yes| +| STENCIL_TEST | GLenum | Yes| +| DEPTH_TEST | GLenum | Yes| +| SCISSOR_TEST | GLenum | Yes| +| POLYGON_OFFSET_FILL | GLenum | Yes| +| SAMPLE_ALPHA_TO_COVERAGE | GLenum | Yes| +| SAMPLE_COVERAGE | GLenum | Yes| +| NO_ERROR | GLenum | Yes| +| INVALID_ENUM | GLenum | Yes| +| INVALID_VALUE | GLenum | Yes| +| INVALID_OPERATION | GLenum | Yes| +| OUT_OF_MEMORY | GLenum | Yes| +| CW | GLenum | Yes| +| CCW | GLenum | Yes| +| LINE_WIDTH | GLenum | Yes| +| ALIASED_POINT_SIZE_RANGE | GLenum | Yes| +| ALIASED_LINE_WIDTH_RANGE | GLenum | Yes| +| CULL_FACE_MODE | GLenum | Yes| +| FRONT_FACE | GLenum | Yes| +| DEPTH_RANGE | GLenum | Yes| +| DEPTH_WRITEMASK | GLenum | Yes| +| DEPTH_CLEAR_VALUE | GLenum | Yes| +| DEPTH_FUNC | GLenum | Yes| +| STENCIL_CLEAR_VALUE | GLenum | Yes| +| STENCIL_FUNC | GLenum | Yes| +| STENCIL_FAIL | GLenum | Yes| +| STENCIL_PASS_DEPTH_FAIL | GLenum | Yes| +| STENCIL_PASS_DEPTH_PASS | GLenum | Yes| +| STENCIL_REF | GLenum | Yes| +| STENCIL_VALUE_MASK | GLenum | Yes| +| STENCIL_WRITEMASK | GLenum | Yes| +| STENCIL_BACK_FUNC | GLenum | Yes| +| STENCIL_BACK_FAIL | GLenum | Yes| +| STENCIL_BACK_PASS_DEPTH_FAIL | GLenum | Yes| +| STENCIL_BACK_PASS_DEPTH_PASS | GLenum | Yes| +| STENCIL_BACK_REF | GLenum | Yes| +| STENCIL_BACK_VALUE_MASK | GLenum | Yes| +| STENCIL_BACK_WRITEMASK | GLenum | Yes| +| VIEWPORT | GLenum | Yes| +| SCISSOR_BOX | GLenum | Yes| +| COLOR_CLEAR_VALUE | GLenum | Yes| +| COLOR_WRITEMASK | GLenum | Yes| +| UNPACK_ALIGNMENT | GLenum | Yes| +| PACK_ALIGNMENT | GLenum | Yes| +| MAX_TEXTURE_SIZE | GLenum | Yes| +| MAX_VIEWPORT_DIMS | GLenum | Yes| +| SUBPIXEL_BITS | GLenum | Yes| +| RED_BITS | GLenum | Yes| +| GREEN_BITS | GLenum | Yes| +| BLUE_BITS | GLenum | Yes| +| ALPHA_BITS | GLenum | Yes| +| DEPTH_BITS | GLenum | Yes| +| STENCIL_BITS | GLenum | Yes| +| POLYGON_OFFSET_UNITS | GLenum | Yes| +| POLYGON_OFFSET_FACTOR | GLenum | Yes| +| TEXTURE_BINDING_2D | GLenum | Yes| +| SAMPLE_BUFFERS | GLenum | Yes| +| SAMPLES | GLenum | Yes| +| SAMPLE_COVERAGE_VALUE | GLenum | Yes| +| SAMPLE_COVERAGE_INVERT | GLenum | Yes| +| COMPRESSED_TEXTURE_FORMATS | GLenum | Yes| +| DONT_CARE | GLenum | Yes| +| FASTEST | GLenum | Yes| +| NICEST | GLenum | Yes| +| GENERATE_MIPMAP_HINT | GLenum | Yes| +| BYTE | GLenum | Yes| +| UNSIGNED_BYTE | GLenum | Yes| +| SHORT | GLenum | Yes| +| UNSIGNED_SHORT | GLenum | Yes| +| INT | GLenum | Yes| +| UNSIGNED_INT | GLenum | Yes| +| FLOAT | GLenum | Yes| +| DEPTH_COMPONENT | GLenum | Yes| +| ALPHA | GLenum | Yes| +| RGB | GLenum | Yes| +| RGBA | GLenum | Yes| +| LUMINANCE | GLenum | Yes| +| LUMINANCE_ALPHA | GLenum | Yes| +| UNSIGNED_SHORT_4_4_4_4 | GLenum | Yes| +| UNSIGNED_SHORT_5_5_5_1 | GLenum | Yes| +| UNSIGNED_SHORT_5_6_5 | GLenum | Yes| +| FRAGMENT_SHADER | GLenum | Yes| +| VERTEX_SHADER | GLenum | Yes| +| MAX_VERTEX_ATTRIBS | GLenum | Yes| +| MAX_VERTEX_UNIFORM_VECTORS | GLenum | Yes| +| MAX_VARYING_VECTORS | GLenum | Yes| +| MAX_COMBINED_TEXTURE_IMAGE_UNITS | GLenum | Yes| +| MAX_VERTEX_TEXTURE_IMAGE_UNITS | GLenum | Yes| +| MAX_TEXTURE_IMAGE_UNITS | GLenum | Yes| +| MAX_FRAGMENT_UNIFORM_VECTORS | GLenum | Yes| +| SHADER_TYPE | GLenum | Yes| +| DELETE_STATUS | GLenum | Yes| +| LINK_STATUS | GLenum | Yes| +| VALIDATE_STATUS | GLenum | Yes| +| ATTACHED_SHADERS | GLenum | Yes| +| ACTIVE_UNIFORMS | GLenum | Yes| +| ACTIVE_ATTRIBUTES | GLenum | Yes| +| SHADING_LANGUAGE_VERSION | GLenum | Yes| +| CURRENT_PROGRAM | GLenum | Yes| +| NEVER | GLenum | Yes| +| LESS | GLenum | Yes| +| EQUAL | GLenum | Yes| +| LEQUAL | GLenum | Yes| +| GREATER | GLenum | Yes| +| NOTEQUAL | GLenum | Yes| +| GEQUAL | GLenum | Yes| +| ALWAYS | GLenum | Yes| +| KEEP | GLenum | Yes| +| REPLACE | GLenum | Yes| +| INCR | GLenum | Yes| +| DECR | GLenum | Yes| +| INVERT | GLenum | Yes| +| INCR_WRAP | GLenum | Yes| +| DECR_WRAP | GLenum | Yes| +| VENDOR | GLenum | Yes| +| RENDERER | GLenum | Yes| +| VERSION | GLenum | Yes| +| NEAREST | GLenum | Yes| +| LINEAR | GLenum | Yes| +| NEAREST_MIPMAP_NEAREST | GLenum | Yes| +| LINEAR_MIPMAP_NEAREST | GLenum | Yes| +| NEAREST_MIPMAP_LINEAR | GLenum | Yes| +| LINEAR_MIPMAP_LINEAR | GLenum | Yes| +| TEXTURE_MIN_FILTER | GLenum | Yes| +| TEXTURE_WRAP_S | GLenum | Yes| +| TEXTURE_WRAP_T | GLenum | Yes| +| TEXTURE_2D | GLenum | Yes| +| TEXTURE | GLenum | Yes| +| TEXTURE_CUBE_MAP | GLenum | Yes| +| TEXTURE_BINDING_CUBE_MAP | GLenum | Yes| +| TEXTURE_CUBE_MAP_POSITIVE_X | GLenum | Yes| +| TEXTURE_CUBE_MAP_NEGATIVE_X | GLenum | Yes| +| TEXTURE_CUBE_MAP_POSITIVE_Y | GLenum | Yes| +| TEXTURE_CUBE_MAP_NEGATIVE_Y | GLenum | Yes| +| TEXTURE_CUBE_MAP_POSITIVE_Z | GLenum | Yes| +| TEXTURE_CUBE_MAP_NEGATIVE_Z | GLenum | Yes| +| MAX_CUBE_MAP_TEXTURE_SIZE | GLenum | Yes| +| TEXTURE0 | GLenum | Yes| +| TEXTURE1 | GLenum | Yes| +| TEXTURE2 | GLenum | Yes| +| TEXTURE3 | GLenum | Yes| +| TEXTURE4 | GLenum | Yes| +| TEXTURE5 | GLenum | Yes| +| TEXTURE6 | GLenum | Yes| +| TEXTURE7 | GLenum | Yes| +| TEXTURE8 | GLenum | Yes| +| TEXTURE9 | GLenum | Yes| +| TEXTURE10 | GLenum | Yes| +| TEXTURE11 | GLenum | Yes| +| TEXTURE12 | GLenum | Yes| +| TEXTURE13 | GLenum | Yes| +| TEXTURE14 | GLenum | Yes| +| TEXTURE15 | GLenum | Yes| +| TEXTURE16 | GLenum | Yes| +| TEXTURE17 | GLenum | Yes| +| TEXTURE18 | GLenum | Yes| +| TEXTURE19 | GLenum | Yes| +| TEXTURE20 | GLenum | Yes| +| TEXTURE21 | GLenum | Yes| +| TEXTURE22 | GLenum | Yes| +| TEXTURE23 | GLenum | Yes| +| TEXTURE24 | GLenum | Yes| +| TEXTURE25 | GLenum | Yes| +| TEXTURE26 | GLenum | Yes| +| TEXTURE27 | GLenum | Yes| +| TEXTURE28 | GLenum | Yes| +| TEXTURE29 | GLenum | Yes| +| TEXTURE30 | GLenum | Yes| +| TEXTURE31 | GLenum | Yes| +| ACTIVE_TEXTURE | GLenum | Yes| +| REPEAT | GLenum | Yes| +| CLAMP_TO_EDGE | GLenum | Yes| +| MIRRORED_REPEAT | GLenum | Yes| +| FLOAT_VEC2 | GLenum | Yes| +| FLOAT_VEC3 | GLenum | Yes| +| FLOAT_VEC4 | GLenum | Yes| +| INT_VEC2 | GLenum | Yes| +| INT_VEC3 | GLenum | Yes| +| INT_VEC4 | GLenum | Yes| +| BOOL | GLenum | Yes| +| BOOL_VEC2 | GLenum | Yes| +| BOOL_VEC3 | GLenum | Yes| +| BOOL_VEC4 | GLenum | Yes| +| FLOAT_MAT2 | GLenum | Yes| +| FLOAT_MAT3 | GLenum | Yes| +| FLOAT_MAT4 | GLenum | Yes| +| SAMPLER_2D | GLenum | Yes| +| SAMPLER_CUBE | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_ENABLED | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_SIZE | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_STRIDE | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_TYPE | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_NORMALIZED | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_POINTER | GLenum | Yes| +| VERTEX_ATTRIB_ARRAY_BUFFER_BINDING | GLenum | Yes| +| IMPLEMENTATION_COLOR_READ_TYPE | GLenum | Yes| +| IMPLEMENTATION_COLOR_READ_FORMAT | GLenum | Yes| +| COMPILE_STATUS | GLenum | Yes| +| LOW_FLOAT | GLenum | Yes| +| MEDIUM_FLOAT | GLenum | Yes| +| HIGH_FLOAT | GLenum | Yes| +| LOW_INT | GLenum | Yes| +| MEDIUM_INT | GLenum | Yes| +| HIGH_INT | GLenum | Yes| +| FRAMEBUFFER | GLenum | Yes| +| RENDERBUFFER | GLenum | Yes| +| RGBA4 | GLenum | Yes| +| RGB5_A1 | GLenum | Yes| +| RGB565 | GLenum | Yes| +| DEPTH_COMPONENT16 | GLenum | Yes| +| STENCIL_INDEX8 | GLenum | Yes| +| DEPTH_STENCIL | GLenum | Yes| +| RENDERBUFFER_WIDTH | GLenum | Yes| +| RENDERBUFFER_HEIGHT | GLenum | Yes| +| RENDERBUFFER_INTERNAL_FORMAT | GLenum | Yes| +| RENDERBUFFER_RED_SIZE | GLenum | Yes| +| RENDERBUFFER_GREEN_SIZE | GLenum | Yes| +| RENDERBUFFER_BLUE_SIZE | GLenum | Yes| +| RENDERBUFFER_ALPHA_SIZE | GLenum | Yes| +| RENDERBUFFER_DEPTH_SIZE | GLenum | Yes| +| RENDERBUFFER_STENCIL_SIZE | GLenum | Yes| +| FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE | GLenum | Yes| +| FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL | GLenum | Yes| +| FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE | GLenum | Yes| +| COLOR_ATTACHMENT0 | GLenum | Yes| +| DEPTH_ATTACHMENT | GLenum | Yes| +| STENCIL_ATTACHMENT | GLenum | Yes| +| DEPTH_STENCIL_ATTACHMENT | GLenum | Yes| +| NONE | GLenum | Yes| +| FRAMEBUFFER_COMPLETE | GLenum | Yes| +| FRAMEBUFFER_INCOMPLETE_ATTACHMENT | GLenum | Yes| +| FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT | GLenum | Yes| +| FRAMEBUFFER_INCOMPLETE_DIMENSIONS | GLenum | Yes| +| FRAMEBUFFER_UNSUPPORTED | GLenum | Yes| +| FRAMEBUFFER_BINDING | GLenum | Yes| +| RENDERBUFFER_BINDING | GLenum | Yes| +| MAX_RENDERBUFFER_SIZE | GLenum | Yes| +| INVALID_FRAMEBUFFER_OPERATION | GLenum | Yes| +| UNPACK_FLIP_Y_WEBGL | GLenum | Yes| +| UNPACK_PREMULTIPLY_ALPHA_WEBGL | GLenum | Yes| +| CONTEXT_LOST_WEBGL | GLenum | Yes| +| UNPACK_COLORSPACE_CONVERSION_WEBGL | GLenum | Yes| +| BROWSER_DEFAULT_WEBGL | GLenum | Yes| +| canvas | HTMLCanvasElement \| OffscreenCanvas | Yes| +| drawingBufferWidth | GLsizei | Yes| +| drawingBufferHeight | GLsizei | Yes| ### Methods - | Method| Return Value Type| +| Method| Return Value Type| | -------- | -------- | -| getContextAttributes() | WebGLContextAttributes \| null | -| isContextLost() | boolean | -| getSupportedExtensions() | string[] \| null | -| getExtension(name: string) | any | -| activeTexture(texture: GLenum) | void | -| attachShader(program: WebGLProgram, shader: WebGLShader) | void | -| bindAttribLocation(program: WebGLProgram, index: GLuint, name: string) | void | -| bindBuffer(target: GLenum, buffer: WebGLBuffer \| null) | void | -| bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer \| null) | void | -| bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer \| null) | void | -| bindTexture(target: GLenum, texture: WebGLTexture \| null) | void | -| blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) | void | -| blendEquation(mode: GLenum) | void | -| blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) | void | -| blendFunc(sfactor: GLenum, dfactor: GLenum) | void | -| blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) | void | -| checkFramebufferStatus(target: GLenum) | GLenum | -| clear(mask: GLbitfield) | void | -| clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) | void | -| clearDepth(depth: GLclampf) | void | -| clearStencil(s: GLint) | void | -| colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) | void | -| compileShader(shader: WebGLShader) | void | -| copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) | void | -| copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | -| createBuffer() | WebGLBuffer \| null | -| createFramebuffer() | WebGLFramebuffer \| null | -| createProgram() | WebGLProgram \| null | -| createRenderbuffer() | WebGLRenderbuffer \| null | -| createShader(type: GLenum) | WebGLShader \| null | -| createTexture() | WebGLTexture \| null | -| cullFace(mode: GLenum) | void | -| deleteBuffer(buffer: WebGLBuffer \| null) | void | -| deleteFramebuffer(framebuffer: WebGLFramebuffer \| null) | void | -| deleteProgram(program: WebGLProgram \| null) | void | -| deleteRenderbuffer(renderbuffer: WebGLRenderbuffer \| null) | void | -| deleteShader(shader: WebGLShader \| null) | void | -| deleteTexture(texture: WebGLTexture \| null) | void | -| depthFunc(func: GLenum) | void | -| depthMask(flag: GLboolean) | void | -| depthRange(zNear: GLclampf, zFar: GLclampf) | void | -| detachShader(program: WebGLProgram, shader: WebGLShader) | void | -| disable(cap: GLenum) | void | -| disableVertexAttribArray(index: GLuint) | void | -| drawArrays(mode: GLenum, first: GLint, count: GLsizei) | void | -| drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) | void | -| enable(cap: GLenum) | void | -| enableVertexAttribArray(index: GLuint) | void | -| finish() | void | -| flush() | void | -| framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer \| null) | void | -| framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture \| null, level: GLint) | void | -| frontFace(mode: GLenum) | void | -| generateMipmap(target: GLenum) | void | -| getActiveAttrib(program: WebGLProgram, index: GLuint) | WebGLActiveInfo \| null | -| getActiveUniform(program: WebGLProgram, index: GLuint) | WebGLActiveInfo \| null | -| getAttachedShaders(program: WebGLProgram) | WebGLShader[] \| null | -| getAttribLocation(program: WebGLProgram, name: string) | GLint | -| getBufferParameter(target: GLenum, pname: GLenum) | any | -| getParameter(pname: GLenum) | any | -| getError() | GLenum | -| getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) | any | -| getProgramParameter(program: WebGLProgram, pname: GLenum) | any | -| getProgramInfoLog(program: WebGLProgram) | string \| null | -| getRenderbufferParameter(target: GLenum, pname: GLenum) | any | -| getShaderParameter(shader: WebGLShader, pname: GLenum) | any | -| getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) | WebGLShaderPrecisionFormat \| null | -| getShaderInfoLog(shader: WebGLShader) | string \| null | -| getShaderSource(shader: WebGLShader) | string \| null | -| getTexParameter(target: GLenum, pname: GLenum) | any | -| getUniform(program: WebGLProgram, location: WebGLUniformLocation) | any | -| getUniformLocation(program: WebGLProgram, name: string) | WebGLUniformLocation \| null | -| getVertexAttrib(index: GLuint, pname: GLenum) | any | -| getVertexAttribOffset(index: GLuint, pname: GLenum) | GLintptr | -| hint(target: GLenum, mode: GLenum) | void | -| isBuffer(buffer: WebGLBuffer \| null) | GLboolean | -| isEnabled(cap: GLenum) | GLboolean | -| isFramebuffer(framebuffer: WebGLFramebuffer \| null) | GLboolean | -| isProgram(program: WebGLProgram \| null) | GLboolean | -| isRenderbuffer(renderbuffer: WebGLRenderbuffer \| null) | GLboolean | -| isShader(shader: WebGLShader \| null) | GLboolean | -| isTexture(texture: WebGLTexture \| null) | GLboolean | -| lineWidth(width: GLfloat) | void | -| linkProgram(program: WebGLProgram) | void | -| pixelStorei(pname: GLenum, param: GLint \| GLboolean) | void | -| polygonOffset(factor: GLfloat, units: GLfloat) | void | -| renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) | void | -| sampleCoverage(value: GLclampf, invert: GLboolean) | void | -| scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | -| shaderSource(shader: WebGLShader, source: string) | void | -| stencilFunc(func: GLenum, ref: GLint, mask: GLuint) | void | -| stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) | void | -| stencilMask(mask: GLuint) | void | -| stencilMaskSeparate(face: GLenum, mask: GLuint) | void | -| stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) | void | -| stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) | void | -| texParameterf(target: GLenum, pname: GLenum, param: GLfloat) | void | -| texParameteri(target: GLenum, pname: GLenum, param: GLint) | void | -| uniform1f(location: WebGLUniformLocation \| null, x: GLfloat) | void | -| uniform2f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat) | void | -| uniform3f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat, z: GLfloat) | void | -| uniform4f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) | void | -| uniform1i(location: WebGLUniformLocation \| null, x: GLint) | void | -| uniform2i(location: WebGLUniformLocation \| null, x: GLint, y: GLint) | void | -| uniform3i(location: WebGLUniformLocation \| null, x: GLint, y: GLint, z: GLint) | void | -| uniform4i(location: WebGLUniformLocation \| null, x: GLint, y: GLint, z: GLint, w: GLint) | void | -| useProgram(program: WebGLProgram \| null) | void | -| validateProgram(program: WebGLProgram) | void | -| vertexAttrib1f(index: GLuint, x: GLfloat) | void | -| vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) | void | -| vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) | void | -| vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) | void | -| vertexAttrib1fv(index: GLuint, values: Float32List) | void | -| vertexAttrib2fv(index: GLuint, values: Float32List) | void | -| vertexAttrib3fv(index: GLuint, values: Float32List) | void | -| vertexAttrib4fv(index: GLuint, values: Float32List) | void | -| vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) | void | -| viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | +| getContextAttributes() | WebGLContextAttributes \| null | +| isContextLost() | boolean | +| getSupportedExtensions() | string[] \| null | +| getExtension(name: string) | any | +| activeTexture(texture: GLenum) | void | +| attachShader(program: WebGLProgram, shader: WebGLShader) | void | +| bindAttribLocation(program: WebGLProgram, index: GLuint, name: string) | void | +| bindBuffer(target: GLenum, buffer: WebGLBuffer \| null) | void | +| bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer \| null) | void | +| bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer \| null) | void | +| bindTexture(target: GLenum, texture: WebGLTexture \| null) | void | +| blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) | void | +| blendEquation(mode: GLenum) | void | +| blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) | void | +| blendFunc(sfactor: GLenum, dfactor: GLenum) | void | +| blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) | void | +| checkFramebufferStatus(target: GLenum) | GLenum | +| clear(mask: GLbitfield) | void | +| clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) | void | +| clearDepth(depth: GLclampf) | void | +| clearStencil(s: GLint) | void | +| colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) | void | +| compileShader(shader: WebGLShader) | void | +| copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) | void | +| copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | +| createBuffer() | WebGLBuffer \| null | +| createFramebuffer() | WebGLFramebuffer \| null | +| createProgram() | WebGLProgram \| null | +| createRenderbuffer() | WebGLRenderbuffer \| null | +| createShader(type: GLenum) | WebGLShader \| null | +| createTexture() | WebGLTexture \| null | +| cullFace(mode: GLenum) | void | +| deleteBuffer(buffer: WebGLBuffer \| null) | void | +| deleteFramebuffer(framebuffer: WebGLFramebuffer \| null) | void | +| deleteProgram(program: WebGLProgram \| null) | void | +| deleteRenderbuffer(renderbuffer: WebGLRenderbuffer \| null) | void | +| deleteShader(shader: WebGLShader \| null) | void | +| deleteTexture(texture: WebGLTexture \| null) | void | +| depthFunc(func: GLenum) | void | +| depthMask(flag: GLboolean) | void | +| depthRange(zNear: GLclampf, zFar: GLclampf) | void | +| detachShader(program: WebGLProgram, shader: WebGLShader) | void | +| disable(cap: GLenum) | void | +| disableVertexAttribArray(index: GLuint) | void | +| drawArrays(mode: GLenum, first: GLint, count: GLsizei) | void | +| drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) | void | +| enable(cap: GLenum) | void | +| enableVertexAttribArray(index: GLuint) | void | +| finish() | void | +| flush() | void | +| framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer \| null) | void | +| framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture \| null, level: GLint) | void | +| frontFace(mode: GLenum) | void | +| generateMipmap(target: GLenum) | void | +| getActiveAttrib(program: WebGLProgram, index: GLuint) | WebGLActiveInfo \| null | +| getActiveUniform(program: WebGLProgram, index: GLuint) | WebGLActiveInfo \| null | +| getAttachedShaders(program: WebGLProgram) | WebGLShader[] \| null | +| getAttribLocation(program: WebGLProgram, name: string) | GLint | +| getBufferParameter(target: GLenum, pname: GLenum) | any | +| getParameter(pname: GLenum) | any | +| getError() | GLenum | +| getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) | any | +| getProgramParameter(program: WebGLProgram, pname: GLenum) | any | +| getProgramInfoLog(program: WebGLProgram) | string \| null | +| getRenderbufferParameter(target: GLenum, pname: GLenum) | any | +| getShaderParameter(shader: WebGLShader, pname: GLenum) | any | +| getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) | WebGLShaderPrecisionFormat \| null | +| getShaderInfoLog(shader: WebGLShader) | string \| null | +| getShaderSource(shader: WebGLShader) | string \| null | +| getTexParameter(target: GLenum, pname: GLenum) | any | +| getUniform(program: WebGLProgram, location: WebGLUniformLocation) | any | +| getUniformLocation(program: WebGLProgram, name: string) | WebGLUniformLocation \| null | +| getVertexAttrib(index: GLuint, pname: GLenum) | any | +| getVertexAttribOffset(index: GLuint, pname: GLenum) | GLintptr | +| hint(target: GLenum, mode: GLenum) | void | +| isBuffer(buffer: WebGLBuffer \| null) | GLboolean | +| isEnabled(cap: GLenum) | GLboolean | +| isFramebuffer(framebuffer: WebGLFramebuffer \| null) | GLboolean | +| isProgram(program: WebGLProgram \| null) | GLboolean | +| isRenderbuffer(renderbuffer: WebGLRenderbuffer \| null) | GLboolean | +| isShader(shader: WebGLShader \| null) | GLboolean | +| isTexture(texture: WebGLTexture \| null) | GLboolean | +| lineWidth(width: GLfloat) | void | +| linkProgram(program: WebGLProgram) | void | +| pixelStorei(pname: GLenum, param: GLint \| GLboolean) | void | +| polygonOffset(factor: GLfloat, units: GLfloat) | void | +| renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) | void | +| sampleCoverage(value: GLclampf, invert: GLboolean) | void | +| scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | +| shaderSource(shader: WebGLShader, source: string) | void | +| stencilFunc(func: GLenum, ref: GLint, mask: GLuint) | void | +| stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) | void | +| stencilMask(mask: GLuint) | void | +| stencilMaskSeparate(face: GLenum, mask: GLuint) | void | +| stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) | void | +| stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) | void | +| texParameterf(target: GLenum, pname: GLenum, param: GLfloat) | void | +| texParameteri(target: GLenum, pname: GLenum, param: GLint) | void | +| uniform1f(location: WebGLUniformLocation \| null, x: GLfloat) | void | +| uniform2f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat) | void | +| uniform3f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat, z: GLfloat) | void | +| uniform4f(location: WebGLUniformLocation \| null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) | void | +| uniform1i(location: WebGLUniformLocation \| null, x: GLint) | void | +| uniform2i(location: WebGLUniformLocation \| null, x: GLint, y: GLint) | void | +| uniform3i(location: WebGLUniformLocation \| null, x: GLint, y: GLint, z: GLint) | void | +| uniform4i(location: WebGLUniformLocation \| null, x: GLint, y: GLint, z: GLint, w: GLint) | void | +| useProgram(program: WebGLProgram \| null) | void | +| validateProgram(program: WebGLProgram) | void | +| vertexAttrib1f(index: GLuint, x: GLfloat) | void | +| vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) | void | +| vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) | void | +| vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) | void | +| vertexAttrib1fv(index: GLuint, values: Float32List) | void | +| vertexAttrib2fv(index: GLuint, values: Float32List) | void | +| vertexAttrib3fv(index: GLuint, values: Float32List) | void | +| vertexAttrib4fv(index: GLuint, values: Float32List) | void | +| vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) | void | +| viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) | void | ## WebGLRenderingContextOverloads WebGLRenderingContextOverloads - | Method| Return Value Type| +| Method| Return Value Type| | -------- | -------- | -| bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void | -| bufferData(target: GLenum, data: BufferSource \| null, usage: GLenum) | 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 | -| 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; | -| 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 | -| 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, format: GLenum, type: GLenum, source: TexImageSource) | void | -| uniform1fv(location: WebGLUniformLocation \| null, v: Float32List) | void | -| uniform2fv(location: WebGLUniformLocation \| null, v: Float32List) | void | -| uniform3fv(location: WebGLUniformLocation \| null, v: Float32List) | void | -| uniform4fv(location: WebGLUniformLocation \| null, v: Float32List) | void | -| uniform1iv(location: WebGLUniformLocation \| null, v: Int32List) | void | -| uniform2iv(location: WebGLUniformLocation \| null, v: Int32List) | void | -| uniform3iv(location: WebGLUniformLocation \| null, v: Int32List) | void | -| uniform4iv(location: WebGLUniformLocation \| null, v: Int32List) | void | -| uniformMatrix2fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | -| uniformMatrix3fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | -| uniformMatrix4fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | +| bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void | +| bufferData(target: GLenum, data: BufferSource \| null, usage: GLenum) | 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 | +| 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 | +| 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 | +| 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, format: GLenum, type: GLenum, source: TexImageSource) | void | +| uniform1fv(location: WebGLUniformLocation \| null, v: Float32List) | void | +| uniform2fv(location: WebGLUniformLocation \| null, v: Float32List) | void | +| uniform3fv(location: WebGLUniformLocation \| null, v: Float32List) | void | +| uniform4fv(location: WebGLUniformLocation \| null, v: Float32List) | void | +| uniform1iv(location: WebGLUniformLocation \| null, v: Int32List) | void | +| uniform2iv(location: WebGLUniformLocation \| null, v: Int32List) | void | +| uniform3iv(location: WebGLUniformLocation \| null, v: Int32List) | void | +| uniform4iv(location: WebGLUniformLocation \| null, v: Int32List) | void | +| uniformMatrix2fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | +| uniformMatrix3fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | +| uniformMatrix4fv(location: WebGLUniformLocation \| null, transpose: GLboolean, value: Float32List) | void | diff --git a/en/application-dev/reference/apis/js-apis-webgl2.md b/en/application-dev/reference/apis/js-apis-webgl2.md index 0052505dfb6d127a7081b35b01f3b302b74b2deb..6fc36366d38b7d65484822911e8acdf926b8e931 100644 --- a/en/application-dev/reference/apis/js-apis-webgl2.md +++ b/en/application-dev/reference/apis/js-apis-webgl2.md @@ -7,6 +7,8 @@ This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set > **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. +> +> WebGL2 complies with the OpenGL protocol and does not support multi-thread calling. ## Invoking Method diff --git a/en/application-dev/reference/arkui-ts/Readme-EN.md b/en/application-dev/reference/arkui-ts/Readme-EN.md index 5e5e1e6e82959ae4b6b56f23c354720f02fbf700..1d668f270f754d5a5c5a64b2d1bd1c4291081a20 100644 --- a/en/application-dev/reference/arkui-ts/Readme-EN.md +++ b/en/application-dev/reference/arkui-ts/Readme-EN.md @@ -10,7 +10,6 @@ - [Focus Event](ts-universal-focus-event.md) - [Mouse Event](ts-universal-mouse-key.md) - [Component Area Change Event](ts-universal-component-area-change-event.md) - - [Visible Area Change Event](ts-universal-component-visible-area-change-event.md) - Universal Attributes - [Size](ts-universal-attributes-size.md) - [Location](ts-universal-attributes-location.md) diff --git a/en/application-dev/reference/arkui-ts/ts-container-swiper.md b/en/application-dev/reference/arkui-ts/ts-container-swiper.md index b25c576613e6c228df9320f0a6b6048847aa4e85..161e30cef3b73797b6e14be707306f38eb80b175 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/en/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -1,8 +1,7 @@ # Swiper -The **** component provides a container that allows users to switch among child components through swiping. - +The **\** component provides a container that allows users to switch among child components using swipe gestures. > **NOTE** > @@ -23,49 +22,94 @@ This component can contain child components. Swiper(value:{controller?: SwiperController}) -- Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | controller | [SwiperController](#swipercontroller) | No | null | Controller bound to the component to control the page switching. | +**Parameters** +| Name | Type | Mandatory | Description | +| ---------- | ------------------------------------- | ---- | -------------------- | +| controller | [SwiperController](#swipercontroller) | No | Controller bound to the component to control the page switching.
Default value: **null** | -## Attributes -| Name | Type | Default Value | Description | -| -------- | -------- | -------- | -------- | -| index | number | 0 | Index of the child component currently displayed in the container. | -| autoPlay | boolean | false | Whether to enable automatic playback for child component switching. If this attribute is **true**, the indicator dots do not take effect. | -| interval | number | 3000 | Interval for automatic playback, in ms. | -| indicator | boolean | true | Whether to enable the navigation dots. | -| loop | boolean | true | Whether to enable loop playback.
The value **true** means to enable loop playback. When **LazyForEach** is used, it is recommended that the number of the components to load exceed 5. | -| duration | number | 400 | Duration of the animation for switching child components, in ms. | -| vertical | boolean | false | Whether vertical swiping is used. | -| itemSpace | Length | 0 | Space between child components. | -| cachedCount8+ | number | 1 | Number of child components to be cached. | -| disableSwipe8+ | boolean | false | Whether to disable the swipe feature. | -| curve8+ | [Curve](ts-animatorproperty.md) \| Curves | Curve.Ease | Animation curve. The ease-in/ease-out curve is used by default. For details about common curves, see [Curve enums](ts-animatorproperty.md). You can also create custom curves ([interpolation curve objects](ts-interpolation-calculation.md)) by using APIs provided by the interpolation calculation module. | -| indicatorStyle8+ | {
left?: Length,
top?: Length,
right?: Length,
bottom?: Length,
size?: Length,
color?: Color,
selectedColor?: Color
} | - | Style of the navigation dots indicator.
- **left**: distance between the navigation dots indicator and the left edge of the **\** component.
- **top**: distance between the navigation dots indicator and the top edge of the **\** component.
- **right**: distance between the navigation dots indicator and the right edge of the **\** component.
- **bottom**: distance between the navigation dots indicator and the right edge of the **\** component.
- **size**: diameter of the navigation dots indicator.
- **color**: color of the navigation dots indicator.
- **selectedColor**: color of the selected navigation dot. | +## Attributes +[Menu control](ts-universal-attributes-menu.md) is not supported. + +| Name | Type | Description | +| --------------------------- | ---------------------------------------- | ---------------------------------------- | +| index | number | Index of the child component currently displayed in the container.
Default value: **0** | +| autoPlay | boolean | Whether to enable automatic playback for child component switching. If this attribute is **true**, the navigation dots indicator does not take effect.
Default value: **false** | +| interval | number | Interval for automatic playback, in ms.
Default value: **3000** | +| indicator | boolean | Whether to enable the navigation dots indicator.
Default value: **true** | +| loop | boolean | Whether to enable loop playback.
The value **true** means to enable loop playback. When LazyForEach is used, it is recommended that the number of the components to load exceed 5.
Default value: **true**| +| duration | number | Duration of the animation for switching child components, in ms.
Default value: **400** | +| vertical | boolean | Whether vertical swiping is used.
Default value: **false** | +| itemSpace | Length | Space between child components.
Default value: **0** | +| displayMode | SwiperDisplayMode | Mode in which elements are displayed along the main axis. This attribute takes effect only when **displayCount** is not set.
Default value: **SwiperDisplayMode.Stretch**| +| cachedCount8+ | number | Number of child components to be cached.
Default value: **1** | +| disableSwipe8+ | boolean | Whether to disable the swipe feature.
Default value: **false** | +| curve8+ | [Curve](ts-animatorproperty.md#Curve) \| string | Animation curve. The ease-in/ease-out curve is used by default. For details about common curves, see [Curve enums](ts-animatorproperty.md#curve-enums). You can also create custom curves ([interpolation curve objects](ts-interpolation-calculation.md)) by using the API provided by the interpolation calculation module.
Default value: **Curve.Ease**| +| indicatorStyle8+ | {
left?: Length,
top?: Length,
right?: Length,
bottom?: Length,
size?: Length,
color?: Color,
selectedColor?: Color
} | Style of the navigation dots indicator.
- **left**: distance between the navigation dots indicator and the left edge of the **\** component.
- **top**: distance between the navigation dots indicator and the top edge of the **\** component.
- **right**: distance between the navigation dots indicator and the right edge of the **\** component.
- **bottom**: distance between the navigation dots indicator and the bottom edge of the **\** component.
- **size**: diameter of the navigation dots indicator.
- **color**: color of the navigation dots indicator.
- **selectedColor**: color of the selected navigation dot.| +| displayCount8+ | number\|string | Number of elements to display.
Default value: **1** | +| effectMode8+ | EdgeEffect | Swipe effect. For details, see **EdgeEffect**.
Default value: **EdgeEffect.Spring**| + +## SwiperDisplayMode + +| Name| Description| +| ----------- | ------------------------------------------ | +| Stretch | The slide width of the **\** component is equal to the width of the component.| +| AutoLinear | The slide width of the **\** component is equal to the maximum width of the child components.| + +## EdgeEffect + +| Name | Description | +| ------ | ------------------------------------------------------------------------- | +| Spring | Spring effect. When at one of the edges, the component can move beyond the bounds through touches, and produce a bounce effect when the user releases their finger. | +| Fade | Fade effect. When at one of the edges, the component can move beyond the bounds through touches, and produce a fade effect along the way; when the user releases their finger, the fade changes. | +| None | No effect. When at one of the edges, the component cannot move beyond the bounds. | ## SwiperController -Controller of the **** component. You can bind this object to the **** component and use it to control page switching. +Controller of the **\** component. You can bind this object to the **** component and use it to control page switching. + +### showNext + +showNext(): void + +Turns to the next page. + +### showPrevious + +showPrevious(): void + +Turns to the previous page. -| Name | Description | -| -------- | -------- | -| showNext():void | Turns to the next page. | -| showPrevious():void | Turns to the previous page. | +### finishAnimation +finishAnimation(callback?: () => void): void + +Stops this animation. + +**Parameters** + +| Name | Type | Mandatory.| Description| +| --------- | ---------- | ------ | -------- | +| callback | () => void | Yes | Callback invoked when the animation stops.| ## Events -| Name | Description | -| -------- | -------- | -| onChange( index: number) => void | Triggered when the index of the currently displayed component changes. | +### onChange +onChange( index: number) => void -## Example +Triggered when the index of the currently displayed component changes. +**Parameters** + +| Name | Type | Mandatory.| Description| +| --------- | ---------- | ------ | -------- | +| index | number | Yes | Index of the currently displayed element.| + + +## Example ```ts // xxx.ets @@ -123,7 +167,7 @@ struct SwiperExample { .duration(1000) .vertical(false) // Horizontal swiping is enabled by default. .itemSpace(0) - .curve(Curve.Linear) // Animation curve + .curve(Curve.Linear) // Animation curve. .onChange((index: number) => { console.info(index.toString()) }) diff --git a/en/application-dev/reference/arkui-ts/ts-universal-events-key.md b/en/application-dev/reference/arkui-ts/ts-universal-events-key.md index 233209b41cd2f710e298ac0864227071e327d90c..3169c685e1f5945fcc41dc7d1dfa152d56f8f2d5 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-events-key.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-events-key.md @@ -25,7 +25,7 @@ None | Name | Type | Description | | -------- | -------- | -------- | | type | [KeyType](#keytype-enums) | Type of a key. | - | [keyCode](../apis/js-apis-keycode.md) | number | Key code. | + | keyCode | number | Key code. | | keyText | string | Key value. | | keySource | [KeySource](#keysource-enums) | Type of the input device that triggers the key event. | | deviceId | number | ID of the input device that triggers the key event. | diff --git a/en/application-dev/ui/figures/create-resource-file-1.png b/en/application-dev/ui/figures/create-resource-file-1.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d82caac558cd58b78aba3014b6ac60148f6bc8 Binary files /dev/null and b/en/application-dev/ui/figures/create-resource-file-1.png differ diff --git a/en/application-dev/ui/figures/create-resource-file-2.png b/en/application-dev/ui/figures/create-resource-file-2.png new file mode 100644 index 0000000000000000000000000000000000000000..b4d23e8dc15bafbb08ca691575ce2ea9fe989e91 Binary files /dev/null and b/en/application-dev/ui/figures/create-resource-file-2.png differ diff --git a/en/application-dev/ui/figures/create-resource-file-3.png b/en/application-dev/ui/figures/create-resource-file-3.png new file mode 100644 index 0000000000000000000000000000000000000000..566653c5e49753e1f04d0d6b5b5c3e931f4354b5 Binary files /dev/null and b/en/application-dev/ui/figures/create-resource-file-3.png differ diff --git a/zh-cn/application-dev/ability/stage-ability.md b/zh-cn/application-dev/ability/stage-ability.md index 8e9ccc1e75e89bb8c5f4c2faa22005952eaf7d20..ef785cc275e4b30d6a29e4470c7b963c6c7d3632 100644 --- a/zh-cn/application-dev/ability/stage-ability.md +++ b/zh-cn/application-dev/ability/stage-ability.md @@ -86,7 +86,7 @@ Ability功能如下(Ability类,具体的API详见[接口文档](../reference onWindowStageCreate(windowStage) { console.log("MainAbility onWindowStageCreate") - windowStage.loadContent("pages/index").then((data) => { + windowStage.loadContent("pages/index").then(() => { console.log("MainAbility load content succeed") }).catch((error) => { console.error("MainAbility load content failed with error: "+ JSON.stringify(error)) @@ -228,8 +228,8 @@ var want = { "bundleName": "com.example.MyApplication", "abilityName": "MainAbility" }; -context.startAbility(want).then((data) => { - console.log("Succeed to start ability with data: " + JSON.stringify(data)) +context.startAbility(want).then(() => { + console.log("Succeed to start ability") }).catch((error) => { console.error("Failed to start ability with error: "+ JSON.stringify(error)) }) @@ -245,8 +245,8 @@ var want = { "bundleName": "com.example.MyApplication", "abilityName": "MainAbility" }; -context.startAbility(want).then((data) => { - console.log("Succeed to start remote ability with data: " + JSON.stringify(data)) +context.startAbility(want).then(() => { + console.log("Succeed to start remote ability") }).catch((error) => { console.error("Failed to start remote ability with error: " + JSON.stringify(error)) }) diff --git a/zh-cn/application-dev/database/database-storage-guidelines.md b/zh-cn/application-dev/database/database-storage-guidelines.md index cbb2ebf5e36ddfc75a8a7349a2397c5438113d88..f7559dc39e96e46a2f2493c601442a22f00eac81 100644 --- a/zh-cn/application-dev/database/database-storage-guidelines.md +++ b/zh-cn/application-dev/database/database-storage-guidelines.md @@ -88,9 +88,9 @@ context.getFilesDir().then((filePath) => { path = filePath; console.info("======================>getFilesDirPromsie====================>"); + + let promise = dataStorage.getStorage(path + '/mystore'); }); - - let promise = dataStorage.getStorage(path + '/mystore'); ``` 3. 存入数据。 @@ -99,7 +99,7 @@ ```js promise.then((storage) => { - let getPromise = storage.put('startup', 'auto'); // 保存数据到缓存的storage示例中。 + let getPromise = storage.put('startup', 'auto'); // 保存数据到缓存的storage实例中 getPromise.then(() => { console.info("Succeeded in putting the value of startup."); }).catch((err) => { diff --git a/zh-cn/application-dev/device/usb-guidelines.md b/zh-cn/application-dev/device/usb-guidelines.md index 4743a90dd8a3bd7b072054c19fd00bd5b314f2ff..8c836de6508cd2a01eeb76f4a74b93bba695db9c 100644 --- a/zh-cn/application-dev/device/usb-guidelines.md +++ b/zh-cn/application-dev/device/usb-guidelines.md @@ -17,19 +17,19 @@ USB类开放能力如下,具体请查阅[API参考文档](../reference/apis/js | 接口名 | 描述 | | -------- | -------- | -| hasRight(deviceName: string): boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 | -| requestRight(deviceName: string): Promise<boolean> | 请求给定软件包的临时权限以访问设备。 | -| connectDevice(device: USBDevice): Readonly<USBDevicePipe> | 根据getDevices()返回的设备信息打开USB设备。 | -| getDevices(): Array<Readonly<USBDevice>> | 返回USB设备的列表。 | -| setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | 设置设备的配置。 | -| setInterface(pipe: USBDevicePipe, iface: USBInterface): number | 设置设备的接口。 | -| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | 获取接口。 | -|bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise<number> | 批量传输。 | -| closePipe(pipe: USBDevicePipe): number | 关闭设备消息控制通道。 | -| releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | 释放接口。 | -| getFileDescriptor(pipe: USBDevicePipe): number | 获取文件描述符。 | -| getRawDescriptor(pipe: USBDevicePipe): Uint8Array | 获取原始的USB描述符。 | -| controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise<number> | 控制传输。 | +| hasRight(deviceName:string):boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 | +| requestRight(deviceName:string):Promise<boolean> | 请求给定软件包的临时权限以访问设备。 | +| connectDevice(device:USBDevice):Readonly<USBDevicePipe> | 根据`getDevices()`返回的设备信息打开USB设备。 | +| getDevices():Array<Readonly<USBDevice>> | 返回USB设备列表。 | +| setConfiguration(pipe:USBDevicePipe,config:USBConfig):number | 设置设备的配置。 | +| setInterface(pipe:USBDevicePipe,iface:USBInterface):number | 设置设备的接口。 | +| claimInterface(pipe:USBDevicePipe,iface:USBInterface,force?:boolean):number | 获取接口。 | +|bulkTransfer(pipe:USBDevicePipe,endpoint:USBEndpoint,buffer:Uint8Array,timeout?:number):Promise<number> | 批量传输。 | +| closePipe(pipe:USBDevicePipe):number | 关闭设备消息控制通道。 | +| releaseInterface(pipe:USBDevicePipe,iface:USBInterface):number | 释放接口。 | +| getFileDescriptor(pipe:USBDevicePipe):number | 获取文件描述符。 | +| getRawDescriptor(pipe:USBDevicePipe):Uint8Array | 获取原始的USB描述符。 | +| controlTransfer(pipe:USBDevicePipe,contrlparam:USBControlParams,timeout?:number):Promise<number> | 控制传输。 | ## 开发步骤 @@ -115,7 +115,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例 打开对应接口,在设备信息(deviceList)中选取对应的interface。 interface1为设备配置中的一个接口。 */ - usb.claimInterface(pipe , interface1, true); + usb.claimInterface(pipe, interface1, true); ``` 4. 数据传输。 diff --git a/zh-cn/application-dev/dfx/hitracemeter-guidelines.md b/zh-cn/application-dev/dfx/hitracemeter-guidelines.md index aaefd0400b6070416d1371ad8e04606bea4d9d00..1c288b2bdc2d2835a3c0091dc53a122a0c1d5d47 100644 --- a/zh-cn/application-dev/dfx/hitracemeter-guidelines.md +++ b/zh-cn/application-dev/dfx/hitracemeter-guidelines.md @@ -2,7 +2,7 @@ ## 场景介绍 -HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自己的业务逻辑中的关键代码位置调用HiTraceMeter提供的API接口,能够有效追踪进程轨迹、查看系统性能。 +HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自己的业务逻辑中的关键代码位置调用HiTraceMeter提供的API接口,能够有效跟踪进程轨迹、查看系统性能。 ## 接口说明 @@ -12,15 +12,15 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自 | 接口名 | 返回值 | 描述 | | ---------------------------------------------------------------------------- | --------- | ------------ | -| hiTraceMeter.startTrace(name: string, taskId: number, expectedTime?: number) | void | 标记一个预追踪耗时任务的开始。如果有多个相同name的任务需要追踪或者对同一个任务要追踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。如果具有相同name的任务是串行执行的,则taskId可以相同。 | +| hiTraceMeter.startTrace(name: string, taskId: number, expectedTime?: number) | void | 标记一个预跟踪耗时任务的开始。如果有多个相同name的任务需要跟踪或者对同一个任务要跟踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。如果具有相同name的任务是串行执行的,则taskId可以相同。 | | hiTraceMeter.finishTrace(name: string, taskId: number) | void | name和taskId必须与流程开始的hiTraceMeter.startTrace对应参数值保持一致。 | -| hiTraceMeter.traceByValue(name: string, value: number) | void | 用来标记一个预追踪的数值变量,该变量的数值会不断变化。| +| hiTraceMeter.traceByValue(name: string, value: number) | void | 用来标记一个预跟踪的数值变量,该变量的数值会不断变化。| ## 开发步骤 在应用启动执行页面加载后,开始分布式跟踪,完成业务之后,停止分布式跟踪。 -1. 新建一个JS应用工程,在“Project”窗口点击“entry > src > main > js > default > pages > index”,打开工程中的“index.js”文件,在页面执行加载后,在自己的业务中调用hiTraceMeter的接口,进行性能打点追踪,示例代码如下: +1. 新建一个JS应用工程,在“Project”窗口点击“entry > src > main > js > default > pages > index”,打开工程中的“index.js”文件,在页面执行加载后,在自己的业务中调用hiTraceMeter的接口,进行性能打点跟踪,示例代码如下: ```js import hiTraceMeter from '@ohos.hiTraceMeter' @@ -36,11 +36,11 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自 hiTraceMeter.startTrace("business", 1); hiTraceMeter.startTrace("business", 1, 5); - // 追踪并行执行的同名任务 + // 跟踪并行执行的同名任务 hiTraceMeter.startTrace("business", 1); // 业务流程 console.log(`business running`); - hiTraceMeter.startTrace("business", 2); // 第二个追踪的任务开始,同时第一个追踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同 + hiTraceMeter.startTrace("business", 2); // 第二个跟踪的任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同 // 业务流程 console.log(`business running`); hiTraceMeter.finishTrace("business", 1); @@ -48,14 +48,14 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自 console.log(`business running`); hiTraceMeter.finishTrace("business", 2); - // 追踪串行执行的同名任务 + // 跟踪串行执行的同名任务 hiTraceMeter.startTrace("business", 1); // 业务流程 console.log(`business running`); - hiTraceMeter.finishTrace("business", 1); // 第一个追踪的任务结束 + hiTraceMeter.finishTrace("business", 1); // 第一个跟踪的任务结束 // 业务流程 console.log(`business running`); - hiTraceMeter.startTrace("business", 1); // 第二个追踪的同名任务开始,同名的待追踪任务串行执行 + hiTraceMeter.startTrace("business", 1); // 第二个跟踪的同名任务开始,同名的待跟踪任务串行执行 // 业务流程 console.log(`business running`); diff --git a/zh-cn/application-dev/dfx/hitracemeter-overview.md b/zh-cn/application-dev/dfx/hitracemeter-overview.md index 50673c97ec36c9a3e0356dbf0ccdb6f733f8dc67..1982213ba44d24e98b8b0c799ec9845ed3749f5a 100644 --- a/zh-cn/application-dev/dfx/hitracemeter-overview.md +++ b/zh-cn/application-dev/dfx/hitracemeter-overview.md @@ -1,6 +1,6 @@ # 性能打点跟踪概述 -hiTraceMeter是用于追踪进程轨迹,度量程序执行性能的一种工具,基于内核的ftrace机制,提供给用户态应用代码执行时长度量打点的能力。开发者通过使用hiTraceMeter API在程序中打点,并使用hiTraceMeter提供的命令行工具采集跟踪数据。 +hiTraceMeter是用于跟踪进程轨迹,度量程序执行性能的一种工具,基于内核的ftrace机制,提供给用户态应用代码执行时长度量打点的能力。开发者通过使用hiTraceMeter API在程序中打点,并使用hiTraceMeter提供的命令行工具采集跟踪数据。 ## 基本概念 diff --git a/zh-cn/application-dev/internationalization/i18n-guidelines.md b/zh-cn/application-dev/internationalization/i18n-guidelines.md index a8acb6712629a290279d144e68297ae0668bb2c9..52412dc5966912a2b0d04485cbe0404e9c49abc4 100644 --- a/zh-cn/application-dev/internationalization/i18n-guidelines.md +++ b/zh-cn/application-dev/internationalization/i18n-guidelines.md @@ -1,13 +1,13 @@ # I18n开发指导 -I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使用方法。 +本模块提供系统相关的或者增强的国际化能力,包括区域管理、电话号码处理、日历等,相关接口为ECMA 402标准中未定义的补充接口。更多接口和使用方式请见[I18N](../reference/apis/js-apis-i18n.md)。 +[Intl](intl-guidelines.md)模块提供了ECMA 402标准定义的基础国际化接口,与本模块共同使用可提供完整地国际化支持能力。 ## 获取系统语言区域信息 调用系统提供的接口访问系统的语言区域信息。 - ### 接口说明 | 模块 | 接口名称 | 描述 | @@ -20,15 +20,13 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 | ohos.i18n | getDisplayLanguage(language:string,locale:string,sentenceCase?:boolean):string | 获取语言的本地化表示。 | | ohos.i18n | getDisplayCountry(country:string,locale:string,sentenceCase?:boolean):string | 获取国家的本地化表示。 | - ### 开发步骤 1. 获取系统语言。 调用getSystemLanguage方法获取当前系统设置的语言(i18n为导入的模块)。 - - ``` + ```js var language = i18n.getSystemLanguage(); ``` @@ -36,7 +34,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getSystemRegion方法获取当前系统设置的区域 - ``` + ```js var region = i18n.getSystemRegion(); ``` @@ -44,7 +42,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getSystemLocale方法获取当前系统设置的Locale - ``` + ```js var locale = i18n.getSystemLocale(); ``` @@ -52,8 +50,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用isRTL方法获取Locale的语言是否为从右到左语言。 - - ``` + ```js var rtl = i18n.isRTL("zh-CN"); ``` @@ -61,7 +58,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用is24HourClock方法来判断当前系统的时间是否采用24小时制。 - ``` + ```js var hourClock = i18n.is24HourClock(); ``` @@ -69,7 +66,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getDisplayLanguage方法获取某一语言的本地化表示。其中,language表示待本地化显示的语言,locale表示本地化的Locale,sentenceCase结果是否需要首字母大写。 - ``` + ```js var language = "en"; var locale = "zh-CN"; var sentenceCase = false; @@ -80,18 +77,16 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getDisplayCountry方法获取某一国家的本地化表示。其中,country表示待本地化显示的国家,locale表示本地化的Locale,sentenceCase结果是否需要首字母大写。 - ``` + ```js var country = "US"; var locale = "zh-CN"; var sentenceCase = false; var localizedCountry = i18n.getDisplayCountry(country, locale, sentenceCase); ``` - ## 获取日历信息 -调用日历[Calendar](../reference/apis/js-apis-intl.md)相关接口来获取日历的相关信息,例如获取日历的本地化显示、一周起始日、一年中第一周的最小天数等。 - +调用日历[Calendar](../reference/apis/js-apis-i18n.md#calendar8)相关接口来获取日历的相关信息,例如获取日历的本地化显示、一周起始日、一年中第一周的最小天数等。 ### 接口说明 @@ -110,23 +105,21 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 | ohos.i18n | getDisplayName(locale:string):string8+ | 获取日历对象的本地化表示。 | | ohos.i18n | isWeekend(date?:Date):boolean8+ | 判断给定的日期是否在日历中是周末。 | - ### 开发步骤 1. 实例化日历对象。 调用getCalendar方法获取指定locale和type的时区对象(i18n为导入的模块)。其中,type表示合法的日历类型,目前合法的日历类型包括:"buddhist", "chinese", "coptic", "ethiopic", "hebrew", "gregory", "indian", "islamic_civil", "islamic_tbla", "islamic_umalqura", "japanese", "persian"。当type没有给出时,采用区域默认的日历类型。 - - ``` - var calendar = i18n.getCalendar("zh-CN", "gregory); + ```js + var calendar = i18n.getCalendar("zh-CN", "gregory"); ``` 2. 设置日历对象的时间。 调用setTime方法设置日历对象的时间。setTime方法接收两种类型的参数。一种是传入一个Date对象,另一种是传入一个数值表示从1970.1.1 00:00:00 GMT逝去的毫秒数。 - ``` + ```js var date1 = new Date(); calendar.setTime(date1); var date2 = 1000; @@ -137,16 +130,15 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用set方法设置日历对象的年、月、日、时、分、秒。 - ``` + ```js calendar.set(2021, 12, 21, 6, 0, 0) ``` 4. 设置、获取日历对象的时区。 调用setTimeZone方法和getTimeZone方法来设置、获取日历对象的时区。其中,setTimeZone方法需要传入一个字符串表示需要设置的时区。 - - ``` + ```js calendar.setTimeZone("Asia/Shanghai"); var timezone = calendar.getTimeZone(); ``` @@ -155,8 +147,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用setFirstDayOfWeek方法和getFirstDayOfWeek方法设置、获取日历对象的一周起始日。其中,setFirstDayOfWeek需要传入一个数值表示一周的起始日,1代表周日,7代表周六。 - - ``` + ```js calendar.setFirstDayOfWeek(1); var firstDayOfWeek = calendar.getFirstDayOfWeek(); ``` @@ -164,34 +155,30 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 6. 设置、获取日历对象第一周的最小天数 调用setMinimalDaysInFirstWeek方法和getMinimalDaysInFirstWeek方法来设置、获取日历对象第一周的最小天数。 - ``` + ```js calendar.setMinimalDaysInFirstWeek(3); var minimalDaysInFirstWeek = calendar.getMinimalDaysInFirstWeek(); ``` 7. 获取日历对象的本地化显示 调用getDisplayName来获取日历对象的本地化显示。 - - ``` + ```js var localizedName = calendar.getDisplayName("zh-CN"); ``` 8. 判断某一个日期是否为周末。 调用isWeekend方法来判断输入的Date是否为周末。 - - ``` + ```js var date = new Date(); var weekend = calendar.isWeekend(date); ``` - ## 电话号码格式化 -调用电话号码格式化[PhoneNumberFormat](../reference/apis/js-apis-intl.md)的接口,实现对针对不同国家电话号码的格式化以及判断电话号码格式是否正确的功能。 - +调用电话号码格式化[PhoneNumberFormat](../reference/apis/js-apis-i18n.md#phonenumberformat8)的接口,实现对针对不同国家电话号码的格式化以及判断电话号码格式是否正确的功能。 ### 接口说明 @@ -201,23 +188,21 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 | ohos.i18n | isValidNumber(number:string):boolean8+ | 判断number是否是一个格式正确的电话号码。 | | ohos.i18n | format(number:string):string8+ | 对number按照指定国家及风格进行格式化。 | - ### 开发步骤 1. 实例化电话号码格式化对象。 调用PhoneNumberFormat的构造函数来实例化电话号码格式化对象,需要传入电话号码的国家代码及格式化选项。其中,格式化选项是可选的,包括style选项,该选项的取值包括:"E164", "INTERNATIONAL", "NATIONAL", "RFC3966"。 - - ``` - var phoneNumberFormat = new i18n.PhoneNubmerFormat("CN", {type: "E164"}); + ```js + var phoneNumberFormat = new i18n.PhoneNumberFormat("CN", {type: "E164"}); ``` 2. 判断电话号码格式是否正确。 调用isValidNumber方法来判断输入的电话号码的格式是否正确。 - ``` + ```js var validNumber = phoneNumberFormat.isValidNumber("15812341234"); ``` @@ -225,31 +210,27 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用电话号码格式化对象的format方法来对输入的电话号码进行格式化。 - ``` + ```js var formattedNumber = phoneNumberFormat.format("15812341234"); ``` - ## 度量衡转换 度量衡转换接口可以实现度量衡转换的相关功能。 - ### 接口说明 | 模块 | 接口名称 | 描述 | | -------- | -------- | -------- | | ohos.i18n | unitConvert(fromUnit:UnitInfo,toUnit:UnitInfo,value:number,locale:string,style?:string):string8+ | 将fromUnit的单位转换为toUnit的单位,并根据区域与风格进行格式化。 | - ### 开发步骤 1. 度量衡单位转换。 - 调用[unitConvert](../reference/apis/js-apis-intl.md)方法实现度量衡单位转换,并进行格式化显示的功能。 + 调用[unitConvert](../reference/apis/js-apis-i18n.md#unitconvert8)方法实现度量衡单位转换,并进行格式化显示的功能。 - - ``` + ```js var fromUnit = {unit: "cup", measureSystem: "US"}; var toUnit = {unit: "liter", measureSystem: "SI"}; var number = 1000; @@ -258,11 +239,9 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 i18n.Util.unitConvert(fromUtil, toUtil, number, locale, style); ``` - ## 字母表索引 -调用字母表索引[IndexUtil](../reference/apis/js-apis-intl.md)的接口可以获取不同Locale的字母表索引,以及实现计算字符串所属索引的功能。 - +调用字母表索引[IndexUtil](../reference/apis/js-apis-i18n.md#indexutil8)的接口可以获取不同Locale的字母表索引,以及实现计算字符串所属索引的功能。 ### 接口说明 @@ -273,7 +252,6 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 | ohos.i18n | addLocale(locale:string): void8+ | 将新的Locale对应的索引加入当前索引列表。 | | ohos.i18n | getIndex(text:string):string8+ | 获取text对应的索引。 | - ### 开发步骤 1. 实例化字母表索引对象。 @@ -281,15 +259,15 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getInstance方法来实例化特定locale对应的字母表索引对象。当locale参数为空时,实例化系统默认Locale的字母表索引对象。 - ``` - var indexUtil = getInstance("zh-CN"); + ```js + var indexUtil = i18n.getInstance("zh-CN"); ``` 2. 获取索引列表。 调用getIndexList方法来获取当前Locale对应的字母表索引列表。 - ``` + ```js var indexList = indexUtil.getIndexList(); ``` @@ -297,7 +275,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用addLocale方法,将新的Locale对应的字母表索引添加到当前字母表索引列表中。 - ``` + ```js indexUtil.addLocale("ar") ``` @@ -305,16 +283,14 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用getIndex方法来获取某一字符串对应的字母表索引。 - ``` + ```js var text = "access index"; indexUtil.getIndex(text); ``` - ## 获取文本断点位置 -当文本比较长无法在一行进行显示时,调用文本断点[BreakIterator8](../reference/apis/js-apis-intl.md)的接口,来获取文本可以断行的位置。 - +当文本比较长无法在一行进行显示时,调用文本断点[BreakIterator8](../reference/apis/js-apis-i18n.md#breakiterator8)的接口,来获取文本可以断行的位置。 ### 接口说明 @@ -331,15 +307,13 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 | ohos.i18n | following(offset:number):number8+ | 将断行对象移动到offset指定位置的后面一个分割点的位置。 | | ohos.i18n | isBoundary(offset:number):boolean8+ | 判断某个位置是否是分割点。 | - ### 开发步骤 1. 实例化断行对象。 调用getLineInstance方法来实例化断行对象。 - - ``` + ```js var locale = "en-US" var breakIterator = i18n.getLineInstance(locale); ``` @@ -348,8 +322,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 调用setLineBreakText方法和getLineBreakText方法来设置、访问要断行处理的文本。 - - ``` + ```js var text = "Apple is my favorite fruit"; breakIterator.setLineBreakText(text); var breakText = breakIterator.getLineBreakText(); @@ -358,9 +331,8 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 3. 获取断行对象当前的位置。 调用current方法来获取断行对象在当前处理文本中的位置。 - - ``` + ```js var pos = breakIterator.current(); ``` @@ -368,8 +340,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 系统提供了很多接口可以用于调整断行对象在处理文本中的位置,包括first, last, next, previous, following。 - - ``` + ```js var firstPos = breakIterator.first(); // 将断行对象设置到第一个分割点的位置,即文本的起始位置; var lastPos = breakIterator.last(); // 将断行对象设置到最后一个分割点的位置,即文本末尾的下一个位置; // 将断行对象向前或向后移动一定数量的分割点。 @@ -384,8 +355,7 @@ I18n开发指导提供了未在ECMA 402中定义的国际化能力接口的使 5. 判断某个位置是否为分割点。 调用isBoundary方法来判断一个方法是否为分割点;如果该位置是分割点,则返回true,并且将断行对象移动到该位置;如果该位置不是分割点,则返回false,并且将断行对象移动到该位置后的一个分割点。 - - ``` + ```js var isboundary = breakIterator.isBoundary(5); - ``` + ``` \ No newline at end of file diff --git a/zh-cn/application-dev/internationalization/intl-guidelines.md b/zh-cn/application-dev/internationalization/intl-guidelines.md index 52309a061652382bd03ff417d23cceeaf439bf30..f4e6705ec756d2a03027450909dafe47e7d6780c 100644 --- a/zh-cn/application-dev/internationalization/intl-guidelines.md +++ b/zh-cn/application-dev/internationalization/intl-guidelines.md @@ -1,11 +1,12 @@ # Intl开发指导 -Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方法。 +本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。更多接口和使用方式请见[Intl](../reference/apis/js-apis-intl.md)。 -## 设置区域信息 +[I18N](i18n-guidelines.md)模块提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。 -调用[Locale](../reference/apis/js-apis-intl.md)的相关接口实现最大化区域信息或最小化区域信息。 +## 设置区域信息 +调用[Locale](../reference/apis/js-apis-intl.md#locale)的相关接口实现最大化区域信息或最小化区域信息。 ### 接口说明 @@ -17,17 +18,30 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 | ohos.intl | maximize():Locale | 最大化区域信息。 | | ohos.intl | minimize():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的字符串参数可以分为以下四部分:语言、脚本、地区、扩展参数。各个部分按照顺序使用中划线“-”进行连接。 + - 语言:必选,使用2个或3个小写英文字母表示(可参考ISO-639标准),例如英文使用“en”表示,中文使用“zh”表示。 + - 脚本:可选,使用4个英文字母表示,其中首字母需要大写,后面3个使用小写字母(可参考ISO-15924)。例如,中文繁体使用脚本“Hant”表示,中文简体使用脚本“Hans”表示。 + - 国家或地区:可选,使用两个大写字母表示(可参考ISO-3166),例如中国使用“CN”表示,美国使用“US”表示; + - 扩展参数:可选,由key和value两部分组成,目前支持以下扩展参数(可参考BCP 47扩展)。各个扩展参数之间没有严格的顺序,使用“-key-value”的格式书写。扩展参数整体使用“-u”连接到语言、脚本、地区后面。例如“zh-u-nu-latn-ca-chinese”表示使用“latn”数字系统,“chinese”日历系统。扩展参数也可以通过第二个参数传入。 + | 扩展参数ID | 扩展参数说明 | + | -------- | -------- | + | ca | 表示日历系统 | + | co | 表示排序规则 | + | hc | 表示守时惯例 | + | nu | 表示数字系统 | + | kn | 表示字符串排序、比较时是否考虑数字的实际值 | + | kf | 表示字符串排序、比较时是否考虑大小写 | - ``` + ```js 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); ``` @@ -35,7 +49,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 调用toString方法来获取Locale对象的字符串表示,其中包括了语言、区域及其他选项信息。 - ``` + ```js var localeStr = localeObj.toString(); ``` @@ -43,7 +57,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 调用maximize方法来最大化区域信息,即当缺少脚本与地区信息时,对其进行补全。 - ``` + ```js var maximizedLocale = localeObj.maximize(); ``` @@ -51,15 +65,13 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 调用minimize方法来最小化区域信息,即当存在脚本与地区信息时,对其进行删除。 - ``` + ```js var minimizedLocale = localeObj.minimize(); ``` - ## 格式化日期时间 -调用日期时间格式化[DateTimeFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的日期格式化以及时间段格式化功能。 - +调用日期时间格式化[DateTimeFormat](../reference/apis/js-apis-intl.md#datetimeformat)的接口,实现针对特定Locale的日期格式化以及时间段格式化功能。 ### 接口说明 @@ -71,21 +83,19 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 | ohos.intl | formatRange(startDate:Date,endDate:Date):string | 依据DateTimeFormat对象的Locale及其他格式化属性,计算时间段的格式化表示。 | | ohos.intl | resolvedOptions():DateTimeOptions | 获取DateTimeFormat对象的相关属性。 | - ### 开发步骤 1. 实例化日期时间格式化对象。 一种方法是使用DateTimeFormat提供的默认构造函数,通过访问系统语言和地区设置,获取系统默认Locale,并将其作为DateTimeFormat对象内部的Locale(intl为导入的模块名)。 - - ``` + ```js var dateTimeFormat = new intl.DateTimeFormat(); ``` - 另一种方法是使用开发者提供的Locale和格式化参数来创建日期时间格式化对象。其中,格式化参数是可选的,完整的格式化参数列表见[DateTimeOptions](../reference/apis/js-apis-intl.md)。 + 另一种方法是使用开发者提供的Locale和格式化参数来创建日期时间格式化对象。其中,格式化参数是可选的,完整的格式化参数列表见[DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions)。 - ``` + ```js var options = {dateStyle: "full", timeStyle: "full"}; var dateTimeFormat = new intl.DateTimeFormat("zh-CN", options); ``` @@ -94,34 +104,33 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 使用DateTimeFormat的format方法对一个Date对象进行格式化,该方法会返回一个字符串作为格式化的结果。 - ``` - Date date = new Date(); + ```js + var date = new Date(); var formatResult = dateTimeFormat.format(date); ``` 3. 格式化时间段。 - 使用DateTimeFormat的formatRange方法对一个时间段进行格式化。该方法需要传入两个Date对象,分别表示时间段的起止时间,返回一个字符串作为格式化的结果。 + 使用DateTimeFormat的formatRange方法对一个时间段进行格式化。该方法需要传入两个Date对象,分别表示时间段的起止日期,返回一个字符串作为格式化的结果。当传入的两个Date对象表示同一天时,返回对象为该日期的表示;当传入的两个Date对象不是同一天时,返回结果为这两个日期的区间表示。 - ``` - Date startDate = new Date(); - Date endDate = new Date(); - var formatResult = dateTimeFormat.formatRange(startDate, endDate); + ```js + var startDate = new Date(2021, 11, 17, 3, 24, 0); + var endDate = new Date(2021, 11, 18, 3, 24, 0); + var datefmt = new Intl.DateTimeFormat("en-GB"); + datefmt.formatRange(startDate, endDate); ``` 4. 访问日期时间格式化对象的相关属性。 DateTimeFormat的resolvedOptions方法会返回一个对象,该对象包含了DateTimeFormat对象的所有相关属性及其值。 - ``` + ```js var options = dateTimeFormat.resolvedOptions(); ``` - ## 数字格式化 -调用数字格式化[NumberFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的数字格式化功能。 - +调用数字格式化[NumberFormat](../reference/apis/js-apis-intl.md#numberformat)的接口,实现针对特定Locale的数字格式化功能。 ### 接口说明 @@ -132,21 +141,19 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 | ohos.intl | format(number:number):string | 依据NumberFormat对象的Locale及其他格式化属性,计算数字的格式化表示。 | | ohos.intl | resolvedOptions():NumberOptions | 获取NumberFormat对象的相关属性。 | - ### 开发步骤 1. 实例化数字格式化对象。 一种方法是使用NumberFormat提供的默认构造函数,通过访问系统的语言和地区以获取系统默认Locale并进行设置(intl为导入的模块名)。 - - ``` + ```js var numberFormat = new intl.NumberFormat(); ``` - 另一种方法是使用开发者提供的Locale和格式化参数来创建数字格式化对象。其中,格式化参数是可选的,完整的格式化参数列表参见[NumberOptions](../reference/apis/js-apis-intl.md)。 + 另一种方法是使用开发者提供的Locale和格式化参数来创建数字格式化对象。其中,格式化参数是可选的,完整的格式化参数列表参见[NumberOptions](../reference/apis/js-apis-intl.md#numberoptions)。 - ``` + ```js var options = {compactDisplay: "short", notation: "compact"}; var numberFormat = new intl.NumberFormat("zh-CN", options); ``` @@ -155,7 +162,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 使用NumberFormat的format方法对传入的数字进行格式化。该方法返回一个字符串作为格式化的结果。 - ``` + ```js var number = 1234.5678 var formatResult = numberFormat.format(number); ``` @@ -164,15 +171,13 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 NumberFormat的resolvedOptions方法会返回一个对象,该对象包含了NumberFormat对象的所有相关属性及其值。 - ``` + ```js var options = numberFormat.resolvedOptions(); ``` - ## 字符串排序 -不同区域的用户对于字符串排序具有不同的需求。调用字符串排序[Collator](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的字符串排序功能。 - +不同区域的用户对于字符串排序具有不同的需求。调用字符串排序[Collator](../reference/apis/js-apis-intl.md#collator8)的接口,实现针对特定Locale的字符串排序功能。 ### 接口说明 @@ -183,29 +188,27 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 | ohos.intl | compare(first:string,second:string):number8+ | 依据排序对象的Locale及其属性,计算两个字符串的比较结果。 | | ohos.intl | resolvedOptions():CollatorOptions8+ | 获取排序对象的相关属性。 | - ### 开发步骤 1. 实例化排序对象。 一种方法是使用Collator提供的默认构造函数,通过访问系统的语言和地区以获取系统默认Locale并进行设置(intl为导入的模块名)。 - - ``` + ```js var collator = new intl.Collator(); ``` - 另一种方法是使用开发者提供的Locale和其他相关参数来创建Collator对象,完整的参数列表参见[CollatorOptions](../reference/apis/js-apis-intl.md)。 + 另一种方法是使用开发者提供的Locale和其他相关参数来创建Collator对象,完整的参数列表参见[CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions8)。 - ``` - var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"}; + ```js + var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"}); ``` 2. 比较字符串。 - 使用Collator的compare方法对传入的两个字符串进行比较。该方法返回一个数值作为比较的结果,返回-1表示第一个字符串小于第二个字符串,返回1表示第一个字符大于第二个字符串,返回0表示两个字符串相同。 + 使用Collator的compare方法对传入的两个字符串进行比较。该方法返回一个数值作为比较的结果,返回-1表示第一个字符串小于第二个字符串,返回1表示第一个字符大于第二个字符串,返回0表示两个字符串相同。基于两个字符串的比较结果,开发者可以字符串集合进行排序。 - ``` + ```js var str1 = "first string"; var str2 = "second string"; var compareResult = collator.compare(str1, str2); @@ -215,15 +218,13 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 Collator的resolvedOptions方法会返回一个对象,该对象包含了Collator对象的所有相关属性及其值。 - ``` + ```js var options = collator.resolvedOptions(); ``` - ## 判定单复数类别 -在一些语言的语法中,当数字后面存在名词时,名词需要根据数字的值采用不同的形式。调用单复数[PluralRules](../reference/apis/js-apis-intl.md)的接口,可以实现针对特定Locale计算数字单复数类别的功能,从而选择合适的名词单复数表示。 - +在一些语言的语法中,当数字后面存在名词时,名词需要根据数字的值采用不同的形式。调用单复数[PluralRules](../reference/apis/js-apis-intl.md#pluralrules8)的接口,可以实现针对特定Locale计算数字单复数类别的功能,从而选择合适的名词单复数表示。 ### 接口说明 @@ -240,31 +241,28 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 一种方法是使用PluralRules提供的默认构造函数,通过访问系统的语言和地区以获取系统默认Locale并进行设置(intl为导入的模块名)。 - - ``` + ```js var pluralRules = new intl.PluralRules(); ``` - 另一种方法是使用开发者提供的Locale和其他相关参数来创建单复数对象。完整的参数列表参见[PluralRulesOptions](../reference/apis/js-apis-intl.md)。 + 另一种方法是使用开发者提供的Locale和其他相关参数来创建单复数对象。完整的参数列表参见[PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions8)。 - ``` - var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"}; + ```js + var pluralRules = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"}); ``` 2. 计算数字单复数类别。 使用PluralRules的select方法计算传入数字的单复数类别。该方法返回一个字符串作为传入数字的类别,包括:"zero", "one", "two", "few", "many", "other"六个类别。 - ``` + ```js var number = 1234.5678 var categoryResult = plurals.select(number); ``` - ## 相对时间格式化 -调用相对时间格式化[RelativeTimeFormat](../reference/apis/js-apis-intl.md)的接口,实现针对特定Locale的相对时间格式化功能。 - +调用相对时间格式化[RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8)的接口,实现针对特定Locale的相对时间格式化功能。 ### 接口说明 @@ -276,29 +274,27 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 | ohos.intl | formatToParts(value:number,unit:string):Array<object>8+ | 依据相对时间格式化对象的Locale及其他格式化属性,返回相对时间格式化表示的各个部分。 | | ohos.intl | resolvedOptions():RelativeTimeFormatResolvedOptions8+ | 获取相对时间格式化对象的相关属性。 | - ### 开发步骤 1. 实例化相对时间格式化对象。 一种方法是使用RelativeTimeFormat提供的默认构造函数,通过访问系统的语言和地区以获取系统默认Locale并进行设置(intl为导入的模块名)。 - - ``` + ```js 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"}); ``` 2. 相对时间格式化。 使用RelativeTimeFormat的format方法对相对时间进行格式化。方法接收一个表示相对时间长度的数值和表示单位的字符串,其中单位包括:"year", "quarter", "month", "week", "day", "hour", "minute", "second"。方法返回一个字符串作为格式化的结果。 - ``` + ```js var number = 2; var unit = "year" var formatResult = relativeTimeFormat.format(number, unit); @@ -308,7 +304,7 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 获取相对时间格式化结果的各个部分,从而自定义格式化结果。 - ``` + ```js var number = 2; var unit = "year" var formatResult = relativeTimeFormat.formatToParts(number, unit); @@ -316,9 +312,9 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 4. 访问相对时间格式化对象的相关属性。 - RelativeTimeFormat的resolvedOptions方法会返回一个对象,该对象包含了RelativeTimeFormat对象的所有相关属性及其值,完整的属性列表参见[ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md)。 + RelativeTimeFormat的resolvedOptions方法会返回一个对象,该对象包含了RelativeTimeFormat对象的所有相关属性及其值,完整的属性列表参见[ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md#relativetimeformatresolvedoptions8)。 - ``` + ```js var options = numberFormat.resolvedOptions(); ``` @@ -326,6 +322,6 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 针对Intl开发,有以下相关实例可供参考: --[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International) +-[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International) --[`International`:国际化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/International) \ No newline at end of file +-[`International`:国际化(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International) \ No newline at end of file diff --git a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md index a29a36a5fc857ecb83dbb0da378176eee5859730..12380b3370f08c172450ab403a5575920d471ba5 100644 --- a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md +++ b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md @@ -282,7 +282,7 @@ let alarm : reminderAgent.ReminderRequestAlarm = { 基于后台代理提醒开发,有以下相关实例可供参考: -- [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/AlarmClock) +- [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/Notification/AlarmClock) -- [`FlipClock`:翻页时钟(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/CompleteApps/FlipClock) +- [`FlipClock`:翻页时钟(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/CompleteApps/FlipClock) diff --git a/zh-cn/application-dev/quick-start/stage-structure.md b/zh-cn/application-dev/quick-start/stage-structure.md index e9b246568c0d6885e1a12ab43cfeded9983bfbb7..417b2e99214a58f7b5ce78b55ee455600d1380aa 100644 --- a/zh-cn/application-dev/quick-start/stage-structure.md +++ b/zh-cn/application-dev/quick-start/stage-structure.md @@ -2,7 +2,7 @@ # 应用包结构配置文件的说明 -在开发FA模型下的应用程序时,需要在config.json文件中对应用的包结构进行申明;同样的,在开发stage模型下的应用程序时,需要在module.json和app.json配置文件中对应用的包结构进行声明。 +在开发FA模型下的应用程序时,需要在config.json文件中对应用的包结构进行申明;同样的,在开发stage模型下的应用程序时,需要在module.json5和app.json配置文件中对应用的包结构进行声明。 ## 配置文件内部结构 @@ -66,7 +66,7 @@ app.json示例: ### module对象内部结构 -module.json示例: +module.json5示例: ```json { @@ -543,7 +543,7 @@ form示例 : } ``` -在module.json的extension组件下面定义metadata信息 +在module.json5的extension组件下面定义metadata信息 ```json { @@ -665,7 +665,7 @@ metadata中指定commonEvent信息,其中 : } ``` -在module.json的extension组件下面定义metadata信息,如下 : +在module.json5的extension组件下面定义metadata信息,如下 : ```json "extensionAbilities": [ @@ -757,7 +757,7 @@ distroFilter示例 : ] ``` -在module.json的extensionAbilities组件下面定义metadata信息,如下 : +在module.json5的extensionAbilities组件下面定义metadata信息,如下 : ```json "extensionAbilities": [ diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md index da6f4cca3a3c0b104794a9da072feb1074152ba7..27adc1252d59277920d4023fe0581e6911702a2d 100644 --- a/zh-cn/application-dev/reference/apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/apis/Readme-CN.md @@ -157,7 +157,7 @@ - [@ohos.hiAppEvent (应用打点)](js-apis-hiappevent.md) - [@ohos.hichecker (检测模式)](js-apis-hichecker.md) - [@ohos.hidebug (Debug调试)](js-apis-hidebug.md) - - [@ohos.hilog (日志打印)](js-apis-hilog.md) + - [@ohos.hilog (HiLog日志打印)](js-apis-hilog.md) - [@ohos.hiTraceChain (分布式跟踪)](js-apis-hitracechain.md) - [@ohos.hiTraceMeter (性能打点)](js-apis-hitracemeter.md) - [@ohos.inputMethod (输入法框架)](js-apis-inputmethod.md) @@ -166,6 +166,7 @@ - [@ohos.screenLock (锁屏管理)](js-apis-screen-lock.md) - [@ohos.systemTime (设置系统时间)](js-apis-system-time.md) - [@ohos.wallpaper (壁纸)](js-apis-wallpaper.md) + - [console (日志打印)](js-apis-logs.md) - [Timer (定时器)](js-apis-timer.md) - 设备管理 @@ -239,5 +240,4 @@ - [@system.router (页面路由)](js-apis-system-router.md) - [@system.sensor (传感器)](js-apis-system-sensor.md) - [@system.storage (数据存储)](js-apis-system-storage.md) - - [@system.vibrator (振动)](js-apis-system-vibrate.md) - - [console (日志打印)](js-apis-logs.md) \ No newline at end of file + - [@system.vibrator (振动)](js-apis-system-vibrate.md) \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-Context.md b/zh-cn/application-dev/reference/apis/js-apis-Context.md index 929e3176ffe672a2c0382ee87854775fb54fdda6..8404d21f0912af47ecb183483a22fcff93d43f5d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-Context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md @@ -193,6 +193,44 @@ context.requestPermissionsFromUser( ``` +## Context.requestPermissionsFromUser7+ + +requestPermissionsFromUser(permissions: Array\, requestCode: number): Promise\<[PermissionRequestResult](#permissionrequestresult7)> + +从系统请求某些权限(promise形式)。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + +| 名称 | 类型 | 必填 | 描述 | +| -------------- | ------------------- | ----- | -------------------------------------------- | +| permissions | Array\ | 是 | 指示要请求的权限列表。此参数不能为null。 | +| requestCode | number | 是 | 指示要传递给PermissionRequestResult的请求代码。 | + +**返回值:** + +| 类型 | 说明 | +| ------------------------------------------------------------- | ---------------- | +| Promise\<[PermissionRequestResult](#permissionrequestresult7)> | 返回授权结果信息。 | + +**示例:** + +```js +import featureAbility from '@ohos.ability.featureAbility' +var context = featureAbility.getContext(); +context.requestPermissionsFromUser( + ["com.example.permission1", + "com.example.permission2", + "com.example.permission3", + "com.example.permission4", + "com.example.permission5"], + 1).then((data)=>{ + console.info("====>requestdata====>" + JSON.stringify(data)); + }); +``` + + ## Context.getApplicationInfo diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md index 2a9549bfd40320b4c053ca72f4b8ffa21c18c595..2bf803c7b7dadb36d5c4b82b5ab94e195e201a42 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md @@ -126,7 +126,7 @@ var options = { windowMode: 0, }; this.context.startAbility(want, options) -.then((data) => { +.then(() => { console.log('Operation successful.') }).catch((error) => { console.log('Operation failed.'); @@ -273,7 +273,7 @@ var options = { }; var accountId = 11; this.context.startAbility(want, accountId, options) -.then((data) => { +.then(() => { console.log('Operation successful.') }).catch((error) => { console.log('Operation failed.'); @@ -352,7 +352,7 @@ startAbilityForResult(want: Want, options: StartOptions): Promise<AbilityResu | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | want | [Want](js-apis-featureAbility.md#Want) | 是 | 启动Ability的want信息。 | -| options | StartOptions | 是 | 启动Ability所携带的参数。 | +| options | StartOptions | 否 | 启动Ability所携带的参数。 | **返回值**: @@ -511,8 +511,8 @@ terminateSelf(): Promise<void> **示例**: ```js -this.context.terminateSelf(want).then((data) => { - console.log('success:' + JSON.stringify(data)); +this.context.terminateSelf(want).then(() => { + console.log('success:'); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); @@ -571,7 +571,7 @@ this.context.terminateSelfWithResult( { want: {bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo"}, resultCode: 100 -}).then((result) => { +}).then(() => { console.log("terminateSelfWithResult") }) ``` @@ -768,8 +768,8 @@ setMissionLabel(label: string): Promise\ **示例**: ```js -this.context.setMissionLabel("test").then((data) => { - console.log('success:' + JSON.stringify(data)); +this.context.setMissionLabel("test").then(() => { + console.log('success:'); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); @@ -850,4 +850,4 @@ var contentStorage = { "link": 'link', }; this.context.restoreWindowStage(contentStorage); -``` \ No newline at end of file +``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md index b2530e53a0e01d534e641356bacc2c3a410d73b8..fe547447c22eba2860cf219a375d00d310edf27d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md @@ -22,8 +22,8 @@ import Ability from '@ohos.application.Ability'; | 名称 | 参数类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | context | [AbilityContext](js-apis-ability-context.md) | 是 | 否 | 上下文。 | -| launchWant | [Want](js-apis-featureAbility.md#Want类型说明) | 是 | 否 | Ability启动时的参数。 | -| lastRequestWant | [Want](js-apis-featureAbility.md#Want类型说明) | 是 | 否 | Ability最后请求时的参数。| +| launchWant | [Want](js-apis-application-want.md) | 是 | 否 | Ability启动时的参数。 | +| lastRequestWant | [Want](js-apis-application-want.md) | 是 | 否 | Ability最后请求时的参数。| ## Ability.onCreate @@ -38,7 +38,7 @@ Ability创建时回调,执行初始化业务逻辑操作。 | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-featureAbility.md#Want类型说明) | 是 | 当前Ability的Want类型信息,包括ability名称、bundle名称等。 | + | want | [Want](js-apis-application-want.md) | 是 | 当前Ability的Want类型信息,包括ability名称、bundle名称等。 | | param | AbilityConstant.LaunchParam | 是 | 创建 ability、上次异常退出的原因信息。 | **示例:** @@ -223,7 +223,7 @@ onNewWant(want: Want): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-featureAbility.md#Want类型说明) | 是 | Want类型参数,如ability名称,包名等。 | + | want | [Want](js-apis-application-want.md) | 是 | Want类型参数,如ability名称,包名等。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md index 70507b6e8e69a164198e66262ca3710a1a8a4870..807b6944c557388fee89c55752af5b08b1a368d3 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md @@ -1269,9 +1269,8 @@ getConnectionDevices(): Array<string> **返回值:** -| | | +| 类型 | 说明 | | ------------------- | ------------- | -| 类型 | 说明 | | Array<string> | 返回已连接设备的地址列表。 | @@ -1290,11 +1289,11 @@ getDeviceState(device: string): ProfileConnectionState | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------- | | device | string | 是 | 远端设备地址。 | + **返回值:** -| | | +| 类型 | 说明 | | ------------------------------------------------- | ----------------------- | -| 类型 | 说明 | | [ProfileConnectionState](#profileconnectionstate) | 返回profile的连接状态。 | @@ -1318,13 +1317,11 @@ connect(device: string): boolean | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------- | | device | string | 是 | 远端设备地址。 | -| **返回值:** -| | | -| ------- | ------------------- | | 类型 | 说明 | +| ------- | ------------------- | | boolean | 成功返回true,失败返回false。 | **示例:** @@ -1350,13 +1347,12 @@ disconnect(device: string): boolean | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------- | | device | string | 是 | 远端设备地址。 | -| + **返回值:** -| | | -| ------- | ------------------- | | 类型 | 说明 | +| ------- | ------------------- | | boolean | 成功返回true,失败返回false。 | **示例:** @@ -1443,9 +1439,8 @@ getPlayingState(device: string): PlayingState **返回值:** -| | | -| ----------------------------- | ---------- | | 类型 | 说明 | +| ----------------------------- | ---------- | | [PlayingState](#PlayingState) | 远端设备的播放状态。 | **示例:** @@ -1476,13 +1471,12 @@ connect(device: string): boolean | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------- | | device | string | 是 | 远端设备地址。 | -| + **返回值:** -| | | -| ------- | ------------------- | | 类型 | 说明 | +| ------- | ------------------- | | boolean | 成功返回true,失败返回false。 | **示例:** @@ -1508,7 +1502,7 @@ disconnect(device: string): boolean | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------- | | device | string | 是 | 远端设备地址。 | -| + **返回值:** @@ -1753,9 +1747,8 @@ removeService(serviceUuid: string): boolean **返回值:** -| | | -| ------- | -------------------------- | | 类型 | 说明 | +| ------- | -------------------------- | | boolean | 删除服务操作,成功返回true,否则返回false。 | **示例:** @@ -1803,9 +1796,8 @@ server端特征值发生变化时,主动通知已连接的client设备。 **返回值:** -| | | -| ------- | ------------------------ | | 类型 | 说明 | +| ------- | ------------------------ | | boolean | 通知操作,成功返回true,否则返回false。 | **示例:** @@ -1849,9 +1841,8 @@ server端回复client端的读写请求。 **返回值:** -| | | -| ------- | -------------------------- | | 类型 | 说明 | +| ------- | -------------------------- | | boolean | 回复响应操作,成功返回true,否则返回false。 | **示例:** @@ -2479,9 +2470,8 @@ client端读取蓝牙低功耗设备特定服务的特征值。 **返回值:** -| | | -| ---------------------------------------- | -------------------------- | | 类型 | 说明 | +| ---------------------------------------- | -------------------------- | | Promise<[BLECharacteristic](#blecharacteristic)> | client读取特征值,通过promise形式获取。 | **示例:** @@ -2570,9 +2560,8 @@ client端读取蓝牙低功耗设备特定的特征包含的描述符。 **返回值:** -| | | -| ---------------------------------------- | -------------------------- | | 类型 | 说明 | +| ---------------------------------------- | -------------------------- | | Promise<[BLEDescriptor](#bledescriptor)> | client读取描述符,通过promise形式获取。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-brightness.md index 17676f2c3a129536fcce34ca4e5cb418676d736a..e313d9fafc58bfd6e787c37aea890833f4965c7a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-brightness.md @@ -1,10 +1,10 @@ # 屏幕亮度 +该模块提供屏幕亮度的设置接口。 + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -该模块提供屏幕亮度的设置接口。 - ## 导入模块 diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-storage.md b/zh-cn/application-dev/reference/apis/js-apis-data-storage.md index fe7757c9f90c8e2105b41db8fbc5f90c8d64e5da..e41af6f916e6336a2d9951edfbd469cc36dcbbe2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-storage.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-storage.md @@ -52,13 +52,13 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -let storage = data_storage.getStorageSync(path + '/mystore'); -storage.putSync('startup', 'auto'); -storage.flushSync(); + let storage = data_storage.getStorageSync(path + '/mystore'); + storage.putSync('startup', 'auto'); + storage.flushSync(); +}); ``` @@ -85,18 +85,18 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -data_storage.getStorage(path + '/mystore', function (err, storage) { + data_storage.getStorage(path + '/mystore', function (err, storage) { if (err) { - console.info("Failed to get the storage. path: " + path + '/mystore'); - return; + console.info("Failed to get the storage. path: " + path + '/mystore'); + return; } storage.putSync('startup', 'auto'); storage.flushSync(); -}) + }) +}); ``` @@ -128,17 +128,17 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -let getPromise = data_storage.getStorage(path + '/mystore'); -getPromise.then((storage) => { + let getPromise = data_storage.getStorage(path + '/mystore'); + getPromise.then((storage) => { storage.putSync('startup', 'auto'); storage.flushSync(); -}).catch((err) => { + }).catch((err) => { console.info("Failed to get the storage. path: " + path + '/mystore'); -}) + }) +}); ``` @@ -166,12 +166,11 @@ var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { path = filePath; console.info("======================>getFilesDirPromsie====================>"); -}); -data_storage.deleteStorageSync(path + '/mystore'); + data_storage.deleteStorageSync(path + '/mystore'); +}); ``` - ## data_storage.deleteStorage deleteStorage(path: string, callback: AsyncCallback<void>): void @@ -195,17 +194,17 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -data_storage.deleteStorage(path + '/mystore', function (err) { + data_storage.deleteStorage(path + '/mystore', function (err) { if (err) { - console.info("Failed to delete the storage with err: " + err); - return; + console.info("Failed to delete the storage with err: " + err); + return; } console.info("Succeeded in deleting the storage."); -}) + }) +}); ``` @@ -237,16 +236,16 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -let promisedelSt = data_storage.deleteStorage(path + '/mystore'); -promisedelSt.then(() => { + let promisedelSt = data_storage.deleteStorage(path + '/mystore'); + promisedelSt.then(() => { console.info("Succeeded in deleting the storage."); -}).catch((err) => { + }).catch((err) => { console.info("Failed to delete the storage with err: " + err); -}) + }) +}); ``` @@ -273,9 +272,9 @@ var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { path = filePath; console.info("======================>getFilesDirPromsie====================>"); + + data_storage.removeStorageFromCacheSync(path + '/mystore'); }); - -data_storage.removeStorageFromCacheSync(path + '/mystore'); ``` @@ -302,17 +301,17 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -data_storage.removeStorageFromCache(path + '/mystore', function (err) { + data_storage.removeStorageFromCache(path + '/mystore', function (err) { if (err) { - console.info("Failed to remove storage from cache with err: " + err); - return; + console.info("Failed to remove storage from cache with err: " + err); + return; } console.info("Succeeded in removing storage from cache."); -}) + }) +}); ``` @@ -344,24 +343,22 @@ import featureAbility from '@ohos.ability.featureAbility'; var path; var context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { - path = filePath; - console.info("======================>getFilesDirPromsie====================>"); -}); + path = filePath; + console.info("======================>getFilesDirPromsie====================>"); -let promiserevSt = data_storage.removeStorageFromCache(path + '/mystore') -promiserevSt.then(() => { + let promiserevSt = data_storage.removeStorageFromCache(path + '/mystore') + promiserevSt.then(() => { console.info("Succeeded in removing storage from cache."); -}).catch((err) => { + }).catch((err) => { console.info("Failed to remove storage from cache with err: " + err); -}) + }) +}); ``` - ## Storage 提供获取和修改存储数据的接口。 - ### getSync getSync(key: string, defValue: ValueType): ValueType diff --git a/zh-cn/application-dev/reference/apis/js-apis-display.md b/zh-cn/application-dev/reference/apis/js-apis-display.md index eae58c773b060e035bc0309de7361219230455d7..679d712b03946b6ec92f5fa3297a254ceffbddf1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-display.md +++ b/zh-cn/application-dev/reference/apis/js-apis-display.md @@ -152,9 +152,9 @@ getAllDisplay(): Promise<Array<Display>> ```js let promise = display.getAllDisplay(); promise.then((data) => { - console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err)); -}).catch((err) => { console.info('Succeeded in obtaining all the display objects. Data: ' + JSON.stringify(data)); +}).catch((err) => { + console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err)); }); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md b/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md index 21120abf3742bcec6278b7619198e007ae47f323..423a723e3f018b6df3207b3a676f36a0aba6ccc0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md @@ -139,10 +139,10 @@ startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; import wantConstant from '@ohos.ability.wantConstant' featureAbility.startAbilityForResult( - { + { want: { action: "action.system.home", @@ -155,6 +155,9 @@ featureAbility.startAbilityForResult( uri:"" }, }, + (err, data) => { + console.info("err: " + JSON.stringify(err) + "data: " + JSON.stringify(data)) + } ) ``` @@ -181,7 +184,7 @@ startAbilityForResult(parameter: StartAbilityParameter): Promise\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; import wantConstant from '@ohos.ability.wantConstant' featureAbility.startAbilityForResult( { @@ -285,7 +288,7 @@ terminateSelfWithResult(parameter: AbilityResult): Promise\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; import wantConstant from '@ohos.ability.wantConstant' featureAbility.terminateSelfWithResult( { @@ -336,7 +339,7 @@ hasWindowFocus(callback: AsyncCallback\): void **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.hasWindowFocus() ``` @@ -359,7 +362,7 @@ hasWindowFocus(): Promise\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.hasWindowFocus().then((data) => { console.info("==========================>hasWindowFocus=======================>"); }); @@ -384,7 +387,7 @@ getWant(callback: AsyncCallback\): void **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.getWant() ``` @@ -407,7 +410,7 @@ getWant(): Promise\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.getWant().then((data) => { console.info("==========================>getWantCallBack=======================>"); }); @@ -430,7 +433,7 @@ getContext(): Context **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; var context = featureAbility.getContext() context.getBundleName() ``` @@ -454,7 +457,7 @@ terminateSelf(callback: AsyncCallback\): void **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.terminateSelf() ``` @@ -477,7 +480,7 @@ terminateSelf(): Promise\ **示例:** ```javascript -import featureAbility from '@ohos.ability.featureability'; +import featureAbility from '@ohos.ability.featureAbility'; featureAbility.terminateSelf().then((data) => { console.info("==========================>terminateSelfCallBack=======================>"); }); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-hilog.md b/zh-cn/application-dev/reference/apis/js-apis-hilog.md index d479d6c59dce6eb1ea8d3c879fce110d9ed2e99d..5c5be9e3608cb98d7bd5b068cff556f194e0e345 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hilog.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hilog.md @@ -1,4 +1,4 @@ -# 日志打印 +# HiLog日志打印 hilog日志系统,使应用/服务可以按照指定级别、标识和格式字符串输出日志内容,帮助开发者了解应用/服务的运行状态,更好地调试程序。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md index 4664e089d2d341df4d5303f7228f5dc862dd565b..1bc3cc40c1af48bafe81d5410d42480774187f9a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md @@ -1,6 +1,6 @@ # 性能打点 -本模块提供了追踪进程轨迹,度量程序执行性能的打点能力。本模块打点的数据供hiTraceMeter工具分析使用。 +本模块提供了跟踪进程轨迹,度量程序执行性能的打点能力。本模块打点的数据供hiTraceMeter工具分析使用。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -17,9 +17,9 @@ import hiTraceMeter from '@ohos.hiTraceMeter'; startTrace(name: string, taskId: number): void -标记一个预追踪耗时任务的开始。 +标记一个预跟踪耗时任务的开始。 -如果有多个相同name的任务需要追踪或者对同一个任务要追踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。 +如果有多个相同name的任务需要跟踪或者对同一个任务要跟踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。 如果具有相同name的任务是串行执行的,则taskId可以相同。具体示例可参考[hiTraceMeter.finishTrace](#hitracemeterfinishtrace)中的示例。 @@ -29,7 +29,7 @@ startTrace(name: string, taskId: number): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| name | string | 是 | 要追踪的任务名称 | +| name | string | 是 | 要跟踪的任务名称 | | taskId | number | 是 | 任务id | **示例:** @@ -43,7 +43,7 @@ hiTraceMeter.startTrace("myTestFunc", 1); finishTrace(name: string, taskId: number): void -标记一个预追踪耗时任务的结束。 +标记一个预跟踪耗时任务的结束。 finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemeterstarttrace)对应参数值一致。 @@ -53,7 +53,7 @@ finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemetersta | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| name | string | 是 | 要追踪的任务名称 | +| name | string | 是 | 要跟踪的任务名称 | | taskId | number | 是 | 任务id。 | **示例:** @@ -63,10 +63,10 @@ hiTraceMeter.finishTrace("myTestFunc", 1); ``` ```js -//追踪并行执行的同名任务 +//跟踪并行执行的同名任务 hiTraceMeter.startTrace("myTestFunc", 1); //业务流程...... -hiTraceMeter.startTrace("myTestFunc", 2); //第二个追踪的任务开始,同时第一个追踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。 +hiTraceMeter.startTrace("myTestFunc", 2); //第二个跟踪的任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。 //业务流程...... hiTraceMeter.finishTrace("myTestFunc", 1); //业务流程...... @@ -74,12 +74,12 @@ hiTraceMeter.finishTrace("myTestFunc", 2); ``` ```js -//追踪串行执行的同名任务 +//跟踪串行执行的同名任务 hiTraceMeter.startTrace("myTestFunc", 1); //业务流程...... -hiTraceMeter.finishTrace("myTestFunc", 1); //第一个追踪的任务结束 +hiTraceMeter.finishTrace("myTestFunc", 1); //第一个跟踪的任务结束 //业务流程...... -hiTraceMeter.startTrace("myTestFunc", 1); //第二个追踪的同名任务开始,同名的待追踪任务串行执行。 +hiTraceMeter.startTrace("myTestFunc", 1); //第二个跟踪的同名任务开始,同名的待跟踪任务串行执行。 //业务流程...... hiTraceMeter.finishTrace("myTestFunc", 1); ``` @@ -89,7 +89,7 @@ hiTraceMeter.finishTrace("myTestFunc", 1); traceByValue(name: string, count: number): void -用来标记一个预追踪的数值变量,该变量的数值会不断变化。 +用来标记一个预跟踪的数值变量,该变量的数值会不断变化。 **系统能力:** SystemCapability.HiviewDFX.HiTrace @@ -97,7 +97,7 @@ traceByValue(name: string, count: number): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| name | string | 是 | 要追踪的数值变量名称 | +| name | string | 是 | 要跟踪的数值变量名称 | | count | number | 是 | 变量的值 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-i18n.md b/zh-cn/application-dev/reference/apis/js-apis-i18n.md index fff45c8b7c38b1c905f413003f1b550bca8b3dcd..36de9ce83ebe13e63937ab664588ef17ef1b7b36 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-i18n.md +++ b/zh-cn/application-dev/reference/apis/js-apis-i18n.md @@ -1,14 +1,17 @@ # 国际化-I18n -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + 本模块提供系统相关的或者增强的国际化能力,包括区域管理、电话号码处理、日历等,相关接口为ECMA 402标准中未定义的补充接口。 +[Intl模块](js-apis-intl.md)提供了ECMA 402标准定义的基础国际化接口,与本模块共同使用可提供完整地国际化支持能力。 + +> **说明:** +> - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > -> - I18N模块包含国际化能力增强接口(未在ECMA 402中定义)。 +> - I18N模块包含国际化能力增强接口(未在ECMA 402中定义),包括区域管理、电话号码处理、日历等,国际化基础能力请参考[Intl模块](js-apis-intl.md)。 ## 导入模块 -``` +```js import i18n from '@ohos.i18n'; ``` @@ -34,7 +37,7 @@ getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): st | string | 指定语言的本地化显示文本。 | **示例:** - ``` + ```js i18n.getDisplayLanguage("zh", "en-GB", true); i18n.getDisplayLanguage("zh", "en-GB"); ``` @@ -61,7 +64,7 @@ getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): stri | string | 指定国家的本地化显示文本。 | **示例:** - ``` + ```js i18n.getDisplayCountry("zh-CN", "en-GB", true); i18n.getDisplayCountry("zh-CN", "en-GB"); ``` @@ -86,7 +89,7 @@ isRTL(locale: string): boolean | boolean | true表示该locale从右至左显示语言;false表示该locale从左至右显示语言。 | **示例:** - ``` + ```js i18n.isRTL("zh-CN");// 中文不是RTL语言,返回false i18n.isRTL("ar-EG");// 阿语是RTL语言,返回true ``` @@ -106,7 +109,7 @@ getSystemLanguage(): string | string | 系统语言ID。 | **示例:** - ``` + ```js i18n.getSystemLanguage(); ``` @@ -115,14 +118,14 @@ getSystemLanguage(): string setSystemLanguage(language: string): boolean -设置系统语言。 +设置系统语言。当前调用该接口不支持系统界面语言的实时刷新。 + +此接口为系统接口。 **需要权限**:ohos.permission.UPDATE_CONFIGURATION **系统能力**:SystemCapability.Global.I18n -**系统API**: 该接口为系统接口,三方应用不支持调用。 - **参数:** | 参数名 | 类型 | 说明 | | -------- | ------ | ----- | @@ -134,7 +137,7 @@ setSystemLanguage(language: string): boolean | boolean | 返回true,表示系统语言设置成功;返回false,表示系统语言设置失败。 | **示例:** - ``` + ```js i18n.setSystemLanguage('zh'); ``` @@ -145,9 +148,9 @@ getSystemLanguages(): Array<string> 获取系统支持的语言列表。 -**系统能力**:SystemCapability.Global.I18n +此接口为系统接口。 -**系统API**: 该接口为系统接口,三方应用不支持调用。 +**系统能力**:SystemCapability.Global.I18n **返回值:** | 类型 | 说明 | @@ -155,7 +158,7 @@ getSystemLanguages(): Array<string> | Array<string> | 系统支持的语言ID列表。 | **示例:** - ``` + ```js i18n.getSystemLanguages(); ``` @@ -166,9 +169,9 @@ getSystemCountries(language: string): Array<string> 获取针对输入语言系统支持的区域列表。 -**系统能力**:SystemCapability.Global.I18n +此接口为系统接口。 -**系统API**: 该接口为系统接口,三方应用不支持调用。 +**系统能力**:SystemCapability.Global.I18n **参数:** | 参数名 | 类型 | 说明 | @@ -181,7 +184,7 @@ getSystemCountries(language: string): Array<string> | Array<string> | 系统支持的区域ID列表。 | **示例:** - ``` + ```js i18n.getSystemCountries('zh'); ``` @@ -200,7 +203,7 @@ getSystemRegion(): string | string | 系统地区ID。 | **示例:** - ``` + ```js i18n.getSystemRegion(); ``` @@ -211,12 +214,12 @@ setSystemRegion(region: string): boolean 设置系统区域。 +此接口为系统接口。 + **需要权限**:ohos.permission.UPDATE_CONFIGURATION **系统能力**:SystemCapability.Global.I18n -**系统API**: 该接口为系统接口,三方应用不支持调用。 - **参数:** | 参数名 | 类型 | 说明 | | ------ | ------ | ----- | @@ -228,7 +231,7 @@ setSystemRegion(region: string): boolean | boolean | 返回true,表示系统区域设置成功;返回false,表示系统区域设置失败。 | **示例:** - ``` + ```js i18n.setSystemRegion('CN'); ``` @@ -247,7 +250,7 @@ getSystemLocale(): string | string | 系统区域ID。 | **示例:** - ``` + ```js i18n.getSystemLocale(); ``` @@ -258,12 +261,12 @@ setSystemLocale(locale: string): boolean 设置系统Locale。 +此接口为系统接口。 + **需要权限**:ohos.permission.UPDATE_CONFIGURATION **系统能力**:SystemCapability.Global.I18n -**系统API**: 该接口为系统接口,三方应用不支持调用。 - **参数:** | 参数名 | 类型 | 说明 | | ------ | ------ | --------------- | @@ -275,7 +278,7 @@ setSystemLocale(locale: string): boolean | boolean | 返回true,表示系统Locale设置成功;返回false,表示系统Locale设置失败。 | **示例:** - ``` + ```js i18n.setSystemLocale('zh-CN'); ``` @@ -286,9 +289,9 @@ isSuggested(language: string, region?: string): boolean 判断当前语言和区域是否匹配。 -**系统能力**:SystemCapability.Global.I18n +此接口为系统接口。 -**系统API**: 该接口为系统接口,三方应用不支持调用。 +**系统能力**:SystemCapability.Global.I18n **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -302,7 +305,7 @@ isSuggested(language: string, region?: string): boolean | boolean | 返回true,表示当前语言和地区匹配;返回false,表示当前语言和地区不匹配。 | **示例:** - ``` + ```js i18n.isSuggested('zh', 'CN'); ``` @@ -327,7 +330,7 @@ getCalendar(locale: string, type? : string): Calendar | [Calendar](#calendar8) | 日历对象。 | **示例:** - ``` + ```js i18n.getCalendar("zh-Hans", "gregory"); ``` @@ -349,7 +352,7 @@ setTime(date: Date): void | date | Date | 是 | 将要设置的日历对象的内部时间日期。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("en-US", "gregory"); var date = new Date(2021, 10, 7, 8, 0, 0, 0); calendar.setTime(date); @@ -370,7 +373,7 @@ setTime(time: number): void | time | number | 是 | time为从1970.1.1 00:00:00 GMT逝去的毫秒数。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("en-US", "gregory"); calendar.setTime(10540800000); ``` @@ -395,7 +398,7 @@ set(year: number, month: number, date:number, hour?: number, minute?: number, se | second | number | 否 | 设置的秒。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00 ``` @@ -415,7 +418,7 @@ setTimeZone(timezone: string): void | timezone | string | 是 | 设置的时区id,如“Asia/Shanghai”。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.setTimeZone("Asia/Shanghai"); ``` @@ -435,7 +438,7 @@ getTimeZone(): string | string | 日历对象的时区id。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.setTimeZone("Asia/Shanghai"); calendar.getTimeZone(); // Asia/Shanghai" @@ -456,7 +459,7 @@ getFirstDayOfWeek(): number | number | 获取一周的起始日,1代表周日,7代表周六。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("en-US", "gregory"); calendar.getFirstDayOfWeek(); ``` @@ -476,7 +479,7 @@ setFirstDayOfWeek(value: number): void | value | number | 否 | 设置一周的起始日,1代表周日,7代表周六。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.setFirstDayOfWeek(0); ``` @@ -496,7 +499,7 @@ getMinimalDaysInFirstWeek(): number | number | 一年中第一周的最小天数。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.getMinimalDaysInFirstWeek(); ``` @@ -516,7 +519,7 @@ setMinimalDaysInFirstWeek(value: number): void | value | number | 否 | 一年中第一周的最小天数。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.setMinimalDaysInFirstWeek(3); ``` @@ -541,7 +544,7 @@ get(field: string): number | number | 与field相关联的值,如当前Calendar对象的内部日期的年份为1990,get("year")返回1990。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00 calendar.get("hour_of_day"); // 8 @@ -567,7 +570,7 @@ getDisplayName(locale: string): string | string | 日历在locale所指示的区域的名字。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("en-US", "buddhist"); calendar.getDisplayName("zh"); // 佛历 ``` @@ -592,7 +595,7 @@ isWeekend(date?: Date): boolean | boolean | 当所判断的日期为周末时,返回 true,否则返回false。 | **示例:** - ``` + ```js var calendar = i18n.getCalendar("zh-Hans"); calendar.set(2021, 11, 11, 8, 0, 0); // set time to 2021.11.11 08:00:00 calendar.isWeekend(); // false @@ -619,7 +622,7 @@ constructor(country: string, options?: PhoneNumberFormatOptions) | options | [PhoneNumberFormatOptions](#phonenumberformatoptions8) | 否 | 电话号码格式化对象的相关选项。 | **示例:** - ``` + ```js var phoneNumberFormat= new i18n.PhoneNumberFormat("CN", {"type": "E164"}); ``` @@ -643,7 +646,7 @@ isValidNumber(number: string): boolean | boolean | 返回true表示电话号码的格式正确,返回false表示电话号码的格式错误。 | **示例:** - ``` + ```js var phonenumberfmt = new i18n.PhoneNumberFormat("CN"); phonenumberfmt.isValidNumber("15812312312"); ``` @@ -668,7 +671,7 @@ format(number: string): string | string | 格式化后的电话号码。 | **示例:** - ``` + ```js var phonenumberfmt = new i18n.PhoneNumberFormat("CN"); phonenumberfmt.format("15812312312"); ``` @@ -678,7 +681,7 @@ format(number: string): string 表示电话号码格式化对象可设置的属性。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ---- | ------ | ---- | ---- | ---------------------------------------- | @@ -689,7 +692,7 @@ format(number: string): string 度量衡单位信息。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ------------- | ------ | ---- | ---- | ---------------------------------------- | @@ -723,7 +726,7 @@ static unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: | string | 按照toUnit的单位格式化后,得到的字符串。 | **示例:** - ``` + ```js i18n.Util.unitConvert({unit: "cup", measureSystem: "US"}, {unit: "liter", measureSystem: "SI"}, 1000, "en-US", "long"); ``` @@ -747,7 +750,7 @@ getInstance(locale?:string): IndexUtil | [IndexUtil](#indexutil8) | locale对应的IndexUtil对象。 | **示例:** - ``` + ```js var indexUtil= i18n.getInstance("zh-CN"); ``` @@ -769,7 +772,7 @@ getIndexList(): Array<string> | Array<string> | 返回当前locale对应的索引列表。 | **示例:** - ``` + ```js var indexUtil = i18n.getInstance("zh-CN"); var indexList = indexUtil.getIndexList(); ``` @@ -789,7 +792,7 @@ addLocale(locale: string): void | locale | string | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 | **示例:** - ``` + ```js var indexUtil = i18n.getInstance("zh-CN"); indexUtil.addLocale("en-US"); ``` @@ -814,9 +817,9 @@ getIndex(text: string): string | string | 输入文本对应的索引值。 | **示例:** - ``` + ```js var indexUtil= i18n.getInstance("zh-CN"); - indexUtil.getIndex("hi"); // 返回h + indexUtil.getIndex("hi"); // 返回hi ``` @@ -842,7 +845,7 @@ static isDigit(char: string): boolean | boolean | 返回true表示输入的字符是数字,返回false表示输入的字符不是数字。 | **示例:** - ``` + ```js var isdigit = i18n.Character.isDigit("1"); // 返回true ``` @@ -866,7 +869,7 @@ static isSpaceChar(char: string): boolean | boolean | 返回true表示输入的字符是空格符,返回false表示输入的字符不是空格符。 | **示例:** - ``` + ```js var isspacechar = i18n.Character.isSpaceChar("a"); // 返回false ``` @@ -890,7 +893,7 @@ static isWhitespace(char: string): boolean | boolean | 返回true表示输入的字符是空白符,返回false表示输入的字符不是空白符。 | **示例:** - ``` + ```js var iswhitespace = i18n.Character.isWhitespace("a"); // 返回false ``` @@ -914,7 +917,7 @@ static isRTL(char: string): boolean | boolean | 返回true表示输入的字符是从右到左语言的字符,返回false表示输入的字符不是从右到左语言的字符。 | **示例:** - ``` + ```js var isrtl = i18n.Character.isRTL("a"); // 返回false ``` @@ -938,7 +941,7 @@ static isIdeograph(char: string): boolean | boolean | 返回true表示输入的字符是表意文字,返回false表示输入的字符不是表意文字。 | **示例:** - ``` + ```js var isideograph = i18n.Character.isIdeograph("a"); // 返回false ``` @@ -962,7 +965,7 @@ static isLetter(char: string): boolean | boolean | 返回true表示输入的字符是字母,返回false表示输入的字符不是字母。 | **示例:** - ``` + ```js var isletter = i18n.Character.isLetter("a"); // 返回true ``` @@ -986,7 +989,7 @@ static isLowerCase(char: string): boolean | boolean | 返回true表示输入的字符是小写字母,返回false表示输入的字符不是小写字母。 | **示例:** - ``` + ```js var islowercase = i18n.Character.isLowerCase("a"); // 返回true ``` @@ -1010,7 +1013,7 @@ static isUpperCase(char: string): boolean | boolean | 返回true表示输入的字符是大写字母,返回false表示输入的字符不是大写字母。 | **示例:** - ``` + ```js var isuppercase = i18n.Character.isUpperCase("a"); // 返回false ``` @@ -1034,7 +1037,7 @@ static getType(char: string): string | string | 输入字符的一般类别值。 | **示例:** - ``` + ```js var type = i18n.Character.getType("a"); ``` @@ -1058,7 +1061,7 @@ getLineInstance(locale: string): BreakIterator | [BreakIterator](#breakiterator8) | 用于进行断句的处理器。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); ``` @@ -1080,7 +1083,7 @@ setLineBreakText(text: string): void | text | string | 是 | 指定BreakIterator进行断句的文本。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); ``` @@ -1100,7 +1103,7 @@ getLineBreakText(): string | string | BreakIterator对象正在处理的文本 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.getLineBreakText(); // Apple is my favorite fruit. @@ -1121,7 +1124,7 @@ current(): number | number | BreakIterator在当前所处理的文本中的位置。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.current(); // 0 @@ -1142,7 +1145,7 @@ first(): number | number | 被处理文本的第一个分割点的偏移量。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.first(); // 0 @@ -1163,7 +1166,7 @@ last(): number | number | 被处理的文本的最后一个分割点的偏移量 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.last(); // 27 @@ -1189,7 +1192,7 @@ next(index?: number): number | number | 返回移动了index个分割点后,当前[BreakIterator](#breakiterator8)在文本中的位置。若移动index个分割点后超出了所处理的文本的长度范围,返回-1。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.first(); // 0 @@ -1212,7 +1215,7 @@ previous(): number | number | 返回移动到前一个分割点后,当前[BreakIterator](#breakiterator8)在文本中的位置。若移动index个分割点后超出了所处理的文本的长度范围,返回-1。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.first(); // 0 @@ -1240,7 +1243,7 @@ following(offset: number): number | number | 返回[BreakIterator](#breakiterator8)移动后的位置,如果由offset所指定的位置的下一个分割点超出了文本的范围则返回-1。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.following(0); // 6 @@ -1268,7 +1271,7 @@ isBoundary(offset: number): boolean | boolean | 如果是一个分割点返回true, 否则返回false。 | **示例:** - ``` + ```js var iterator = i18n.getLineInstance("en"); iterator.setLineBreakText("Apple is my favorite fruit."); iterator.isBoundary(0); // true; @@ -1290,7 +1293,7 @@ is24HourClock(): boolean | boolean | 返回true,表示系统24小时开关开启;返回false,表示系统24小时开关关闭。 | **示例:** - ``` + ```js var is24HourClock = i18n.is24HourClock(); ``` @@ -1316,7 +1319,7 @@ set24HourClock(option: boolean): boolean | boolean | 返回true,表示修改成功;返回false,表示修改失败。 | **示例:** - ``` + ```js // 将系统时间设置为24小时制 var success = i18n.set24HourClock(true); ``` @@ -1344,7 +1347,7 @@ addPreferredLanguage(language: string, index?: number): boolean | boolean | 返回true,表示添加成功;返回false,表示添加失败。 | **示例:** - ``` + ```js // 将语言zh-CN添加到系统偏好语言列表中 var language = 'zh-CN'; var index = 0; @@ -1373,7 +1376,7 @@ removePreferredLanguage(index: number): boolean | boolean | 返回true,表示删除成功;返回false,表示删除失败。 | **示例:** - ``` + ```js // 删除系统偏好语言列表中的第一个偏好语言 var index = 0; var success = i18n.removePreferredLanguage(index); @@ -1394,7 +1397,7 @@ getPreferredLanguageList(): Array<string> | Array<string> | 系统偏好语言列表。 | **示例:** - ``` + ```js var preferredLanguageList = i18n.getPreferredLanguageList(); ``` @@ -1413,7 +1416,7 @@ getFirstPreferredLanguage(): string | string | 偏好语言列表中的第一个语言。 | **示例:** - ``` + ```js var firstPreferredLanguage = i18n.getFirstPreferredLanguage(); ``` @@ -1437,15 +1440,15 @@ getTimeZone(zoneID?: string): TimeZone | TimeZone | 时区ID对应的时区对象。 | **示例:** - ``` + ```js var timezone = i18n.getTimeZone(); ``` -## RelativeTimeFormat8+ +## TimeZone -### getID8+ +### getID getID(): string @@ -1459,13 +1462,13 @@ getID(): string | string | 时区对象对应的时区ID。 | **示例:** - ``` + ```js var timezone = i18n.getTimeZone(); timezone.getID(); ``` -### getDisplayName8+ +### getDisplayName getDisplayName(locale?: string, isDST?: boolean): string @@ -1485,13 +1488,13 @@ getDisplayName(locale?: string, isDST?: boolean): string | string | 时区对象在指定区域的表示。 | **示例:** - ``` + ```js var timezone = i18n.getTimeZone(); timezone.getDisplayName("zh-CN", false); ``` -### getRawOffset8+ +### getRawOffset getRawOffset(): number @@ -1505,13 +1508,13 @@ getRawOffset(): number | number | 时区对象表示的时区与UTC时区的偏差。 | **示例:** - ``` + ```js var timezone = i18n.getTimeZone(); timezone.getRawOffset(); ``` -### getOffset8+ +### getOffset getOffset(date?: number): number @@ -1525,7 +1528,8 @@ getOffset(date?: number): number | number | 某一时刻时区对象表示的时区与UTC时区的偏差。 | **示例:** - ``` + ```js var timezone = i18n.getTimeZone(); timezone.getOffset(1234567890); - ``` \ No newline at end of file + ``` + \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-intl.md b/zh-cn/application-dev/reference/apis/js-apis-intl.md index 194a9ae443c99078fca73b70f746b13912663771..9157c68e4501463b98633d1c86451b6e455c0f44 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-intl.md +++ b/zh-cn/application-dev/reference/apis/js-apis-intl.md @@ -1,14 +1,17 @@ # 国际化-Intl -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** + 本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。 +[I18N模块](js-apis-i18n.md)提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。 + +> **说明:** > - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > -> - Intl模块包含国际化能力基础接口(在ECMA 402中定义)。 +> - Intl模块包含国际化能力基础接口(在ECMA 402中定义),包括时间日期格式化、数字格式化、排序等,国际化增强能力请参考[I18N模块](js-apis-i18n.md)。 ## 导入模块 -``` +```js import Intl from '@ohos.intl'; ``` @@ -43,7 +46,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var locale = new Intl.Locale(); ``` @@ -63,7 +66,7 @@ constructor(locale: string, options?: LocaleOptions) | options | LocaleOptions | 否 | 用于创建区域对象的选项。 | **示例:** - ``` + ```js var locale = new Intl.Locale("zh-CN"); ``` @@ -82,7 +85,7 @@ toString(): string | string | 字符串形式的区域信息。 | **示例:** - ``` + ```js var locale = new Intl.Locale("zh-CN"); locale.toString(); ``` @@ -102,7 +105,7 @@ maximize(): Locale | [Locale](#locale) | 最大化后的区域对象。 | **示例:** - ``` + ```js var locale = new Intl.Locale("zh-CN"); locale.maximize(); ``` @@ -122,7 +125,7 @@ minimize(): Locale | [Locale](#locale) | 最小化后的区域对象。 | **示例:** - ``` + ```js var locale = new Intl.Locale("zh-CN"); locale.minimize(); ``` @@ -132,7 +135,7 @@ minimize(): Locale 表示区域初始化选项。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | --------------- | ------- | ---- | ---- | ---------------------------------------- | @@ -156,7 +159,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var datefmt= new Intl.DateTimeFormat(); ``` @@ -176,13 +179,13 @@ constructor(locale: string | Array<string>, options?: DateTimeOptions) | options | [DateTimeOptions](#datetimeoptions) | 否 | 用于创建时间日期格式化的选项。 | **示例:** - ``` + ```js var datefmt= new Intl.DateTimeFormat("zh-CN", { dateStyle: 'full', timeStyle: 'medium' }); ``` **示例:** - ``` + ```js var datefmt= new Intl.DateTimeFormat(["ban", "zh"], { dateStyle: 'full', timeStyle: 'medium' }); ``` @@ -206,7 +209,7 @@ format(date: Date): string | string | 格式化后的时间日期字符串 | **示例:** - ``` + ```js var date = new Date(2021, 11, 17, 3, 24, 0); var datefmt = new Intl.DateTimeFormat("en-GB"); datefmt.format(date); @@ -233,7 +236,7 @@ formatRange(startDate: Date, endDate: Date): string | string | 格式化后的时间日期段字符串。 | **示例:** - ``` + ```js var startDate = new Date(2021, 11, 17, 3, 24, 0); var endDate = new Date(2021, 11, 18, 3, 24, 0); var datefmt = new Intl.DateTimeFormat("en-GB"); @@ -255,7 +258,7 @@ resolvedOptions(): DateTimeOptions | [DateTimeOptions](#datetimeoptions) | DateTimeFormat 对象的格式化选项。 | **示例:** - ``` + ```js var datefmt = new Intl.DateTimeFormat("en-GB"); datefmt.resolvedOptions(); ``` @@ -265,7 +268,7 @@ resolvedOptions(): DateTimeOptions 表示时间日期格式化选项。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | --------------- | ------- | ---- | ---- | ---------------------------------------- | @@ -302,7 +305,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var numfmt = new Intl.NumberFormat(); ``` @@ -322,7 +325,7 @@ constructor(locale: string | Array<string>, options?: NumberOptions) | options | [NumberOptions](#numberoptions) | 否 | 用于创建数字格式化的选项。 | **示例:** - ``` + ```js var numfmt = new Intl.NumberFormat("en-GB", {style:'decimal', notation:"scientific"}); ``` @@ -347,7 +350,7 @@ format(number: number): string; **示例:** - ``` + ```js var numfmt = new Intl.NumberFormat(["en-GB", "zh"], {style:'decimal', notation:"scientific"}); numfmt.format(1223); ``` @@ -368,7 +371,7 @@ resolvedOptions(): NumberOptions **示例:** - ``` + ```js var numfmt = new Intl.NumberFormat(["en-GB", "zh"], {style:'decimal', notation:"scientific"}); numfmt.resolvedOptions(); ``` @@ -388,7 +391,7 @@ resolvedOptions(): NumberOptions | currencyDisplay | string | 是 | 是 | 货币的显示方式,取值包括:"symbol", "narrowSymbol", "code", "name"。 | | unit | string | 是 | 是 | 单位名称,如:"meter","inch",“hectare”等。 | | unitDisplay | string | 是 | 是 | 单位的显示格式,取值包括:"long", "short", "narrow"。 | -| unitUsage8+ | string | 是 | 是 | 单位的使用场景,取值包括:"default", "area-land-agricult", "area-land-commercl", "area-land-residntl", "length-person", "length-person-small", "length-rainfall", "length-road", "length-road-small", "length-snowfall", "length-vehicle", "length-visiblty", "length-visiblty-small", "length-person-informal", "length-person-small-informal", "length-road-informal", "speed-road-travel", "speed-wind", "temperature-person", "temperature-weather", "volume-vehicle-fuel"。 | +| unitUsage8+ | string | 是 | 是 | 单位的使用场景,取值包括:"default", "area-land-agricult", "area-land-commercl", "area-land-residntl", "length-person", "length-person-small", "length-rainfall", "length-road", "length-road-small", "length-snowfall", "length-vehicle", "length-visiblty", "length-visiblty-small", "length-person-informal", "length-person-small-informal", "length-road-informal", "speed-road-travel", "speed-wind", "temperature-person", "temperature-weather", "volume-vehicle-fuel"。 | | signDisplay | string | 是 | 是 | 数字符号的显示格式,取值包括:"auto", "never", "always", "expectZero"。 | | compactDisplay | string | 是 | 是 | 紧凑型的显示格式,取值包括:"long", "short"。 | | notation | string | 是 | 是 | 数字的格式化规格,取值包括:"standard", "scientific", "engineering", "compact"。 | @@ -415,7 +418,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var collator = new Intl.Collator(); ``` @@ -436,7 +439,7 @@ constructor(locale: string | Array<string>, options?: CollatorOptions) | options | [CollatorOptions](#collatoroptions) | 否 | 用于创建排序对象的选项。 | **示例:** - ``` + ```js var collator = new Intl.Collator("zh-CN", {localeMatcher: "lookup", usage: "sort"}); ``` @@ -461,7 +464,7 @@ compare(first: string, second: string): number | number | 比较结果。当number为负数,表示first排序在second之前;当number为0,表示first与second排序相同;当number为正数,表示first排序在second之后。 | **示例:** - ``` + ```js var collator = new Intl.Collator("zh-Hans"); collator.compare("first", "second"); ``` @@ -481,17 +484,17 @@ resolvedOptions(): CollatorOptions | [CollatorOptions](#collatoroptions) | 返回的Collator对象的属性。 | **示例:** - ``` + ```js var collator = new Intl.Collator("zh-Hans"); var options = collator.resolvedOptions(); ``` -## CollatorOptions8+ +## CollatorOptions8+ 表示Collator可设置的属性。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ----------------- | ------- | ---- | ---- | ---------------------------------------- | @@ -516,7 +519,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var pluralRules = new Intl.PluralRules(); ``` @@ -536,8 +539,8 @@ constructor(locale: string | Array<string>, options?: PluralRulesOptions) | options | [PluralRulesOptions](#pluralrulesoptions) | 否 | 用于创建单复数对象的选项。 | **示例:** - ``` - var pluralRules= new Intl.PluraRules("zh-CN", {"localeMatcher": "lookup", "type": "cardinal"}); + ```js + var pluralRules= new Intl.PluralRules("zh-CN", {"localeMatcher": "lookup", "type": "cardinal"}); ``` @@ -560,17 +563,17 @@ select(n: number): string | string | 单复数类别,取值包括:"zero","one","two", "few", "many", "others"。 | **示例:** - ``` + ```js var pluralRules = new Intl.PluralRules("zh-Hans"); pluralRules.select(1); ``` -## PluralRulesOptions8+ +## PluralRulesOptions8+ 表示PluralRules对象可设置的属性。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ------------------------ | ------ | ---- | ---- | ---------------------------------------- | @@ -595,7 +598,7 @@ constructor() **系统能力**:SystemCapability.Global.I18n **示例:** - ``` + ```js var relativetimefmt = new Intl.RelativeTimeFormat(); ``` @@ -615,7 +618,7 @@ constructor(locale: string | Array<string>, options?: RelativeTimeFormatIn | options | [RelativeTimeFormatInputOptions](#relativetimeformatinputoptions) | 否 | 用于创建相对时间格式化对象的选项。 | **示例:** - ``` + ```js var relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {"localeMatcher": "lookup", "numeric": "always", "style": "long"}); ``` @@ -640,7 +643,7 @@ format(value: number, unit: string): string | string | 格式化后的相对时间。 | **示例:** - ``` + ```js var relativetimefmt = new Intl.RelativeTimeFormat("zh-CN"); relativetimefmt.format(3, "quarter") ``` @@ -666,7 +669,7 @@ formatToParts(value: number, unit: string): Array<object> | Array<object> | 返回可用于自定义区域设置格式的相对时间格式的对象数组。 | **示例:** - ``` + ```js var relativetimefmt = new Intl.RelativeTimeFormat("en", {"numeric": "auto"}); var parts = relativetimefmt.format(10, "seconds"); ``` @@ -686,17 +689,17 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions | [RelativeTimeFormatResolvedOptions](#relativetimeformatresolvedoptions) | RelativeTimeFormat 对象的格式化选项。 | **示例:** - ``` + ```js var relativetimefmt= new Intl.RelativeTimeFormat("en-GB"); relativetimefmt.resolvedOptions(); ``` -## RelativeTimeFormatInputOptions8+ +## RelativeTimeFormatInputOptions8+ 表示RelativeTimeFormat对象可设置的属性。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ------------- | ------ | ---- | ---- | ---------------------------------------- | @@ -705,11 +708,11 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions | style | string | 是 | 是 | 国际化消息的长度,取值包括:"long", "short", "narrow"。 | -## RelativeTimeFormatResolvedOptions8+ +## RelativeTimeFormatResolvedOptions8+ 表示RelativeTimeFormat对象可设置的属性。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Global.I18n +**系统能力**:SystemCapability.Global.I18n | 名称 | 参数类型 | 可读 | 可写 | 说明 | | --------------- | ------ | ---- | ---- | ---------------------------------------- | diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-logs.md index ed92b8b2c47d6826c1ba0c90178046cca60678ba..81203760b52838389b008cae779e23116380bff7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-logs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-logs.md @@ -1,7 +1,12 @@ # 日志打印 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 从API Version 7 开始,该接口不再维护,推荐使用新接口[`@ohos.hilog`](js-apis-hilog.md)'。 +本模块提供基础的日志打印能力,支持按照日志级别打印日志信息。 + +如果需要使用更高级的日志打印服务,比如按照指定标识筛选日志内容,推荐使用[`@ohos.hilog`](js-apis-hilog.md)。 + +> **说明:** +> +> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## console.debug @@ -9,10 +14,13 @@ debug(message: string): void 打印debug级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.log @@ -21,10 +29,13 @@ log(message: string): void 打印debug级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.info @@ -33,10 +44,13 @@ info(message: string): void 打印info级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.warn @@ -45,10 +59,13 @@ warn(message: string): void 打印warn级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.error @@ -57,10 +74,13 @@ error(message: string): void 打印error级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## 示例 diff --git a/zh-cn/application-dev/reference/apis/js-apis-notification.md b/zh-cn/application-dev/reference/apis/js-apis-notification.md index ad443f07c5346e6b5133a9f633f2161a1587abc9..99198439f1b08db8d3847fec0e4f7bfbd693a016 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md @@ -3055,7 +3055,7 @@ Notification.subscribe(subscriber, subscribeCallback); | desc | 是 | 是 | string | 否 | 通知渠道描述信息。 | | badgeFlag | 是 | 是 | boolean | 否 | 是否显示角标。 | | bypassDnd | 是 | 是 | boolean | 否 | 置是否在系统中绕过免打扰模式。 | -| lockscreenVisibility | 是 | 是 | boolean | 否 | 在锁定屏幕上显示通知的模式。 | +| lockscreenVisibility | 是 | 是 | number | 否 | 在锁定屏幕上显示通知的模式。 | | vibrationEnabled | 是 | 是 | boolean | 否 | 是否可振动。 | | sound | 是 | 是 | string | 否 | 通知提示音。 | | lightEnabled | 是 | 是 | boolean | 否 | 是否闪灯。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md index 3a52e071218063300184d674c36bafbced129641..2c4b2dedd6ad05b58909ef2018d0c7abe46743c4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md @@ -1,6 +1,6 @@ # 电量信息 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明:** > - 从API Version 6开始,该接口不再维护,推荐使用新接口[`@ohos.batteryInfo`](js-apis-battery-info.md)。 > > - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -26,16 +26,9 @@ getStatus(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | - -success返回值: - -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| charging | boolean | 当前电池是否在充电中。 | -| level | number | 当前电池的电量,取值范围:0.00 - 1.00 。 | +| success | (data: [BatteryResponse](#batteryresponse)) => void | 否 | 接口调用成功的回调函数。| +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。| +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -52,4 +45,11 @@ export default { }); }, } -``` \ No newline at end of file +``` + +## BatteryResponse + +| 参数名 | 类型 | 说明 | +| -------- | -------- | -------- | +| charging | boolean | 当前电池是否在充电中。 | +| level | number | 当前电池的电量,取值范围:0.00 - 1.00 。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md index aa52115fe4f88eea6c57b03ede1731d73c11cefd..cf8e51aa4d1b60ca58443507a460b53ae55387bc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md @@ -1,6 +1,6 @@ # 屏幕亮度 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明:** > - 从API Version 7 开始,该接口不再维护,推荐使用新接口[`@ohos.brightness`](js-apis-brightness.md)。 > > - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -23,11 +23,12 @@ getValue(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | (data: [BrightnessResponse](#brightnessresponse)) => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | success返回值: @@ -35,6 +36,7 @@ success返回值: | -------- | -------- | -------- | | value | number | 屏幕亮度,取值为1-255之间的整数。 | + **示例:** ```js @@ -62,12 +64,13 @@ setValue(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | value | number | 是 | 屏幕亮度,值为1-255之间的整数。
- 如果值小于等于0,系统按1处理。
- 如果值大于255,系统按255处理。
- 如果值为小数,系统将处理为整数。例如设置为8.1,系统按8处理。 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -97,13 +100,14 @@ getMode(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | (data: [BrightnessModeResponse](#brightnessmoderesponse)) => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | - success返回值: +success返回值: | 参数名 | 类型 | 说明 | | -------- | -------- | -------- | @@ -138,10 +142,10 @@ setMode(Object): void **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| mode | number | 是 | 值为0或1
- 0为手动调节屏幕亮度
- 1为自动调节屏幕亮度 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| mode | number | 是 | 值为0或1
- 0为手动调节屏幕亮度。
- 1为自动调节屏幕亮度。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -174,9 +178,9 @@ setKeepScreenOn(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | keepScreenOn | boolean | 是 | 是否保持屏幕常亮。 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -195,3 +199,17 @@ setKeepScreenOn(Object): void }, } ``` +## + +## BrightnessResponse + +| 名称 | 类型 | 说明 | +| -------- | -------- | -------- | +| value | number | 屏幕亮度,取值为1-255之间的整数。 | + +## BrightnessModeResponse + +| 名称 | 类型 | 说明 | +| -------- | -------- | -------- | +| mode | number | 值为0或1。
-0为手动调节屏幕亮度模式。
-1为手动调节屏幕亮度模式。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-timer.md b/zh-cn/application-dev/reference/apis/js-apis-timer.md index 8085456cf414c6b960aa2f6bc6a5ca003bc777f5..735737431ac22d891412701063b23ca254979d9b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-timer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-timer.md @@ -1,5 +1,10 @@ # 定时器 +本模块提供基础的定时器能力,支持按照指定的时间执行对应函数。 + +> **说明:** +> +> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## setTimeout @@ -7,19 +12,24 @@ setTimeout(handler[,delay[,…args]]): number 设置一个定时器,该定时器在定时器到期后执行一个函数。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | handler | Function | 是 | 定时器到期后执行函数。 | - | delay | number | 否 | 延迟的毫秒数,函数的调用会在该延迟之后发生。如果省略该参数,delay取默认值0,意味着“马上”执行,或尽快执行。 | - | ...args | Array<any> | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| handler | Function | 是 | 定时器到期后执行函数。 | +| delay | number | 否 | 延迟的毫秒数,函数的调用会在该延迟之后发生。如果省略该参数,delay取默认值0,意味着“马上”执行,或尽快执行。 | +| ...args | Array<any> | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | + +**返回值:** -- 返回值 - | 类型 | 说明 | - | -------- | -------- | - | number | timeout定时器的ID。 | +| 类型 | 说明 | +| -------- | -------- | +| number | timeout定时器的ID。 | + +**示例:** -- 示例 ```js export default { setTimeOut() { @@ -37,12 +47,16 @@ clearTimeout(timeoutID: number): void 取消了先前通过调用setTimeout()建立的定时器。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | timeoutID | number | 是 | 要取消定时器的ID, 是由setTimeout()返回的。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| timeoutID | number | 是 | 要取消定时器的ID, 是由setTimeout()返回的。 | + +**示例:** -- 示例 ```js export default { clearTimeOut() { @@ -61,19 +75,24 @@ setInterval(handler[, delay[, ...args]]): number 重复调用一个函数,在每次调用之间具有固定的时间延迟。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | handler | Function | 是 | 要重复调用的函数。 | - | delay | number | 否 | 延迟的毫秒数(一秒等于1000毫秒),函数的调用会在该延迟之后发生。 | - | ...args | Array<any> | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full -- 返回值 - | 类型 | 说明 | - | -------- | -------- | - | number | intervalID重复定时器的ID。 | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| handler | Function | 是 | 要重复调用的函数。 | +| delay | number | 否 | 延迟的毫秒数(一秒等于1000毫秒),函数的调用会在该延迟之后发生。 | +| ...args | Array<any> | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| number | intervalID重复定时器的ID。 | + +**示例:** -- 示例 ```js export default { setInterval() { @@ -89,14 +108,18 @@ setInterval(handler[, delay[, ...args]]): number clearInterval(intervalID: number): void -可取消先前通过 setInterval() 设置的重复定时任务。 +可取消先前通过setInterval()设置的重复定时任务。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | intervalID | number | 是 | 要取消的重复定时器的ID,是由 setInterval() 返回的。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| intervalID | number | 是 | 要取消的重复定时器的ID,是由 setInterval() 返回的。 | + +**示例:** -- 示例 ```js export default { clearInterval() { @@ -107,4 +130,3 @@ clearInterval(intervalID: number): void } } ``` - diff --git a/zh-cn/application-dev/reference/apis/js-apis-webgl.md b/zh-cn/application-dev/reference/apis/js-apis-webgl.md index f2c0b6cf7b21655ccf681ddd8fe45136c4cb1a54..204459ff0e9a17dd08fcd22bb0100cbc71bebbfb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-webgl.md +++ b/zh-cn/application-dev/reference/apis/js-apis-webgl.md @@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 2.0特性集。更多信息请参考[WebG > **说明:** > > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> WebGL遵循OpenGL协议,不支持多线程调用。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-webgl2.md b/zh-cn/application-dev/reference/apis/js-apis-webgl2.md index c57f9b87dd7b0c66f7ee6bf7ac027bf71a29a4cc..be0517cdd2004bdfd8cac994f75b543b76db59a0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-webgl2.md +++ b/zh-cn/application-dev/reference/apis/js-apis-webgl2.md @@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 3.0特性集。更多信息请参考[WebG > **说明:** > > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> WebGL2遵循OpenGL协议,不支持多线程调用。 diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001236876377.jpg b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001236876377.jpg index b12c5fb6563c7ee9d8dfa7e6af1cfe1dcfa1361c..e5af4f50ebd9bdab6af30219f30fdf948a019a52 100644 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001236876377.jpg and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001236876377.jpg differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md index 206340230419dda2809cc5210bc23d261308c9db..62db1a023a01f369b6fa4d4421aecda83a79f840 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md @@ -2,18 +2,19 @@ ## Color -| 颜色名称 | 颜色值 | 颜色示意 | -| ------------------------ | -------- | ------------------------------------------------------------ | -| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) | -| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) | -| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) | -| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) | -| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) | -| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) | -| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) | -| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) | -| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) | -| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) | +| 颜色名称 | 颜色值 | 颜色示意 | +| -------- | -------- | ------------------------------------------------------------ | +| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) | +| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) | +| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) | +| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) | +| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) | +| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) | +| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) | +| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) | +| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) | +| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) | +| Grey | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) | ## ImageFit @@ -69,6 +70,7 @@ | Press | 鼠标按键按下。 | | Release | 鼠标按键松开。 | | Move | 鼠标移动。 | +| Hover | 鼠标悬停。 | ## Curve @@ -99,10 +101,12 @@ ## FillMode -| 名称 | 描述 | -| -------- | -------------------------------- | -| None | 播放完成后恢复初始状态。 | -| Forwards | 播放完成后保持动画结束时的状态。 | +| 名称 | 描述 | +| --------- | -------------------------------------------------------- | +| None | 播放完成后恢复初始状态。 | +| Forwards | 播放完成后保持动画结束时的状态。 | +| Backwards | 在显示动画之前,为动画延迟指定的时间段应用“开始”属性值。 | +| Both | 应用正向和反向填充模式。 | ## PlayMode diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md index 712f1619796f55e7e730460806e362b155ec4838..ea8b4a0a7629efee1e72fdc24627659108047ec3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md @@ -19,13 +19,13 @@ ## 接口 -Blank(min?: Length) +Blank(min?: number | string) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------ | ---------------------------- | ---- | ------ | ------------------------------------ | -| min | [Length](ts-types.md#length) | 否 | 0 | 空白填充组件在容器主轴上的最小大小。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | ---------------- | ---- | ------ | ------------------------------------ | +| min | number \| string | 否 | 0 | 空白填充组件在容器主轴上的最小大小。 | ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md index 1ed06ba87e197e56bfe813e880cfabf6766887a5..ff1a8d6ae3af6a29f11db749dec523267e880f80 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md @@ -16,7 +16,7 @@ ## 接口 -Checkbox( name?: string, group?: string ) +Checkbox( options?: {name?: string, group?: string} ) **参数:** diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md index 218afeda49fc2a840d4d26e9491d2b121ebe8bc2..649e80e27b5cc1b229767dc628437644f52c35fe 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md @@ -16,7 +16,7 @@ ## 接口 -CheckboxGroup( group?: string ) +CheckboxGroup( option?: {group?: string} ) 创建多选框群组,可以控制群组内的Checkbox全选或者不全选,相同group的Checkbox和CheckboxGroup为同一群组。 @@ -35,9 +35,22 @@ CheckboxGroup( group?: string ) ## 事件 -| 名称 | 功能描述 | -| ---------------------------------------- | ---------------------------------------- | -| onChange (callback: (names: Array<string>, status: SelectStatus) => void ) | CheckboxGroup的选中状态或群组内的Checkbox的选中状态发生变化时,触发回调。
- names:群组内所有被选中的多选框名称。
- status:选中状态。 | +## onChange + +onChange (callback: (event: CheckboxGroupResult ) => void ) + +CheckboxGroup的选中状态或群组内的Checkbox的选中状态发生变化时,触发回调。 + +| 名称 | 参数类型 | 必填 | 描述 | +| ----- | ------------------- | ---- | -------------------- | +| event | CheckboxGroupResult | 是 | 选中状态的回调结果。 | + +## CheckboxGroupResult + +| 名称 | 参数类型 | 描述 | +| ------ | ------------------- | -------------- | +| name | Array<string> | checkBox名称。 | +| status | selectStatus | 选中状态。 | ## SelectStatus枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md index ff2fb565e4a16d9505f8f792c8aa21aad3db1468..cb7fae4c536a2df5ac01e9876f0249671bdc0d1e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md @@ -22,6 +22,14 @@ DataPanel(options:{values: number[], max?: number, type?: DataPanelType}) | max | number | 否 | 100 | - max大于0,表示数据的最大值。
- max小于等于0,max等于value数组各项的和,按比例显示。 | | type8+ | DataPanelType | 否 | DataPanelType.Circle | 数据面板的类型。 | +## 属性 + +| 名称 | 参数类型 | 默认值 | 描述 | +| ----------- | -------- | ------ | ------------------------------------ | +| closeEffect | boolean | true | 设置是否禁用数据比率图表的特殊效果。 | + + + ## DataPanelType枚举说明 | 名称 | 描述 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md index dc170aba22056f7a8f723b88c5a1852354a0d81c..3dcd973266b811dc3eb66ea2d659a273f813a853 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md @@ -24,7 +24,7 @@ Divider() | ----------- | --------------------------------------------------------- | ----------------- | ------------------------------------------------------------ | | vertical | boolean | false | 使用水平分割线还是垂直分割线,false: 水平分割线, true:垂直分割线。 | | color | [ResourceColor](ts-types.md#resourcecolor8) | - | 设置分割线颜色。 | -| strokeWidth | [Length](ts-types.md#length) | 1 | 设置分割线宽度。 | +| strokeWidth | number \| string | 1 | 设置分割线宽度。 | | lineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle枚举说明) | LineCapStyle.Butt | 设置分割线条的端点样式。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md index 91d290bef726e242937dbdae7c9c91403f2f00e3..8b16eb1a5afbee14e4b1e0226762e7761c6b9db6 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md @@ -33,8 +33,8 @@ Gauge(options:{value: number, min?: number, max?: number}) | value | number | 0 | 设置当前数据图表的值。 | | startAngle | number | -150 | 设置起始角度位置,时钟0点为0度,顺时针方向为正角度。 | | endAngle | number | 150 | 设置终止角度位置,时钟0点为0度,顺时针方向为正角度。 | -| colors | Array<ColorStop> | - | 设置图表的颜色,支持分段颜色设置。 | -| strokeWidth | Length | - | 设置环形图表的环形厚度。 | +| colors | Array<any> | - | 设置图表的颜色,支持分段颜色设置。 | +| strokeWidth | [Length](ts-types.md#length) | - | 设置环形图表的环形厚度。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md index 2599fc7c4f042c77d4e0753b31a46280bbee25ea..97ad67174661bc2245e2b17d8279354895464cf7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md @@ -24,16 +24,16 @@ ImageAnimator() ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | -| ---------- | ---------------------------------------- | -------- | ---- | ---------------------------------------- | -| images | Array<{
src:string,
width?:Length,
height?:Length,
top?:Length,
left?:Length,
duration?:number
}> | [] | 是 | 设置图片帧信息集合。每一帧的帧信息包含图片路径、图片大小、图片位置和图片播放时长信息。详细说明如下:
src:图片路径,图片格式为svg,png和jpg。
width:图片宽度。
height:图片高度。
top:图片相对于组件左上角的纵向坐标。
left:图片相对于组件左上角的横向坐标。
duration:每一帧图片的播放时长,单位毫秒。 | -| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | Initial | 否 | 默认为初始状态,用于控制播放状态。 | -| duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中设置了单独的duration后,该属性设置无效。 | -| reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。 | -| fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的 width 、height 、top和left属性都要单独设置。 | -| preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 | -| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | -| iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 | +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +| ---------- | ------------------------------------------------------------ | -------- | ---- | ------------------------------------------------------------ | +| images | Array<{
src: string,
width?: number \| string,
height?: number \| string,
top?: number \| string,
left?: number \| string,
duration?: number
}> | [] | 是 | 设置图片帧信息集合。每一帧的帧信息包含图片路径、图片大小、图片位置和图片播放时长信息。详细说明:
- src:图片路径,图片格式为svg,png和jpg。
- width:图片宽度。
- height:图片高度。
- top:图片相对于组件左上角的纵向坐标。
- left:图片相对于组件左上角的横向坐标。
- duration:每一帧图片的播放时长,单位毫秒。 | +| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | Initial | 否 | 默认为初始状态,用于控制播放状态。 | +| duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms。
duration为0时,不播放图片。
值的改变只会在下一次循环开始时生效。
当images中设置了单独的duration后,该属性设置无效。 | +| reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。 | +| fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的 width 、height 、top和left属性都要单独设置。 | +| preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 | +| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | +| iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md index 8fde4a5bdc1a42f1015107d45f470cfa9cf028a5..d3bb6d270cd9121caad6d58b2791c8cff2e001d7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md @@ -42,13 +42,23 @@ Progress(options: {value: number, total?: number, style?: ProgressStyle, type?: | ScaleRing8+ | 环形有刻度样式,类似时钟刻度形式加载进度。 | | Capsule8+ | 胶囊样式,头尾两端处,进度条由弧形变成直线和直线变成弧形的过程;中段处,进度条正常往右走的过程。 | +## ProgressStyle枚举说明 + +| 名称 | 描述 | +| ---------------------- | ------------------------------------------------------------ | +| Linear | 线性样式。 | +| Ring8+ | 环形无刻度样式,环形圆环逐渐填充完成过程。 | +| Eclipse | 圆形样式,展现类似月圆月缺的进度展示效果,从月牙逐渐到满月的这个过程代表了下载的进度。 | +| ScaleRing8+ | 环形有刻度样式,类似时钟刻度形式加载进度。 | +| Capsule8+ | 胶囊样式,头尾两端处,进度条由弧形变成直线和直线变成弧形的过程;中段处,进度条正常往右走的过程。 | + ## 属性 | 名称 | 参数类型 | 默认值 | 描述 | | ------------------ | ------------------------------------------------------------ | ------ | ------------------------------------------------------------ | | value | number | - | 设置当前进度值。 | | color | [ResourceColor](ts-types.md#resourcecolor8) | - | 设置进度条前景色。 | -| style8+ | {
strokeWidth?: [Length](ts-types.md#length),
scaleCount?: number,
scaleWidth?: [Length](ts-types.md#length)
} | - | 定义组件的样式。
strokeWidth: 设置进度条宽度。
scaleCount: 设置环形进度条总刻度数。
scaleWidth: 设置环形进度条刻度粗细。
刻度粗细大于进度条宽度时,刻度粗细为系统默认粗细。 | +| style8+ | {
strokeWidth?: [Length](ts-types.md#length),
scaleCount?: number,
scaleWidth?: [Length](ts-types.md#length)
} | - | 定义组件的样式。
strokeWidth: 设置进度条宽度。
scaleCount: 设置环形进度条总刻度数。
scaleWidth: 设置环形进度条刻度粗细。
刻度粗细大于进度条宽度时,刻度粗细为系统默认粗细。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md index 2e0a2af3022c4824338731a4ee1c05c25716b970..1f1038d5d03cea38ae18d0dd9f701a4a6d1aa9dd 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -74,15 +74,15 @@ caretPosition(value: number): void @Entry @Component struct SearchExample { - @State changevalue: string = '' - @State submitvalue: string = '' + @State changeValue: string = '' + @State submitValue: string = '' controller: SearchController = new SearchController() build() { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text(this.submitvalue) - Text(this.changevalue) - Search({value: this.changevalue, placeholder: 'Type to search', controller: this.controller}) + Text(this.submitValue) + Text(this.changeValue) + Search({value: this.changeValue, placeholder: 'Type to search', controller: this.controller}) .searchButton('Search') .width(400) .height(35) @@ -90,10 +90,10 @@ struct SearchExample { .placeholderColor(Color.Grey) .placeholderFont({ size: 26, weight: 10, family: 'serif', style: FontStyle.Normal }) .onSubmit((value: string) => { - this.submitvalue = value + this.submitValue = value }) .onChange((value: string) => { - this.changevalue += value + this.changeValue = value }) .margin({ top: 30, left:10, right:10 }) } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md index 07f253b0b2fb15b3b8f53d5d868ec7b0efc9be28..6a725256acbcf522cc04af70fd41c790bb1bdd3d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md @@ -19,13 +19,13 @@ ## 接口 -Span(value: string | Resource) +Span(content: string | Resource) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------- | ------------------ | ---- | ------ | ---------- | -| content | string \| Resource | 是 | - | 文本内容。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------- | ---------------------------------------- | ---- | ------ | ---------- | +| content | string\|[Resource](ts-types.md#resource) | 是 | - | 文本内容。 | ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md index f8dc80acbd6ee51f41dd24653c1beeeb1aaaa07d..46310bdef3e2a623b58deda098c1273d814f17e5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md @@ -23,9 +23,9 @@ Text(content?: string | Resource) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------- | ------------------ | ---- | ------ | ------------------------------------------------------------ | -| content | string \| Resource | 否 | '' | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------- | ------------------------------------------ | ---- | ------ | ------------------------------------------------------------ | +| content | string \| [Resource](ts-types.md#resource) | 否 | '' | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。 | ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index d94f69a697b4939ce4e1a466c2b5e7ded2df9fb8..4b762cda550d778132eeb398752b8d0b5fe8a03e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -42,7 +42,6 @@ TextInput(value?:{placeholder?: [ResourceStr](ts-types.md#resourcestr8), text?: | caretColor | [ResourceColor](ts-types.md#resourcecolor8) | - | 设置输入框光标颜色。 | | maxLength | number | - | 设置文本的最大输入字符数。 | | inputFilter8+ | {
value: [ResourceStr](ts-types.md#resourcestr8)8+,
error?: (value: string) => void
} | - | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | -| showPasswordIcon9+ | boolean | true | 密码输入模式时,密码框末尾的图标是否显示。 | ## EnterKeyType枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md index 22b04a4777bd6c1013f56f734e3780208482f562..7ec01cd1c95acabd638e8f78acef211df9a65aee 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md @@ -1,10 +1,10 @@ # XComponent - 可用于EGL/OpenGLES和媒体数据写入,并显示在XComponent组件。 + > **说明:** - > **说明:** - > - > 该组件从API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + > 该组件从API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + 可用于EGL/OpenGLES和媒体数据写入,并显示在XComponent组件。 ## 权限列表 @@ -16,23 +16,36 @@ ## 接口 - XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController}) + XComponent\(value: {id: string, type: string, libraryname?: string, controller?: XComponentController}\) -**参数:** +**参数:** -| 名称 | 参数类型 | 必填 | 描述 | -| ----------- | --------------------------------------------- | ---- | ------------------------------------------------------------ | -| id | string | 是 | 组件的唯一标识,支持最大的字符串长度128。 | -| type | string | 是 | 用于指定XComponent组件类型,可选值为:
-surface:组件内容单独送显,直接合成到屏幕。
-component:组件内容与其他组件合成后统一送显。 | -| libraryname | string | 否 | 应用Native层编译输出动态库名称。 | -| controller | [XComponentController](#xcomponentcontroller) | 否 | 给组件绑定一个控制器,通过控制器调用组件方法。 | +| 参数名 | 参数类型 | 必填 | 描述 | +| --------- | ------ | ---- | ----- | +| id | string | 是 | 组件的唯一标识,支持最大的字符串长度128。 | +| type | string | 是 | 用于指定XComponent组件类型,可选值为:
-surface:组件内容单独送显,直接合成到屏幕。
-component:组件内容与其他组件合成后统一送显。 | +| libraryname | string | 否 | 应用Native层编译输出动态库名称。 | +| controller | [XComponentcontroller](#xcomponentcontroller) | 否 | 给组件绑定一个控制器,通过控制器调用组件方法。 | ## 事件 -| 名称 | 功能描述 | -| -------------------------------- | ------------ | -| onLoad(callback: (event?: object) => void) | 插件加载完成时回调事件, 返回值object即为XComponent实例对象的context。 | -| onDestroy(event: () => void) | 插件卸载完成时回调事件。 | +### onLoad + +onLoad(callback: (event?: object) => void ) + +插件加载完成时回调事件。 + +**参数:** + +| 参数名 | 参数类型 | 必填 | 描述 | +| ------------- | ------ | ---- | ----------------------- | +| event | object | 否 | 获取XComponent实例对象的context,context上挂载的方法由开发者在c++层定义。 | + +### onDestroy + +onDestroy(event: () => void ) + +插件卸载完成时回调事件。 ## XComponentController @@ -50,7 +63,9 @@ getXComponentSurfaceId(): string 获取XComponent对应Surface的ID,供@ohos接口使用,比如camera相关接口。 -**返回值:** +**系统接口:** 此接口为系统接口。 + +**返回值:** | 类型 | 描述 | | ------ | ----------------------- | @@ -62,12 +77,14 @@ setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number}): 设置XComponent持有Surface的宽度和高度。 -**参数:** +**系统接口:** 此接口为系统接口。 -| 参数名 | 参数类型 | 必填 | 默认值 | 描述 | -| ------------- | ------ | ---- | ---- | ----------------------- | -| surfaceWidth | number | 是 | - | XComponent持有Surface的宽度。 | -| surfaceHeight | number | 是 | - | XComponent持有Surface的高度。 | +**参数:** + +| 参数名 | 参数类型 | 必填 | 描述 | +| ------------- | ------ | ---- | ----------------------- | +| surfaceWidth | number | 是 | XComponent持有Surface的宽度。 | +| surfaceHeight | number | 是 | XComponent持有Surface的高度。 | ### getXComponentContext @@ -75,7 +92,7 @@ getXComponentContext(): Object 获取XComponent实例对象的context。 -**返回值:** +**返回值:** | 类型 | 描述 | | ------ | ---------------------------------------- | @@ -87,6 +104,7 @@ getXComponentContext(): Object 示例效果请以真机运行为准,当前IDE预览器不支持。 ```ts +// xxx.ets import camera from '@ohos.multimedia.camera'; @Entry @Component @@ -114,4 +132,4 @@ struct PreviewArea { .position({x: 0, y: 48}) } } -``` \ No newline at end of file +``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md index 9f11de083b79f5efd32d63dbf939119e6994e5e2..c1dce5fd99edd0a7f2a89e2564f76814039eddb1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md @@ -85,7 +85,7 @@ destroy(name: string): void path: this.animatePath, }) }) - + // @ts-ignore Animator('__lottie_ets') // declare Animator('__lottie_ets') when use lottie Button('load animation') .onClick(() => { diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md index dce05090891618aca6d9c19e1130700d869a26da..6452dfd07a1fbc8e6cfd8661fddba16d195e2c5e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md @@ -40,8 +40,10 @@ AlphabetIndexer(value: {arrayValue: Array<string>, selected: number}) | selectedFont | [Font](ts-types.md#font) | 设置选中项文字样式。 | | popupFont | [Font](ts-types.md#font) | 设置提示弹窗字体样式。 | | font | [Font](ts-types.md#font) | 设置字母索引条默认字体样式。 | -| itemSize | Length | 设置字母索引条字母区域大小,字母区域为正方形,即正方形边长。 | +| itemSize | string \| number | 设置字母索引条字母区域大小,字母区域为正方形,即正方形边长。 | | alignStyle | IndexerAlign | 设置提示弹窗的弹出位置。 | +| selected | number | 设置选中项索引值。 | +| popupPosition | {
x?:[Length](ts-types.md#length)
y?:[Length](ts-types.md#length)
} | 设置弹出窗口相对于索引器条上边框中点的位置。 | ## IndexerAlign枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md index 74c3addbc6da5294890faa601c3e53c5ba523aa4..470174aa5ab238c276262623e3375f1a3805ea81 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md @@ -19,13 +19,13 @@ ## 接口 -Column(value?:{space?: Length}) +Column(value?:{space?: string | number}) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ----- | ------ | ---- | ---- | --------- | -| space | Length | 否 | 0 | 纵向布局元素间距。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | -------------- | ---- | ------ | ------------------ | +| space | string\|number | 否 | 0 | 纵向布局元素间距。 | ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md index 80cb4fc94288a1754092e241bb2771259e676194..c282a22d3746b08dc37ef2db7ba104bf46488a69 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md @@ -37,8 +37,8 @@ Grid(scroller?: Scroller) | columnsGap | Length | 0 | 用于设置列与列的间距。 | | rowsGap | Length | 0 | 用于设置行与行的间距。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 | -| scrollBarColor | string \| number \| Color | - | 设置滚动条的颜色。 | -| scrollBarWidth | Length | - | 设置滚动条的宽度。 | +| scrollBarColor | string \| number \| [Color](ts-appendix-enums.md#color) | - | 设置滚动条的颜色。 | +| scrollBarWidth | string \| number | - | 设置滚动条的宽度。 | | cachedCount | number | 1 | 设置预加载的GridItem的数量。 | | editMode 8+ | boolean | flase | 是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部[GridItem](ts-container-griditem.md)。 | | layoutDirection8+ | GridDirection | GridDirection.Row | 设置布局的主轴方向。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcontainer.md index 51e10bb92756b345c0ca2cce102d25ac78229935..00ff348764438a53dd2057d43542017f86300d92 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcontainer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcontainer.md @@ -19,16 +19,16 @@ ## 接口 -GridContainer(options?: { columns?: number | 'auto', sizeType?: SizeType, gutter?: Length, margin?: Length}) +GridContainer(options?: { columns?: number | auto, sizeType?: SizeType, gutter?: string|number, margin?: string|number}) **参数:** -| 参数名 | 类型 | 必填 | 默认值 | 说明 | -| -------- | -------------------------- | ---- | ------------- | ---------- | -| columns | number \| 'auto' | 否 | 'auto' | 设置当前布局总列数。 | -| sizeType | SizeType | 否 | SizeType.Auto | 选用设备宽度类型。 | -| gutter | Length | 否 | - | 栅格布局列间距。 | -| margin | Length | 否 | - | 栅格布局两侧间距。 | +| 参数名 | 类型 | 必填 | 默认值 | 说明 | +| -------- | ------------------------ | ---- | ------------- | -------------------- | +| columns | number \| auto | 否 | auto | 设置当前布局总列数。 | +| sizeType | SizeType | 否 | SizeType.Auto | 选用设备宽度类型。 | +| gutter | Length | 否 | - | 栅格布局列间距。 | +| margin | Length | 否 | - | 栅格布局两侧间距。 | ## SizeType枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md index c1ce2af6874226ccfc67db86269946cf3640546b..94a2f6d117a45bdcd7ba1eb13a1bdd5709435c45 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md @@ -21,13 +21,13 @@ ## 接口 -List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}) +List(value?:{space?: number | string, initialIndex?: number, scroller?: Scroller}) **参数:** | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | ------------ | ------ | ---- | ---- | ---------------------------------------- | -| space | Length | 否 | 0 | 列表项间距。 | +| space | number \| string | 否 | 0 | 列表项间距。 | | initialIndex | number | 否 | 0 | 设置当前List初次加载时视口起始位置显示的item,即显示第一个item,如设置的序号超过了最后一个item的序号,则设置不生效。 | | scroller | [Scroller](ts-container-scroll.md#scroller) | 否 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 | @@ -36,14 +36,13 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} | 名称 | 参数类型 | 默认值 | 描述 | | ---------------------------- | ---------------------------------------- | ----------------- | ---------------------------------------- | | listDirection | [Axis](ts-appendix-enums.md#axis) | Vertical | 设置List组件排列方向参照Axis枚举说明。 | -| divider | {
strokeWidth: Length,
color?:[ResourceColor](ts-types.md#resourcecolor8),
startMargin?: Length,
endMargin?: Length
} | - | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 | +| divider | {
strokeWidth: [Length](ts-types.md#length),
color?: [ResourceColor](ts-types.md#resourcecolor8),
startMargin?: [Length](ts-types.md#length),
endMargin?: [Length](ts-types.md#length)
} \| null | - | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 | | cachedCount | number | 1 | 设置预加载的ListItem的数量。 | | editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 | | edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | | chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:list内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。
- false:不启用链式联动。
- true:启用链式联动。 | | multiSelectable8+ | boolean | false | 是否开启鼠标框选。
- false:关闭框选。
- true:开启框选。 | -| restoreId8+ | number | - | 组件迁移标识符,标识后的组件在应用迁移时,组件状态会被迁移到被拉起方的同标识组件。
列表组件状态,包括起始位置显示的item序号。 | ## 事件 @@ -57,7 +56,7 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} | onReachEnd(event: () => void) | 列表到底末尾位置时触发。 | | onScrollStop(event: () => void) | 列表滑动停止时触发。 | | onItemMove(event: (from: number, to: number) => boolean) | 列表元素发生移动时触发,返回值from、to分别为移动前索引值与移动后索引值。 | -| onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => (() => any) \| void) | 开始拖拽列表元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为被拖拽列表元素索引值。 | +| onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => ((() => any) \| void)) | 开始拖拽列表元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为被拖拽列表元素索引值。 | | onItemDragEnter(event: (event: ItemDragInfo) => void) | 拖拽进入列表元素范围内时触发,返回值event见ItemDragInfo对象说明。 | | onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | 拖拽在列表元素范围内移动时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽起始位置,insertIndex为拖拽插入位置。 | | onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void) | 拖拽离开列表元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽离开的列表元素索引值。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md index 96be40af5f4645e3d342f29bfe8fbe579b9b98ac..6700b91a38f36c1fb9b35c9916159c369450bb15 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md @@ -40,10 +40,10 @@ Navigator(value?: {target: string, type?: NavigationType}) ## 属性 -| 名称 | 参数 | 默认值 | 描述 | -| ------ | ------- | --------- | ---------------------------------------- | -| active | boolean | - | 当前路由组件是否处于激活状态,处于激活状态时,会生效相应的路由操作。 | -| params | Object | undefined | 跳转时要同时传递到目标页面的数据,可在目标页面使用router.getParams()获得。 | +| 名称 | 参数 | 默认值 | 描述 | +| ------ | ------- | --------- | ------------------------------------------------------------ | +| active | boolean | - | 当前路由组件是否处于激活状态,处于激活状态时,会生效相应的路由操作。 | +| params | object | undefined | 跳转时要同时传递到目标页面的数据,可在目标页面使用router.getParams()获得。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md index a579806a93ba9daa1154e7ec8e948373a2b9593a..a1e509d4738e0728db0f78553793a2210fa59e10 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md @@ -19,7 +19,7 @@ ## 接口 -Panel(value:{show:boolean}) +Panel(show:boolean) **参数:** @@ -29,14 +29,14 @@ Panel(value:{show:boolean}) ## 属性 -| 名称 | 参数类型 | 默认值 | 描述 | -| ---------- | --------- | ------------------ | ---------------------------------- | -| type | PanelType | PanelType.Foldable | 设置可滑动面板的类型。 | -| mode | PanelMode | - | 设置可滑动面板的初始状态。 | -| dragBar | boolean | true | 设置是否存在dragbar,true表示存在,false表示不存在。 | -| fullHeight | Length | - | 指定PanelMode.Full状态下的高度。 | -| halfHeight | Length | - | 指定PanelMode.Half状态下的高度,默认为屏幕尺寸的一半。 | -| miniHeight | Length | - | 指定PanelMode.Mini状态下的高度。 | +| 名称 | 参数类型 | 默认值 | 描述 | +| ---------- | -------------- | ------------------ | ------------------------------------------------------ | +| type | PanelType | PanelType.Foldable | 设置可滑动面板的类型。 | +| mode | PanelMode | - | 设置可滑动面板的初始状态。 | +| dragBar | boolean | true | 设置是否存在dragbar,true表示存在,false表示不存在。 | +| fullHeight | number\|string | - | 指定PanelMode.Full状态下的高度。 | +| halfHeight | number\|string | - | 指定PanelMode.Half状态下的高度,默认为屏幕尺寸的一半。 | +| miniHeight | number\|string | - | 指定PanelMode.Mini状态下的高度。 | ## PanelType枚举说明 @@ -56,9 +56,9 @@ Panel(value:{show:boolean}) ## 事件 -| 名称 | 功能描述 | -| ---------------------------------------- | ---------------------------------------- | -| onChange(callback: (width: number, height: number, mode: PanelMode) => void) | 当可滑动面板发生状态变化时触发, 返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。 | +| 名称 | 功能描述 | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| onChange(event: (width: number, height: number, mode: PanelMode) => void) | 当可滑动面板发生状态变化时触发, 返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md index 7f10e7980fc3da996395e6b8abf01145775258ee..de86851e93ce7a5151f28aeebd706788c6af0442 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md @@ -23,9 +23,9 @@ Row(value?:{space?: string | number}) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ----- | ------ | ---- | ---- | --------- | -| space | Length | 否 | 0 | 横向布局元素间距。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | -------------------------- | ---- | ------ | ------------------ | +| space | string \| number | 否 | 0 | 横向布局元素间距。 | ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md index 3bc7c038e51279b044dedbb0482147e8c7ba4e65..1c2783baafe653a7112d6181477174ab8946340d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md @@ -30,8 +30,8 @@ Scroll(scroller?: Scroller) | scrollable | ScrollDirection | ScrollDirection.Vertical | 设置滚动方法。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 | | scrollBarColor | string \| number \| Color | - | 设置滚动条的颜色。 | -| scrollBarWidth | number \| string | - | 设置滚动条的宽度。 | -| edgeEffect | EdgeEffect | EdgeEffect.Spring | 设置滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | +| scrollBarWidth | string \| number | - | 设置滚动条的宽度。 | +| edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 设置滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | ## ScrollDirection枚举说明 @@ -42,14 +42,6 @@ Scroll(scroller?: Scroller) | None | 不可滚动。 | | Free | 支持竖直或水平方向滚动。 | -## EdgeEffect枚举说明 - -| 名称 | 描述 | -| ------ | ---------------------------------------- | -| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 | -| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 | -| None | 滑动到边缘后无效果。 | - ## 事件 | 名称 | 功能描述 | @@ -79,31 +71,19 @@ scrollTo(value: { xOffset: number | string, yOffset: number | string, animation? **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| --------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- | -| xOffset | Length | 是 | - | 水平滑动偏移。 | -| yOffset | Length | 是 | - | 竖直滑动偏移。 | -| animation | {
duration: number,
curve: [Curve](ts-animatorproperty.md) \|
CubicBezier \|
SpringCurve
} | 否 | | 动画配置:
- duration: 滚动时长设置。
- curve: 滚动曲线设置。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| --------- | ------------------------------------------------------------ | ---- | ------ | ------------------------------------------------------------ | +| xOffset | number \| string | 是 | - | 水平滑动偏移。 | +| yOffset | number \| string | 是 | - | 竖直滑动偏移。 | +| animation | {
duration: number,
curve: [Curve](ts-animatorproperty.md) 
} | 否 | | 动画配置:
- duration: 滚动时长设置。
- curve: 滚动曲线设置。 | ### scrollEdge -scrollEdge(value: Edge): void +scrollEdge(value: [Edge](ts-appendix-enums.md#edge)): void 滚动到容器边缘。 -## Edge枚举说明 - -| 名称 | 描述 | -| ----- | ---- | -| Top | 竖直方向上边缘 | -| Center | 竖直方向居中位置 | -| Bottom | 竖直方向下边缘 | -| Baseline | 交叉轴方向文本基线位置 | -| Start | 水平方向起始位置 | -| Middle | 水平方向居中位置 | -| End | 水平方向末尾位置 | - ### scrollPage scrollPage(value: { next: boolean, direction?: Axis }): void @@ -124,12 +104,6 @@ currentOffset() 返回当前的滚动偏移量。 -**返回值:** - -| 类型 | 描述 | -| ---------------------------------------- | ---------------------------------------- | -| {
xOffset: number,
yOffset: number
} | xOffset: 水平滑动偏移;
yOffset: 竖直滑动偏移。 | - ### scrollToIndex scrollToIndex(value: number): void diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md index 03e67a3e44dd8624f0990c4a5d7588eacac76e1d..8c55742c98609167f7ff9b4276486c86f739961c 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md @@ -59,9 +59,9 @@ SideBarContainer( type?: SideBarContainerType ) ## 事件 -| 名称 | 功能描述 | -| ---------------------------------------- | ---------------------------------------- | -| onChange(callback: (value: boolen) => void) | 当侧边栏的状态在显示和隐藏之间切换时触发回调。

value的true表示显示,false表示隐藏。 | +| 名称 | 功能描述 | +| ------------------------------------- | ------------------------------------------------------------ | +| onChange(callback: boolen) => void | 当侧边栏的状态在显示和隐藏之间切换时触发回调。

true表示显示,false表示隐藏。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md index c3a71457cc689bff1666303aad80609056f56af1..bfb324ba57c6cbf5154220413b05185dcacd4ef9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -1,11 +1,13 @@ # Swiper - 滑动容器,提供切换子组件显示的能力。 > **说明:** > > 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + + ## 权限列表 无 @@ -18,13 +20,14 @@ ## 接口 -Swiper(value: (controller?: SwiperController)) +Swiper(value?:{controller?: SwiperController}) -**参数:** +**参数:** + + | 参数名 | 参数类型 | 必填 | 参数描述 | + | ---------- | ------------------------------------- | ---- | -------------------- | + | controller | [SwiperController](#swipercontroller) | 否 | 给组件绑定一个控制器,用来控制组件翻页。
默认值:null | -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ---------- | ------------------------------------- | ---- | ---- | -------------------- | -| controller | [SwiperController](#swipercontroller) | 否 | null | 给组件绑定一个控制器,用来控制组件翻页。 | ## 属性 @@ -46,45 +49,69 @@ Swiper(value: (controller?: SwiperController)) | displayCount8+ | number \| string | 1 | 设置一页中显示子组件的个数,设置为“auto”时等同于SwiperDisplayMode.AutoLinear的显示效果。 | | effectMode8+ | EdgeEffect | EdgeEffect.Spring | 设置滑动到边缘时的显示效果。 | | curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | Curve.Ease | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。 | -| indicatorStyle8+ | {
left?: Length,
top?: Length,
right?: Length,
bottom?: Length,
size?: Length,
mask?: boolean,
color?: [ResourceColor](ts-types.md#resourcecolor8),
selectedColor?: [ResourceColor](ts-types.md#resourcecolor8)
} | - | 设置indicator样式:
- left: 设置导航点距离Swiper组件左边的距离。
- top: 设置导航点距离Swiper组件顶部的距离。
- right: 设置导航点距离Swiper组件右边的距离。
- bottom: 设置导航点距离Swiper组件底部的距离。
- size: 设置导航点的直径。
- mask: 设置是否显示导航点蒙层样式。
- color: 设置导航点的颜色。
- selectedColor: 设置选中的导航点的颜色。 | +| indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md#resourcecolor8),
selectedColor?: [ResourceColor](ts-types.md#resourcecolor8)
} | - | 设置indicator样式:
- left: 设置导航点距离Swiper组件左边的距离。
- top: 设置导航点距离Swiper组件顶部的距离。
- right: 设置导航点距离Swiper组件右边的距离。
- bottom: 设置导航点距离Swiper组件底部的距离。
- size: 设置导航点的直径。
- mask: 设置是否显示导航点蒙层样式。
- color: 设置导航点的颜色。
- selectedColor: 设置选中的导航点的颜色。 | +## SwiperDisplayMode枚举说明 + + | 名称 | 描述 | + | ----------- | ------------------------------------------ | + | Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。| + | AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。| +## EdgeEffect枚举说明 + + | 名称 | 描述 | + | ------ | ------------------------------------------------------------------------- | + | Spring | 弹性物理动效,滑动到边缘后可以通过触摸事件继续滑动一段距离,松手后回弹。 | + | Fade | 滑动到边缘后,可以通过触摸事件继续滑动一段阴影,松手后阴影回弹。 | + | None | 滑动到边缘后无效果。 | ## SwiperController Swiper容器组件的控制器,可以将此对象绑定至Swiper组件,然后通过它控制翻页。 -| 接口名称 | 功能描述 | -| ------------------- | ------ | -| showNext() | 翻至下一页。 | -| showPrevious() | 翻至上一页。 | -| finishAnimation(callback?: () => void) | 停止Swiper动画。 | +### showNext -## SwiperDisplayMode枚举说明 +showNext(): void -| 名称 | 描述 | -| ------ | ---------------------------------------- | -| Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。 | -| AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。 | +翻至下一页。 -## EdgeEffect枚举说明 +### showPrevious + +showPrevious(): void -| 名称 | 描述 | -| ------ | ---------------------------------------- | -| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 | -| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 | -| None | 滑动到边缘后无效果。 | +翻至上一页。 +### finishAnimation + +finishAnimation(callback?: () => void): void + +停止播放动画。 + +**参数:** + +| 参数名 | 参数类型 | 必填项 | 参数描述 | +| --------- | ---------- | ------ | -------- | +| callback | () => void | 是 | 动画结束的回调。 | ## 事件 -| 名称 | 功能描述 | -| ---------------------------------------- | ------------------ | -| onChange(event: (index: number) => void) | 当前显示的子组件索引变化时触发该事件,返回值为当前显示的子组件的索引值。 | +### onChange + +onChange( index: number) => void + +当前显示的组件索引变化时触发该事件。 + +**参数:** + +| 参数名 | 参数类型 | 必填项 | 参数描述 | +| --------- | ---------- | ------ | -------- | +| index | number | 是 | 当前显示元素的索引。 | ## 示例 -``` +```ts +// xxx.ets class MyDataSource implements IDataSource { private list: number[] = [] private listener: DataChangeListener diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md index d9e8889701cea489448d2aee69c1a3d26d6d5b2d..13ceeecf8af610e54a3e0e67403df739059ebfd6 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md @@ -28,7 +28,7 @@ TabContent() | 名称 | 参数类型 | 默认值 | 描述 | | ------ | ------------------------------------------------------------ | ------ | ------------------------------------------------------------ | -| tabBar | string \| Resource \| {
icon?: string \| Resource,
text?: string \| Resource
}
\| [CustomBuilder](ts-types.md#custombuilder8)8+ | - | 设置TabBar上显示内容。
CustomBuilder: 构造器,内部可以传入组件(API8版本以上适用)。
>  **说明:**
> 如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 | +| tabBar | string \| [Resource](ts-types.md#resource) \| {
icon?: string \| [Resource](ts-types.md#resource),
text?: string \| [Resource](ts-types.md#resource)
}
\| [CustomBuilder](ts-types.md#custombuilder8)8+ | - | 设置TabBar上显示内容。
CustomBuilder: 构造器,内部可以传入组件(API8版本以上适用)。
>  **说明:**
> 如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 | > **说明:** > - TabContent组件不支持设置通用宽度属性,其宽度默认撑满Tabs父组件。 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md index 1db4f4378afc8816facaae96a2606e5b1488a10d..c9883c3e88261d2626e10e20a8f6f44f066d664c 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md @@ -19,21 +19,21 @@ ## 接口 -Circle(options?: {width: Length, height: Length}) +Circle(value?: {width: string | number, height: string | number}) -**options参数:** +**参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------ | ------ | ---- | ---- | ---- | -| width | Length | 是 | - | 宽度。 | -| height | Length | 是 | - | 高度。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | -------------------------- | ---- | ------ | -------- | +| width | string \| number | 是 | - | 宽度。 | +| height | string \| number | 是 | - | 高度。 | ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | -| ------ | ------ | ---- | ---- | --------- | -| width | Length | 0 | 否 | 圆所在矩形的宽度。 | -| height | Length | 0 | 否 | 圆所在矩形的高度。 | +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +| -------- | -------- | ------ | ---- | ------------------ | +| width | Length | 0 | 否 | 圆所在矩形的宽度。 | +| height | Length | 0 | 否 | 圆所在矩形的高度。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md index 36d8040c657a83c3c36a00bdb40ada585d9cbf8f..8bd5b9e6a42a870e5685abb223235498460b73d4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md @@ -20,21 +20,21 @@ ## 接口 -ellipse(options?: {width: Length, height: Length}) +Ellipse(value?: {width: string | number, height: string | number}) -**options参数说明:** +**参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------ | ------ | ---- | ---- | ---- | -| width | Length | 是 | - | 宽度。 | -| height | Length | 是 | - | 高度。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | -------------------------- | ---- | ------ | -------- | +| width | string \| number | 是 | - | 宽度。 | +| height | string \| number | 是 | - | 高度。 | ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | -| ------ | ------ | ---- | ---- | ---------- | -| width | Length | 0 | 否 | 椭圆所在矩形的宽度。 | -| height | Length | 0 | 否 | 椭圆所在矩形的高度。 | +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +| -------- | -------- | ------ | ---- | -------------------- | +| width | Length | 0 | 否 | 椭圆所在矩形的宽度。 | +| height | Length | 0 | 否 | 椭圆所在矩形的高度。 | ## 示例 @@ -46,7 +46,7 @@ ellipse(options?: {width: Length, height: Length}) struct EllipseExample { build() { Flex({ justifyContent: FlexAlign.SpaceAround }) { - // 在一个 150 * 70 的矩形框中绘制一个椭圆 + // 在一个 150 * 80 的矩形框中绘制一个椭圆 Ellipse({ width: 150, height: 80 }) // 在一个 150 * 70 的矩形框中绘制一个椭圆 Ellipse().width(150).height(80) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md index b5f80f172d4d1f459d31b8bec542396a9b506bb5..c7a9f94701a61607503a113b124ecc91c5730443 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md @@ -19,23 +19,23 @@ ## 接口 -Line(options?: {width: Length, height: Length}) +Line(value?: {width: string | number, height: string | number}) -**options参数说明:** +**参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ------ | ------ | ---- | ---- | ---- | -| width | Length | 是 | - | 宽度。 | -| height | Length | 是 | - | 高度。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | -------------------------- | ---- | ------ | -------- | +| width | string \| number | 是 | - | 宽度。 | +| height | string \| number | 是 | - | 高度。 | ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | -| ---------- | ------ | ----------- | ---- | ------------- | -| width | Length | 0 | 否 | 直线所在矩形的宽度。 | -| height | Length | 0 | 否 | 直线所在矩形的高度。 | -| startPoint | Point | [0, 0] | 是 | 直线起点坐标(相对坐标)。 | -| endPoint | Point | [0, 0] | 是 | 直线终点坐标(相对坐标)。 | +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +| ---------- | ------------- | ----------- | ---- | ------------------------ | +| width | Length | 0 | 否 | 直线所在矩形的宽度。 | +| height | Length | 0 | 否 | 直线所在矩形的高度。 | +| startPoint | Array支持在resources下面的video或rawfile文件夹里放置媒体资源。
支持dataability://的路径前缀,用于访问通过Data Ability提供的视频路径,具体路径信息详见[Data Ability说明](../../ability/fa-dataability.md)。 | - | currentProgressRate | number \| PlaybackSpeed8+ | 否 | 1.0 \| PlaybackSpeed.
Speed_Forward_1_00_X | 视频播放倍速。
>  **说明:**
> number取值仅支持:0.75,1.0,1.25,1.75,2.0。
| - | previewUri | string \| PixelMap8+ \| [Resource](ts-types.md#resource) | 否 | - | 预览图片的路径。 | - | controller | [VideoController](#videocontroller) | 否 | - | 控制器。 | +**参数:** +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------- | ------------------------------------------------------------ | +| src | string \| [Resource](ts-types.md#resource) | 否 | - | 视频播放源的路径,支持本地视频路径和网络路径。
支持在resources下面的video或rawfile文件夹里放置媒体资源。
支持dataability://的路径前缀,用于访问通过Data Ability提供的视频路径,具体路径信息详见[Data Ability说明](../../ability/fa-dataability.md)。 | +| currentProgressRate | number \| PlaybackSpeed8+ | 否 | 1.0 \| PlaybackSpeed.
Speed_Forward_1_00_X | 视频播放倍速。
>  **说明:**
> number取值仅支持:0.75,1.0,1.25,1.75,2.0。
| +| previewUri | string \| PixelMap8+ \| [Resource](ts-types.md#resource) | 否 | - | 预览图片的路径。 | +| controller | [VideoController](#videocontroller) | 否 | - | 控制器。 | -- PlaybackSpeed8+类型接口说明 - | 名称 | 描述 | - | -------------------- | --------- | - | Speed_Forward_0_75_X | 0.75倍速播放。 | - | Speed_Forward_1_00_X | 1倍速播放。 | - | Speed_Forward_1_25_X | 1.25倍速播放。 | - | Speed_Forward_1_75_X | 1.75倍速播放。 | - | Speed_Forward_2_00_X | 2倍速播放。 | +## PlaybackSpeed8+类型接口说明 + +| 名称 | 描述 | +| -------------------- | --------- | +| Speed_Forward_0_75_X | 0.75倍速播放。 | +| Speed_Forward_1_00_X | 1倍速播放。 | +| Speed_Forward_1_25_X | 1.25倍速播放。 | +| Speed_Forward_1_75_X | 1.75倍速播放。 | +| Speed_Forward_2_00_X | 2倍速播放。 | ## 属性 @@ -63,15 +64,14 @@ Video(value: VideoOptions) | 名称 | 功能描述 | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| onStart(event: () => void) | 播放时触发该事件。 | -| onPause(event: () => void) | 暂停时触发该事件。 | -| onFinish(event: () => void) | 播放结束时触发该事件。 | -| onError(event:() => void) | 播放失败时触发该事件。 | -| onPrepared(callback:(event?: { time: number }) => void) | 视频准备完成时触发该事件,通过duration可以获取视频时长,单位为秒(s)。 | -| onSeeking(callback:(event?: { time: number }) => void) | 操作进度条过程时上报时间信息,单位为s。 | -| onSeeked(callback:(event?: { time: number }) => void) | 操作进度条完成后,上报播放时间信息,单位为s。 | -| onUpdate(callback:(event?: { time: number }) => void) | 播放进度变化时触发该事件,单位为s,更新时间间隔为250ms。 | -| onFullscreenChange(callback: (event?: { fullscreen: boolean }) => void) | 当视频进入和退出全屏时调用。 | +| onStart(event:() => void) | 播放时触发该事件。 | +| onPause(event:() => void) | 暂停时触发该事件。 | +| onFinish(event:() => void) | 播放结束时触发该事件。 | +| onError(event:() => void) | 播放失败时触发该事件。 | +| onPrepared(callBack:(event?: { duration: number }) => void) | 视频准备完成时触发该事件,通过duration可以获取视频时长,单位为s。
- duration: 视频的时长。 | +| onSeeking(callBack:(event?: { time: number }) => void) | 操作进度条过程时上报时间信息,单位为s。 | +| onSeeked(callBack:(event?: { time: number }) => void) | 操作进度条完成后,上报播放时间信息,单位为s。 | +| onUpdate(callBack:(event?: { time: number }) => void) | 播放进度变化时触发该事件,单位为s,更新时间间隔为250ms。 | ## VideoController @@ -110,10 +110,11 @@ setCurrentTime(value: number) 指定视频播放的进度位置。 -- 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | ----- | ------ | ---- | ---- | --------- | - | value | number | 是 | - | 视频播放进度位置。 | +**参数:** + +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ----- | ------ | ---- | ---- | --------- | +| value | number | 是 | - | 视频播放进度位置。 | ### requestFullscreen @@ -121,10 +122,11 @@ requestFullscreen(value: boolean) 请求全屏播放。 -- 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | ----- | ------ | ---- | ----- | ------- | - | value | number | 是 | false | 是否全屏播放。 | +**参数:** + +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ----- | ------ | ---- | ----- | ------- | +| value | number | 是 | false | 是否全屏播放。 | ### exitFullscreen @@ -138,19 +140,21 @@ setCurrentTime(value: number, seekMode: SeekMode) 指定视频播放的进度位置,并指定跳转模式。 -- 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | ---- | ---- | --------- | - | value | number | 是 | - | 视频播放进度位置。 | - | seekMode | SeekMode | 是 | - | 跳转模式。 | - -- SeekMode8+类型接口说明 - | 名称 | 描述 | - | ---------------- | -------------- | - | PreviousKeyframe | 跳转到前一个最近的关键帧。 | - | NextKeyframe | 跳转到后一个最近的关键帧。 | - | ClosestKeyframe | 跳转到最近的关键帧。 | - | Accurate | 精准跳转,不论是否为关键帧。 | +**参数:** + +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| -------- | -------- | ---- | ---- | --------- | +| value | number | 是 | - | 视频播放进度位置。 | +| seekMode | SeekMode | 是 | - | 跳转模式。 | + +## SeekMode8+类型接口说明 + +| 名称 | 描述 | +| ---------------- | -------------- | +| PreviousKeyframe | 跳转到前一个最近的关键帧。 | +| NextKeyframe | 跳转到后一个最近的关键帧。 | +| ClosestKeyframe | 跳转到最近的关键帧。 | +| Accurate | 精准跳转,不论是否为关键帧。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md index 47141fdcea02499ed47fd6ad052d96a899beed2b..b4a8cfc32754fd588c6cdff63295191632578be0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md @@ -14,7 +14,7 @@ ## ActionSheet.show -show(options: { paramObject1}) +show(value?: {  title?: string | Resource,message?: string | Resource,confirm?:{value: string | Resource,action:() => void},cancel?:()=>void,sheets?:Arrayvalue: string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容和点击回调。
value:按钮文本内容。
action: 按钮选中时的回调。 | | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length,
dy: Length
} | 否 | {
dx: 0,
dy: 0
} | 弹窗相对alignment所在位置的偏移量。 | + | offset | {
dx: number \| string \| [Resource](ts-types.md#resource),
dy: number \| string \| [Resource](ts-types.md#resource)
} | 否 | {
dx: 0,
dy: 0
} | 弹窗相对alignment所在位置的偏移量。 | | sheets | Array8+ @@ -149,7 +149,7 @@ | width | Length | 否 | 边框宽度。 | | color | ResourceColor | 否 | 边框颜色。 | | radius | Length | 否 | 边框角度。 | -| style | [BorderStyle](../reference/arkui-ts/ts-appendix-enums.md#borderstyle) | 否 | 边框样式。 | +| style | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 边框样式。 | ## CustomBuilder8+ @@ -157,5 +157,5 @@ | 名称 | 类型定义 | 描述 | | ------------- | ---------------------- | ------------------------------------------------------------ | -| CustomBuilder | () => any | 这种方法类型必须使用@Builder装饰器修饰。具体用法见[@Builder](ts-component-based-builder.md)。 | +| CustomBuilder | () => any | 这种方法类型必须使用@Builder装饰器修饰。具体用法见[@Builder](../../ui/ts-component-based-builder.md)。 | diff --git a/zh-cn/application-dev/security/accesstoken-overview.md b/zh-cn/application-dev/security/accesstoken-overview.md index 9885ce6029ff076b1d590a7d5b3b4dee288839d8..6b989600605acc1210ac1ca580f5b9ed56b91cb2 100644 --- a/zh-cn/application-dev/security/accesstoken-overview.md +++ b/zh-cn/application-dev/security/accesstoken-overview.md @@ -35,7 +35,7 @@ ATM(AccessTokenManager)是OpenHarmony上基于AccessToken构建的统一的 应用使用权限的工作流程如图所示。 -![](figures/permission-workflow.jpg) +![](figures/figure1.png) 1:开发者可以参考下图,判断应用能否申请目标权限。 @@ -67,13 +67,13 @@ ATM(AccessTokenManager)是OpenHarmony上基于AccessToken构建的统一的 如果应用需要将自身的APL等级声明为system_basic及以上的APL等级,在开发应用安装包时,要修改应用的Profile文件。 -在文件"bundle-info"的"apl"字段声明应用的APL等级后,使用[hap包签名工具](hapsigntool-overview.md)生成证书;也可以使用DevEco Studio[自动签名](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-auto-configuring-signature-information-0000001271659465#section161281722111)。 +在文件"bundle-info"的"apl"字段声明应用的APL等级后,使用[hap包签名工具](hapsigntool-guidelines.md)生成证书;也可以使用DevEco Studio[自动签名](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-auto-configuring-signature-information-0000001271659465#section161281722111)。 > **注意:**
直接修改应用Profile文件的方式,仅用于应用/服务调试阶段使用,不可用于发布上架应用市场。如果需要开发商用版本的应用,请在对应的应用市场进行发布证书和Profile文件的申请。 示例如下: -该示例仅涉及修改"apl"字段,其余信息请根据实际情况。Profile文件的字段说明可参考[HarmonyAppProvision配置文件的说明](../quick-start/app-provision-structure.md)。 +该示例仅涉及修改"apl"字段,其余信息请根据实际情况修改。 ```json { @@ -184,7 +184,7 @@ ACL方式的工作流程可以参考[ACL方式使用说明](#acl方式使用说 **ACL申请方式须知** -开发应用安装包时,需要修改应用的Profile文件,在文件的"acl"字段声明目标的访问控制列表。然后使用[hap包签名工具](hapsigntool-overview.md)生成证书。 +开发应用安装包时,需要修改应用的Profile文件,在文件的"acl"字段声明目标的访问控制列表。然后使用[hap包签名工具](hapsigntool-guidelines.md)生成证书。 > **注意:**
直接修改应用Profile文件的方式,仅用于应用/服务调试阶段使用,不可用于发布上架应用市场。如果需要开发商用版本的应用,请在对应的应用市场进行发布证书和Profile文件的申请。 @@ -197,5 +197,3 @@ ACL方式的工作流程可以参考[ACL方式使用说明](#acl方式使用说 }, } ``` - -Profile文件的字段说明可参考[HarmonyAppProvision配置文件的说明](../quick-start/app-provision-structure.md)。 \ No newline at end of file diff --git a/zh-cn/application-dev/security/permission-list.md b/zh-cn/application-dev/security/permission-list.md index f3f5e6bdf1217edcd3f3fc70ada79f10b56a585d..d3fd29b3aadf308fcc044256299539a8b6a25d02 100644 --- a/zh-cn/application-dev/security/permission-list.md +++ b/zh-cn/application-dev/security/permission-list.md @@ -77,7 +77,6 @@ | ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 | | ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 | | ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 | -| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 | | ohos.permission.ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 | | ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 | | ohos.permission.GET_RUNNING_INFO | system_basic | system_grant | TRUE | 允许应用获取运行态信息。 | diff --git a/zh-cn/application-dev/task-management/background-task-dev-guide.md b/zh-cn/application-dev/task-management/background-task-dev-guide.md index 5a0b2fb0c2a557d804f106151d1f432906d60923..63abf1638eea80de283fb1f4d7cc63faad2cd907 100644 --- a/zh-cn/application-dev/task-management/background-task-dev-guide.md +++ b/zh-cn/application-dev/task-management/background-task-dev-guide.md @@ -289,4 +289,4 @@ export default { 基于后台任务管理,有以下相关实例可供参考: -- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) \ No newline at end of file +- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/Readme-CN.md b/zh-cn/application-dev/ui/Readme-CN.md index 8de5fbcdd7d15deba1bc4c0d857c6ff02cf48566..a54003072d7028cca338ddc92c97e72c377bc65e 100755 --- a/zh-cn/application-dev/ui/Readme-CN.md +++ b/zh-cn/application-dev/ui/Readme-CN.md @@ -1,6 +1,76 @@ # UI开发 - [方舟开发框架(ArkUI)概述](arkui-overview.md) +- 基于TS扩展的声明式开发范式 + - [概述](ui-ts-overview.md) + - 框架说明 + - 文件组织 + - [目录结构](ts-framework-directory.md) + - [应用代码文件访问规则](ts-framework-file-access-rules.md) + - [js标签配置](ts-framework-js-tag.md) + - 资源管理 + - [资源文件的分类](ui-ts-basic-resource-file-categories.md) + - [资源访问](ts-resource-access.md) + - [像素单位](ts-pixel-units.md) + - 声明式语法 + - [描述规范使用说明](ts-syntax-intro.md) + - 通用UI描述规范 + - [基本概念](ts-general-ui-concepts.md) + - 声明式UI描述规范 + - [无构造参数配置](ts-parameterless-configuration.md) + - [必选参数构造配置](ts-configuration-with-mandatory-parameters.md) + - [属性配置](ts-attribution-configuration.md) + - [事件配置](ts-event-configuration.md) + - [子组件配置](ts-child-component-configuration.md) + - 组件化 + - [@Component](ts-component-based-component.md) + - [@Entry](ts-component-based-entry.md) + - [@Preview](ts-component-based-preview.md) + - [@Builder](ts-component-based-builder.md) + - [@Extend](ts-component-based-extend.md) + - [@CustomDialog](ts-component-based-customdialog.md) + - [@Styles](ts-component-based-styles.md) + - UI状态管理 + - [基本概念](ts-ui-state-mgmt-concepts.md) + - 管理组件拥有的状态 + - [@State](ts-component-states-state.md) + - [@Prop](ts-component-states-prop.md) + - [@Link](ts-component-states-link.md) + - 管理应用程序的状态 + - [应用程序的数据存储](ts-application-states-appstorage.md) + - [持久化数据管理](ts-application-states-apis-persistentstorage.md) + - [环境变量](ts-application-states-apis-environment.md) + - 其他类目的状态管理 + - [Observed和ObjectLink数据管理](ts-other-states-observed-objectlink.md) + - [@Consume和@Provide数据管理](ts-other-states-consume-provide.md) + - [@Watch](ts-other-states-watch.md) + - 渲染控制语法 + - [条件渲染](ts-rending-control-syntax-if-else.md) + - [循环渲染](ts-rending-control-syntax-foreach.md) + - [数据懒加载](ts-rending-control-syntax-lazyforeach.md) + - 深入理解组件化 + - [build函数](ts-function-build.md) + - [自定义组件初始化](ts-custom-component-initialization.md) + - [自定义组件生命周期回调函数](ts-custom-component-lifecycle-callbacks.md) + - [组件创建和重新初始化示例](ts-component-creation-re-initialization.md) + - [语法糖](ts-syntactic-sugar.md) + - 常见组件开发指导 + - [Button开发指导](ui-ts-basic-components-button.md) + - [Web开发指导](ui-ts-components-web.md) + - 常见布局开发指导 + - [弹性布局](ui-ts-layout-flex.md) + - [栅格布局](ui-ts-layout-grid-container.md) + - [媒体查询](ui-ts-layout-mediaquery.md) + - 体验声明式UI + - [创建声明式UI工程](ui-ts-creating-project.md) + - [初识Component](ui-ts-components.md) + - [创建简单视图](ui-ts-creating-simple-page.md) + - 页面布局与连接 + - [构建食物数据模型](ui-ts-building-data-model.md) + - [构建食物列表List布局](ui-ts-building-category-list-layout.md) + - [构建食物分类Grid布局](ui-ts-building-category-grid-layout.md) + - [页面跳转与数据传递](ui-ts-page-redirection-data-transmission.md) + - [性能提升的推荐方案](ts-performance-improvement-recommendation.md) - 基于JS扩展的类Web开发范式 - [概述](ui-js-overview.md) - 框架说明 @@ -73,73 +143,3 @@ - [动画动效](ui-js-animate-dynamic-effects.md) - [动画帧](ui-js-animate-frame.md) - [自定义组件](ui-js-custom-components.md) -- 基于TS扩展的声明式开发范式 - - [概述](ui-ts-overview.md) - - 框架说明 - - 文件组织 - - [目录结构](ts-framework-directory.md) - - [应用代码文件访问规则](ts-framework-file-access-rules.md) - - [js标签配置](ts-framework-js-tag.md) - - 资源管理 - - [资源文件的分类](ui-ts-basic-resource-file-categories.md) - - [资源访问](ts-resource-access.md) - - [像素单位](ts-pixel-units.md) - - 声明式语法 - - [描述规范使用说明](ts-syntax-intro.md) - - 通用UI描述规范 - - [基本概念](ts-general-ui-concepts.md) - - 声明式UI描述规范 - - [无构造参数配置](ts-parameterless-configuration.md) - - [必选参数构造配置](ts-configuration-with-mandatory-parameters.md) - - [属性配置](ts-attribution-configuration.md) - - [事件配置](ts-event-configuration.md) - - [子组件配置](ts-child-component-configuration.md) - - 组件化 - - [@Component](ts-component-based-component.md) - - [@Entry](ts-component-based-entry.md) - - [@Preview](ts-component-based-preview.md) - - [@Builder](ts-component-based-builder.md) - - [@Extend](ts-component-based-extend.md) - - [@CustomDialog](ts-component-based-customdialog.md) - - [@Styles](ts-component-based-styles.md) - - UI状态管理 - - [基本概念](ts-ui-state-mgmt-concepts.md) - - 管理组件拥有的状态 - - [@State](ts-component-states-state.md) - - [@Prop](ts-component-states-prop.md) - - [@Link](ts-component-states-link.md) - - 管理应用程序的状态 - - [应用程序的数据存储](ts-application-states-appstorage.md) - - [持久化数据管理](ts-application-states-apis-persistentstorage.md) - - [环境变量](ts-application-states-apis-environment.md) - - 其他类目的状态管理 - - [Observed和ObjectLink数据管理](ts-other-states-observed-objectlink.md) - - [@Consume和@Provide数据管理](ts-other-states-consume-provide.md) - - [@Watch](ts-other-states-watch.md) - - 渲染控制语法 - - [条件渲染](ts-rending-control-syntax-if-else.md) - - [循环渲染](ts-rending-control-syntax-foreach.md) - - [数据懒加载](ts-rending-control-syntax-lazyforeach.md) - - 深入理解组件化 - - [build函数](ts-function-build.md) - - [自定义组件初始化](ts-custom-component-initialization.md) - - [自定义组件生命周期回调函数](ts-custom-component-lifecycle-callbacks.md) - - [组件创建和重新初始化示例](ts-component-creation-re-initialization.md) - - [语法糖](ts-syntactic-sugar.md) - - 常见组件开发指导 - - [Button开发指导](ui-ts-basic-components-button.md) - - [Web开发指导](ui-ts-components-web.md) - - 常见布局开发指导 - - [弹性布局](ui-ts-layout-flex.md) - - [栅格布局](ui-ts-layout-grid-container.md) - - [媒体查询](ui-ts-layout-mediaquery.md) - - 体验声明式UI - - [创建声明式UI工程](ui-ts-creating-project.md) - - [初识Component](ui-ts-components.md) - - [创建简单视图](ui-ts-creating-simple-page.md) - - 页面布局与连接 - - [构建食物数据模型](ui-ts-building-data-model.md) - - [构建食物列表List布局](ui-ts-building-category-list-layout.md) - - [构建食物分类Grid布局](ui-ts-building-category-grid-layout.md) - - [页面跳转与数据传递](ui-ts-page-redirection-data-transmission.md) - - [性能提升的推荐方案](ts-performance-improvement-recommendation.md) diff --git a/zh-cn/application-dev/ui/ts-resource-access.md b/zh-cn/application-dev/ui/ts-resource-access.md index a804d024efad2b63cf011fe54719c50583a8fd7a..15304f092429c2aa0699820e8c7ca2f358e30076 100644 --- a/zh-cn/application-dev/ui/ts-resource-access.md +++ b/zh-cn/application-dev/ui/ts-resource-access.md @@ -11,7 +11,7 @@ > > 资源描述符不能拼接使用,仅支持普通字符串如`'app.type.name'`。 > -> `$r`返回值为Resource对象,可通过[getString](../../reference/apis/js-apis-resource-manager.md#getstring) 方法获取对应的字符串。 +> `$r`返回值为Resource对象,可通过[getString](../reference/apis/js-apis-resource-manager.md#getstring) 方法获取对应的字符串。 在xxx.ets文件中,可以使用在resources目录中定义的资源。 @@ -151,4 +151,4 @@ plural.json文件的内容如下: 针对访问应用资源,有以下相关实例可供参考: -- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/ResourceManager) +- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/ResourceManager) diff --git a/zh-cn/application-dev/ui/ts-syntactic-sugar.md b/zh-cn/application-dev/ui/ts-syntactic-sugar.md index 92b9df0a8905896b5433cad07d7b2ffa220103b3..ec2ef4563f43d7974737f3c5d2fba86b03f3ee47 100644 --- a/zh-cn/application-dev/ui/ts-syntactic-sugar.md +++ b/zh-cn/application-dev/ui/ts-syntactic-sugar.md @@ -166,3 +166,32 @@ struct bindPopup { } } ``` + + +## 状态变量多种数据类型声明使用限制 + +@State、@Provide、 @Link和@Consume四种状态变量的多种数据类型只能同时由简单数据类型或引用数据类型其中一种构成。 + +示例: + +```ts +@Entry +@Component +struct Index { + //错误写法: @State message: string | Resource = 'Hello World' + @State message: string = 'Hello World' + + build() { + Row() { + Column() { + Text(`${ this.message }`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} +``` + diff --git a/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md b/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md index c293ca9b6a00b0eb11f0fa65220b0041525a450d..6bba68df526e4954da25c42f423248c22c7e73e5 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md +++ b/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md @@ -90,4 +90,4 @@ 针对background-position样式动画开发,有以下相关实例可供参考: -- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsImage) \ No newline at end of file +- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsImage) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-animate-transform.md b/zh-cn/application-dev/ui/ui-js-animate-transform.md index 4c45a884ba119e91bd9cf8fdcab768fd97760ccb..b8b2c2938cffdf4bd8c4b054bab49d28f0e0222e 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-transform.md +++ b/zh-cn/application-dev/ui/ui-js-animate-transform.md @@ -580,13 +580,13 @@ transform可以设置多个值并且多个值可同时设置,下面案例中 针对transform样式动画开发,有以下相关实例可供参考: -- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation) +- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation) -- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimationStyle) +- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimationStyle) -- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/Clock) +- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/Clock) -- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation) +- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation) - [动画样式(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/AnimationDemo) diff --git a/zh-cn/application-dev/ui/ui-js-building-ui-component.md b/zh-cn/application-dev/ui/ui-js-building-ui-component.md index cf63923328412ea24648f56227297cc43d7d552d..c755b700452a88948a4a8189ea58ee3bd852cf59 100755 --- a/zh-cn/application-dev/ui/ui-js-building-ui-component.md +++ b/zh-cn/application-dev/ui/ui-js-building-ui-component.md @@ -25,19 +25,21 @@ 针对组件开发,有以下相关实例可供参考: -- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel) +- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsPanel) -- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Popup) +- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Popup) -- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/RefreshContainer) +- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/RefreshContainer) -- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSComponments) +- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSComponments) -- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsUserRegistration) +- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsUserRegistration) -- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) +- [`ECG`:心率检测(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/ECG) -- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/media/JsVideo) +- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Badge) + +- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/media/JsVideo) - [rating(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/RatingApplication) diff --git a/zh-cn/application-dev/ui/ui-js-building-ui-routes.md b/zh-cn/application-dev/ui/ui-js-building-ui-routes.md index eaa20d1aa8db22928bbd55d19447d71168de6ea6..71645421a2a3c700a841d48914497a1a85167efc 100644 --- a/zh-cn/application-dev/ui/ui-js-building-ui-routes.md +++ b/zh-cn/application-dev/ui/ui-js-building-ui-routes.md @@ -89,4 +89,4 @@ export default { 针对页面路由开发,有以下相关实例可供参考: -- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter) +- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsRouter) diff --git a/zh-cn/application-dev/ui/ui-js-component-tabs.md b/zh-cn/application-dev/ui/ui-js-component-tabs.md index 59421b9fefdaba9363a61368da04b71cc6821446..a048cb8911d454fbed5b4d3020de818370362f8d 100644 --- a/zh-cn/application-dev/ui/ui-js-component-tabs.md +++ b/zh-cn/application-dev/ui/ui-js-component-tabs.md @@ -314,4 +314,4 @@ export default { 针对Tabs开发,有以下相关实例可供参考: -- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Tabs) \ No newline at end of file +- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Tabs) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-canvas.md b/zh-cn/application-dev/ui/ui-js-components-canvas.md index 5eb3b7ac4d5cf0051ad0db76c87755992abe339a..cb2c9cc2fc8017cc06be470d428c9cfbdce42970 100644 --- a/zh-cn/application-dev/ui/ui-js-components-canvas.md +++ b/zh-cn/application-dev/ui/ui-js-components-canvas.md @@ -144,4 +144,4 @@ export default { 针对Canvas开发,有以下相关实例可供参考: -- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas) +- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsCanvas) diff --git a/zh-cn/application-dev/ui/ui-js-components-chart.md b/zh-cn/application-dev/ui/ui-js-components-chart.md index 4b6122184055f72c9d35b58a0c535048c672f064..bf8a67cef32caa9e906a994417badc2247e37fca 100644 --- a/zh-cn/application-dev/ui/ui-js-components-chart.md +++ b/zh-cn/application-dev/ui/ui-js-components-chart.md @@ -619,6 +619,6 @@ export default { 针对Chart开发,有以下相关实例可供参考: -- [`Chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/chart) +- [`Chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/chart) - [chart(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SwitchApplication) diff --git a/zh-cn/application-dev/ui/ui-js-components-dialog.md b/zh-cn/application-dev/ui/ui-js-components-dialog.md index b068911ac4eb7133b9fa352beaf8f1fd1617f79a..780087b8b52a543e46318ab2237ee941265e8fd7 100644 --- a/zh-cn/application-dev/ui/ui-js-components-dialog.md +++ b/zh-cn/application-dev/ui/ui-js-components-dialog.md @@ -325,6 +325,6 @@ export default { 针对Dialog开发,有以下相关实例可供参考: -- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog) +- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsDialog) - [dialog(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/DialogDemo) diff --git a/zh-cn/application-dev/ui/ui-js-components-grid.md b/zh-cn/application-dev/ui/ui-js-components-grid.md index e17190343be5be83ce9093b5442358748db529d4..8444150dcd559dee40757a28928039c23c65ffbf 100644 --- a/zh-cn/application-dev/ui/ui-js-components-grid.md +++ b/zh-cn/application-dev/ui/ui-js-components-grid.md @@ -248,4 +248,4 @@ export default { 针对Grid开发,有以下相关实例可供参考: -- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid) +- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGrid) diff --git a/zh-cn/application-dev/ui/ui-js-components-list.md b/zh-cn/application-dev/ui/ui-js-components-list.md index 858e7ce407f85079702f317a2d7af9d4f6ee5085..f898b675dcf96416691f25d151a54b7006a47b10 100644 --- a/zh-cn/application-dev/ui/ui-js-components-list.md +++ b/zh-cn/application-dev/ui/ui-js-components-list.md @@ -314,4 +314,4 @@ export default { 针对List开发,有以下相关实例可供参考: -- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsList) \ No newline at end of file +- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsList) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-menu.md b/zh-cn/application-dev/ui/ui-js-components-menu.md index 3192194e488b11e7d2c179fa9c29100d4b7a9d44..0edb74d01338bbeb8fd8bfd9d4c5db4efe3d1b9b 100644 --- a/zh-cn/application-dev/ui/ui-js-components-menu.md +++ b/zh-cn/application-dev/ui/ui-js-components-menu.md @@ -283,4 +283,4 @@ export default { 针对Menu开发,有以下相关实例可供参考: -- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSMenu) +- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSMenu) diff --git a/zh-cn/application-dev/ui/ui-js-components-picker.md b/zh-cn/application-dev/ui/ui-js-components-picker.md index eea53de79480a2ed54a58a4fdcb20dc3d5be06e4..d9b41d2a7d2ebc85836ad8d9e3518bc47cc11240 100644 --- a/zh-cn/application-dev/ui/ui-js-components-picker.md +++ b/zh-cn/application-dev/ui/ui-js-components-picker.md @@ -301,4 +301,4 @@ export default { 针对Picker开发,有以下相关实例可供参考: -- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Picker) +- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Picker) diff --git a/zh-cn/application-dev/ui/ui-js-components-slider.md b/zh-cn/application-dev/ui/ui-js-components-slider.md index 24c1bf161971a3cb35c07a40d4263c13d2993773..1f894d50077f6dde211cf680709430ed3c81fdb9 100644 --- a/zh-cn/application-dev/ui/ui-js-components-slider.md +++ b/zh-cn/application-dev/ui/ui-js-components-slider.md @@ -217,6 +217,6 @@ export default{ 针对Slider开发,有以下相关实例可供参考: -- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Slider) +- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Slider) - [slider(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SliderApplication) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-stepper.md b/zh-cn/application-dev/ui/ui-js-components-stepper.md index 0c3489679485b33cd3f54c5a274cc9dda4b1479a..8762c6438765646e9cb3988725dc369b9bcf57ac 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -407,4 +407,4 @@ export default { 针对Stepper开发,有以下相关实例可供参考: -- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/StepNavigator) +- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/StepNavigator) diff --git a/zh-cn/application-dev/ui/ui-js-components-svg-overview.md b/zh-cn/application-dev/ui/ui-js-components-svg-overview.md index 1855fa80f88923e1ae17be6564183077f50f9911..71b8b97b2b37eac212034e32c2e05a00e53ee7ba 100644 --- a/zh-cn/application-dev/ui/ui-js-components-svg-overview.md +++ b/zh-cn/application-dev/ui/ui-js-components-svg-overview.md @@ -84,4 +84,4 @@ svg{ 针对Svg开发,有以下相关实例可供参考: -- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg) +- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsSvg) diff --git a/zh-cn/application-dev/ui/ui-js-components-swiper.md b/zh-cn/application-dev/ui/ui-js-components-swiper.md index 3517c637a60e4adff5a982b544bc463e39825252..a67ce65389c616550be1e165d7dd61c91ea224a6 100644 --- a/zh-cn/application-dev/ui/ui-js-components-swiper.md +++ b/zh-cn/application-dev/ui/ui-js-components-swiper.md @@ -369,4 +369,4 @@ export default { 针对Swiper开发,有以下相关实例可供参考: -- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Swiper) +- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Swiper) diff --git a/zh-cn/application-dev/ui/ui-js-components-text.md b/zh-cn/application-dev/ui/ui-js-components-text.md index 091d3507356076328dad2794aa539135ed324d40..cb4debaee43b9ad028c63c9ce2c2162b363d705e 100644 --- a/zh-cn/application-dev/ui/ui-js-components-text.md +++ b/zh-cn/application-dev/ui/ui-js-components-text.md @@ -276,4 +276,4 @@ export default { 针对Text开发,有以下相关实例可供参考: -- [`JsTextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsBasicComponents) +- [`JsTextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsBasicComponents) diff --git a/zh-cn/application-dev/ui/ui-js-components-toolbar.md b/zh-cn/application-dev/ui/ui-js-components-toolbar.md index 6d71893d1d35313aae2528622eb4694d96cbf889..37bc0b9e1fb5589aa1df3b160b82a87212dcd971 100644 --- a/zh-cn/application-dev/ui/ui-js-components-toolbar.md +++ b/zh-cn/application-dev/ui/ui-js-components-toolbar.md @@ -235,4 +235,5 @@ export default { 针对Toolbar开发,有以下相关实例可供参考: -- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Toolbar) +- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/applications_app_samples +/tree/master/UI/Toolbar) diff --git a/zh-cn/application-dev/ui/ui-js-custom-components.md b/zh-cn/application-dev/ui/ui-js-custom-components.md index 829dff91ed9646fd49061091fc7b790cc9aeff58..7e520b1aee36ebdae7fb840c87e685937e191366 100755 --- a/zh-cn/application-dev/ui/ui-js-custom-components.md +++ b/zh-cn/application-dev/ui/ui-js-custom-components.md @@ -103,6 +103,6 @@ 针对自定义组件开发,有以下相关实例可供参考: -- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSUICustomComponent) +- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSUICustomComponent) - [自定义组件(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/JSCanvasComponet) diff --git a/zh-cn/application-dev/ui/ui-js-overview.md b/zh-cn/application-dev/ui/ui-js-overview.md index 22adf599ad38ff406b93ffc1c8678760c607c059..89be29a238b9521c61b8bda3b12d855f3c3ca4da 100755 --- a/zh-cn/application-dev/ui/ui-js-overview.md +++ b/zh-cn/application-dev/ui/ui-js-overview.md @@ -34,20 +34,22 @@ 基于JS扩展的类Web开发范式的方舟开发框架,有以下相关实例可供参考: -- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/AtomicLayout) +- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/AtomicLayout) -- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsFA) +- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsFA) -- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsShopping) +- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsShopping) -- [`Stack`:堆叠容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Stack) +- [`Stack`:堆叠容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Stack) -- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalList) +- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalList) -- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalPage) +- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalPage) -- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGallery) +- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGallery) -- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) +- [`AirQuality`:空气质量(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/AirQuality) + +- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Badge) - [购物应用(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/ShoppingOpenHarmony) diff --git a/zh-cn/application-dev/ui/ui-ts-building-data-model.md b/zh-cn/application-dev/ui/ui-ts-building-data-model.md index 4043e160d484f6d3f3586348e7779b4bc6bc87bb..42eec7a17592f85aa1e10a746c80997f845b96fb 100644 --- a/zh-cn/application-dev/ui/ui-ts-building-data-model.md +++ b/zh-cn/application-dev/ui/ui-ts-building-data-model.md @@ -76,3 +76,7 @@ 已完成好健康饮食应用的数据资源准备,接下来将通过加载这些数据来创建食物列表页面。 + +## 相关实例 +针对构建食物分类列表页面和食物详情页,有以下相关实例可供参考: +- [DefiningPageLayoutAndConnection:页面布局和连接(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/DefiningPageLayoutAndConnection) diff --git a/zh-cn/application-dev/ui/ui-ts-components-web.md b/zh-cn/application-dev/ui/ui-ts-components-web.md index 8d223f77587c83475f2720b8b62d11776af7e507..177880e10b0cf8798394cc1efe5a8120aac88d78 100644 --- a/zh-cn/application-dev/ui/ui-ts-components-web.md +++ b/zh-cn/application-dev/ui/ui-ts-components-web.md @@ -198,4 +198,4 @@ struct WebComponent { 针对Web开发,有以下相关实例可供参考: -- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web) \ No newline at end of file +- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Web) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md index c82d9a23ccdde3e1b7029b954aa4783394c16e0c..8e976dd67cf0ff1769a0057fb32b9fa4ff0472b5 100644 --- a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md +++ b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md @@ -528,6 +528,6 @@ 针对创建简单视图,有以下示例工程可供参考: -- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BuildCommonView) +- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BuildCommonView) 本示例为构建了简单页面展示食物番茄的图片和营养信息,主要为了展示简单页面的Stack布局和Flex布局。 diff --git a/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md b/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md index a3c6a88db472a4450dcd933fccf1296701d83bfa..ec103e4e07a3e4e52cd9e2de53f066a321cf2137 100644 --- a/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md +++ b/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md @@ -152,5 +152,5 @@ listener.on('change', onPortrait) 针对媒体查询开发,有以下相关实例可供参考: -- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MediaQuery) +- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MediaQuery) diff --git a/zh-cn/application-dev/ui/ui-ts-overview.md b/zh-cn/application-dev/ui/ui-ts-overview.md index 9351079d31ed5e8f518e2ca93e456e170199ad8d..5f7780947f8cbd6e014c98897bced69c3b6d5d60 100644 --- a/zh-cn/application-dev/ui/ui-ts-overview.md +++ b/zh-cn/application-dev/ui/ui-ts-overview.md @@ -61,25 +61,25 @@ 基于TS扩展的声明式开发范式的方舟开发框架,有以下相关实例可供参考: -- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Canvas) +- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Canvas) -- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Drag) +- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Drag) -- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/ArkUIAnimation) +- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/ArkUIAnimation) -- [`Xcomponent`:XComponent(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/XComponent) +- [`Xcomponent`:XComponent(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/XComponent) -- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MouseEvent) +- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MouseEvent) -- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Gallery) +- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Gallery) -- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BringApp) +- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BringApp) -- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Chat) +- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Chat) -- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Shopping) +- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Shopping) -- [`Lottie`:Lottie(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Lottie) +- [`Lottie`:Lottie(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Lottie) - [极简声明式UI范式(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) @@ -91,4 +91,4 @@ - [弹窗(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CustomDialogEts) -- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/CustomComponent) \ No newline at end of file +- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/CustomComponent) \ No newline at end of file diff --git a/zh-cn/application-dev/website.md b/zh-cn/application-dev/website.md index 0e4c945f5799f5462eb80f4bf06e05125c5f7682..fa94146cdb2205e4ad926bd93e194f769558abed 100644 --- a/zh-cn/application-dev/website.md +++ b/zh-cn/application-dev/website.md @@ -11,7 +11,6 @@ - 开发基础知识 - [应用包结构说明(FA模型)](quick-start/package-structure.md) - [应用包结构说明(Stage模型)](quick-start/stage-structure.md) - - [资源文件的分类](quick-start/basic-resource-file-categories.md) - [SysCap说明](quick-start/syscap.md) - 开发 - Ability开发 @@ -42,12 +41,10 @@ - [目录结构](ui/ts-framework-directory.md) - [应用代码文件访问规则](ui/ts-framework-file-access-rules.md) - [js标签配置](ui/ts-framework-js-tag.md) - - 资源访问 - - [访问应用资源](ui/ts-application-resource-access.md) - - [访问系统资源](ui/ts-system-resource-access.md) - - [媒体资源类型说明](ui/ts-media-resource-type.md) + - 资源管理 + - [资源文件的分类](ui/ui-ts-basic-resource-file-categories.md) + - [资源访问](ui/ts-resource-access.md) - [像素单位](ui/ts-pixel-units.md) - - [类型定义](ui/ts-types.md) - 声明式语法 - [描述规范使用说明](ui/ts-syntax-intro.md) - 通用UI描述规范 @@ -249,9 +246,9 @@ - 轻量级数据存储 - [轻量级数据存储概述](database/database-storage-overview.md) - [轻量级数据存储开发指导](database/database-storage-guidelines.md) - - 分布式数据对象 - - [分布式数据对象概述](database/database-distributedobject-overview.md) - - [分布式数据对象开发指导](database/database-distributedobject-guidelines.md) + - 分布式数据对象 + - [分布式数据对象概述](database/database-distributedobject-overview.md) + - [分布式数据对象开发指导](database/database-distributedobject-guidelines.md) - 任务管理 - 后台任务 - [后台任务概述](task-management/background-task-overview.md) @@ -446,7 +443,8 @@ - [时间选择弹窗](reference/arkui-ts/ts-methods-timepicker-dialog.md) - [文本选择弹窗](reference/arkui-ts/ts-methods-textpicker-dialog.md) - [菜单](reference/arkui-ts/ts-methods-menu.md) - - [文档中涉及到的内置枚举值](reference/arkui-ts/ts-appendix-enums.md) + - [枚举说明](reference/arkui-ts/ts-appendix-enums.md) + - [类型说明](reference/arkui-ts/ts-types.md) - 组件参考(基于JS扩展的类Web开发范式) - 组件通用信息 - [通用属性](reference/arkui-js/js-components-common-attributes.md) @@ -713,9 +711,9 @@ - 网络管理 - [@ohos.net.connection (网络连接管理)](reference/apis/js-apis-net-connection.md) - [@ohos.net.http (数据请求)](reference/apis/js-apis-http.md) - - [@ohos.request (上传下载)](reference/apis/js-apis-request.md) - [@ohos.net.socket (Socket连接)](reference/apis/js-apis-socket.md) - [@ohos.net.webSocket (WebSocket连接)](reference/apis/js-apis-webSocket.md) + - [@ohos.request (上传下载)](reference/apis/js-apis-request.md) - 通信与连接 - [@ohos.bluetooth (蓝牙)](reference/apis/js-apis-bluetooth.md) - [@ohos.connectedTag (有源标签)](reference/apis/js-apis-connectedTag.md) @@ -731,7 +729,7 @@ - [@ohos.hiAppEvent (应用打点)](reference/apis/js-apis-hiappevent.md) - [@ohos.hichecker (检测模式)](reference/apis/js-apis-hichecker.md) - [@ohos.hidebug (Debug调试)](reference/apis/js-apis-hidebug.md) - - [@ohos.hilog (日志打印)](reference/apis/js-apis-hilog.md) + - [@ohos.hilog (HiLog日志打印)](reference/apis/js-apis-hilog.md) - [@ohos.hiTraceChain (分布式跟踪)](reference/apis/js-apis-hitracechain.md) - [@ohos.hiTraceMeter (性能打点)](reference/apis/js-apis-hitracemeter.md) - [@ohos.inputMethod (输入法框架)](reference/apis/js-apis-inputmethod.md) @@ -740,6 +738,7 @@ - [@ohos.screenLock (锁屏管理)](reference/apis/js-apis-screen-lock.md) - [@ohos.systemTime (设置系统时间)](reference/apis/js-apis-system-time.md) - [@ohos.wallpaper (壁纸)](reference/apis/js-apis-wallpaper.md) + - [console (日志打印)](reference/apis/js-apis-logs.md) - [Timer (定时器)](reference/apis/js-apis-timer.md) - 设备管理 - [@ohos.batteryInfo (电量信息)](reference/apis/js-apis-battery-info.md) @@ -810,7 +809,6 @@ - [@system.sensor (传感器)](reference/apis/js-apis-system-sensor.md) - [@system.storage (数据存储)](reference/apis/js-apis-system-storage.md) - [@system.vibrator (振动)](reference/apis/js-apis-system-vibrate.md) - - [console (日志打印)](reference/apis/js-apis-logs.md) - 接口参考(Native API) - 模块 - [Native XComponent](reference/native-apis/_o_h___native_x_component.md) diff --git a/zh-cn/device-dev/kernel/Readme-CN.md b/zh-cn/device-dev/kernel/Readme-CN.md index 1aad387ebed29c3145e8c892cbbdb84004f41479..871abd58d3ce58fd0db5d0145860d8ae06273d28 100755 --- a/zh-cn/device-dev/kernel/Readme-CN.md +++ b/zh-cn/device-dev/kernel/Readme-CN.md @@ -27,7 +27,7 @@ - 内核调测 - 内存调测 - [内存信息统计](kernel-mini-memory-debug-mes.md) - - [内存泄漏检测](kernel-mini-imemory-debug-det.md) + - [内存泄漏检测](kernel-mini-memory-debug-det.md) - [踩内存检测](kernel-mini-memory-debug-cet.md) - [异常调测](kernel-mini-memory-exception.md) - [Trace调测](kernel-mini-memory-trace.md) diff --git a/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md b/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md index d3e4753307214cffd9e903b54e34f0ce1c6938b1..c2ad48c9d263c6802e11c116c14e64b857074e85 100644 --- a/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md +++ b/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md @@ -5,6 +5,6 @@ - **[内存信息统计](kernel-mini-memory-debug-mes.md)** -- **[内存泄漏检测](kernel-mini-imemory-debug-det.md)** +- **[内存泄漏检测](kernel-mini-memory-debug-det.md)** - **[踩内存检测](kernel-mini-memory-debug-cet.md)** \ No newline at end of file