From 105dcf44055db3efed226a31a08870eace3684b4 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 31 Mar 2022 04:20:12 -0700 Subject: [PATCH 1/5] add get system capability api Signed-off-by: taiyipei --- api/@ohos.systemCapability.d.ts | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 api/@ohos.systemCapability.d.ts diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts new file mode 100644 index 0000000000..7da61a4172 --- /dev/null +++ b/api/@ohos.systemCapability.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { AsyncCallback, Callback } from './basic.d.ts'; + +/** +* Provides interfaces to get system capability. +* +* @since 8 +* @syscap SystemCapability.Developtools.Syscap +* @systemapi +*/ + +declare namespace systemCapability { + /** + * Get System Capability. + * + * @since 8 + * @systemapi + * @syscap SystemCapability.Developtools.Syscap + * @return system capability string. + * @param callback indicates the system capability string result. + */ + function getSystemCapability(callback: Callback): void; + function getSystemCapability(): Promise; +} + +export default systemCapability; + -- Gitee From 50683b6a69dd1d595d49db15b6e47eb6b53364d1 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 31 Mar 2022 04:52:35 -0700 Subject: [PATCH 2/5] change get to query Signed-off-by: taiyipei --- api/@ohos.systemCapability.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts index 7da61a4172..95dbf43f3b 100644 --- a/api/@ohos.systemCapability.d.ts +++ b/api/@ohos.systemCapability.d.ts @@ -32,8 +32,8 @@ declare namespace systemCapability { * @return system capability string. * @param callback indicates the system capability string result. */ - function getSystemCapability(callback: Callback): void; - function getSystemCapability(): Promise; + function querySystemCapability(callback: Callback): void; + function querySystemCapability(): Promise; } export default systemCapability; -- Gitee From 82e7ad66b4df951fb73105fc78cbbc8b4deb96f9 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Sun, 17 Apr 2022 19:25:41 -0700 Subject: [PATCH 3/5] change to API9 Signed-off-by: taiyipei --- api/@ohos.systemCapability.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts index 95dbf43f3b..6368b0a08d 100644 --- a/api/@ohos.systemCapability.d.ts +++ b/api/@ohos.systemCapability.d.ts @@ -17,7 +17,7 @@ import { AsyncCallback, Callback } from './basic.d.ts'; /** * Provides interfaces to get system capability. * -* @since 8 +* @since 9 * @syscap SystemCapability.Developtools.Syscap * @systemapi */ @@ -26,7 +26,7 @@ declare namespace systemCapability { /** * Get System Capability. * - * @since 8 + * @since 9 * @systemapi * @syscap SystemCapability.Developtools.Syscap * @return system capability string. -- Gitee From 6fcab47ca49aa94e62425a4bacc591b4e194df84 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Sun, 17 Apr 2022 19:38:04 -0700 Subject: [PATCH 4/5] correct typo Signed-off-by: taiyipei --- api/@ohos.systemCapability.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts index 6368b0a08d..1b22d2d8e8 100644 --- a/api/@ohos.systemCapability.d.ts +++ b/api/@ohos.systemCapability.d.ts @@ -32,8 +32,8 @@ declare namespace systemCapability { * @return system capability string. * @param callback indicates the system capability string result. */ - function querySystemCapability(callback: Callback): void; - function querySystemCapability(): Promise; + function querySystemCapabilities(callback: Callback): void; + function querySystemCapabilities(): Promise; } export default systemCapability; -- Gitee From e667d6aa8691b747f79234a269600e2564c425ec Mon Sep 17 00:00:00 2001 From: taiyipei Date: Sun, 24 Apr 2022 01:26:35 -0700 Subject: [PATCH 5/5] change callback to async Signed-off-by: taiyipei --- api/@ohos.systemCapability.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts index 1b22d2d8e8..eb1b74802f 100644 --- a/api/@ohos.systemCapability.d.ts +++ b/api/@ohos.systemCapability.d.ts @@ -32,7 +32,7 @@ declare namespace systemCapability { * @return system capability string. * @param callback indicates the system capability string result. */ - function querySystemCapabilities(callback: Callback): void; + function querySystemCapabilities(callback: AsyncCallback): void; function querySystemCapabilities(): Promise; } -- Gitee