未验证 提交 181778cc 编写于 作者: O openharmony_ci 提交者: Gitee

!23373 ArkTS规范整改

Merge pull request !23373 from chenshixu1/master
...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void ...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void ...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", "default", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", "default", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.get("const.ohos.apiversion"); let p = systemparameter.get("const.ohos.apiversion");
p.then((value:string) => { p.then((value: string) => {
console.log("get test.parameter.key success: " + value); console.log("get test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log("get test.parameter.key error: " + err.code); console.log("get test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
...@@ -208,7 +208,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void ...@@ -208,7 +208,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.set("test.parameter.key", "testValue", (err:BusinessError, data:string) =>{ systemparameter.set("test.parameter.key", "testValue", (err: BusinessError, data: void) =>{
if (err == undefined) { if (err == undefined) {
console.log("set test.parameter.key value success :" + data) console.log("set test.parameter.key value success :" + data)
} else { } else {
...@@ -251,9 +251,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -251,9 +251,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.set("test.parameter.key", "testValue"); let p = systemparameter.set("test.parameter.key", "testValue");
p.then((value:string) => { p.then((value: void) => {
console.log("set test.parameter.key success: " + value); console.log("set test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log(" set test.parameter.key error: " + err.code); console.log(" set test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
......
...@@ -68,7 +68,7 @@ get(key: string, callback: AsyncCallback<string>): void ...@@ -68,7 +68,7 @@ get(key: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -101,7 +101,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void ...@@ -101,7 +101,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", "default", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", "default", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -141,9 +141,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -141,9 +141,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.get("const.ohos.apiversion"); let p = systemparameter.get("const.ohos.apiversion");
p.then((value:string) => { p.then((value: string) => {
console.log("get test.parameter.key success: " + value); console.log("get test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log("get test.parameter.key error: " + err.code); console.log("get test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
...@@ -200,7 +200,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void ...@@ -200,7 +200,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.set("test.parameter.key", "testValue", (err:BusinessError, data:string) => { systemparameter.set("test.parameter.key", "testValue", (err: BusinessError, data: void) => {
if (err == undefined) { if (err == undefined) {
console.log("set test.parameter.key value success :" + data) console.log("set test.parameter.key value success :" + data)
} else { } else {
...@@ -239,9 +239,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -239,9 +239,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.set("test.parameter.key", "testValue"); let p = systemparameter.set("test.parameter.key", "testValue");
p.then((value:string) => { p.then((value: void) => {
console.log("set test.parameter.key success: " + value); console.log("set test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log(" set test.parameter.key error: " + err.code); console.log(" set test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册