未验证 提交 4643603a 编写于 作者: O openharmony_ci 提交者: Gitee

!23654 arkts 告警清理monthly

Merge pull request !23654 from 耿文广/monthly_20230815
......@@ -296,5 +296,14 @@ struct MyComponent {
2. 对于\@State来说,命名参数机制传递的值并不是必选的,如果没有命名参数传值,则使用本地初始化的默认值:
```ts
MyComponent({ count: 1, increaseBy: 2 })
class C1 {
public count:number;
public increaseBy:number;
constructor(count: number, increaseBy:number) {
this.count = count;
this.increaseBy = increaseBy;
}
}
let obj = new C1(1, 2)
MyComponent(obj)
```
......@@ -103,7 +103,7 @@ export { MainPage } from './src/main/ets/components/MainPage/MainPage'
```js
// library/src/main/ts/test.ets
export class Log {
static info(msg) {
static info(msg: string) {
console.info(msg);
}
}
......
......@@ -136,13 +136,14 @@ setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: Upg
```js
import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication';
let moduleName = 'entry';
let upgradeFlag = freeInstall.UpgradeFlag.SINGLE_UPGRADE;
try {
freeInstall.setHapModuleUpgradeFlag(bundleName, moduleName, upgradeFlag).then(() => {
console.info('Operation succeed')
}).catch(err => {
}).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err));
});
} catch (err) {
......@@ -236,12 +237,13 @@ isHapModuleRemovable(bundleName: string, moduleName: string): Promise\<boolean>;
```js
import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication';
let moduleName = 'entry';
try {
freeInstall.isHapModuleRemovable(bundleName, moduleName).then(data => {
console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => {
}).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err));
});
} catch (err) {
......@@ -332,12 +334,13 @@ getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise\
```js
import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication';
let bundlePackFlag = freeInstall.BundlePackFlag.GET_PACK_INFO_ALL;
try {
freeInstall.getBundlePackInfo(bundleName, bundlePackFlag).then(data => {
console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => {
}).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err));
});
} catch (err) {
......@@ -402,10 +405,11 @@ getDispatchInfo(): Promise\<DispatchInfo>;
```js
import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
try {
freeInstall.getDispatchInfo().then(data => {
console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => {
}).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err));
});
} catch (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册