未验证 提交 69e56aeb 编写于 作者: 1 189******51 提交者: Gitee

IssueNo: #I7UZUJ:[新需求]: Rectify the arkts syntax

Description: Rectify the arkts syntax
Sig: SIG_ApplicaitonFramework
Feature or Bugfix: Feature
Binary Source: No
Signed-off-by: N189******51 <lipeicheng5@huawei.com>
上级 394aff5f
...@@ -59,13 +59,16 @@ getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback\<RemoteAb ...@@ -59,13 +59,16 @@ getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback\<RemoteAb
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
{ {
deviceId: '1', deviceId: '1',
bundleName: 'com.example.application', bundleName: 'com.example.application',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
}, (err, data) => { }, (err: BusinessError, data: distributedBundle.RemoteAbilityInfo) => {
if (err) { if (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
} else { } else {
...@@ -115,15 +118,18 @@ getRemoteAbilityInfo(elementName: ElementName): Promise\<RemoteAbilityInfo>; ...@@ -115,15 +118,18 @@ getRemoteAbilityInfo(elementName: ElementName): Promise\<RemoteAbilityInfo>;
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
{ {
deviceId: '1', deviceId: '1',
bundleName: 'com.example.application', bundleName: 'com.example.application',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
}).then(data => { }).then((data: distributedBundle.RemoteAbilityInfo) => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
}); });
} catch (err) { } catch (err) {
...@@ -164,6 +170,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, callback: AsyncCallback\ ...@@ -164,6 +170,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, callback: AsyncCallback\
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
[ [
...@@ -177,7 +186,7 @@ try { ...@@ -177,7 +186,7 @@ try {
bundleName: 'com.example.application2', bundleName: 'com.example.application2',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
} }
], (err, data) => { ], (err: BusinessError, data: distributedBundle.RemoteAbilityInfo[]) => {
if (err) { if (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
} else { } else {
...@@ -227,6 +236,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>): Promise\<Array\<RemoteA ...@@ -227,6 +236,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>): Promise\<Array\<RemoteA
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
[ [
...@@ -240,9 +252,9 @@ try { ...@@ -240,9 +252,9 @@ try {
bundleName: 'com.example.application2', bundleName: 'com.example.application2',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
} }
]).then(data => { ]).then((data: distributedBundle.RemoteAbilityInfo[]) => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
}); });
} catch (err) { } catch (err) {
...@@ -284,13 +296,16 @@ getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCa ...@@ -284,13 +296,16 @@ getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCa
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
{ {
deviceId: '1', deviceId: '1',
bundleName: 'com.example.application', bundleName: 'com.example.application',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
}, 'zh-Hans-CN', (err, data) => { }, 'zh-Hans-CN', (err: BusinessError, data: distributedBundle.RemoteAbilityInfo) => {
if (err) { if (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
} else { } else {
...@@ -341,15 +356,18 @@ getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise\<RemoteA ...@@ -341,15 +356,18 @@ getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise\<RemoteA
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
{ {
deviceId: '1', deviceId: '1',
bundleName: 'com.example.application', bundleName: 'com.example.application',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
}, 'zh-Hans-CN').then(data => { }, 'zh-Hans-CN').then((data: distributedBundle.RemoteAbilityInfo) => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
}); });
} catch (err) { } catch (err) {
...@@ -391,6 +409,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, locale: string, callback ...@@ -391,6 +409,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, locale: string, callback
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
[ [
...@@ -404,7 +425,7 @@ try { ...@@ -404,7 +425,7 @@ try {
bundleName: 'com.example.application2', bundleName: 'com.example.application2',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
} }
], 'zh-Hans-CN', (err, data) => { ], 'zh-Hans-CN', (err: BusinessError, data: distributedBundle.RemoteAbilityInfo[]) => {
if (err) { if (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
} else { } else {
...@@ -455,6 +476,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, locale: string): Promise ...@@ -455,6 +476,9 @@ getRemoteAbilityInfo(elementNames: Array\<ElementName>, locale: string): Promise
**示例:** **示例:**
```ts ```ts
import distributedBundle from '@ohos.bundle.distributedBundleManager';
import { BusinessError } from '@ohos.base';
try { try {
distributedBundle.getRemoteAbilityInfo( distributedBundle.getRemoteAbilityInfo(
[ [
...@@ -468,9 +492,9 @@ try { ...@@ -468,9 +492,9 @@ try {
bundleName: 'com.example.application2', bundleName: 'com.example.application2',
abilityName: 'EntryAbility' abilityName: 'EntryAbility'
} }
], 'zh-Hans-CN').then(data => { ], 'zh-Hans-CN').then((data: distributedBundle.RemoteAbilityInfo[]) => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`); console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
}); });
} catch (err) { } catch (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册