提交 974ece4d 编写于 作者: W wusongqing

updated docs against master updates

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 a4969725
...@@ -924,14 +924,14 @@ Describes the HAP module information. ...@@ -924,14 +924,14 @@ Describes the HAP module information.
| labelId | number | Yes | No | Module label ID. | | labelId | number | Yes | No | Module label ID. |
| iconId | number | Yes | No | Module icon ID. | | iconId | number | Yes | No | Module icon ID. |
| backgroundImg | string | Yes | No | Module background image. | | backgroundImg | string | Yes | No | Module background image. |
| supportedModes | number | Yes | No | Modes supported by the module. | | supportedModes | number | Yes | No | Running modes supported by the module. |
| reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running.| | reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running.|
| deviceTypes | Array\<string> | Yes | No | An array of supported device types.| | deviceTypes | Array\<string> | Yes | No | Device types supported by the module.|
| abilityInfo | Array\\<AbilityInfo> | Yes | No | Ability information. | | abilityInfo | Array\<AbilityInfo> | Yes | No | Ability information. |
| moduleName | string | Yes | No | Module name. | | moduleName | string | Yes | No | Module name. |
| mainAbilityName | string | Yes | No | Name of the entrance ability. | | mainAbilityName | string | Yes | No | Name of the main ability. |
| installationFree | boolean | Yes | No | When installation-free is supported. | | installationFree | boolean | Yes | No | Whether installation-free is supported. |
| mainElementName | string | Yes| No| Information about the entry ability.| | mainElementName | string | Yes| No| Information about the main ability.|
## AppVersionInfo ## AppVersionInfo
......
...@@ -490,7 +490,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -490,7 +490,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re
```js ```js
this.context.terminateSelf((err) => { this.context.terminateSelf((err) => {
console.log('terminateSelf result:' + JSON.stringfy(err)); console.log('terminateSelf result:' + JSON.stringify(err));
}); });
``` ```
...@@ -512,9 +512,9 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -512,9 +512,9 @@ Terminates this ability. This API uses a promise to return the result.
```js ```js
this.context.terminateSelf(want).then((data) => { this.context.terminateSelf(want).then((data) => {
console.log('success:' + JSON.stringfy(data)); console.log('success:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringfy(error)); console.log('failed:' + JSON.stringify(error));
}); });
``` ```
...@@ -717,7 +717,7 @@ var connection = 111; ...@@ -717,7 +717,7 @@ var connection = 111;
this.context.disconnectAbility(connection).then(() => { this.context.disconnectAbility(connection).then(() => {
console.log('disconnect success') console.log('disconnect success')
}).catch((err) => { }).catch((err) => {
console.log('disconnect filed') console.log('disconnect failed')
}) })
``` ```
...@@ -740,7 +740,7 @@ Sets the label of the ability in the mission. This API uses an asynchronous call ...@@ -740,7 +740,7 @@ Sets the label of the ability in the mission. This API uses an asynchronous call
```js ```js
this.context.setMissionLabel("test",(result) => { this.context.setMissionLabel("test",(result) => {
console.log('requestPermissionsFromUserresult:' + JSON.stringfy(result)); console.log('requestPermissionsFromUserresult:' + JSON.stringify(result));
}); });
``` ```
...@@ -769,9 +769,9 @@ Sets the label of the ability in the mission. This API uses a promise to return ...@@ -769,9 +769,9 @@ Sets the label of the ability in the mission. This API uses a promise to return
```js ```js
this.context.setMissionLabel("test").then((data) => { this.context.setMissionLabel("test").then((data) => {
console.log('success:' + JSON.stringfy(data)); console.log('success:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringfy(error)); console.log('failed:' + JSON.stringify(error));
}); });
``` ```
...@@ -794,7 +794,7 @@ Requests permissions from end users in the form of a dialog box. This API uses a ...@@ -794,7 +794,7 @@ Requests permissions from end users in the form of a dialog box. This API uses a
```js ```js
this.context.requestPermissionsFromUser(permissions,(result) => { this.context.requestPermissionsFromUser(permissions,(result) => {
console.log('requestPermissionsFromUserresult:' + JSON.stringfy(result)); console.log('requestPermissionsFromUserresult:' + JSON.stringify(result));
}); });
``` ```
...@@ -823,9 +823,9 @@ Requests permissions from end users in the form of a dialog box. This API uses a ...@@ -823,9 +823,9 @@ Requests permissions from end users in the form of a dialog box. This API uses a
```js ```js
this.context.requestPermissionsFromUser(permissions).then((data) => { this.context.requestPermissionsFromUser(permissions).then((data) => {
console.log('success:' + JSON.stringfy(data)); console.log('success:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringfy(error)); console.log('failed:' + JSON.stringify(error));
}); });
``` ```
......
...@@ -143,7 +143,7 @@ Called when this ability is destroyed to clear resources. ...@@ -143,7 +143,7 @@ Called when this ability is destroyed to clear resources.
onForeground(): void; onForeground(): void;
Called when this ability is running in the foreground. Called when this ability is switched from the background to the foreground.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
...@@ -162,7 +162,7 @@ Called when this ability is running in the foreground. ...@@ -162,7 +162,7 @@ Called when this ability is running in the foreground.
onBackground(): void; onBackground(): void;
Callback when this ability is switched to the background. Called when this ability is switched from the foreground to the background.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
...@@ -486,7 +486,7 @@ Registers a callback that is invoked when the Stub on the target ability is disc ...@@ -486,7 +486,7 @@ Registers a callback that is invoked when the Stub on the target ability is disc
## Callee ## Callee
Implements callbacks for caller notification registration and unregistration. Implements callbacks for caller notification registration and deregistration.
## Callee.on ## Callee.on
...@@ -546,7 +546,7 @@ Registers a caller notification callback, which is invoked when the target abili ...@@ -546,7 +546,7 @@ Registers a caller notification callback, which is invoked when the target abili
off(method: string): void; off(method: string): void;
Unregisters a caller notification callback, which is invoked when the target ability registers a function. Deregisters a caller notification callback, which is invoked when the target ability registers a function.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
......
...@@ -32,10 +32,11 @@ Checks whether this application is undergoing a stability test. This API uses an ...@@ -32,10 +32,11 @@ Checks whether this application is undergoing a stability test. This API uses an
**Example** **Example**
```js ```js
import app from '@ohos.application.appManager'; import app from '@ohos.application.appManager';
app.isRunningInStabilityTest((err, flag) => { app.isRunningInStabilityTest((err, flag) => {
console.log('startAbility result:' + JSON.stringfy(err)); console.log('startAbility result:' + JSON.stringify(err));
}) })
``` ```
...@@ -59,9 +60,9 @@ Checks whether this application is undergoing a stability test. This API uses a ...@@ -59,9 +60,9 @@ Checks whether this application is undergoing a stability test. This API uses a
```js ```js
import app from '@ohos.application.appManager'; import app from '@ohos.application.appManager';
app.isRunningInStabilityTest().then((flag) => { app.isRunningInStabilityTest().then((flag) => {
console.log('success:' + JSON.stringfy(flag)); console.log('success:' + JSON.stringify(flag));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringfy(error)); console.log('failed:' + JSON.stringify(error));
}); });
``` ```
......
...@@ -227,7 +227,7 @@ var audioCapturerOptions = { ...@@ -227,7 +227,7 @@ var audioCapturerOptions = {
} }
var audioCapturer; var audioCapturer;
audio.createAudioRenderer(audioCapturerOptions).then((data) => { audio.createAudioCapturer(audioCapturerOptions).then((data) => {
audioCapturer = data; audioCapturer = data;
console.info('AudioCapturer Created : Success : Stream Type: SUCCESS'); console.info('AudioCapturer Created : Success : Stream Type: SUCCESS');
}).catch((err) => { }).catch((err) => {
...@@ -3183,7 +3183,7 @@ Subscribes to mark reached events. When the period of frame capturing reaches th ...@@ -3183,7 +3183,7 @@ Subscribes to mark reached events. When the period of frame capturing reaches th
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| :------- | :----------------------- | :--- | :------------------------------------------ | | :------- | :----------------------- | :--- | :------------------------------------------ |
| type | string | Yes | Type of event to subscribe to. The value **periodReach** means the period reached event, which is triggered when the period of frame capturing reaches the value of the **frame** parameter.| | type | string | Yes | Type of event to subscribe to. The value **periodReach** means the period reached event, which is triggered when the period of frame capturing reaches the value of the **frame** parameter.|
| frame | number | Yes | Period during which frame rendering is listened. The value must be greater than **0**. | | frame | number | Yes | Period during which frame capturing is listened. The value must be greater than **0**. |
| callback | (position: number) => {} | Yes | Callback invoked when the event is triggered. | | callback | (position: number) => {} | Yes | Callback invoked when the event is triggered. |
**Example** **Example**
......
# Camera Management # Camera Management
> **NOTE**<br/> > **NOTE**
>
> The initial APIs of this module are supported since API version 9. API version 9 is a canary release for trial use. The APIs of this version may be unstable. > The initial APIs of this module are supported since API version 9. API version 9 is a canary release for trial use. The APIs of this version may be unstable.
## Modules to Import ## Modules to Import
......
...@@ -29,7 +29,7 @@ Converts an XML text into a JavaScript object. ...@@ -29,7 +29,7 @@ Converts an XML text into a JavaScript object.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ------- | --------------------------------- | ---- | ------------------ | | ------- | --------------------------------- | ---- | ------------------ |
| xml | string | Yes| XML text to convert.| | xml | string | Yes| XML text to convert.|
| options | [ConvertOptions](#convertoptions) | No| Settings of the convert operation.| | options | [ConvertOptions](#convertoptions) | No| Options for coversion.|
- Return value - Return value
......
...@@ -43,7 +43,7 @@ Defines the data structure of the fault log information. ...@@ -43,7 +43,7 @@ Defines the data structure of the fault log information.
querySelfFaultLog(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void querySelfFaultLog(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void
Obtains the fault information about the current process. This API uses a callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information. Obtains the fault information about the current process. This API uses an asynchronous callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
**System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger **System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger
......
# FeatureAbility Module (JavaScript) # FeatureAbility
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Constraints ## Constraints
...@@ -17,7 +18,7 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -17,7 +18,7 @@ import featureAbility from '@ohos.ability.featureAbility'
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>): void startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>): void
Starts an ability. This method uses a callback to return the result. Starts an ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -56,7 +57,7 @@ featureAbility.startAbility( ...@@ -56,7 +57,7 @@ featureAbility.startAbility(
startAbility(parameter: StartAbilityParameter): Promise\<number> startAbility(parameter: StartAbilityParameter): Promise\<number>
Starts an ability. This method uses a promise to return the result. Starts an ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -123,7 +124,7 @@ featureAbility.acquireDataAbilityHelper( ...@@ -123,7 +124,7 @@ featureAbility.acquireDataAbilityHelper(
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\<AbilityResult>): void startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\<AbilityResult>): void
Starts an ability. This method uses a callback to return the execution result when the ability is destroyed. Starts an ability. This API uses a callback to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -160,7 +161,7 @@ featureAbility.startAbilityForResult( ...@@ -160,7 +161,7 @@ featureAbility.startAbilityForResult(
startAbilityForResult(parameter: StartAbilityParameter): Promise\<AbilityResult> startAbilityForResult(parameter: StartAbilityParameter): Promise\<AbilityResult>
Starts an ability. This method uses a promise to return the execution result when the ability is destroyed. Starts an ability. This API uses a promise to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -216,7 +217,7 @@ featureAbility.startAbilityForResult( ...@@ -216,7 +217,7 @@ featureAbility.startAbilityForResult(
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -264,7 +265,7 @@ featureAbility.terminateSelfWithResult( ...@@ -264,7 +265,7 @@ featureAbility.terminateSelfWithResult(
terminateSelfWithResult(parameter: AbilityResult): Promise\<void> terminateSelfWithResult(parameter: AbilityResult): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -321,7 +322,7 @@ featureAbility.terminateSelfWithResult( ...@@ -321,7 +322,7 @@ featureAbility.terminateSelfWithResult(
hasWindowFocus(callback: AsyncCallback\<boolean>): void hasWindowFocus(callback: AsyncCallback\<boolean>): void
Checks whether the main window of this ability has the focus. This method uses a callback to return the result. Checks whether the main window of this ability has the focus. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -344,7 +345,7 @@ featureAbility.hasWindowFocus() ...@@ -344,7 +345,7 @@ featureAbility.hasWindowFocus()
hasWindowFocus(): Promise\<boolean> hasWindowFocus(): Promise\<boolean>
Checks whether the main window of this ability has the focus. This method uses a promise to return the result. Checks whether the main window of this ability has the focus. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -369,7 +370,7 @@ featureAbility.hasWindowFocus().then((data) => { ...@@ -369,7 +370,7 @@ featureAbility.hasWindowFocus().then((data) => {
getWant(callback: AsyncCallback\<Want>): void getWant(callback: AsyncCallback\<Want>): void
Obtains the **Want** object sent from this ability. This method uses a callback to return the result. Obtains the **Want** object sent from this ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -392,7 +393,7 @@ featureAbility.getWant() ...@@ -392,7 +393,7 @@ featureAbility.getWant()
getWant(): Promise\<Want> getWant(): Promise\<Want>
Obtains the **Want** object sent from this ability. This method uses a promise to return the result. Obtains the **Want** object sent from this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -439,7 +440,7 @@ context.getBundleName() ...@@ -439,7 +440,7 @@ context.getBundleName()
terminateSelf(callback: AsyncCallback\<void>): void terminateSelf(callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -462,7 +463,7 @@ featureAbility.terminateSelf() ...@@ -462,7 +463,7 @@ featureAbility.terminateSelf()
terminateSelf(): Promise\<void> terminateSelf(): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -484,7 +485,7 @@ featureAbility.terminateSelf().then((data) => { console.info("============= ...@@ -484,7 +485,7 @@ featureAbility.terminateSelf().then((data) => { console.info("=============
connectAbility(request: Want, options:ConnectOptions): number connectAbility(request: Want, options:ConnectOptions): number
Connects this ability to a specific Service ability. This method uses a callback to return the result. Connects this ability to a specific Service ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -553,7 +554,7 @@ var connId = featureAbility.connectAbility( ...@@ -553,7 +554,7 @@ var connId = featureAbility.connectAbility(
disconnectAbility(connection: number, callback:AsyncCallback\<void>): void disconnectAbility(connection: number, callback:AsyncCallback\<void>): void
Disconnects this ability from a specific Service ability. This method uses a callback to return the result. Disconnects this ability from a specific Service ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -600,7 +601,7 @@ var result = featureAbility.disconnectAbility(connId, ...@@ -600,7 +601,7 @@ var result = featureAbility.disconnectAbility(connId,
disconnectAbility(connection: number): Promise\<void> disconnectAbility(connection: number): Promise\<void>
Disconnects this ability from a specific Service ability. This method uses a promise to return the result. Disconnects this ability from a specific Service ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -652,7 +653,7 @@ featureAbility.disconnectAbility(connId).then((error,data)=>{ ...@@ -652,7 +653,7 @@ featureAbility.disconnectAbility(connId).then((error,data)=>{
getWindow(callback: AsyncCallback\<window.Window>): void getWindow(callback: AsyncCallback\<window.Window>): void
Obtains the window corresponding to this ability. This method uses a callback to return the result. Obtains the window corresponding to this ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -672,7 +673,7 @@ featureAbility.getWindow() ...@@ -672,7 +673,7 @@ featureAbility.getWindow()
getWindow(): Promise\<window.Window>; getWindow(): Promise\<window.Window>;
Obtains the window corresponding to this ability. This method uses a promise to return the result. Obtains the window corresponding to this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......
...@@ -363,7 +363,7 @@ Removes an entry at the specified position from this container. ...@@ -363,7 +363,7 @@ Removes an entry at the specified position from this container.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| index | number | Yes| Position index of the entry to remove.| | index | number | Yes| Position index of the entry.|
**Return value** **Return value**
......
...@@ -579,7 +579,7 @@ let fdPath = 'fd://' ...@@ -579,7 +579,7 @@ let fdPath = 'fd://'
let path = '/data/accounts/account_0/appdata/ohos.xxx.xxx.xxx/01.mp3'; let path = '/data/accounts/account_0/appdata/ohos.xxx.xxx.xxx/01.mp3';
fileIO.open(path).then(fdNumber) => { fileIO.open(path).then(fdNumber) => {
fdPath = fdPath + '' + fdNumber; fdPath = fdPath + '' + fdNumber;
console.info('open fd sucess fd is' + fdPath); console.info('open fd success fd is' + fdPath);
}, (err) => { }, (err) => {
console.info('open fd failed err is' + err); console.info('open fd failed err is' + err);
}).catch((err) => { }).catch((err) => {
......
...@@ -618,7 +618,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba ...@@ -618,7 +618,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void; moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void;
Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses an asynchronous callback to return the result. Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
...@@ -652,7 +652,7 @@ Switches a given mission to the foreground, with the startup parameters for the ...@@ -652,7 +652,7 @@ Switches a given mission to the foreground, with the startup parameters for the
moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&gt;; moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&gt;;
Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses a promise to return the result. Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......
# Battery Level # Battery Level
> ![icon-note.gif](public_sys-resources/icon-note.gif) **Note:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.batteryInfo`](js-apis-battery-info.md) instead. > - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.batteryInfo`](js-apis-battery-info.md) instead.
> >
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
...@@ -42,7 +42,7 @@ A constructor used to create a URI instance. ...@@ -42,7 +42,7 @@ A constructor used to create a URI instance.
| Name| Type.| Readable| Writable| Description| | Name| Type.| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| url | string | Yes| Yes| Input object.| | uri | string | Yes| Yes| Input object.|
**Example** **Example**
...@@ -59,7 +59,7 @@ new uri.URI('http://username:password@host:8080'); // Output 'http://username:pa ...@@ -59,7 +59,7 @@ new uri.URI('http://username:password@host:8080'); // Output 'http://username:pa
toString(): string toString(): string
Obtains the query string applicable to this URL. Obtains the query string applicable to this URI.
**Return value** **Return value**
...@@ -70,8 +70,8 @@ Obtains the query string applicable to this URL. ...@@ -70,8 +70,8 @@ Obtains the query string applicable to this URL.
**Example** **Example**
```js ```js
const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da'); const uri = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString() uri.toString()
``` ```
......
...@@ -85,7 +85,7 @@ Triggers vibration with a specific effect. This API uses a promise to return the ...@@ -85,7 +85,7 @@ Triggers vibration with a specific effect. This API uses a promise to return the
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ------------- | | -------- | --------------------- | ---- | ------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect. | | effectId | [EffectId](#effectid) | Yes | Vibration effect. |
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -115,7 +115,7 @@ Triggers vibration with a specific effect. This API uses an asynchronous callbac ...@@ -115,7 +115,7 @@ Triggers vibration with a specific effect. This API uses an asynchronous callbac
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------------- | | -------- | ------------------------- | ---- | ----------------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect. | | effectId | [EffectId](#effectid) | Yes | Vibration effect. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully. | | callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully. |
**Example** **Example**
...@@ -182,7 +182,7 @@ Stops the vibration based on the specified **stopMode**. This API uses an asynch ...@@ -182,7 +182,7 @@ Stops the vibration based on the specified **stopMode**. This API uses an asynch
if(error){ if(error){
console.log("error.code"+error.code+"error.message"+error.message); console.log("error.code"+error.code+"error.message"+error.message);
}else{ }else{
console.log("Callback returned to indicate successful."); console.log("Callback returned to indicate a successful stop.");
} }
}) })
``` ```
......
...@@ -858,7 +858,7 @@ Checks whether two **WantAgent** objects are equal. This API uses a promise to r ...@@ -858,7 +858,7 @@ Checks whether two **WantAgent** objects are equal. This API uses a promise to r
| Name | Readable| Writable| Type | Mandatory| Description | | Name | Readable| Writable| Type | Mandatory| Description |
| ---------- | --- | ---- | --------- | ---- | ------------- | | ---------- | --- | ---- | --------- | ---- | ------------- |
| agent | Yes | No | WantAgent | Yes | The first **WantAgent** object.| | agent | Yes | No | WantAgent | Yes | The first **WantAgent** object.|
| otherAgent | Yes | No | WantAgent | Yes | The second **WantAgent** object.| | otherAgent | Yes | No | WantAgent | Yes | The second **WantAgent** object. |
**Return value** **Return value**
...@@ -936,10 +936,10 @@ Obtains the operation type of a **WantAgent** object. This API uses an asynchron ...@@ -936,10 +936,10 @@ Obtains the operation type of a **WantAgent** object. This API uses an asynchron
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
//wantAgent���� // wantAgent object
var wantAgent; var wantAgent;
//WantAgentInfo���� // WantAgentInfo object
var wantAgentInfo = { var wantAgentInfo = {
wants: [ wants: [
{ {
...@@ -989,13 +989,13 @@ Obtains the operation type of a **WantAgent** object. This API uses a promise to ...@@ -989,13 +989,13 @@ Obtains the operation type of a **WantAgent** object. This API uses a promise to
| Name | Readable | Writable | Type | Mandatory | Description | | Name | Readable | Writable | Type | Mandatory | Description |
| ---------- | --- | ---- | --------- | ---- | ------------- | | ---------- | --- | ---- | --------- | ---- | ------------- |
| agent | Yes | No | WantAgent | Yes | WantAgent���� | | agent | Yes | No | WantAgent | Yes | Target **WantAgent** object. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------------ | | ----------------- | ------------------------------------------ |
| Promise\<number\> | Promise used to return the operation type. | | Promise\<number> | Promise used to return the operation type. |
**Example** **Example**
...@@ -1003,10 +1003,10 @@ Obtains the operation type of a **WantAgent** object. This API uses a promise to ...@@ -1003,10 +1003,10 @@ Obtains the operation type of a **WantAgent** object. This API uses a promise to
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
//wantAgent���� // wantAgent object
var wantAgent; var wantAgent;
//WantAgentInfo���� // WantAgentInfo object
var wantAgentInfo = { var wantAgentInfo = {
wants: [ wants: [
{ {
......
...@@ -77,7 +77,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -77,7 +77,7 @@ This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| --------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ | | --------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ |
| type | [WindowType](#windowtype) | Yes | Yes | Type of the system bar whose properties are changed. Only the navigation bar and status bar are supported.| | type | [WindowType](#windowtype) | Yes | Yes | Type of the system bar whose properties are changed. Only the status bar and navigation bar are supported.|
| isEnable | boolean | Yes | Yes | Whether the system bar is displayed. | | isEnable | boolean | Yes | Yes | Whether the system bar is displayed. |
| region | [Rect](#rect) | Yes | Yes | Current position and size of the system bar. | | region | [Rect](#rect) | Yes | Yes | Current position and size of the system bar. |
| backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **\#00FF00** or **\#FF00FF00**.| | backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **\#00FF00** or **\#FF00FF00**.|
...@@ -488,7 +488,7 @@ Obtains the top window of the current application. This API uses a promise to re ...@@ -488,7 +488,7 @@ Obtains the top window of the current application. This API uses a promise to re
on(type: 'systemBarTintChange', callback: Callback&lt;SystemBarTintState&gt;): void on(type: 'systemBarTintChange', callback: Callback&lt;SystemBarTintState&gt;): void
Enables listening for the properties changes of the status bar and navigation bar. Enables listening for properties changes of the status bar and navigation bar.
This is a system API and cannot be called by third-party applications. This is a system API and cannot be called by third-party applications.
...@@ -514,7 +514,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -514,7 +514,7 @@ This is a system API and cannot be called by third-party applications.
off(type: 'systemBarTintChange', callback?: Callback&lt;SystemBarTintState &gt;): void off(type: 'systemBarTintChange', callback?: Callback&lt;SystemBarTintState &gt;): void
Disables listening for the properties changes of the status bar and navigation bar. Disables listening for properties changes of the status bar and navigation bar.
This is a system API and cannot be called by third-party applications. This is a system API and cannot be called by third-party applications.
...@@ -1062,7 +1062,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses ...@@ -1062,7 +1062,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------------ | ------------------------- | ---- | ------------------------------------------------------------ | | ------------------ | ------------------------- | ---- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed.| | isLayoutFullScreen | boolean | Yes | Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
**Example** **Example**
...@@ -1090,7 +1090,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses ...@@ -1090,7 +1090,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------------ | ------- | ---- | ------------------------------------------------------------ | | ------------------ | ------- | ---- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed.| | isLayoutFullScreen | boolean | Yes | Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed.|
**Return value** **Return value**
...@@ -1781,8 +1781,9 @@ setDimBehind(dimBehindValue: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -1781,8 +1781,9 @@ setDimBehind(dimBehindValue: number, callback: AsyncCallback&lt;void&gt;): void
Sets the dimness of the window that is not on top. This API uses an asynchronous callback to return the result. Sets the dimness of the window that is not on top. This API uses an asynchronous callback to return the result.
> This API is supported since API version 7 and deprecated since API version 9. > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
...@@ -1811,8 +1812,9 @@ setDimBehind(dimBehindValue: number): Promise&lt;void&gt; ...@@ -1811,8 +1812,9 @@ setDimBehind(dimBehindValue: number): Promise&lt;void&gt;
Sets the dimness of the window that is not on top. This API uses a promise to return the result. Sets the dimness of the window that is not on top. This API uses a promise to return the result.
> This API is supported since API version 7 and deprecated since API version 9. > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
...@@ -1911,7 +1913,7 @@ Sets whether to keep the screen always on. This API uses an asynchronous callbac ...@@ -1911,7 +1913,7 @@ Sets whether to keep the screen always on. This API uses an asynchronous callbac
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | ------------------------- | ---- | ------------------------ | | -------------- | ------------------------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Sets whether to keep the screen always on.| | isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
**Example** **Example**
...@@ -1933,8 +1935,9 @@ setOutsideTouchable(touchable: boolean, callback: AsyncCallback&lt;void&gt;): vo ...@@ -1933,8 +1935,9 @@ setOutsideTouchable(touchable: boolean, callback: AsyncCallback&lt;void&gt;): vo
Sets whether the area outside the subwindow is touchable. This API uses an asynchronous callback to return the result. Sets whether the area outside the subwindow is touchable. This API uses an asynchronous callback to return the result.
> This API is supported since API version 7 and deprecated since API version 9. > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
...@@ -1963,8 +1966,9 @@ setOutsideTouchable(touchable: boolean): Promise&lt;void&gt; ...@@ -1963,8 +1966,9 @@ setOutsideTouchable(touchable: boolean): Promise&lt;void&gt;
Sets whether the area outside the subwindow is touchable. This API uses a promise to return the result. Sets whether the area outside the subwindow is touchable. This API uses a promise to return the result.
> This API is supported since API version 7 and deprecated since API version 9. > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
...@@ -2003,7 +2007,7 @@ Sets whether to keep the screen always on. This API uses a promise to return the ...@@ -2003,7 +2007,7 @@ Sets whether to keep the screen always on. This API uses a promise to return the
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | ------- | ---- | ------------------------ | | -------------- | ------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Sets whether to keep the screen always on.| | isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
**Return value** **Return value**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册