---
api/@ohos.nfc.cardEmulation.js | 105 +++++++++++++++++++++++++
api/@ohos.nfc.controller.js | 116 +++++++++++++++++++++++++++
api/@ohos.nfc.tag.js | 118 ++++++++++++++++++++++++++++
api/tag/nfctech.js | 139 +++++++++++++++++++++++++++++++++
api/tag/tagSession.js | 132 +++++++++++++++++++++++++++++++
5 files changed, 610 insertions(+)
create mode 100755 api/@ohos.nfc.cardEmulation.js
create mode 100755 api/@ohos.nfc.controller.js
create mode 100755 api/@ohos.nfc.tag.js
create mode 100755 api/tag/nfctech.js
create mode 100755 api/tag/tagSession.js
diff --git a/api/@ohos.nfc.cardEmulation.js b/api/@ohos.nfc.cardEmulation.js
new file mode 100755
index 0000000000..505b362654
--- /dev/null
+++ b/api/@ohos.nfc.cardEmulation.js
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2021-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.
+ */
+
+/**
+ * Provides methods to operate or manage NFC card emulation.
+ *
+ * @import import cardEmulation from '@ohos.nfc.cardEmulation';
+ *
+ * @since 6
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+declare namespace cardEmulation {
+ enum Featuretype {
+ /** This constant is used to check whether HCE card emulation is supported. */
+ HCE = 0,
+
+ /** This constant is used to check whether SIM card emulation is supported. */
+ UICC = 1,
+
+ /** This constant is used to check whether eSE card emulation is supported. */
+ ESE = 2,
+ }
+
+ /**
+ * Checks whether a specified type of card emulation is supported.
+ *
+ * This method is used to check Whether the host or secure element supports card emulation.
+ *
+ * @param feature Indicates the card emulation type, {@code HCE}, {@code UICC}, or {@code ESE}.
+ * @return Returns {@code true} if the specified type of card emulation is supported; returns
+ * {@code false} otherwise.
+ *
+ * @since 6
+ */
+ function isSupported(feature: number):boolean;
+
+ /**
+ * A class for NFC host application.
+ *
+ *
The NFC host application use this class, then Nfc service can access the application
+ * installation information and connect to services of the application.
+ *
+ * @since 8
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+ export class HceService {
+ /**
+ * start HCE
+ *
+ * @return Returns {@code true} if HCE is enabled or has been enabled; returns {@code false} otherwise.
+ * @permission ohos.permission.NFC_CARD_EMULATION
+ *
+ * @since 8
+ */
+ startHCE(aidList: string[]): boolean;
+
+ /**
+ * stop HCE
+ *
+ * @return Returns {@code true} if HCE is disabled or has been disabled; returns {@code false} otherwise.
+ * @permission ohos.permission.NFC_CARD_EMULATION
+ *
+ * @since 8
+ */
+ stopHCE(): boolean;
+
+
+ /**
+ * register HCE event to receive the APDU data.
+ *
+ * @param type the type to register.
+ * @param callback Callback used to listen for HCE data device received.
+ * @permission ohos.permission.NFC_CARD_EMULATION
+ *
+ * @since 8
+ */
+
+ on(type: "hceCmd", callback: AsyncCallback): void;
+
+ /**
+ * Sends a response APDU to the remote device.
+ *
+ * This method is used by a host application when swiping card.
+ *
+ * @param responseApdu Indicates the response, which is a byte array.
+ * @permission ohos.permission.NFC_CARD_EMULATION
+ *
+ * @since 8
+ */
+ sendResponse(responseApdu: number[]): void;
+ }
+}
+export default cardEmulation;
diff --git a/api/@ohos.nfc.controller.js b/api/@ohos.nfc.controller.js
new file mode 100755
index 0000000000..35c767cb74
--- /dev/null
+++ b/api/@ohos.nfc.controller.js
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2021-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 { Callback } from './basic';
+
+/**
+ * Provides methods to operate or manage NFC.
+ *
+ * @import import controller from '@ohos.nfc.controller';
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+declare namespace nfcController {
+ enum NfcState {
+ /** Indicates that NFC is disabled. */
+ STATE_OFF = 1,
+
+ /** Indicates that NFC is being enabled. */
+ STATE_TURNING_ON = 2,
+
+ /** Indicates that NFC is enabled. */
+ STATE_ON = 3,
+
+ /** Indicates that NFC is being disabled. */
+ STATE_TURNING_OFF = 4,
+ }
+
+ /**
+ * Checks whether a device supports NFC.
+ *
+ * @return Returns {@code true} if the device supports NFC; returns {@code false} otherwise.
+ *
+ * @since 7
+ */
+ function isNfcAvailable(): boolean
+
+ /**
+ * register nfc state changed event.
+ *
+ * @param type the type to register.
+ * @param callback Callback used to listen for the nfc state changed event.
+ *
+ * @since 7
+ */
+
+ function on(type: "nfcStateChange", callback: Callback): void
+
+ /**
+ * unregister nfc state changed event.
+ *
+ * @param type the type to unregister.
+ * @param callback Callback used to listen for the nfc state changed event.
+ *
+ * @since 7
+ */
+
+ function off(type: "nfcStateChange", callback?: Callback): void
+
+ /**
+ * Enables NFC.
+ *
+ * @return Returns {@code true} if NFC is enabled or has been enabled; returns {@code false} otherwise.
+ * @permission ohos.permission.MANAGE_SECURE_SETTINGS
+ *
+ * @since 7
+ */
+ function openNfc(): boolean
+
+ /**
+ * Disables NFC.
+ *
+ * @return Returns {@code true} if NFC is disabled or has been disabled; returns {@code false} otherwise.
+ * @permission ohos.permission.MANAGE_SECURE_SETTINGS
+ *
+ * @since 7
+ */
+ function closeNfc(): boolean
+
+ /**
+ * Checks whether NFC is enabled.
+ *
+ * @return Returns {@code true} if NFC is enabled; returns {@code false} otherwise.
+ *
+ * @since 7
+ */
+ function isNfcOpen(): boolean
+
+ /**
+ * Obtains the NFC status.
+ *
+ * The NFC status can be any of the following:
- {@link #STATE_OFF}: Indicates that NFC
+ * is disabled.
- {@link #STATE_TURNING_ON}: Indicates that NFC is being enabled.
+ *
- {@link #STATE_ON}: Indicates that NFC is enabled.
- {@link #STATE_TURNING_OFF}: Indicates
+ * that NFC is being disabled.
+ *
+ * @return Returns the NFC status.
+ *
+ * @since 7
+ */
+ function getNfcState(): boolean
+}
+
+export default nfcController;
\ No newline at end of file
diff --git a/api/@ohos.nfc.tag.js b/api/@ohos.nfc.tag.js
new file mode 100755
index 0000000000..78ec3e6702
--- /dev/null
+++ b/api/@ohos.nfc.tag.js
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2021-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 { NfcATag, NfcBTag, NfcFTag, NfcVTag } from './tag/nfctech';
+
+/**
+ * Provides methods to operate or manage NFC tag.
+ *
+ * @import import tag from '@ohos.nfc.tag';
+ *
+ * @since 7
+ * @sysCap SystemCapability.Communication.NFC.Core
+ */
+declare namespace tag {
+ /** Indicates an NFC-A tag. */
+ const NFC_A = 1;
+
+ /** Indicates an NFC-B tag. */
+ const NFC_B = 2;
+
+ /** Indicates an ISO-DEP tag. */
+ const ISO_DEP = 3;
+
+ /** Indicates an NFC-F tag. */
+ const NFC_F = 4;
+
+ /** Indicates an NFC-V tag. */
+ const NFC_V = 5;
+
+ /** Indicated an NDEF tag. */
+ const NDEF = 6;
+
+ /** Indicates a MifareClassic tag. */
+ const MIFARE_CLASSIC = 8;
+
+ /** Indicates a MifareUltralight tag. */
+ const MIFARE_ULTRALIGHT = 9;
+
+ /**
+ * Obtains an {@code NfcATag} object based on the tag information.
+ *
+ * During tag reading, if the tag supports the NFC-A technology, an {@code NfcATag} object
+ * will be created based on the tag information.
+ *
+ * @param tagInfo Indicates the tag information.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ function getNfcATag(tagInfo: TagInfo): NfcATag
+
+ /**
+ * Obtains an {@code NfcBTag} object based on the tag information.
+ *
+ *
During tag reading, if the tag supports the NFC-B technology, an {@code NfcBTag} object
+ * will be created based on the tag information.
+ *
+ * @param tagInfo Indicates the tag information.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ function getNfcBTag(tagInfo: TagInfo): NfcBTag
+
+ /**
+ * Obtains an {@code NfcFTag} object based on the tag information.
+ *
+ *
During tag reading, if the tag supports the NFC-F technology, an {@code NfcFTag} object
+ * will be created based on the tag information.
+ *
+ * @param tagInfo Indicates the tag information.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ function getNfcFTag(tagInfo: TagInfo): NfcFTag
+
+ /**
+ * Obtains an {@code NfcVTag} object based on the tag information.
+ *
+ *
During tag reading, if the tag supports the NFC-V technology, an {@code NfcVTag} object
+ * will be created based on the tag information.
+ *
+ * @param tagInfo Indicates the tag information.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ function getNfcVTag(tagInfo: TagInfo): NfcVTag
+
+
+ /**
+ * Provides tag information.
+ *
+ *
This class provides the technology a tag supports, for example, NFC-A. Applications can create
+ * different tags based on the supported technology.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ * @permission ohos.permission.NFC_TAG
+ */
+ export interface TagInfo {
+ supportedProfiles: number[];
+ }
+}
+export default tag;
\ No newline at end of file
diff --git a/api/tag/nfctech.js b/api/tag/nfctech.js
new file mode 100755
index 0000000000..fbcc5f2897
--- /dev/null
+++ b/api/tag/nfctech.js
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2021-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 { TagSession } form './tagSession';
+
+/**
+ * Provides interfaces to control the read and write of tags that support the NFC-A technology.
+ *
+ *
This class is inherited from the {@link TagSession} abstract class, and provides methods to create
+ * {@code NfcATag} objects and obtain the ATQA and SAK.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+export interface NfcATag extends TagSession{
+ /**
+ * Obtains the SAK of an NFC-A tag.
+ *
+ * @return Returns the SAK of the NFC-A tag.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getSak():number;
+
+ /**
+ * Obtains the ATQA of an NFC-A tag.
+ *
+ * @return Returns the ATQA of the NFC-A tag.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getAtqa():number[];
+}
+
+/**
+ * Provides interfaces to create an {@code NfcBTag} and perform I/O operations on the tag.
+ *
+ *
This class inherits from the {@link TagSession} abstract class and provides interfaces to create an
+ * {@code NfcBTag} and obtain the tag information.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+export interface NfcBTag extends TagSession{
+ /**
+ * Obtains the application data of a tag.
+ *
+ * @return Returns the application data of the tag.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getRespAppData():number[];
+
+ /**
+ * Obtains the protocol information of a tag.
+ *
+ * @return Returns the protocol information of the tag.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getRespProtocol():number[];
+}
+
+/**
+ * Provides methods for creating an NFC-F tag, obtaining tag information, and controlling tag read and write.
+ *
+ *
This class inherits from the {@link TagSession} abstract class and provides interfaces to create an
+ * {@code NfcFTag} and obtain the tag information.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+export interface NfcFTag extends TagSession{
+ /**
+ * Obtains the system code from this {@code NfcFTag} instance.
+ *
+ * @return Returns the system code.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getSystemCode():number[];
+
+ /**
+ * Obtains the PMm (consisting of the IC code and manufacturer parameters) from this {@code NfcFTag} instance.
+ *
+ * @return Returns the PMm.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getPmm():number[];
+}
+
+/**
+ * Provides methods for creating an NFC-V tag, obtaining tag information, and controlling tag read and write.
+ *
+ *
This class inherits from the {@link TagSession} abstract class and provides interfaces to create an
+ * {@code NfcVTag} and obtain the tag information.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+export interface NfcVTag extends TagSession{
+ /**
+ * Obtains the response flags from this {@code NfcVTag} instance.
+ *
+ * @return Returns the response flags.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getResponseFlags():number;
+
+ /**
+ * Obtains the data storage format identifier (DSFID) from this {@code NfcVTag} instance.
+ *
+ * @return Returns the DSFID.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getDsfId():number;
+}
diff --git a/api/tag/tagSession.js b/api/tag/tagSession.js
new file mode 100755
index 0000000000..c50deecbf2
--- /dev/null
+++ b/api/tag/tagSession.js
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2021-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 tag from '../ohos.nfc.tag';
+import { AsyncCallback } form './basic';
+
+/**
+ * Controls tag read and write.
+ *
+ *
Classes for different types of tags inherit from this abstract class to control connections to
+ * tags, read data from tags, and write data to tags.
+ *
+ * @since 7
+ * @syscap SystemCapability.Communication.NFC.Core
+ */
+export interface TagSession {
+ /**
+ * Obtains the tag information.
+ *
+ * @return Returns the tag information, which is a {@link TagInfo} object.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getTagInfo(): tag.TagInfo;
+
+ /**
+ * Connects to a tag.
+ *
+ *
This method must be called before data is read from or written to the tag.
+ *
+ * @return Returns {@code true} if the connection is set up; returns {@code false} otherwise.
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ connectTag(): boolean;
+
+ /**
+ * Resets a connection with a tag and restores the default timeout duration for writing data to the tag.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ reset(): void;
+
+ /**
+ * Checks whether a connection has been set up with a tag.
+ *
+ * @return Returns {@code true} if a connection has been set up with the tag;
+ * returns {@code false} otherwise.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ isTagConnected(); boolean;
+
+ /**
+ * Sets the timeout duration (ms) for sending data to a tag.
+ *
+ *
If data is not sent to the tag within the duration, data sending fails.
+ *
+ * @param timeout Indicates the timeout duration to be set.
+ * @return Returns {@code true} if the setting is successful; returns {@code false} otherwise.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ setSendDataTimeout(timeout: number): boolean;
+
+ /**
+ * Queries the timeout duration (ms) for sending data to a tag.
+ *
+ * @return Returns the timeout duration.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getSendDataTimeout(): number;
+
+ /**
+ * Writes data to a tag.
+ *
+ * @param data Indicates the data to be written to the tag.
+ * @return Returns bytes received in response. Or bytes with a length of 0 if the
+ * data fails to be written to the tag.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ sendData(data: number[]): Promise;
+
+ /**
+ * Writes data to a tag.
+ *
+ * @param data Indicates the data to be written to the tag.
+ * @return Returns bytes received in response. Or bytes with a length of 0 if the
+ * data fails to be written to the tag.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ sendData(data: number[], callback: AsyncCallback): void;
+
+ /**
+ * Queries the maximum length of data that can be sent to a tag.
+ *
+ * @return Returns the maximum length of the data to be sent to the tag.
+ *
+ * @permission ohos.permission.NFC_TAG
+ *
+ * @since 7
+ */
+ getMaxSendLength(): number;
+}
\ No newline at end of file
--
Gitee
From 7f17adcece7a35ebea1551d0b0be3511c3a4cee5 Mon Sep 17 00:00:00 2001
From: sunyaozu
Date: Wed, 2 Mar 2022 10:19:16 +0800
Subject: [PATCH 15/45] fix sysCap error
Signed-off-by: sunyaozu
---
api/@ohos.i18n.d.ts | 132 ++++++++++++++++++++++----------------------
api/@ohos.intl.d.ts | 86 ++++++++++++++---------------
2 files changed, 109 insertions(+), 109 deletions(-)
diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts
index cec6042811..b8dc57ffdc 100644
--- a/api/@ohos.i18n.d.ts
+++ b/api/@ohos.i18n.d.ts
@@ -16,14 +16,14 @@
/**
* Provides international settings related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 7
*/
declare namespace i18n {
/**
* Obtains the country or region name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country The locale whose country or region name will be displayed.
* @param locale The locale used to display the country or region.
* @param sentenceCase Specifies whether the country or region name is displayed in sentence case.
@@ -35,7 +35,7 @@ export function getDisplayCountry(country: string, locale: string, sentenceCase?
/**
* Obtains the language name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The locale whose language name will be displayed.
* @param locale The locale used to display the language.
* @param sentenceCase Specifies whether the language name is displayed in sentence case.
@@ -47,7 +47,7 @@ export function getDisplayLanguage(language: string, locale: string, sentenceCas
/**
* Obtain all languages supported by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns all languages supported by the system.
* @since 7
* @systemapi Hide this for inner system use.
@@ -57,7 +57,7 @@ export function getSystemLanguages(): Array;
/**
* Obtain all regions supported by the system in the language.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language used to get the list of regions.
* @return Returns all regions supported by the system in the language.
* @since 7
@@ -68,7 +68,7 @@ export function getSystemCountries(language: string): Array;
/**
* Determine whether the current language or region is recommended.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language code.
* @param region The region code.
* @return Returns whether the current language or region is recommended.
@@ -80,7 +80,7 @@ export function isSuggested(language: string, region?: string): boolean;
/**
* Obtain the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the language currently used by the system.
* @since 7
*/
@@ -89,7 +89,7 @@ export function getSystemLanguage(): string;
/**
* Set the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -99,7 +99,7 @@ export function setSystemLanguage(language: string): boolean;
/**
* Obtain the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the region currently used by the system.
* @since 7
*/
@@ -108,7 +108,7 @@ export function getSystemRegion(): string;
/**
* Set the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param region The region to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -118,7 +118,7 @@ export function setSystemRegion(region: string): boolean;
/**
* Obtain the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the locale currently used by the system.
* @since 7
*/
@@ -127,7 +127,7 @@ export function getSystemLocale(): string;
/**
* Set the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -137,14 +137,14 @@ export function setSystemLocale(locale: string): boolean;
/**
* Provides util functions.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface Util {
/**
* Convert from unit to to unit and format according to the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param fromUnit Information of the unit to be converted.
* @param toUnit Information about the unit to be converted to.
* @param value Indicates the number to be formatted.
@@ -158,7 +158,7 @@ export interface Util {
/**
* Provides the options of unit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface UnitInfo {
@@ -176,7 +176,7 @@ export interface UnitInfo {
/**
* Provides the options of PhoneNumberFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PhoneNumberFormatOptions {
@@ -189,14 +189,14 @@ export interface PhoneNumberFormatOptions {
/**
* Provides the API for formatting phone number strings
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PhoneNumberFormat {
/**
* A constructor used to create a PhoneNumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country Indicates a character string containing the country information for the PhoneNumberFormat object.
* @param type Indicates the type used to format the phone number, includes: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL".
* @since 8
@@ -206,7 +206,7 @@ export class PhoneNumberFormat {
/**
* Judges whether phone number is valid.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be judged.
* @return Returns a boolean indicates whether the input phone number is valid.
* @since 8
@@ -216,7 +216,7 @@ export class PhoneNumberFormat {
/**
* Obtains the formatted phone number strings of number.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be formatted.
* @return Returns the formatted phone number.
* @since 8
@@ -227,7 +227,7 @@ export class PhoneNumberFormat {
/**
* Get a Calendar instance specified by locale and type.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale used to get calendar.
* @param type If type is not specified, get locale's default Calendar, else get the specified type of Calendar.
* such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura,
@@ -240,7 +240,7 @@ export class Calendar {
/**
* set the date.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object used to set the time and date.
* @since 8
*/
@@ -249,7 +249,7 @@ export class Calendar {
/**
* set the time.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param time Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT.
* @since 8
*/
@@ -258,7 +258,7 @@ export class Calendar {
/**
* Set the time
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param year The year field of the calendar, ranges from 0 to 9999.
* @param month The month field of the calendar, ranges from 0 to 11.
* @param date The day field of the calendar, ranges from 1 to 31.
@@ -272,7 +272,7 @@ export class Calendar {
/**
* Set the timezone of this calendar.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param timezone The id of a timezone.
* @since 8
*/
@@ -281,7 +281,7 @@ export class Calendar {
/**
* Get the timezone id of this calendar instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the timezone id of this calendar.
* @since 8
*/
@@ -290,7 +290,7 @@ export class Calendar {
/**
* Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns start day of a week.
* @since 8
*/
@@ -299,7 +299,7 @@ export class Calendar {
/**
* Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
* @since 8
*/
@@ -308,7 +308,7 @@ export class Calendar {
/**
* Get the minimal days of a week, which is needed for the first day of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the minimal days of a week.
* @since 8
*/
@@ -317,7 +317,7 @@ export class Calendar {
/**
* Set the minimal days of a week, which is needed for the first week of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value The value to be set.
* @since 8
*/
@@ -326,7 +326,7 @@ export class Calendar {
/**
* Get the associated value with the field.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param field Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week
* day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy,
* dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month.
@@ -338,7 +338,7 @@ export class Calendar {
/**
* Get calendar's name localized for display in the given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Locale used to get the localized name for this calendar.
* @return Returns the localized name of this calendar.
* @since 8
@@ -349,7 +349,7 @@ export class Calendar {
* Returns true if the given date is a weekend day. If the date is not given,
* the date object of this calendar is used.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object whose attribute is desired.
* @return Returns whether the date is a weekend day.
* @since 8
@@ -360,7 +360,7 @@ export class Calendar {
/**
* Judge whether the locale is RTL locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @return Returns true representing the locale is an RTL locale
*
@@ -371,7 +371,7 @@ export function isRTL(locale: string): boolean;
/**
* Obtains a BreakIterator object for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale the returned BreakIterator will adapt the rule, specified by the locale, to break text.
* @return Returns a newly constructed BreakIterator object.
* @since 8
@@ -381,14 +381,14 @@ export function isRTL(locale: string): boolean;
/**
* The BreakIterator class is used for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class BreakIterator {
/**
* Obtains the current position of the BreakIterator instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the current position of the BreakIterator instance.
* @since 8
*/
@@ -398,7 +398,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the first break point, the first break point is always the beginning of the
* processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the first break point.
* @since 8
*/
@@ -408,7 +408,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the last break point. the last break point is always the index beyond the
* last character of the processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the last break point.
* @since 8
*/
@@ -417,7 +417,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the nth break point from the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index indicates the number of break points to advance. If index is not given, n is treated as 1.
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
@@ -427,7 +427,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the break point preceding the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -436,7 +436,7 @@ export class BreakIterator {
/**
* Set the text to be processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text Indicates the text to be processed by the BreakIterator.
* @since 8
*/
@@ -445,7 +445,7 @@ export class BreakIterator {
/**
* Set the BreakIterator's position to the first break point following the specified offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -454,7 +454,7 @@ export class BreakIterator {
/**
* Obtains the text being processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the text that is processed by the BreakIterator.
* @since 8
*/
@@ -465,7 +465,7 @@ export class BreakIterator {
* position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator
* will be moved to the break point following the offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param offset The offset to be checked.
* @return Returns true if the offset is a break point.
* @since 8
@@ -477,14 +477,14 @@ export class BreakIterator {
* Sequence text can be grouped under the specified area,
* and grouping index with different lengths can be specified.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class IndexUtil {
/**
* Get IndexUtil object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @return Returns IndexUtil object.
@@ -495,7 +495,7 @@ export class IndexUtil {
/**
* Get a list of labels for use as a UI index
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a list of labels
* @since 8
*/
@@ -504,7 +504,7 @@ export class IndexUtil {
/**
* Add the index characters from a Locale to the index.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale whose index characters are to be added.
* @since 8
*/
@@ -513,7 +513,7 @@ export class IndexUtil {
/**
* Get corresponding index of the input text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text input text
* @since 8
*/
@@ -523,14 +523,14 @@ export class IndexUtil {
/**
* Provides the API for accessing unicode character properties, sunch as whether a character is a digit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Character {
/**
* Determines whether the specified code point is a digit character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a digit character
*/
@@ -539,7 +539,7 @@ export class Character {
/**
* Determines if the specified character is a space character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a space character
*/
@@ -548,7 +548,7 @@ export class Character {
/**
* Determines if the specified character is a whitespace character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a whitespace character
*/
@@ -557,7 +557,7 @@ export class Character {
/**
* Determines if the specified character is a RTL character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a RTL character
*/
@@ -566,7 +566,7 @@ export class Character {
/**
* Determines if the specified character is a Ideographic character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Ideographic character
*/
@@ -575,7 +575,7 @@ export class Character {
/**
* Determines if the specified character is a Letter or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Letter
*/
@@ -584,7 +584,7 @@ export class Character {
/**
* Determines if the specified character is a LowerCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a LowerCase character
*/
@@ -593,7 +593,7 @@ export class Character {
/**
* Determines if the specified character is a UpperCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a UpperCase character
*/
@@ -602,7 +602,7 @@ export class Character {
/**
* Get the general category value of the specified character.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns the general category of the specified character.
*/
@@ -612,7 +612,7 @@ export class Character {
/**
* check out whether system is 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a boolean represent whether system is 24-hour system.
* @since 8
*/
@@ -621,7 +621,7 @@ export class Character {
/**
* set 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param option represent the boolean to be set.
* @return Returns a boolean represent whether setting 24-hour system success.
* @since 8
@@ -631,7 +631,7 @@ export class Character {
/**
* Add one language to preferred language List.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language the language to be added.
* @param index the position of preferred language list to be inserted.
* @return Returns a boolean represent whether language added success.
@@ -642,7 +642,7 @@ export function addPreferredLanguage(language: string, index?: number): boolean;
/**
* Remove one language from preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index the position of removed language in preferred language list.
* @return Returns a boolean represent whether removed success.
* @since 8
@@ -652,7 +652,7 @@ export function removePreferredLanguage(index: number): boolean;
/**
* Access the system preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string Array represent the preferred language list.
* @since 8
*/
@@ -661,7 +661,7 @@ export function getPreferredLanguageList(): Array;
/**
* Get the first preferred language of system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string represent the first preferred language of system.
* @since 8
*/
diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts
index 070d0614a1..5bf8f664ee 100755
--- a/api/@ohos.intl.d.ts
+++ b/api/@ohos.intl.d.ts
@@ -16,7 +16,7 @@
/**
* Provides internationalization related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
declare namespace intl {
@@ -24,7 +24,7 @@ declare namespace intl {
* Provides the options of Locale.
*
* @since 8
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface LocaleOptions {
/**
@@ -73,14 +73,14 @@ export interface LocaleOptions {
/**
* Provides APIs for obtaining locale information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class Locale {
/**
* A constructor used to create a Locale object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region.
* @since 6
@@ -90,7 +90,7 @@ export class Locale {
/**
* Indicates the language of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
language: string
@@ -98,7 +98,7 @@ export class Locale {
/**
* Indicates the script of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
script: string
@@ -106,7 +106,7 @@ export class Locale {
/**
* Indicates the region of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
region: string
@@ -115,7 +115,7 @@ export class Locale {
* Indicates the basic locale information, which is returned as a substring of
* a complete locale string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
baseName: string
@@ -153,7 +153,7 @@ export class Locale {
/**
* Convert the locale information to string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns locale information in string form.
*/
toString(): string;
@@ -161,7 +161,7 @@ export class Locale {
/**
* Maximize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns maximized locale.
*/
maximize(): Locale;
@@ -169,7 +169,7 @@ export class Locale {
/**
* Minimize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns minimized locale.
*/
minimize(): Locale;
@@ -178,7 +178,7 @@ export class Locale {
/**
* Provides the options of date time format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface DateTimeOptions {
/**
@@ -280,14 +280,14 @@ export interface DateTimeOptions {
/**
* Provides the API for formatting date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -295,7 +295,7 @@ export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates character string containing the locale information, including
* the language and optionally the script and region, for the DateTimeFormat object.
* @param options Indicates the options used to format the date.
@@ -306,7 +306,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Indicates the Date object to be formatted.
* @return Returns a date string formatted based on the specified locale.
* @since 6
@@ -316,7 +316,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings of a date range.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param startDate Indicates the start date of the date range.
* @param endDate Indicates the end date of the date range.
* @return Returns a date string formatted based on the specified locale.
@@ -327,7 +327,7 @@ export class DateTimeFormat {
/**
* Obtains the options of the DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the DateTimeFormat object.
* @since 6
*/
@@ -337,7 +337,7 @@ export class DateTimeFormat {
/**
* Provides the options of number format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface NumberOptions {
/**
@@ -439,13 +439,13 @@ export interface NumberOptions {
/**
* Provides the API for formatting number strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -453,7 +453,7 @@ export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @param options Indicates the options used to format the number.
@@ -464,7 +464,7 @@ export class NumberFormat {
/**
* Obtains the formatted number string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the number to be formatted.
* @return Returns a number string formatted based on the specified locale.
* @since 6
@@ -474,7 +474,7 @@ export class NumberFormat {
/**
* Obtains the options of the NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the NumberFormat object.
* @since 6
*/
@@ -484,7 +484,7 @@ export class NumberFormat {
/**
* Provides the options of Collator
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface CollatorOptions {
@@ -533,21 +533,21 @@ export interface CollatorOptions {
/**
* Enable language-sensitive string comparison.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Collator {
/**
* A constructor used to create Collator object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
/**
* A constructor used to create Collator Object;
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the Collator object.
* @param options Indicates the options used to initialize Collator object.
@@ -558,7 +558,7 @@ export class Collator {
/**
* compares two strings according to the sort order of this Collator object
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param first The first string to compare.
* @param second The second string to compare.
* @return Returns a number indicating how first compare to second:
@@ -573,7 +573,7 @@ export class Collator {
* Returns a new object with properties reflecting the locale and collation options computed
* during initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a CollatorOptions object reflecting the properties of this object.
* @since 8
*/
@@ -583,7 +583,7 @@ export class Collator {
/**
* Provides the options of PluralRules
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PluralRulesOptions {
@@ -633,14 +633,14 @@ export interface PluralRulesOptions {
/**
* Enables plural-sensitive formatting and plural-related language rules.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -648,7 +648,7 @@ export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the PluralRules object.
* @param options Indicates the options used to initialize PluralRules object.
@@ -659,7 +659,7 @@ export class PluralRules {
/**
* Returns a string indicating which plural rule to use for locale-aware formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param n The number to get a plural rule for.
* @return A string representing the pluralization category of the number,
* can be one of zero, one, two, few, many or other.
@@ -671,7 +671,7 @@ export class PluralRules {
/**
* Provides the input options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatInputOptions {
@@ -697,7 +697,7 @@ export class PluralRules {
/**
* Provides the resolved options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatResolvedOptions {
@@ -728,14 +728,14 @@ export interface RelativeTimeFormatResolvedOptions {
* Given a Time period length value and a unit, RelativeTimeFormat object enables
* language-sensitive relative time formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -743,7 +743,7 @@ export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the RelativeTimeFormat object.
* @param options Indicates the options used to initialize RelativeTimeFormat object.
@@ -754,7 +754,7 @@ export class RelativeTimeFormat {
/**
* formats a value and unit according to the locale and formatting options of this object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit Unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -767,7 +767,7 @@ export class RelativeTimeFormat {
* returns an Array of objects representing the relative time format in parts that can be used for
* custom locale-aware formatting
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -780,7 +780,7 @@ export class RelativeTimeFormat {
* Returns a new object with properties reflecting the locale and formatting options computed during
* initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @returns RelativeTimeFormatOptions which reflecting the locale and formatting options of the object.
* @since 8
*/
--
Gitee
From 4f55b7c7d6b61c4ce849f393470d07a83e42de23 Mon Sep 17 00:00:00 2001
From: x00405909
Date: Wed, 2 Mar 2022 10:19:56 +0800
Subject: [PATCH 16/45] =?UTF-8?q?syscap=20=E6=94=B9=E5=B0=8F=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: x00405909
Change-Id: I56891fcba44d730c51398d851bc23b2510b7fbab
---
api/@ohos.deviceInfo.d.ts | 2 +-
api/@ohos.systemparameter.d.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/@ohos.deviceInfo.d.ts b/api/@ohos.deviceInfo.d.ts
index 18cca63174..8e91729a90 100644
--- a/api/@ohos.deviceInfo.d.ts
+++ b/api/@ohos.deviceInfo.d.ts
@@ -17,7 +17,7 @@
* A static class pertaining to the product information.
*
* @since 6
- * @Syscap SystemCapability.Startup.SysInfo
+ * @syscap SystemCapability.Startup.SysInfo
*/
declare namespace deviceInfo {
/**
diff --git a/api/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts
index 57a2906095..1e20358fa7 100644
--- a/api/@ohos.systemparameter.d.ts
+++ b/api/@ohos.systemparameter.d.ts
@@ -19,7 +19,7 @@ import { AsyncCallback, BusinessError } from './basic';
* The interface of system parameters class.
*
* @since 6
- * @Syscap SystemCapability.Startup.SysInfo
+ * @syscap SystemCapability.Startup.SysInfo
* @hide
*/
declare namespace systemParameter {
--
Gitee
From e7de43efb44f169c9b2661a45b917e4b91b45b42 Mon Sep 17 00:00:00 2001
From: PaDaBoo
Date: Wed, 2 Mar 2022 10:45:21 +0800
Subject: [PATCH 17/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9storage=E5=92=8Cprefere?=
=?UTF-8?q?nces=E6=8E=A5=E5=8F=A3=E7=89=88=E6=9C=AC=E6=94=AF=E6=8C=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: PaDaBoo
---
api/@ohos.data.preferences.d.ts | 32 ++++++++++++++---------------
api/@ohos.data.storage.d.ts | 36 ++++++++++++++++-----------------
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts
index c575537103..000599ed5d 100644
--- a/api/@ohos.data.preferences.d.ts
+++ b/api/@ohos.data.preferences.d.ts
@@ -19,9 +19,9 @@ import Context from "./application/Context";
* Provides interfaces to obtain and modify preferences data.
*
* @name preferences
- * @since 8
+ * @since 9
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
*/
declare namespace preferences {
/**
@@ -34,7 +34,7 @@ declare namespace preferences {
* @param name Indicates the preferences file name.
* @return Returns the {@link Preferences} instance matching the specified preferences file name.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
function getPreferences(context: Context, name: string, callback: AsyncCallback): void;
function getPreferences(context: Context, name: string): Promise;
@@ -51,7 +51,7 @@ declare namespace preferences {
* @param context Indicates the context of application or capability.
* @param name Indicates the preferences file name.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
function deletePreferences(context: Context, name: string, callback: AsyncCallback): void;
function deletePreferences(context: Context, name: string): Promise;
@@ -67,7 +67,7 @@ declare namespace preferences {
* @param context Indicates the context of application or capability.
* @param name Indicates the preferences file name.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback): void;
function removePreferencesFromCache(context: Context, name: string): Promise;
@@ -81,8 +81,8 @@ declare namespace preferences {
* to remove the {@link Preferences} instance from the memory.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
- * @since 8
+ *
+ * @since 9
*/
interface Preferences {
/**
@@ -94,7 +94,7 @@ declare namespace preferences {
* @param defValue Indicates the default value to return.
* @return Returns the value matching the specified key if it is found; returns the default value otherwise.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
get(key: string, defValue: ValueType, callback: AsyncCallback): void;
get(key: string, defValue: ValueType): Promise;
@@ -106,7 +106,7 @@ declare namespace preferences {
* @return Returns {@code true} if the {@link Preferences} object contains a preferences with the specified key;
* returns {@code false} otherwise.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
has(key: string, callback: AsyncCallback): boolean;
has(key: string): Promise;
@@ -121,7 +121,7 @@ declare namespace preferences {
* @param value Indicates the value of the preferences.
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
put(key: string, value: ValueType, callback: AsyncCallback): void;
put(key: string, value: ValueType): Promise;
@@ -135,7 +135,7 @@ declare namespace preferences {
* @param key Indicates the key of the preferences to delete. It cannot be {@code null} or empty.
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
delete(key: string, callback: AsyncCallback): void;
delete(key: string): Promise;
@@ -147,7 +147,7 @@ declare namespace preferences {
* file.
*
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
clear(callback: AsyncCallback): void;
clear(): Promise;
@@ -156,7 +156,7 @@ declare namespace preferences {
* Asynchronously saves the {@link Preferences} object to the file.
*
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
flush(callback: AsyncCallback): void;
flush(): Promise;
@@ -166,7 +166,7 @@ declare namespace preferences {
*
* @param callback Indicates the callback when preferences changes.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
on(type: 'change', callback: Callback<{ key: string }>): void;
@@ -175,7 +175,7 @@ declare namespace preferences {
*
* @param callback Indicates the registered callback.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
off(type: 'change', callback: Callback<{ key: string }>): void;
}
@@ -196,4 +196,4 @@ declare namespace preferences {
const MAX_VALUE_LENGTH: 8192;
}
-export default preferences;
\ No newline at end of file
+export default preferences;
diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts
index 15c6b1b06b..3da37c191e 100644
--- a/api/@ohos.data.storage.d.ts
+++ b/api/@ohos.data.storage.d.ts
@@ -19,9 +19,9 @@ import { AsyncCallback, Callback } from './basic';
*
* @name storage
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
*/
declare namespace storage {
/**
@@ -34,7 +34,7 @@ declare namespace storage {
* @return Returns the {@link Storage} instance matching the specified storage file name.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function getStorageSync(path: string): Storage;
@@ -53,7 +53,7 @@ declare namespace storage {
* @param path Indicates the path of storage file
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function deleteStorageSync(path: string): void;
function deleteStorage(path: string, callback: AsyncCallback): void;
@@ -70,7 +70,7 @@ declare namespace storage {
* @param path Indicates the path of storage file.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function removeStorageFromCacheSync(path: string): void;
function removeStorageFromCache(path: string, callback: AsyncCallback): void;
@@ -85,9 +85,9 @@ declare namespace storage {
* to remove the {@link Storage} instance from the memory.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface Storage {
/**
@@ -100,7 +100,7 @@ declare namespace storage {
* @return Returns the value matching the specified key if it is found; returns the default value otherwise.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
getSync(key: string, defValue: ValueType): ValueType;
get(key: string, defValue: ValueType, callback: AsyncCallback): void;
@@ -114,7 +114,7 @@ declare namespace storage {
* returns {@code false} otherwise.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
hasSync(key: string): boolean;
has(key: string, callback: AsyncCallback): boolean;
@@ -131,7 +131,7 @@ declare namespace storage {
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
putSync(key: string, value: ValueType): void;
put(key: string, value: ValueType, callback: AsyncCallback): void;
@@ -147,7 +147,7 @@ declare namespace storage {
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
deleteSync(key: string): void;
delete(key: string, callback: AsyncCallback): void;
@@ -161,7 +161,7 @@ declare namespace storage {
*
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
clearSync(): void;
clear(callback: AsyncCallback): void;
@@ -172,7 +172,7 @@ declare namespace storage {
*
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
flushSync(): void;
flush(callback: AsyncCallback): void;
@@ -184,7 +184,7 @@ declare namespace storage {
* @param callback Indicates the callback when storage changes.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
on(type: 'change', callback: Callback): void;
@@ -194,7 +194,7 @@ declare namespace storage {
* @param callback Indicates the registered callback.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
off(type: 'change', callback: Callback): void;
}
@@ -208,9 +208,9 @@ declare namespace storage {
* Define the change data information object.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface StorageObserver {
/**
@@ -230,4 +230,4 @@ declare namespace storage {
const MAX_VALUE_LENGTH: 8192;
}
-export default storage;
\ No newline at end of file
+export default storage;
--
Gitee
From 37f62fc77a8c508cb92e63d42805f8508e190b70 Mon Sep 17 00:00:00 2001
From: zhangxiao72
Date: Wed, 2 Mar 2022 10:54:16 +0800
Subject: [PATCH 18/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9JavaScriptProxy?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I5408dd6293a3b00cf2a8f6e4869863e8df2ebeed
Signed-off-by: zhangxiao72
---
api/@internal/component/ets/form_component.d.ts | 7 +++++++
api/@internal/component/ets/web.d.ts | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/api/@internal/component/ets/form_component.d.ts b/api/@internal/component/ets/form_component.d.ts
index 1d3fa7dfdd..d2a7037831 100644
--- a/api/@internal/component/ets/form_component.d.ts
+++ b/api/@internal/component/ets/form_component.d.ts
@@ -132,6 +132,13 @@ declare class FormComponentAttribute extends CommonMethod void): FormComponentAttribute;
+
+ /**
+ * Uninstall Card.
+ * @since 7
+ * @systemapi
+ */
+ onUninstall(callback: (info: { id: number }) => void): FormComponentAttribute;
}
declare const FormComponent: FormComponentInterface;
diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts
index d75f2cda11..41529e68d5 100755
--- a/api/@internal/component/ets/web.d.ts
+++ b/api/@internal/component/ets/web.d.ts
@@ -468,7 +468,7 @@ declare class WebAttribute extends CommonMethod {
* Inject the arkUI JS object into H5 and invoke the function of the object in H5.
* @since 8
*/
- javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array }): WebAttribute;
+ javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array, controller: WebController }): WebAttribute;
/*
* Sets whether the Web should save the password.
--
Gitee
From ace311d85369866f7d4af511dd8513390c231680 Mon Sep 17 00:00:00 2001
From: lancer <591320480@qq.com>
Date: Wed, 2 Mar 2022 11:15:48 +0800
Subject: [PATCH 19/45] Description: update capability comment Feature or
Bugfix: Bugfix Binary Source:No Signed-off-by: lancer
---
api/liteWearable/@system.app.d.ts | 2 +-
api/liteWearable/@system.router.d.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/liteWearable/@system.app.d.ts b/api/liteWearable/@system.app.d.ts
index a25c8d9414..1da69498d0 100644
--- a/api/liteWearable/@system.app.d.ts
+++ b/api/liteWearable/@system.app.d.ts
@@ -60,7 +60,7 @@ export interface ScreenOnVisibleOptions {
}
/**
- * @Syscap SysCap.ACE.UIEngineLite
+ * @syscap SystemCapability.ArkUI.ArkUI.Lite
*/
export default class App {
/**
diff --git a/api/liteWearable/@system.router.d.ts b/api/liteWearable/@system.router.d.ts
index 6435e2e693..100ba99982 100644
--- a/api/liteWearable/@system.router.d.ts
+++ b/api/liteWearable/@system.router.d.ts
@@ -35,7 +35,7 @@ export interface RouterOptions {
}
/**
- * @Syscap SysCap.ACE.UIEngineLite
+ * @syscap SystemCapability.ArkUI.ArkUI.Lite
*/
export default class Router {
/**
--
Gitee
From 6513da04b1685c10631d12b698fa99465d16e4c4 Mon Sep 17 00:00:00 2001
From: huangke11
Date: Wed, 2 Mar 2022 11:23:43 +0800
Subject: [PATCH 20/45] modify syscap
Signed-off-by: huangke11
---
api/@ohos.configPolicy.d.ts | 8 +--
api/@ohos.i18n.d.ts | 132 ++++++++++++++++++------------------
api/@ohos.intl.d.ts | 86 +++++++++++------------
3 files changed, 113 insertions(+), 113 deletions(-)
diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts
index 32ef672ca0..d12690c30f 100644
--- a/api/@ohos.configPolicy.d.ts
+++ b/api/@ohos.configPolicy.d.ts
@@ -19,7 +19,7 @@ import {AsyncCallback} from "./basic";
* Provides file path related APIS.
*
* @since 8
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
*/
declare namespace configPolicy {
/**
@@ -27,7 +27,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @return Returns the path of the highest priority config file.
*/
@@ -39,7 +39,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @return Returns paths of config files.
*/
@@ -51,7 +51,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @return Returns paths of config directories.
*/
function getCfgDirList(callback: AsyncCallback>);
diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts
index cec6042811..b8dc57ffdc 100644
--- a/api/@ohos.i18n.d.ts
+++ b/api/@ohos.i18n.d.ts
@@ -16,14 +16,14 @@
/**
* Provides international settings related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 7
*/
declare namespace i18n {
/**
* Obtains the country or region name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country The locale whose country or region name will be displayed.
* @param locale The locale used to display the country or region.
* @param sentenceCase Specifies whether the country or region name is displayed in sentence case.
@@ -35,7 +35,7 @@ export function getDisplayCountry(country: string, locale: string, sentenceCase?
/**
* Obtains the language name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The locale whose language name will be displayed.
* @param locale The locale used to display the language.
* @param sentenceCase Specifies whether the language name is displayed in sentence case.
@@ -47,7 +47,7 @@ export function getDisplayLanguage(language: string, locale: string, sentenceCas
/**
* Obtain all languages supported by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns all languages supported by the system.
* @since 7
* @systemapi Hide this for inner system use.
@@ -57,7 +57,7 @@ export function getSystemLanguages(): Array;
/**
* Obtain all regions supported by the system in the language.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language used to get the list of regions.
* @return Returns all regions supported by the system in the language.
* @since 7
@@ -68,7 +68,7 @@ export function getSystemCountries(language: string): Array;
/**
* Determine whether the current language or region is recommended.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language code.
* @param region The region code.
* @return Returns whether the current language or region is recommended.
@@ -80,7 +80,7 @@ export function isSuggested(language: string, region?: string): boolean;
/**
* Obtain the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the language currently used by the system.
* @since 7
*/
@@ -89,7 +89,7 @@ export function getSystemLanguage(): string;
/**
* Set the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -99,7 +99,7 @@ export function setSystemLanguage(language: string): boolean;
/**
* Obtain the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the region currently used by the system.
* @since 7
*/
@@ -108,7 +108,7 @@ export function getSystemRegion(): string;
/**
* Set the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param region The region to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -118,7 +118,7 @@ export function setSystemRegion(region: string): boolean;
/**
* Obtain the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the locale currently used by the system.
* @since 7
*/
@@ -127,7 +127,7 @@ export function getSystemLocale(): string;
/**
* Set the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -137,14 +137,14 @@ export function setSystemLocale(locale: string): boolean;
/**
* Provides util functions.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface Util {
/**
* Convert from unit to to unit and format according to the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param fromUnit Information of the unit to be converted.
* @param toUnit Information about the unit to be converted to.
* @param value Indicates the number to be formatted.
@@ -158,7 +158,7 @@ export interface Util {
/**
* Provides the options of unit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface UnitInfo {
@@ -176,7 +176,7 @@ export interface UnitInfo {
/**
* Provides the options of PhoneNumberFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PhoneNumberFormatOptions {
@@ -189,14 +189,14 @@ export interface PhoneNumberFormatOptions {
/**
* Provides the API for formatting phone number strings
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PhoneNumberFormat {
/**
* A constructor used to create a PhoneNumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country Indicates a character string containing the country information for the PhoneNumberFormat object.
* @param type Indicates the type used to format the phone number, includes: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL".
* @since 8
@@ -206,7 +206,7 @@ export class PhoneNumberFormat {
/**
* Judges whether phone number is valid.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be judged.
* @return Returns a boolean indicates whether the input phone number is valid.
* @since 8
@@ -216,7 +216,7 @@ export class PhoneNumberFormat {
/**
* Obtains the formatted phone number strings of number.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be formatted.
* @return Returns the formatted phone number.
* @since 8
@@ -227,7 +227,7 @@ export class PhoneNumberFormat {
/**
* Get a Calendar instance specified by locale and type.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale used to get calendar.
* @param type If type is not specified, get locale's default Calendar, else get the specified type of Calendar.
* such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura,
@@ -240,7 +240,7 @@ export class Calendar {
/**
* set the date.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object used to set the time and date.
* @since 8
*/
@@ -249,7 +249,7 @@ export class Calendar {
/**
* set the time.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param time Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT.
* @since 8
*/
@@ -258,7 +258,7 @@ export class Calendar {
/**
* Set the time
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param year The year field of the calendar, ranges from 0 to 9999.
* @param month The month field of the calendar, ranges from 0 to 11.
* @param date The day field of the calendar, ranges from 1 to 31.
@@ -272,7 +272,7 @@ export class Calendar {
/**
* Set the timezone of this calendar.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param timezone The id of a timezone.
* @since 8
*/
@@ -281,7 +281,7 @@ export class Calendar {
/**
* Get the timezone id of this calendar instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the timezone id of this calendar.
* @since 8
*/
@@ -290,7 +290,7 @@ export class Calendar {
/**
* Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns start day of a week.
* @since 8
*/
@@ -299,7 +299,7 @@ export class Calendar {
/**
* Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
* @since 8
*/
@@ -308,7 +308,7 @@ export class Calendar {
/**
* Get the minimal days of a week, which is needed for the first day of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the minimal days of a week.
* @since 8
*/
@@ -317,7 +317,7 @@ export class Calendar {
/**
* Set the minimal days of a week, which is needed for the first week of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value The value to be set.
* @since 8
*/
@@ -326,7 +326,7 @@ export class Calendar {
/**
* Get the associated value with the field.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param field Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week
* day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy,
* dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month.
@@ -338,7 +338,7 @@ export class Calendar {
/**
* Get calendar's name localized for display in the given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Locale used to get the localized name for this calendar.
* @return Returns the localized name of this calendar.
* @since 8
@@ -349,7 +349,7 @@ export class Calendar {
* Returns true if the given date is a weekend day. If the date is not given,
* the date object of this calendar is used.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object whose attribute is desired.
* @return Returns whether the date is a weekend day.
* @since 8
@@ -360,7 +360,7 @@ export class Calendar {
/**
* Judge whether the locale is RTL locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @return Returns true representing the locale is an RTL locale
*
@@ -371,7 +371,7 @@ export function isRTL(locale: string): boolean;
/**
* Obtains a BreakIterator object for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale the returned BreakIterator will adapt the rule, specified by the locale, to break text.
* @return Returns a newly constructed BreakIterator object.
* @since 8
@@ -381,14 +381,14 @@ export function isRTL(locale: string): boolean;
/**
* The BreakIterator class is used for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class BreakIterator {
/**
* Obtains the current position of the BreakIterator instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the current position of the BreakIterator instance.
* @since 8
*/
@@ -398,7 +398,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the first break point, the first break point is always the beginning of the
* processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the first break point.
* @since 8
*/
@@ -408,7 +408,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the last break point. the last break point is always the index beyond the
* last character of the processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the last break point.
* @since 8
*/
@@ -417,7 +417,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the nth break point from the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index indicates the number of break points to advance. If index is not given, n is treated as 1.
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
@@ -427,7 +427,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the break point preceding the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -436,7 +436,7 @@ export class BreakIterator {
/**
* Set the text to be processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text Indicates the text to be processed by the BreakIterator.
* @since 8
*/
@@ -445,7 +445,7 @@ export class BreakIterator {
/**
* Set the BreakIterator's position to the first break point following the specified offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -454,7 +454,7 @@ export class BreakIterator {
/**
* Obtains the text being processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the text that is processed by the BreakIterator.
* @since 8
*/
@@ -465,7 +465,7 @@ export class BreakIterator {
* position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator
* will be moved to the break point following the offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param offset The offset to be checked.
* @return Returns true if the offset is a break point.
* @since 8
@@ -477,14 +477,14 @@ export class BreakIterator {
* Sequence text can be grouped under the specified area,
* and grouping index with different lengths can be specified.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class IndexUtil {
/**
* Get IndexUtil object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @return Returns IndexUtil object.
@@ -495,7 +495,7 @@ export class IndexUtil {
/**
* Get a list of labels for use as a UI index
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a list of labels
* @since 8
*/
@@ -504,7 +504,7 @@ export class IndexUtil {
/**
* Add the index characters from a Locale to the index.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale whose index characters are to be added.
* @since 8
*/
@@ -513,7 +513,7 @@ export class IndexUtil {
/**
* Get corresponding index of the input text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text input text
* @since 8
*/
@@ -523,14 +523,14 @@ export class IndexUtil {
/**
* Provides the API for accessing unicode character properties, sunch as whether a character is a digit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Character {
/**
* Determines whether the specified code point is a digit character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a digit character
*/
@@ -539,7 +539,7 @@ export class Character {
/**
* Determines if the specified character is a space character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a space character
*/
@@ -548,7 +548,7 @@ export class Character {
/**
* Determines if the specified character is a whitespace character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a whitespace character
*/
@@ -557,7 +557,7 @@ export class Character {
/**
* Determines if the specified character is a RTL character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a RTL character
*/
@@ -566,7 +566,7 @@ export class Character {
/**
* Determines if the specified character is a Ideographic character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Ideographic character
*/
@@ -575,7 +575,7 @@ export class Character {
/**
* Determines if the specified character is a Letter or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Letter
*/
@@ -584,7 +584,7 @@ export class Character {
/**
* Determines if the specified character is a LowerCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a LowerCase character
*/
@@ -593,7 +593,7 @@ export class Character {
/**
* Determines if the specified character is a UpperCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a UpperCase character
*/
@@ -602,7 +602,7 @@ export class Character {
/**
* Get the general category value of the specified character.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns the general category of the specified character.
*/
@@ -612,7 +612,7 @@ export class Character {
/**
* check out whether system is 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a boolean represent whether system is 24-hour system.
* @since 8
*/
@@ -621,7 +621,7 @@ export class Character {
/**
* set 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param option represent the boolean to be set.
* @return Returns a boolean represent whether setting 24-hour system success.
* @since 8
@@ -631,7 +631,7 @@ export class Character {
/**
* Add one language to preferred language List.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language the language to be added.
* @param index the position of preferred language list to be inserted.
* @return Returns a boolean represent whether language added success.
@@ -642,7 +642,7 @@ export function addPreferredLanguage(language: string, index?: number): boolean;
/**
* Remove one language from preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index the position of removed language in preferred language list.
* @return Returns a boolean represent whether removed success.
* @since 8
@@ -652,7 +652,7 @@ export function removePreferredLanguage(index: number): boolean;
/**
* Access the system preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string Array represent the preferred language list.
* @since 8
*/
@@ -661,7 +661,7 @@ export function getPreferredLanguageList(): Array;
/**
* Get the first preferred language of system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string represent the first preferred language of system.
* @since 8
*/
diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts
index 070d0614a1..5bf8f664ee 100755
--- a/api/@ohos.intl.d.ts
+++ b/api/@ohos.intl.d.ts
@@ -16,7 +16,7 @@
/**
* Provides internationalization related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
declare namespace intl {
@@ -24,7 +24,7 @@ declare namespace intl {
* Provides the options of Locale.
*
* @since 8
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface LocaleOptions {
/**
@@ -73,14 +73,14 @@ export interface LocaleOptions {
/**
* Provides APIs for obtaining locale information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class Locale {
/**
* A constructor used to create a Locale object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region.
* @since 6
@@ -90,7 +90,7 @@ export class Locale {
/**
* Indicates the language of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
language: string
@@ -98,7 +98,7 @@ export class Locale {
/**
* Indicates the script of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
script: string
@@ -106,7 +106,7 @@ export class Locale {
/**
* Indicates the region of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
region: string
@@ -115,7 +115,7 @@ export class Locale {
* Indicates the basic locale information, which is returned as a substring of
* a complete locale string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
baseName: string
@@ -153,7 +153,7 @@ export class Locale {
/**
* Convert the locale information to string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns locale information in string form.
*/
toString(): string;
@@ -161,7 +161,7 @@ export class Locale {
/**
* Maximize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns maximized locale.
*/
maximize(): Locale;
@@ -169,7 +169,7 @@ export class Locale {
/**
* Minimize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns minimized locale.
*/
minimize(): Locale;
@@ -178,7 +178,7 @@ export class Locale {
/**
* Provides the options of date time format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface DateTimeOptions {
/**
@@ -280,14 +280,14 @@ export interface DateTimeOptions {
/**
* Provides the API for formatting date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -295,7 +295,7 @@ export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates character string containing the locale information, including
* the language and optionally the script and region, for the DateTimeFormat object.
* @param options Indicates the options used to format the date.
@@ -306,7 +306,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Indicates the Date object to be formatted.
* @return Returns a date string formatted based on the specified locale.
* @since 6
@@ -316,7 +316,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings of a date range.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param startDate Indicates the start date of the date range.
* @param endDate Indicates the end date of the date range.
* @return Returns a date string formatted based on the specified locale.
@@ -327,7 +327,7 @@ export class DateTimeFormat {
/**
* Obtains the options of the DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the DateTimeFormat object.
* @since 6
*/
@@ -337,7 +337,7 @@ export class DateTimeFormat {
/**
* Provides the options of number format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface NumberOptions {
/**
@@ -439,13 +439,13 @@ export interface NumberOptions {
/**
* Provides the API for formatting number strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -453,7 +453,7 @@ export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @param options Indicates the options used to format the number.
@@ -464,7 +464,7 @@ export class NumberFormat {
/**
* Obtains the formatted number string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the number to be formatted.
* @return Returns a number string formatted based on the specified locale.
* @since 6
@@ -474,7 +474,7 @@ export class NumberFormat {
/**
* Obtains the options of the NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the NumberFormat object.
* @since 6
*/
@@ -484,7 +484,7 @@ export class NumberFormat {
/**
* Provides the options of Collator
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface CollatorOptions {
@@ -533,21 +533,21 @@ export interface CollatorOptions {
/**
* Enable language-sensitive string comparison.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Collator {
/**
* A constructor used to create Collator object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
/**
* A constructor used to create Collator Object;
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the Collator object.
* @param options Indicates the options used to initialize Collator object.
@@ -558,7 +558,7 @@ export class Collator {
/**
* compares two strings according to the sort order of this Collator object
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param first The first string to compare.
* @param second The second string to compare.
* @return Returns a number indicating how first compare to second:
@@ -573,7 +573,7 @@ export class Collator {
* Returns a new object with properties reflecting the locale and collation options computed
* during initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a CollatorOptions object reflecting the properties of this object.
* @since 8
*/
@@ -583,7 +583,7 @@ export class Collator {
/**
* Provides the options of PluralRules
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PluralRulesOptions {
@@ -633,14 +633,14 @@ export interface PluralRulesOptions {
/**
* Enables plural-sensitive formatting and plural-related language rules.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -648,7 +648,7 @@ export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the PluralRules object.
* @param options Indicates the options used to initialize PluralRules object.
@@ -659,7 +659,7 @@ export class PluralRules {
/**
* Returns a string indicating which plural rule to use for locale-aware formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param n The number to get a plural rule for.
* @return A string representing the pluralization category of the number,
* can be one of zero, one, two, few, many or other.
@@ -671,7 +671,7 @@ export class PluralRules {
/**
* Provides the input options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatInputOptions {
@@ -697,7 +697,7 @@ export class PluralRules {
/**
* Provides the resolved options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatResolvedOptions {
@@ -728,14 +728,14 @@ export interface RelativeTimeFormatResolvedOptions {
* Given a Time period length value and a unit, RelativeTimeFormat object enables
* language-sensitive relative time formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -743,7 +743,7 @@ export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the RelativeTimeFormat object.
* @param options Indicates the options used to initialize RelativeTimeFormat object.
@@ -754,7 +754,7 @@ export class RelativeTimeFormat {
/**
* formats a value and unit according to the locale and formatting options of this object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit Unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -767,7 +767,7 @@ export class RelativeTimeFormat {
* returns an Array of objects representing the relative time format in parts that can be used for
* custom locale-aware formatting
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -780,7 +780,7 @@ export class RelativeTimeFormat {
* Returns a new object with properties reflecting the locale and formatting options computed during
* initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @returns RelativeTimeFormatOptions which reflecting the locale and formatting options of the object.
* @since 8
*/
--
Gitee
From bbc20135f8245d3153ae0786b485d42ac2fdaf8f Mon Sep 17 00:00:00 2001
From: hellohyh001
Date: Wed, 2 Mar 2022 11:52:17 +0800
Subject: [PATCH 21/45] Signed-off-by:hellohyh001
Signed-off-by: hellohyh001
---
api/@system.sensor.d.ts | 878 ++++++++++++++++++++++++++++++++++++++
api/@system.vibrator.d.ts | 66 +++
2 files changed, 944 insertions(+)
create mode 100644 api/@system.sensor.d.ts
create mode 100644 api/@system.vibrator.d.ts
diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts
new file mode 100644
index 0000000000..ec89fd8622
--- /dev/null
+++ b/api/@system.sensor.d.ts
@@ -0,0 +1,878 @@
+/*
+ * Copyright (c) 2021 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.
+ */
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.ACCELEROMETER
+ * @since 3
+ * @deprecated since 8
+ */
+export interface AccelerometerResponse {
+ /**
+ * X-coordinate
+ * @since 3
+ */
+ x: number;
+
+ /**
+ * Y-coordinate
+ * @since 3
+ */
+ y: number;
+
+ /**
+ * Z-coordinate
+ * @since 3
+ */
+ z: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.ACCELEROMETER
+ * @since 3
+ * @deprecated since 8
+ */
+export interface subscribeAccelerometerOptions {
+ /**
+ * Execution frequency of the callback function for listening to acceleration sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 3
+ */
+ interval: string;
+
+ /**
+ * Called when acceleration sensor data changes.
+ * @since 3
+ */
+ success: (data: AccelerometerResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface CompassResponse {
+ /**
+ * Direction of the device (in degrees).
+ * @since 3
+ */
+ direction: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeCompassOptions {
+ /**
+ * Called when compass sensor data changes.
+ * @since 3
+ */
+ success: (data: CompassResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface ProximityResponse {
+ /**
+ * Distance between a visible object and the device screen
+ * @since 3
+ */
+ distance: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeProximityOptions {
+ /**
+ * Called when distance sensor data changes.
+ * @since 3
+ */
+ success: (data: ProximityResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface LightResponse {
+ /**
+ * Light intensity, in lux.
+ * @since 3
+ */
+ intensity: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeLightOptions {
+ /**
+ * Called when ambient light sensor data changes.
+ * @since 3
+ */
+ success: (data: LightResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.ACTIVITY_MOTION
+ * @since 3
+ * @deprecated since 8
+ */
+export interface StepCounterResponse {
+ /**
+ * Number of steps counted.
+ * Each time the device restarts, the value is recalculated from 0 in phone, tablet.
+ * @since 3
+ */
+ steps: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.ACTIVITY_MOTION
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeStepCounterOptions {
+ /**
+ * Called when step counter sensor data changes.
+ * @since 3
+ */
+ success: (data: StepCounterResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface BarometerResponse {
+ /**
+ * Pressure, in pascal.
+ * @since 3
+ */
+ pressure: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeBarometerOptions {
+ /**
+ * Called when the barometer sensor data changes.
+ * @since 3
+ */
+ success: (data: BarometerResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.READ_HEALTH_DATA
+ * @since 3
+ * @deprecated since 8
+ */
+export interface HeartRateResponse {
+ /**
+ * Heart rate.
+ * 255 indicates an invalid value in lite wearable.
+ * @since 3
+ */
+ heartRate: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.READ_HEALTH_DATA
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeHeartRateOptions {
+ /**
+ * Called when the heart rate sensor data changes.
+ * @since 3
+ */
+ success: (data: HeartRateResponse) => void;
+
+ /**
+ * Called when the listening fails
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface OnBodyStateResponse {
+ /**
+ * Whether the sensor is worn.
+ * @since 3
+ */
+ value: boolean;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface SubscribeOnBodyStateOptions {
+ /**
+ * Called when the wearing status changes.
+ * @since 3
+ */
+ success: (data: OnBodyStateResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 3
+ * @deprecated since 8
+ */
+export interface GetOnBodyStateOptions {
+ /**
+ * Called when the sensor wearing state is obtained
+ * @since 3
+ */
+ success: (data: OnBodyStateResponse) => void;
+
+ /**
+ * Called when the sensor wearing state fails to be obtained
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+
+ /**
+ * Called when the execution is completed
+ * @since 3
+ */
+ complete?: () => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 6
+ * @deprecated since 8
+ */
+export interface DeviceOrientationResponse {
+ /**
+ * alpha
+ * @since 6
+ */
+ alpha: number;
+
+ /**
+ * beta
+ * @since 6
+ */
+ beta: number;
+
+ /**
+ * gamma
+ * @since 6
+ */
+ gamma: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 6
+ * @deprecated since 8
+ */
+export interface SubscribeDeviceOrientationOptions {
+ /**
+ * Execution frequency of the callback function for listening to device orientation sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 6
+ */
+ interval: string;
+
+ /**
+ * Called when device orientation sensor data changes.
+ * @since 6
+ */
+ success: (data: DeviceOrientationResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 6
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.GYROSCOPE
+ * @since 6
+ * @deprecated since 8
+ */
+export interface GyroscopeResponse {
+ /**
+ * X-coordinate
+ * @since 6
+ */
+ x: number;
+
+ /**
+ * Y-coordinate
+ * @since 6
+ */
+ y: number;
+
+ /**
+ * Z-coordinate
+ * @since 6
+ */
+ z: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @permission ohos.permission.GYROSCOPE
+ * @since 6
+ * @deprecated since 8
+ */
+export interface SubscribeGyroscopeOptions {
+ /**
+ * Execution frequency of the callback function for listening to gyroscope sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 6
+ */
+ interval: string;
+
+ /**
+ * Called when gyroscope sensor data changes.
+ * @since 6
+ */
+ success: (data: GyroscopeResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 6
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface GravityResponse {
+ /**
+ * X-coordinate
+ * @since 7
+ */
+ x: number;
+
+ /**
+ * Y-coordinate
+ * @since 7
+ */
+ y: number;
+
+ /**
+ * Z-coordinate
+ * @since 7
+ */
+ z: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface SubscribeGravityOptions {
+ /**
+ * Execution frequency of the callback function for listening to gravity sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 7
+ */
+ interval: string;
+
+ /**
+ * Called when gravity sensor data changes.
+ * @since 7
+ */
+ success: (data: GravityResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 7
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface MagneticResponse {
+ /**
+ * X-coordinate
+ * @since 7
+ */
+ x: number;
+
+ /**
+ * Y-coordinate
+ * @since 7
+ */
+ y: number;
+
+ /**
+ * Z-coordinate
+ * @since 7
+ */
+ z: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface SubscribeMagneticOptions {
+ /**
+ * Execution frequency of the callback function for listening to magnetic sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 7
+ */
+ interval: string;
+
+ /**
+ * Called when magnetic sensor data changes.
+ * @since 7
+ */
+ success: (data: MagneticResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 7
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface HallResponse {
+ /**
+ * Indicates the hall sensor data.
+ * @since 7
+ */
+ value: number;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export interface SubscribeHallOptions {
+ /**
+ * Execution frequency of the callback function for listening to hall sensor data.
+ * Available values are as follows:
+ * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming.
+ * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating.
+ * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption.
+ * The default value is normal.
+ * @since 7
+ */
+ interval: string;
+
+ /**
+ * Called when hall sensor data changes.
+ * @since 7
+ */
+ success: (data: HallResponse) => void;
+
+ /**
+ * Called when the listening fails.
+ * @since 7
+ */
+ fail?: (data: string, code: number) => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.Sensor
+ * @import import sensor from '@system.sensor';
+ * @since 7
+ * @deprecated since 8
+ */
+export default class Sensor {
+ /**
+ * Listens to acceleration sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.ACCELEROMETER
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeAccelerometer(options: subscribeAccelerometerOptions): void;
+
+ /**
+ * Cancels listening to acceleration sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.ACCELEROMETER
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeAccelerometer(): void;
+
+ /**
+ * Listens to compass sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeCompass(options: SubscribeCompassOptions): void;
+
+ /**
+ * Cancels listening to compass sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeCompass(): void;
+
+ /**
+ * Listens to distance sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeProximity(options: SubscribeProximityOptions): void;
+
+ /**
+ * Cancels listening to distance sensor data.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeProximity(): void;
+
+ /**
+ * Listens to ambient light sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeLight(options: SubscribeLightOptions): void;
+
+ /**
+ * Cancels listening to ambient light sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeLight(): void;
+
+ /**
+ * Listens to step counter sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.ACTIVITY_MOTION
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeStepCounter(options: SubscribeStepCounterOptions): void;
+
+ /**
+ * Cancels listening to step counter sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.ACTIVITY_MOTION
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeStepCounter(): void;
+
+ /**
+ * Listens to barometer sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeBarometer(options: SubscribeBarometerOptions): void;
+
+ /**
+ * Cancels listening to barometer sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeBarometer(): void;
+
+ /**
+ * Listens to changes of heart rate sensor data.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.READ_HEALTH_DATA
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeHeartRate(options: SubscribeHeartRateOptions): void;
+
+ /**
+ * Cancels listening to heart rate sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.READ_HEALTH_DATA
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeHeartRate(): void;
+
+ /**
+ * Listens to whether a sensor is worn.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void;
+
+ /**
+ * Cancels listening to whether the sensor is worn.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static unsubscribeOnBodyState(): void;
+
+ /**
+ * Obtains the sensor wearing state.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 3
+ * @deprecated since 8
+ */
+ static getOnBodyState(options: GetOnBodyStateOptions): void;
+
+ /**
+ * Listens to device orientation sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 6
+ * @deprecated since 8
+ */
+ static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void;
+
+ /**
+ * Cancels listening to device orientation sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 6
+ * @deprecated since 8
+ */
+ static unsubscribeDeviceOrientation(): void;
+
+ /**
+ * Listens to gyroscope sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.GYROSCOPE
+ * @since 6
+ * @deprecated since 8
+ */
+ static subscribeGyroscope(options: SubscribeGyroscopeOptions): void;
+
+ /**
+ * Cancels listening to gyroscope sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @permission ohos.permission.GYROSCOPE
+ * @since 6
+ * @deprecated since 8
+ */
+ static unsubscribeGyroscope(): void;
+
+ /**
+ * Listens to gravity sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static subscribeGravity(options: SubscribeGravityOptions): void;
+
+ /**
+ * Cancels listening to gravity sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static unsubscribeGravity(): void;
+
+ /**
+ * Listens to magnetic sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static subscribeMagnetic(options: SubscribeMagneticOptions): void;
+
+ /**
+ * Cancels listening to magnetic sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static unsubscribeMagnetic(): void;
+
+ /**
+ * Listens to hall sensor data changes.
+ * If this API is called multiple times, the last call takes effect.
+ * @param options Options.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static subscribeHall(options: SubscribeHallOptions): void;
+
+ /**
+ * Cancels listening to hall sensor data.
+ * @syscap SystemCapability.Sensors.Sensor
+ * @since 7
+ * @deprecated since 8
+ */
+ static unsubscribeHall(): void;
+}
diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts
new file mode 100644
index 0000000000..f8fd9d1be2
--- /dev/null
+++ b/api/@system.vibrator.d.ts
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2020 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.
+ */
+
+/**
+ * @syscap SystemCapability.Sensors.MiscDevice
+ * @import import vibrator from '@system.vibrator';
+ * @permission ohos.permission.VIBRATE
+ * @since 3
+ * @deprecated since 8
+ */
+export interface VibrateOptions {
+ /**
+ * Vibration mode. The value long indicates long vibration, and short indicates short vibration.
+ * The default value is long.
+ * @since 3
+ */
+ mode?: "long" | "short";
+
+ /**
+ * Called when success to trigger vibration.
+ * @since 3
+ */
+ success: () => void;
+
+ /**
+ * Called when fail to trigger vibration.
+ * @since 3
+ */
+ fail?: (data: string, code: number) => void;
+
+ /**
+ * Called when the execution is completed.
+ * @since 3
+ */
+ complete?: () => void;
+}
+
+/**
+ * @syscap SystemCapability.Sensors.MiscDevice
+ * @import import vibrator from '@system.vibrator';
+ * @permission ohos.permission.VIBRATE
+ * @since 3
+ * @deprecated since 8
+ */
+export default class Vibrator {
+ /**
+ * Triggers vibration.
+ * @param options Options.
+ * @permission ohos.permission.VIBRATE
+ * @since 3
+ * @deprecated since 8
+ */
+ static vibrate(options?: VibrateOptions): void;
+}
--
Gitee
From 4f80230676e4a92f5060051e499010ec4c1a9342 Mon Sep 17 00:00:00 2001
From: wyuanchao
Date: Wed, 2 Mar 2022 14:21:10 +0800
Subject: [PATCH 22/45] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20ohos.bundleState.d.t?=
=?UTF-8?q?s=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: wyuanchao
---
api/@ohos.bundleState.d.ts | 277 +++++++++++++++++++++++++++++++++++++
1 file changed, 277 insertions(+)
create mode 100644 api/@ohos.bundleState.d.ts
diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts
new file mode 100644
index 0000000000..9a5f353a8b
--- /dev/null
+++ b/api/@ohos.bundleState.d.ts
@@ -0,0 +1,277 @@
+/*
+ * 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 } from './basic';
+
+/**
+ * Provides methods for managing bundle usage statistics,
+ * including the methods for querying bundle usage information and state data.
+ *
+ * You can use the methods defined in this class to query
+ * the usage history and states of bundles in a specified period.
+ * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and
+ * then returns it to you.
+ *
+ * @since 7
+ * @devices phone, tablet, tv, wearable, car
+ */
+declare namespace bundleState {
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ interface BundleStateInfo {
+ /**
+ * the identifier of BundleStateInfo.
+ */
+ id: number;
+ /**
+ * the total duration, in milliseconds.
+ */
+ abilityInFgTotalTime?: number;
+ /**
+ * the last time when the application was accessed, in milliseconds.
+ */
+ abilityPrevAccessTime?: number;
+ /**
+ * the last time when the application was visible in the foreground, in milliseconds.
+ */
+ abilityPrevSeenTime?: number;
+ /**
+ * the total duration, in milliseconds.
+ */
+ abilitySeenTotalTime?: number;
+ /**
+ * the bundle name of the application.
+ */
+ bundleName?: string;
+ /**
+ * the total duration, in milliseconds.
+ */
+ fgAbilityAccessTotalTime?: number;
+ /**
+ * the last time when the foreground application was accessed, in milliseconds.
+ */
+ fgAbilityPrevAccessTime?: number;
+ /**
+ * the time of the first bundle usage record in this {@code BundleActiveInfo} object,
+ * in milliseconds.
+ */
+ infosBeginTime?: number;
+ /**
+ * the time of the last bundle usage record in this {@code BundleActiveInfo} object,
+ * in milliseconds.
+ */
+ infosEndTime?: number;
+
+ /**
+ * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object.
+ * The bundle name of both objects must be the same.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param toMerge Indicates the {@link BundleActiveInfo} object to merge.
+ * if the bundle names of the two {@link BundleActiveInfo} objects are different.
+ */
+ merge(toMerge: BundleStateInfo): void;
+ }
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ interface BundleActiveState {
+ /**
+ * the usage priority group of the application.
+ */
+ appUsagePriorityGroup?: number;
+ /**
+ * the bundle name.
+ */
+ bundleName?: string;
+ /**
+ * the shortcut ID.
+ */
+ indexOfLink?: string;
+ /**
+ * the class name.
+ */
+ nameOfClass?: string;
+ /**
+ * the time when this state occurred, in milliseconds.
+ */
+ stateOccurredTime?: number;
+ /**
+ * the state type.
+ */
+ stateType?: number;
+ }
+
+ /**
+ * Checks whether the application with a specified bundle name is in the idle state.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param bundleName Indicates the bundle name of the application to query.
+ * @return Returns {@code true} if the application is idle in a particular period;
+ * returns {@code false} otherwise. The time range of the particular period is defined by the system,
+ * which may be hours or days.
+ */
+ function isIdleState(bundleName: string, callback: AsyncCallback): void;
+ function isIdleState(bundleName: string): Promise;
+
+ /**
+ * Queries the usage priority group of the calling application.
+ *
+ * The priority defined in a priority group restricts the resource usage of an application,
+ * for example, restricting the running of background tasks.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @return Returns the usage priority group of the calling application.
+ */
+ function queryAppUsagePriorityGroup(callback: AsyncCallback): void;
+ function queryAppUsagePriorityGroup(): Promise;
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ interface BundleActiveInfoResponse {
+ [key: string]: BundleStateInfo;
+ }
+
+ /**
+ * Queries usage information about each bundle within a specified period.
+ *
+ * This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle.
+ */
+ function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void;
+ function queryBundleStateInfos(begin: number, end: number): Promise;
+
+ /**
+ * Declares interval type.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ export enum IntervalType {
+ /**
+ * Indicates the interval type that will determine the optimal interval based on the start and end time.
+ */
+ BY_OPTIMIZED = 0,
+
+ /**
+ * Indicates the daily interval.
+ */
+ BY_DAILY = 1,
+
+ /**
+ * Indicates the weekly interval.
+ */
+ BY_WEEKLY = 2,
+
+ /**
+ * Indicates the monthly interval.
+ */
+ BY_MONTHLY = 3,
+
+ /**
+ * Indicates the annually interval.
+ */
+ BY_ANNUALLY = 4
+ }
+
+ /**
+ * Queries usage information about each bundle within a specified period at a specified interval.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param byInterval Indicates the interval at which the usage statistics are queried.
+ * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
+ * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle.
+ */
+ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;
+ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;
+
+ /**
+ * Queries state data of all bundles within a specified period identified by the start and end time.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles.
+ */
+ function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void;
+ function queryBundleActiveStates(begin: number, end: number): Promise>;
+
+ /**
+ * Queries state data of the current bundle within a specified period.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
+ * @devices phone, tablet, tv, wearable, car.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle.
+ */
+ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void;
+ function queryCurrentBundleActiveStates(begin: number, end: number): Promise>;
+}
+
+export default bundleState;
\ No newline at end of file
--
Gitee
From 49a92d0fa9917e11cd3e6ac2a88523bc9df0d820 Mon Sep 17 00:00:00 2001
From: zhangfeng
Date: Tue, 1 Mar 2022 14:42:11 +0000
Subject: [PATCH 23/45] update wifi d.ts file
Signed-off-by: zhangfeng
---
api/@ohos.wifi.d.ts | 45 +++++++++++++++++++++++++++++++++++----------
1 file changed, 35 insertions(+), 10 deletions(-)
diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts
index f778a933ff..2df449ff62 100644
--- a/api/@ohos.wifi.d.ts
+++ b/api/@ohos.wifi.d.ts
@@ -444,6 +444,7 @@ declare namespace wifi {
* @return Returns the P2P connection information.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function getP2pLinkedInfo(): Promise;
function getP2pLinkedInfo(callback: AsyncCallback): void;
@@ -454,6 +455,7 @@ declare namespace wifi {
* @return Returns the current group information.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
function getCurrentGroup(): Promise;
function getCurrentGroup(callback: AsyncCallback): void;
@@ -464,26 +466,29 @@ declare namespace wifi {
* @return Returns the found devices list.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
- function getP2pDevices(): Promise;
- function getP2pDevices(callback: AsyncCallback): void;
+ function getP2pPeerDevices(): Promise;
+ function getP2pPeerDevices(callback: AsyncCallback): void;
/**
* Creates a P2P group.
*
* @param config Indicates the configuration for creating a group.
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function createGroup(config: WifiP2PConfig): boolean;
/**
* Removes a P2P group.
*
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function removeGroup(): boolean;
@@ -491,36 +496,40 @@ declare namespace wifi {
* Initiates a P2P connection to a device with the specified configuration.
*
* @param config Indicates the configuration for connecting to a specific group.
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
function p2pConnect(config: WifiP2PConfig): boolean;
/**
* Canceling a P2P connection.
*
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function p2pCancelConnect(): boolean;
/**
* Discovers Wi-Fi P2P devices.
*
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
function startDiscoverDevices(): boolean;
/**
* Stops discovering Wi-Fi P2P devices.
*
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function stopDiscoverDevices(): boolean;
@@ -528,9 +537,11 @@ declare namespace wifi {
* Deletes the persistent P2P group with the specified network ID.
*
* @param netId Indicates the network ID of the group to be deleted.
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION
+ * @systemapi Hide this for inner system use.
*/
function deletePersistentGroup(netId: number): boolean;
@@ -538,9 +549,11 @@ declare namespace wifi {
* Sets the name of the Wi-Fi P2P device.
*
* @param devName Indicates the name to be set.
- * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise.
+ * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise.
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION
+ * @systemapi Hide this for inner system use.
*/
function setDeviceName(devName: string): boolean;
@@ -723,6 +736,7 @@ declare namespace wifi {
* @return Returns 1: idle, 2: starting, 3:started, 4: closing, 5: closed
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function on(type: "p2pStateChange", callback: Callback): void;
@@ -731,6 +745,7 @@ declare namespace wifi {
*
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function off(type: "p2pStateChange", callback?: Callback): void;
@@ -740,6 +755,7 @@ declare namespace wifi {
* @return Returns WifiP2pLinkedInfo
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function on(type: "p2pConnectionChange", callback: AsyncCallback): void;
@@ -748,6 +764,7 @@ declare namespace wifi {
*
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function off(type: "p2pConnectionChange", callback?: AsyncCallback): void;
@@ -757,6 +774,7 @@ declare namespace wifi {
* @return Returns WifiP2pDevice
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
function on(type: "p2pDeviceChange", callback: AsyncCallback): void;
@@ -766,6 +784,7 @@ declare namespace wifi {
* @return Returns WifiP2pDevice
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.LOCATION
*/
function off(type: "p2pDeviceChange", callback?: AsyncCallback): void;
@@ -775,6 +794,7 @@ declare namespace wifi {
* @return Returns WifiP2pDevice[]
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION
*/
function on(type: "p2pPeerDeviceChange", callback: AsyncCallback): void;
@@ -783,6 +803,7 @@ declare namespace wifi {
*
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.LOCATION
*/
function off(type: "p2pPeerDeviceChange", callback?: AsyncCallback): void;
@@ -792,6 +813,7 @@ declare namespace wifi {
* @return Returns void
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function on(type: "p2pPersistentGroupChange", callback: Callback): void;
@@ -800,6 +822,7 @@ declare namespace wifi {
*
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function off(type: "p2pPersistentGroupChange", callback?: Callback): void;
@@ -809,6 +832,7 @@ declare namespace wifi {
* @return Returns 0: initial state, 1: discovery succeeded
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function on(type: "p2pDiscoveryChange", callback: Callback): void;
@@ -817,6 +841,7 @@ declare namespace wifi {
*
* @since 8
* @syscap SystemCapability.Communication.WiFi.P2P
+ * @permission ohos.permission.GET_WIFI_INFO
*/
function off(type: "p2pDiscoveryChange", callback?: Callback): void;
--
Gitee
From cec16f1e0079370bd6304b8bced66d2a6921a25b Mon Sep 17 00:00:00 2001
From: jiangwensai
Date: Wed, 23 Feb 2022 02:39:37 +0000
Subject: [PATCH 24/45] IssueNo: #I4UUXH Description: Fix Extension Name. Sig:
SIG_ApplicationFramework Feature or Bugfix: Bugfix Binary Source: No
Signed-off-by: jiangwensai
Change-Id: If5930c04b37998cdd9c59c6c008b256edfb1cd07
---
....application.ServiceExtensionAbility.d.ts} | 8 +-
api/application/ExtAbilityContext.d.ts | 37 ------
api/application/ServiceExtAbilityContext.d.ts | 120 ------------------
3 files changed, 4 insertions(+), 161 deletions(-)
rename api/{@ohos.application.ServiceExtAbility.d.ts => @ohos.application.ServiceExtensionAbility.d.ts} (94%)
delete mode 100644 api/application/ExtAbilityContext.d.ts
delete mode 100644 api/application/ServiceExtAbilityContext.d.ts
diff --git a/api/@ohos.application.ServiceExtAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts
similarity index 94%
rename from api/@ohos.application.ServiceExtAbility.d.ts
rename to api/@ohos.application.ServiceExtensionAbility.d.ts
index c87682539c..a2567c8945 100644
--- a/api/@ohos.application.ServiceExtAbility.d.ts
+++ b/api/@ohos.application.ServiceExtensionAbility.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
@@ -14,7 +14,7 @@
*/
import rpc from "./@ohos.rpc";
-import ServiceExtAbilityContext from "./application/ServiceExtAbilityContext";
+import ServiceExtensionContext from "./application/ServiceExtensionContext";
import Want from './@ohos.application.Want';
/**
@@ -25,7 +25,7 @@ import Want from './@ohos.application.Want';
* @systemapi hide for inner use.
* @StageModelOnly
*/
-export default class ServiceExtAbility {
+export default class ServiceExtensionAbility {
/**
* Indicates service extension ability context.
*
@@ -34,7 +34,7 @@ export default class ServiceExtAbility {
* @systemapi hide for inner use.
* @StageModelOnly
*/
- context: ServiceExtAbilityContext;
+ context: ServiceExtensionContext;
/**
* Called back when a service extension is started for initialization.
diff --git a/api/application/ExtAbilityContext.d.ts b/api/application/ExtAbilityContext.d.ts
deleted file mode 100644
index 36ddd06d4d..0000000000
--- a/api/application/ExtAbilityContext.d.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2021 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 { HapModuleInfo } from "../bundle/hapModuleInfo";
-import Context from "./Context";
-
-/**
- * The context of an extension. It allows access to extension-specific resources.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @permission N/A
- * @StageModelOnly
- */
-export default class ExtAbilityContext extends Context {
-
- /**
- * Indicates configuration information about an module.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @StageModelOnly
- */
- currentHapModuleInfo: HapModuleInfo;
-}
\ No newline at end of file
diff --git a/api/application/ServiceExtAbilityContext.d.ts b/api/application/ServiceExtAbilityContext.d.ts
deleted file mode 100644
index f10e58fc9a..0000000000
--- a/api/application/ServiceExtAbilityContext.d.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2021 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 } from "../basic";
-import { ConnectOptions } from "../ability/connectOptions";
-import ExtAbilityContext from "./ExtAbilityContext";
-import Want from "../@ohos.application.Want";
-import StartOptions from "../@ohos.application.StartOptions";
-
-/**
- * The context of service extension. It allows access to
- * serviceExtension-specific resources.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @systemapi hide for inner use.
- * @permission N/A
- * @StageModelOnly
- */
-export default class ServiceExtAbilityContext extends ExtAbilityContext {
- /**
- * Service extension uses this method to start a specific ability.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @param parameter Indicates the ability to start.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- startAbility(want: Want, callback: AsyncCallback): void;
- startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void;
- startAbility(want: Want, options?: StartOptions): Promise;
-
- /**
- * Service extension uses this method to start a specific ability with account.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @param parameter Indicates the ability to start.
- * @param parameter Indicates the accountId to start.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
- startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void;
- startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise;
-
- /**
- * Destroys this service extension.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- terminateSelf(callback: AsyncCallback): void;
- terminateSelf(): Promise;
-
- /**
- * Connects an ability to a Service extension.
- *
- * This method can be called by an ability or service extension, but the destination of the connection must be a
- * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target
- * service extension when the Service extension is connected.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @param request Indicates the service extension to connect.
- * @systemapi hide for inner use.
- * @return connection id, int value.
- * @StageModelOnly
- */
- connectAbility(want: Want, options: ConnectOptions): number;
-
- /**
- * Connects an ability to a Service extension with account.
- *
- * This method can be called by an ability or service extension, but the destination of the connection must be a
- * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target
- * service extension when the Service extension is connected.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @param request Indicates the service extension to connect.
- * @param request Indicates the account to connect.
- * @systemapi hide for inner use.
- * @return connection id, int value.
- * @StageModelOnly
- */
- connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number;
-
- /**
- * Disconnects an ability to a service extension, in contrast to
- * {@link connectAbility}.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @param connection the connection id returned from connectAbility api.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- disconnectAbility(connection: number, callback:AsyncCallback): void;
- disconnectAbility(connection: number): Promise;
-}
\ No newline at end of file
--
Gitee
From 6005a924ae1a814d906bda7eb78e4fc33cd232b9 Mon Sep 17 00:00:00 2001
From: YOUR_NAME
Date: Wed, 2 Mar 2022 15:08:42 +0800
Subject: [PATCH 25/45] Fix: Usb module Adds system capabilities
Signed-off-by: YOUR_NAME
---
api/@ohos.usb.d.ts | 70 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 66 insertions(+), 4 deletions(-)
diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts
index ac295ca5d2..4d8b08a6a2 100644
--- a/api/@ohos.usb.d.ts
+++ b/api/@ohos.usb.d.ts
@@ -161,19 +161,22 @@ declare namespace usb {
* Represents the USB endpoint from which data is sent or received.
* You can obtain the USB endpoint through USBInterface {@link USBInterface}.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBEndpoint {
/**
* Endpoint address.
- *
+ *
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
address: number;
/**
* Endpoint attributes.
- *
+ *
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
attributes: number;
@@ -181,6 +184,7 @@ declare namespace usb {
/**
* Endpoint interval.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interval: number;
@@ -188,6 +192,7 @@ declare namespace usb {
/**
* Maximun size of data packets on the endpoint.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
maxPacketSize: number;
@@ -195,6 +200,7 @@ declare namespace usb {
/**
* Endpoint direction.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
direction: USBRequestDirection;
@@ -202,6 +208,7 @@ declare namespace usb {
/**
* Endpoint number.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
number: number;
@@ -209,6 +216,7 @@ declare namespace usb {
/**
* Endpoint type
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
type: number;
@@ -216,6 +224,7 @@ declare namespace usb {
/**
* Unique ID of the interface to which the endpoint belongs {@link USBInterface.id}
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interfaceId: number;
@@ -226,12 +235,14 @@ declare namespace usb {
* Represents a USB interface. One USBconfig {@link USBConfig} can contain multiple USBInterface instances,
* each providing a specific function.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBInterface {
/**
* Unique ID of the USB interface.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
id: number;
@@ -239,6 +250,7 @@ declare namespace usb {
/**
* Interface protocol.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
protocol: number;
@@ -246,6 +258,7 @@ declare namespace usb {
/**
* Device type.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
clazz: number;
@@ -253,6 +266,7 @@ declare namespace usb {
/**
* Device subclass.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
subClass: number;
@@ -260,6 +274,7 @@ declare namespace usb {
/**
* Alternating between descripors of the same USB interface.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
alternateSetting: number;
@@ -267,6 +282,7 @@ declare namespace usb {
/**
* Interface name.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
name: string;
@@ -274,6 +290,7 @@ declare namespace usb {
/**
* Endpoints {@link USBEndpoint} that belongs to the USB interface.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
endpoints: Array;
@@ -282,21 +299,22 @@ declare namespace usb {
/**
* Represents the USB configuration. One USBDevice{@link USBDevice} can contain multiple USBConfig instances.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBConfig {
/**
* Unique ID if the USB configuration.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
- *
- *
*/
id: number;
/**
* Configuration attributes.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
attributes: number;
@@ -304,6 +322,7 @@ declare namespace usb {
/**
* Maximum power consumption, in mA.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
maxPower: number;
@@ -311,6 +330,7 @@ declare namespace usb {
/**
* Configuration name, which can be left empty.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
name: string;
@@ -318,6 +338,7 @@ declare namespace usb {
/**
* Support for remote wakeup.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
isRemoteWakeup: boolean;
@@ -325,6 +346,7 @@ declare namespace usb {
/**
* Support for independent power supplies.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
isSelfPowered: boolean;
@@ -332,6 +354,7 @@ declare namespace usb {
/**
* Supported interface attributes {@link USBInterface}.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interfaces: Array;
@@ -340,84 +363,98 @@ declare namespace usb {
/**
* Represents a USB device.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBDevice {
/**
* Bus address.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
busNum: number;
/**
* Device address.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
devAddress: number;
/**
* Device SN.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
serial: string;
/**
* Device name.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
name: string;
/**
* Device manufacturer.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
manufacturerName: string;
/**
* Product name.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
productName: string;
/**
* Product version.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
version: string;
/**
* Vendor ID.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
vendorId: number;
/**
* Product ID.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
productId: number;
/**
* Device class.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
clazz: number;
/**
* Device subclass.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
subClass: number;
/**
* Device protocol code.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
protocol: number;
/**
* Device configuration descriptor information {@link USBConfig}.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
configs: Array;
@@ -426,18 +463,21 @@ declare namespace usb {
/**
* Represents a USB device pipe, which is used to determine the USB device.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBDevicePipe {
/**
* Bus address.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
busNum: number;
/**
* Device address.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
devAddress: number;
@@ -446,41 +486,49 @@ declare namespace usb {
/**
* Represents control transfer parameters.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
interface USBControlParams {
/**
* Request type.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
request: number;
/**
* Request target tyoe.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
target: USBRequestTargetType;
/**
* Request control type.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
reqType: USBControlRequestType;
/**
* Request parameter value.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
value: number;
/**
* Index of the parameter value.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
index: number;
/**
* Data written to or read from the buffer.
+ *
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
data: Uint8Array;
@@ -489,30 +537,35 @@ declare namespace usb {
/**
* Enumerates USB request target types.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
enum USBRequestTargetType {
/**
* Device.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TARGET_DEVICE = 0,
/**
* Interface.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TARGET_INTERFACE,
/**
* Endpoint.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TARGET_ENDPOINT,
/**
* Others.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TARGET_OTHER
@@ -520,24 +573,29 @@ declare namespace usb {
/**
* Enumerates control request types.
+ *
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
enum USBControlRequestType {
/**
* Standard.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TYPE_STANDARD = 0,
/**
* Class.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TYPE_CLASS,
/**
* Verdor.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_TYPE_VENDOR
@@ -545,18 +603,22 @@ declare namespace usb {
/**
* Enumerates request directions.
+ *
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
enum USBRequestDirection {
/**
* Request for writing data from the host to the device.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_DIR_TO_DEVICE = 0,
/**
* Request for reading data from the device to the host.
*
+ * @syscap SystemCapability.USB.USBManager
* @since 8
*/
USB_REQUEST_DIR_FROM_DEVICE = 0x80
--
Gitee
From 2e2ac7ef3bde5f8b29c05c3b451cd88f0a3ed14c Mon Sep 17 00:00:00 2001
From: yudechen
Date: Wed, 2 Mar 2022 15:09:39 +0800
Subject: [PATCH 26/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9canIUse=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E5=A3=B0=E6=98=8E=E7=9A=84=E4=BD=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I6cca9039d8d3b7c26216c1408be29ce3b59664cf
Signed-off-by: yudechen
---
api/@internal/component/ets/common.d.ts | 6 ------
api/common/@internal/global.d.ts | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts
index c1157b0610..a71d0c9067 100644
--- a/api/@internal/component/ets/common.d.ts
+++ b/api/@internal/component/ets/common.d.ts
@@ -274,12 +274,6 @@ interface DragItemInfo {
extraInfo?: string;
}
-/**
- * Defining syscap function.
- * @since 8
- */
-declare function canIUse(syscap: string): boolean;
-
/**
* Defining animation function.
* @since 7
diff --git a/api/common/@internal/global.d.ts b/api/common/@internal/global.d.ts
index 36a6d6d182..128c337c20 100644
--- a/api/common/@internal/global.d.ts
+++ b/api/common/@internal/global.d.ts
@@ -51,6 +51,12 @@ export declare function clearInterval(intervalID?: number): void;
*/
export declare function clearTimeout(timeoutID?: number): void;
+/**
+ * Defining syscap function.
+ * @since 8
+ */
+ export declare function canIUse(syscap: string): boolean;
+
/**
* Obtain the objects exposed in app.js
* @devices tv, phone, tablet, wearable, smartVision
--
Gitee
From 2db2e933149e935a6b6616876fa3b3e32e60c10b Mon Sep 17 00:00:00 2001
From: wplan1
Date: Tue, 1 Mar 2022 23:18:37 +0800
Subject: [PATCH 27/45] add close rawfd
Signed-off-by: wplan1
---
api/@ohos.resourceManager.d.ts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts
index 5fc83772b6..55fe1e882c 100644
--- a/api/@ohos.resourceManager.d.ts
+++ b/api/@ohos.resourceManager.d.ts
@@ -402,6 +402,24 @@ export interface ResourceManager {
*/
getRawFileDescriptor(path: string): Promise;
+ /**
+ * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode.
+ *
+ * @param path Indicates the resource relative path.
+ * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor.
+ * @since 8
+ */
+ closeRawFileDescriptor(path: string, callback: AsyncCallback): void;
+
+ /**
+ * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode.
+ *
+ * @param path Indicates the resource relative path.
+ * @return Returns result close raw file resource descriptor corresponding to the specified resource path.
+ * @since 8
+ */
+ closeRawFileDescriptor(path: string): Promise;
+
/**
* Obtains release resourceManager.
*
--
Gitee
From 80e24032754fde2c7196556e28fed8f4a6b0d7f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miss=E6=B7=B1=E6=B5=B7=E9=B1=BC?=
Date: Wed, 2 Mar 2022 07:21:21 +0000
Subject: [PATCH 28/45] update api/@ohos.wallpaper.d.ts. Signed-off-by:
miss-deep-sea-fish
---
api/@ohos.wallpaper.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts
index b0f83f66f4..9b1776d5c4 100644
--- a/api/@ohos.wallpaper.d.ts
+++ b/api/@ohos.wallpaper.d.ts
@@ -17,7 +17,7 @@ import image from './@ohos.multimedia.image'
/**
* System wallpaper
- * @sysCap SystemCapability.Miscservices.WallpaperFramework
+ * @syscap SystemCapability.Miscservices.WallpaperFramework
* @devices phone, tablet, tv, wearable, car
* @import import wallpaper from '@ohos.wallpaper';
* @since 7
--
Gitee
From 0f91d5c27087f1d087951200446be5cd05c13d6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miss=E6=B7=B1=E6=B5=B7=E9=B1=BC?=
Date: Wed, 2 Mar 2022 07:22:05 +0000
Subject: [PATCH 29/45] update api/@ohos.systemTime.d.ts. Signed-off-by:
miss-deep-sea-fish
---
api/@ohos.systemTime.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts
index 9071438b0e..8a15765fcb 100755
--- a/api/@ohos.systemTime.d.ts
+++ b/api/@ohos.systemTime.d.ts
@@ -18,7 +18,7 @@ import { AsyncCallback, ErrorCallback } from './basic';
/**
* System time and timezone.
* @since 7
- * @sysCap SystemCapability.Miscservices.Time
+ * @syscap SystemCapability.Miscservices.Time
* @devices phone, tablet, tv, wearable, car
* @import systemTime from '@ohos.systemTime';
*/
--
Gitee
From ce772be61580b1a9f1040c2ca0069ead2bc6ce53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miss=E6=B7=B1=E6=B5=B7=E9=B1=BC?=
Date: Wed, 2 Mar 2022 07:22:50 +0000
Subject: [PATCH 30/45] update api/@ohos.pasteboard.d.ts. Signed-off-by:
miss-deep-sea-fish
---
api/@ohos.pasteboard.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts
index facf37ba9e..e1e14bcded 100644
--- a/api/@ohos.pasteboard.d.ts
+++ b/api/@ohos.pasteboard.d.ts
@@ -17,7 +17,7 @@ import { Want } from './ability/want';
/**
* systemPasteboard
- * @sysCap SystemCapability.Miscservices.Pasteboard
+ * @syscap SystemCapability.Miscservices.Pasteboard
* @devices phone, tablet, tv, wearable, car
* @import import pasteboard from '@ohos.pasteboard';
*/
--
Gitee
From 0a5c2559ae399da64070ff50836e66080180fe7f Mon Sep 17 00:00:00 2001
From: aqxyjay
Date: Wed, 2 Mar 2022 15:44:27 +0800
Subject: [PATCH 31/45] normalize syscap
Signed-off-by: aqxyjay
---
api/@ohos.batteryinfo.d.ts | 8 ++++----
api/@ohos.brightness.d.ts | 3 +--
api/@ohos.power.d.ts | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/api/@ohos.batteryinfo.d.ts b/api/@ohos.batteryinfo.d.ts
index a139929f6d..265f6c4df2 100644
--- a/api/@ohos.batteryinfo.d.ts
+++ b/api/@ohos.batteryinfo.d.ts
@@ -19,7 +19,7 @@
* Battery information includes the remaining battery power,
* voltage, temperature, model, and charger type.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManage.Core
* @since 6
*/
declare namespace batteryInfo {
@@ -74,7 +74,7 @@ declare namespace batteryInfo {
/**
* Indicates the charger type of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManage.Core
* @since 6
*/
export enum BatteryPluggedType {
@@ -103,7 +103,7 @@ declare namespace batteryInfo {
/**
* Indicates the battery charging status of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManage.Core
* @since 6
*/
export enum BatteryChargeState {
@@ -132,7 +132,7 @@ declare namespace batteryInfo {
/**
* Indicates the battery health status of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManage.Core
* @since 6
*/
export enum BatteryHealthState {
diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts
index f12bc7a706..bb8b098804 100644
--- a/api/@ohos.brightness.d.ts
+++ b/api/@ohos.brightness.d.ts
@@ -18,7 +18,7 @@ import { AsyncCallback } from './basic';
/**
* Provides interfaces to control the power of display.
*
- * @sysCap SystemCapability.PowerManager.DisplayPowerManager
+ * @syscap SystemCapability.PowerManager.DisplayPowerManager
* @since 7
*/
declare namespace brightness {
@@ -26,7 +26,6 @@ declare namespace brightness {
* Sets the screen brightness.
*
* @param value Brightness value, ranging from 0 to 255.
- * @sysCap SystemCapability.PowerManager.DisplayPowerManager
* @systemapi
* @since 7
*/
diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts
index 90da7f5099..5f59da72f5 100644
--- a/api/@ohos.power.d.ts
+++ b/api/@ohos.power.d.ts
@@ -18,7 +18,7 @@ import {AsyncCallback} from './basic';
/**
* Provides interfaces to manage power.
*
- * @sysCap SystemCapability.PowerManager.PowerManager.Core
+ * @syscap SystemCapability.PowerManager.PowerManager.Core
* @since 7
*/
declare namespace power {
--
Gitee
From 642e76d19f33ff3896d6fe76e6ce5d4c95b53583 Mon Sep 17 00:00:00 2001
From: zero-cyc
Date: Wed, 2 Mar 2022 16:06:25 +0800
Subject: [PATCH 32/45] chenlien@huawei.com
Signed-off-by: zero-cyc
Change-Id: Ide73e7f099e285f8d86df0e648ebfc1862b01257
---
api/notification/notificationSubscriber.d.ts | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/api/notification/notificationSubscriber.d.ts b/api/notification/notificationSubscriber.d.ts
index d14e59c088..f2356ec81f 100644
--- a/api/notification/notificationSubscriber.d.ts
+++ b/api/notification/notificationSubscriber.d.ts
@@ -37,14 +37,14 @@ export interface NotificationSubscriber {
/**
* Callback when the Do Not Disturb setting changed.
- *
+ * @syscap SystemCapability.Notification.Notification
* @since 8
*/
onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void;
/**
* Callback when the notificaition permission is changed.
- *
+ * @syscap SystemCapability.Notification.Notification
* @since 8
*/
onEnabledNotificationChanged?:(callbackData: EnabledNotificationCallbackData) => void;
@@ -72,6 +72,7 @@ export interface SubscribeCallbackData {
* Describes the properties of the application that the permission to send notifications has changed.
*
* @name EnabledNotificationCallbackData
+ * @syscap SystemCapability.Notification.Notification
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -79,4 +80,4 @@ export interface EnabledNotificationCallbackData {
readonly bundle: string;
readonly uid: number;
readonly enable: boolean;
-}
\ No newline at end of file
+}
--
Gitee
From 294ac0827034114a1195b3c125b4b9c271a2bf01 Mon Sep 17 00:00:00 2001
From: houhaoyu
Date: Wed, 2 Mar 2022 16:10:54 +0800
Subject: [PATCH 33/45] houhaoyu@huawei.com
Signed-off-by: houhaoyu
Change-Id: Ib238f6b3400611b891ebe48eabe8944b1555261f
---
api/@internal/ets/lifecycle.d.ts | 44 --------------------------------
1 file changed, 44 deletions(-)
diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts
index 1ab0f948b8..18cff8475e 100644
--- a/api/@internal/ets/lifecycle.d.ts
+++ b/api/@internal/ets/lifecycle.d.ts
@@ -31,7 +31,6 @@ import { PacMap } from "../ability/dataAbilityHelper";
*
* @name LifecycleForm
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
*/
export declare interface LifecycleForm {
@@ -39,7 +38,6 @@ export declare interface LifecycleForm {
* Called to return a {@link formBindingData.FormBindingData} object.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}.
* The {@code Want} object must include the form ID, form name, and grid style of the form,
* which can be obtained from {@link formManager#FormParam#IDENTITY_KEY},
@@ -55,7 +53,6 @@ export declare interface LifecycleForm {
* Called when the form provider is notified that a temporary form is successfully converted to a normal form.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form.
* @return -
* @FAModelOnly
@@ -66,7 +63,6 @@ export declare interface LifecycleForm {
* Called to notify the form provider to update a specified form.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form to update.
* @return -
* @FAModelOnly
@@ -77,7 +73,6 @@ export declare interface LifecycleForm {
* Called when the form provider receives form events from the system.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID,
* and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE}
* or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE}
@@ -93,7 +88,6 @@ export declare interface LifecycleForm {
* JS forms.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form on which the message event is triggered, which is provided by
* the client to the form provider.
* @param message Indicates the value of the {@code params} field of the message event. This parameter is
@@ -108,7 +102,6 @@ export declare interface LifecycleForm {
* you want your application, as the form provider, to be notified of form deletion.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the deleted form.
* @return -
* @FAModelOnly
@@ -122,7 +115,6 @@ export declare interface LifecycleForm {
* this method returns {@link FormState#DEFAULT} by default.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the description of the form for which the {@link formManager#FormState} is obtained.
* The description covers the bundle name, ability name, module name, form name, and form dimensions.
* @return Returns the {@link formManager#FormState} object.
@@ -136,7 +128,6 @@ export declare interface LifecycleForm {
*
* @name LifecycleApp
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
*/
export declare interface LifecycleApp {
@@ -144,7 +135,6 @@ export declare interface LifecycleApp {
* Called back when the state of an ability changes from BACKGROUND to INACTIVE.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -154,7 +144,6 @@ export declare interface LifecycleApp {
* Called back when an ability enters the BACKGROUND state.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -164,7 +153,6 @@ export declare interface LifecycleApp {
* Called back before an ability is destroyed.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -174,7 +162,6 @@ export declare interface LifecycleApp {
* Called back when an ability is started for initialization.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -185,7 +172,6 @@ export declare interface LifecycleApp {
* to multi-window mode or from multi-window mode to fullscreen mode.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param isShownInMultiWindow Specifies whether this ability is currently in multi-window mode.
* The value {@code true} indicates the multi-window mode, and {@code false} indicates another mode.
* @param newConfig Indicates the new configuration information about this Page ability.
@@ -199,7 +185,6 @@ export declare interface LifecycleApp {
* Asks a user whether to start the migration.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return Returns {@code true} if the user allows the migration; returns {@code false} otherwise.
* @FAModelOnly
*/
@@ -211,7 +196,6 @@ export declare interface LifecycleApp {
* Scheduler Service requests data from the local ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param data Indicates the user data to save.
* @return Returns {@code true} if the data is successfully saved; returns {@code false} otherwise.
* @FAModelOnly
@@ -225,7 +209,6 @@ export declare interface LifecycleApp {
* notify the user of the successful migration and then exit the local ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param result Indicates the migration result code. The value {@code 0} indicates that the migration is
* successful, and {@code -1} indicates that the migration fails.
* @return -
@@ -239,7 +222,6 @@ export declare interface LifecycleApp {
* is restored.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param data Indicates the user data to restore.
* @return -
* @FAModelOnly
@@ -251,7 +233,6 @@ export declare interface LifecycleApp {
* migration is performed for the ability from the local device to the remote device.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -263,7 +244,6 @@ export declare interface LifecycleApp {
* this method is used only to save temporary states.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param outState Indicates the {@code PacMap} object used for storing user data and states. This
* parameter cannot be null.
* @return -
@@ -277,7 +257,6 @@ export declare interface LifecycleApp {
* states. Generally, this method is called after the {@link #onStart(Want)} method.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param inState Indicates the {@code PacMap} object used for storing data and states. This
* parameter can not be null.
* @return -
@@ -290,7 +269,6 @@ export declare interface LifecycleApp {
* change to the BACKGROUND or ACTIVE state).
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -300,7 +278,6 @@ export declare interface LifecycleApp {
* Called back when an ability enters the ACTIVE state.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -310,7 +287,6 @@ export declare interface LifecycleApp {
* Called when the launch mode of an ability is set to singleton.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the new {@code want} containing information about the ability.
* @return -
* @FAModelOnly
@@ -322,7 +298,6 @@ export declare interface LifecycleApp {
* background and there is no enough memory for running as many background processes as possible.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param level Indicates the memory trim level, which shows the current memory usage status.
* @return -
* @FAModelOnly
@@ -335,7 +310,6 @@ export declare interface LifecycleApp {
*
* @name LifecycleService
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
*/
export declare interface LifecycleService {
@@ -344,7 +318,6 @@ export declare interface LifecycleService {
* an ability).
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -354,7 +327,6 @@ export declare interface LifecycleService {
* Called back when Service is started.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the want of Service to start.
* @param startId Indicates the number of times the Service ability has been started. The {@code startId} is
* incremented by 1 every time the ability is started. For example, if the ability has been started
@@ -368,7 +340,6 @@ export declare interface LifecycleService {
* Called back before an ability is destroyed.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -378,7 +349,6 @@ export declare interface LifecycleService {
* Called back when a Service ability is first connected to an ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates connection information about the Service ability.
* @return Returns the proxy of the Service ability.
* @FAModelOnly
@@ -389,7 +359,6 @@ export declare interface LifecycleService {
* Called back when all abilities connected to a Service ability are disconnected.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates disconnection information about the Service ability.
* @return -
* @FAModelOnly
@@ -404,7 +373,6 @@ export declare interface LifecycleService {
* called but {@link #terminateSelf} has not.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the want of the Service ability being connected.
* @return -
* @FAModelOnly
@@ -417,7 +385,6 @@ export declare interface LifecycleService {
*
* @name LifecycleData
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
*/
export declare interface LifecycleData {
@@ -425,7 +392,6 @@ export declare interface LifecycleData {
* Updates one or more data records in the database. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to update.
* @param valueBucket Indicates the data to update. This parameter can be null.
* @param predicates Indicates filter criteria. If this parameter is null, all data records will be updated by
@@ -441,7 +407,6 @@ export declare interface LifecycleData {
* Queries one or more data records in the database. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to query.
* @param columns Indicates the columns to be queried, in array, for example, {"name","age"}. You should define
* the processing logic when this parameter is null.
@@ -458,7 +423,6 @@ export declare interface LifecycleData {
* Deletes one or more data records. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to delete.
* @param predicates Indicates filter criteria. If this parameter is null, all data records will be deleted by
* default.
@@ -475,7 +439,6 @@ export declare interface LifecycleData {
* even if the context has changed.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri to normalize.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
@@ -488,7 +451,6 @@ export declare interface LifecycleData {
* Inserts multiple data records into the database. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the position where the data is to insert.
* @param valueBuckets Indicates the data to insert.
* @param callback function specified by framework to receive the result, developer should call this function to
@@ -503,7 +465,6 @@ export declare interface LifecycleData {
* The default implementation of this method returns the original uri passed to it.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri to denormalize.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
@@ -516,7 +477,6 @@ export declare interface LifecycleData {
* Inserts a data record into the database. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the position where the data is to insert.
* @param valueBucket Indicates the data to insert.
* @param callback function specified by framework to receive the result, developer should call this function to
@@ -530,7 +490,6 @@ export declare interface LifecycleData {
* Opens a file. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
* @param mode Indicates the open mode, which can be "r" for read-only access, "w" for write-only access (erasing
* whatever data is currently in the file), "wt" for write access that truncates any existing file,
@@ -547,7 +506,6 @@ export declare interface LifecycleData {
* Obtains the MIME type of files. This method should be implemented by a Data ability.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the files to obtain.
* @param mimeTypeFilter Indicates the MIME type of the files to obtain. This parameter cannot be set to {@code
* null}.
@@ -565,7 +523,6 @@ export declare interface LifecycleData {
* Called to carry {@code AbilityInfo} to this ability after the ability is initialized.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param info Indicates the {@code AbilityInfo} object containing information about this ability.
* @return -
* @FAModelOnly
@@ -579,7 +536,6 @@ export declare interface LifecycleData {
* Data abilities supports general data types, including text, HTML, and JPEG.
*
* @since 7
- * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri of the data.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
--
Gitee
From ceedda81d5396fc6e65d8cc9dc505b4078af42c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?=
Date: Wed, 2 Mar 2022 08:46:10 +0000
Subject: [PATCH 34/45] rename api/@ohos.nfc.tag.js to api/@ohos.nfc.tag.d.ts.
fix tag and hce api file extension
Signed-off-by: l00438547
---
api/{@ohos.nfc.tag.js => @ohos.nfc.tag.d.ts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename api/{@ohos.nfc.tag.js => @ohos.nfc.tag.d.ts} (100%)
diff --git a/api/@ohos.nfc.tag.js b/api/@ohos.nfc.tag.d.ts
similarity index 100%
rename from api/@ohos.nfc.tag.js
rename to api/@ohos.nfc.tag.d.ts
--
Gitee
From a54b33e800f9f1b00c34e6b4a4c4721784f491af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?=
Date: Wed, 2 Mar 2022 08:56:12 +0000
Subject: [PATCH 35/45] rename api/tag/nfctech.js to api/tag/nfctech.d.ts. fix
tag and hce api file extension
Signed-off-by: l00438547
---
api/tag/{nfctech.js => nfctech.d.ts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename api/tag/{nfctech.js => nfctech.d.ts} (100%)
diff --git a/api/tag/nfctech.js b/api/tag/nfctech.d.ts
similarity index 100%
rename from api/tag/nfctech.js
rename to api/tag/nfctech.d.ts
--
Gitee
From 4a850d40f20b4007baedf8f02015bbd1a77ee116 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?=
Date: Wed, 2 Mar 2022 08:56:55 +0000
Subject: [PATCH 36/45] rename api/@ohos.nfc.cardEmulation.js to
api/@ohos.nfc.cardEmulation.d.ts. fix tag and hce api file extension
Signed-off-by: l00438547
---
api/{@ohos.nfc.cardEmulation.js => @ohos.nfc.cardEmulation.d.ts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename api/{@ohos.nfc.cardEmulation.js => @ohos.nfc.cardEmulation.d.ts} (100%)
diff --git a/api/@ohos.nfc.cardEmulation.js b/api/@ohos.nfc.cardEmulation.d.ts
similarity index 100%
rename from api/@ohos.nfc.cardEmulation.js
rename to api/@ohos.nfc.cardEmulation.d.ts
--
Gitee
From 17847e77b5b573b5f9a87a2bd7b31318cdf05278 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?=
Date: Wed, 2 Mar 2022 08:58:01 +0000
Subject: [PATCH 37/45] rename api/tag/tagSession.js to
api/tag/tagSession.d.ts. fix tag and hce api file extension
Signed-off-by: l00438547
---
api/tag/{tagSession.js => tagSession.d.ts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename api/tag/{tagSession.js => tagSession.d.ts} (100%)
diff --git a/api/tag/tagSession.js b/api/tag/tagSession.d.ts
similarity index 100%
rename from api/tag/tagSession.js
rename to api/tag/tagSession.d.ts
--
Gitee
From fc8ee9ff8cab95aec11a34567c01b988b154a6bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?=
Date: Wed, 2 Mar 2022 08:59:22 +0000
Subject: [PATCH 38/45] rename api/@ohos.nfc.controller.js to
api/@ohos.nfc.controller.d.ts. fix tag and hce api file extension
Signed-off-by: l00438547
---
api/{@ohos.nfc.controller.js => @ohos.nfc.controller.d.ts} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename api/{@ohos.nfc.controller.js => @ohos.nfc.controller.d.ts} (100%)
diff --git a/api/@ohos.nfc.controller.js b/api/@ohos.nfc.controller.d.ts
similarity index 100%
rename from api/@ohos.nfc.controller.js
rename to api/@ohos.nfc.controller.d.ts
--
Gitee
From 83e3ec41e4ef82c7d9315821cee69df0890cf3c4 Mon Sep 17 00:00:00 2001
From: wyuanchao
Date: Wed, 2 Mar 2022 17:16:36 +0800
Subject: [PATCH 39/45] modify bundleState.d.ts
Signed-off-by: wyuanchao
---
api/@ohos.bundleState.d.ts | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts
index 9a5f353a8b..eb724fd056 100644
--- a/api/@ohos.bundleState.d.ts
+++ b/api/@ohos.bundleState.d.ts
@@ -25,14 +25,12 @@ import { AsyncCallback } from './basic';
* then returns it to you.
*
* @since 7
- * @devices phone, tablet, tv, wearable, car
*/
declare namespace bundleState {
/**
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
*/
@@ -86,7 +84,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param toMerge Indicates the {@link BundleActiveInfo} object to merge.
@@ -98,7 +95,6 @@ declare namespace bundleState {
/**
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
*/
@@ -134,7 +130,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param bundleName Indicates the bundle name of the application to query.
@@ -153,7 +148,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @return Returns the usage priority group of the calling application.
@@ -164,7 +158,6 @@ declare namespace bundleState {
/**
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
*/
@@ -179,7 +172,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param begin Indicates the start time of the query period, in milliseconds.
@@ -194,7 +186,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
*/
@@ -230,7 +221,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param byInterval Indicates the interval at which the usage statistics are queried.
@@ -248,7 +238,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param begin Indicates the start time of the query period, in milliseconds.
@@ -263,7 +252,6 @@ declare namespace bundleState {
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App.
- * @devices phone, tablet, tv, wearable, car.
* @permission ohos.permission.BUNDLE_ACTIVE_INFO.
* @systemapi Hide this for inner system use.
* @param begin Indicates the start time of the query period, in milliseconds.
--
Gitee
From a3c4480eba5d9f451bd159c12106acea3eb44f56 Mon Sep 17 00:00:00 2001
From: dy_study
Date: Wed, 2 Mar 2022 02:37:39 +0000
Subject: [PATCH 40/45] IssueNo:api7 ts Description:commit applicationFramework
api7 interface ts files Sig:SIG_ApplicationFramework Feature or Bugfix:
Feature Binary Source: No
Signed-off-by: dy_study
Change-Id: Id5077cb0282c46fb0e5c93265055434ea8eee6b1
---
api/@ohos.ability.errorCode.d.ts | 49 +++++++++++++
api/@ohos.ability.featureAbility.d.ts | 1 +
api/@ohos.ability.particleAbility.d.ts | 24 +++++++
api/@ohos.app.abilityManager.d.ts | 18 +++++
api/@ohos.bundle.d.ts | 74 ++++++++++++++++++--
api/ability/dataAbilityHelper.d.ts | 40 +++++++++++
api/app/appVersionInfo.d.ts | 46 ++++++++++++
api/app/context.d.ts | 97 +++++++++++++++++++++++++-
api/app/processInfo.d.ts | 2 +-
9 files changed, 343 insertions(+), 8 deletions(-)
create mode 100644 api/@ohos.ability.errorCode.d.ts
create mode 100644 api/app/appVersionInfo.d.ts
diff --git a/api/@ohos.ability.errorCode.d.ts b/api/@ohos.ability.errorCode.d.ts
new file mode 100644
index 0000000000..155f039766
--- /dev/null
+++ b/api/@ohos.ability.errorCode.d.ts
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+ /**
+ * Defines error codes used when starting an ability, for example, featureAbility.ErrorCode.NO_ERROR.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+export enum ErrorCode {
+ /**
+ * Permission denied.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ PERMISSION_DENY = -3,
+
+ /**
+ * Ability not found.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ ABILITY_NOT_FOUND = -2,
+
+ /**
+ * Invalid parameter.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ INVALID_PARAMETER = -1,
+
+ /**
+ * No error.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ NO_ERROR = 0
+}
diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts
index 0aebda140e..44de8063d5 100644
--- a/api/@ohos.ability.featureAbility.d.ts
+++ b/api/@ohos.ability.featureAbility.d.ts
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
+import { Callback } from './basic';
import { Want } from './ability/want';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { AbilityResult } from './ability/abilityResult';
diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts
index 968b176d9c..f6d62b65b4 100644
--- a/api/@ohos.ability.particleAbility.d.ts
+++ b/api/@ohos.ability.particleAbility.d.ts
@@ -17,6 +17,8 @@ import { AsyncCallback } from './basic';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { DataAbilityHelper } from './ability/dataAbilityHelper';
import { NotificationRequest } from './notification/notificationRequest';
+import { ConnectOptions } from './ability/connectOptions';
+import { Want } from './ability/want';
/**
* A Particle Ability represents an ability with service.
@@ -85,5 +87,27 @@ declare namespace particleAbility {
*/
function cancelBackgroundRunning(callback: AsyncCallback): void;
function cancelBackgroundRunning(): Promise;
+
+ /**
+ * Connects an ability to a Service ability.
+ *
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @param request Indicates the Service ability to connect.
+ * @param options Callback object for the client. If this parameter is null, an exception is thrown.
+ * @return unique identifier of the connection between the client and the service side.
+ * @FAModelOnly
+ */
+ function connectAbility(request: Want, options:ConnectOptions ): number;
+
+ /**
+ * Disconnects ability to a Service ability.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @param connection the connection id returned from connectAbility api.
+ * @FAModelOnly
+ */
+ function disconnectAbility(connection: number, callback:AsyncCallback): void;
+ function disconnectAbility(connection: number): Promise;
}
export default particleAbility;
diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts
index cc24a83c7b..8dc9575ac0 100644
--- a/api/@ohos.app.abilityManager.d.ts
+++ b/api/@ohos.app.abilityManager.d.ts
@@ -80,6 +80,24 @@ declare namespace abilityManager {
*/
function deleteMissions(missionIds: Array): Promise;
function deleteMissions(missionIds: Array, callback: AsyncCallback): void;
+
+ /**
+ * Is it a ram-constrained device
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return whether a ram-constrained device.
+ */
+ function isRamConstrainedDevice(): Promise;
+ function isRamConstrainedDevice(callback: AsyncCallback): void;
+
+ /**
+ * Get the memory size of the application
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return application memory size.
+ */
+ function getAppMemorySize(): Promise;
+ function getAppMemorySize(callback: AsyncCallback): void;
}
export default abilityManager;
diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts
index bdef6418df..0a7500990c 100644
--- a/api/@ohos.bundle.d.ts
+++ b/api/@ohos.bundle.d.ts
@@ -22,6 +22,7 @@ import { Want } from './ability/want';
import { BundleInstaller } from './bundle/bundleInstaller';
import { ModuleUsageRecord } from './bundle/moduleUsageRecord';
import { PermissionDef } from './bundle/PermissionDef';
+import image from './@ohos.multimedia.image';
/**
* bundle.
@@ -383,6 +384,19 @@ declare namespace bundle {
*/
function getBundleInstaller(callback: AsyncCallback): void;
function getBundleInstaller(): Promise;
+
+ /**
+ * Obtains information about the current ability.
+ *
+ * @since 7
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the application bundle name to be queried.
+ * @param abilityName Indicates the ability name.
+ * @return Returns the AbilityInfo object for the current ability.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ */
+ function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityInfo(bundleName: string, abilityName: string): Promise;
/**
* Obtains based on a given bundle name.
@@ -392,12 +406,13 @@ declare namespace bundle {
* @param bundleName Indicates the application bundle name to be queried.
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object
* that will be returned.
- * @param userId Indicates the user ID.
+ * @param userId Indicates the user ID or do not pass user ID.
* @return Returns the ApplicationInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void;
- function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number) : Promise;
+ function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback) : void;
+ function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number) : Promise;
/**
* Query the AbilityInfo by the given Want.
@@ -438,12 +453,13 @@ declare namespace bundle {
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects
* that will be returned.
- * @param userId Indicates the user ID.
+ * @param userId Indicates the user ID or do not pass user ID.
* @return Returns a list of ApplicationInfo objects.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
*/
function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void;
- function getAllApplicationInfo(bundleFlags: number, userId: number) : Promise>;
+ function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void;
+ function getAllApplicationInfo(bundleFlags: number, userId?: number) : Promise>;
/**
* Obtains bundle name by the given uid.
@@ -470,8 +486,6 @@ declare namespace bundle {
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise;
- /**
-
/**
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
@@ -569,6 +583,54 @@ declare namespace bundle {
*/
function getPermissionDef(permissionName: string, callback: AsyncCallback): void;
function getPermissionDef(permissionName: string): Promise;
+
+ /**
+ * Obtains the label of a specified ability.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application to which the ability belongs.
+ * @param abilityName Indicates the ability name.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ * @return Returns the label representing the label of the specified ability.
+ */
+ function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityLabel(bundleName: string, abilityName: string): Promise;
+
+ /**
+ * Obtains the icon of a specified ability.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application to which the ability belongs.
+ * @param abilityName Indicates the ability name.
+ * @return Returns the PixelMap object representing the icon of the specified ability.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ */
+ function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityIcon(bundleName: string, abilityName: string): Promise;
+
+ /**
+ * Checks whether a specified ability is enabled.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param info Indicates information about the ability to check.
+ * @returns Returns true if the ability is enabled; returns false otherwise.
+ */
+ function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void;
+ function isAbilityEnabled(info: AbilityInfo): Promise;
+
+ /**
+ * Checks whether a specified application is enabled.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application.
+ * @returns Returns true if the application is enabled; returns false otherwise.
+ */
+ function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void;
+ function isApplicationEnabled(bundleName: string): Promise;
}
export default bundle;
diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts
index f1bf139a73..1fd91039bf 100644
--- a/api/ability/dataAbilityHelper.d.ts
+++ b/api/ability/dataAbilityHelper.d.ts
@@ -198,4 +198,44 @@ export interface DataAbilityHelper {
*/
query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;
query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise;
+
+ /**
+ * Calls the extended API of the DataAbility. This method uses a promise to return the result.
+ *
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @param uri URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx"
+ * @param method Indicates the method to call.
+ * @param arg Indicates the parameter of the String type.
+ * @param extras Indicates the parameter of the PacMap type.
+ * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes,
+ * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object.
+ * If the PacMap object is to be transferred to a non-OHOS process,
+ * values of primitive types are supported, but not custom Sequenceable objects.
+ * @return Returns the query result {@link PacMap}.
+ * @FAModelOnly
+ */
+ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void;
+ call(uri: string, method: string, arg: string, extras: PacMap): Promise;
+}
+
+/**
+ * Defines a PacMap object for storing a series of values.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @FAModelOnly
+ */
+ export interface PacMap {
+
+ /**
+ * Indicates the parameter of the PacMap type.
+ * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes,
+ * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object.
+ * If the PacMap object is to be transferred to a non-OHOS process,
+ * values of primitive types are supported, but not custom Sequenceable objects.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @FAModelOnly
+ */
+ [key: string]: number | string | boolean | Array | null;
}
diff --git a/api/app/appVersionInfo.d.ts b/api/app/appVersionInfo.d.ts
new file mode 100644
index 0000000000..9aa63fc268
--- /dev/null
+++ b/api/app/appVersionInfo.d.ts
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+/**
+ * Defines an AppVersionInfo object.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+export interface AppVersionInfo {
+
+ /**
+ * Application name.
+ * @default appName
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ readonly appName: string;
+
+ /**
+ * Application version number.
+ * @default versionCode
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ readonly versionCode: number;
+
+ /**
+ * Application version name.
+ * @default versionName
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ readonly versionName: string;
+}
diff --git a/api/app/context.d.ts b/api/app/context.d.ts
index 06097c18c9..048c033f5d 100644
--- a/api/app/context.d.ts
+++ b/api/app/context.d.ts
@@ -18,6 +18,10 @@ import { ApplicationInfo } from '../bundle/applicationInfo';
import { ProcessInfo } from './processInfo';
import { ElementName } from '../bundle/elementName';
import BaseContext from '../application/BaseContext';
+import { HapModuleInfo } from '../bundle/hapModuleInfo';
+import { AppVersionInfo } from './appVersionInfo';
+import { AbilityInfo } from '../bundle/abilityInfo';
+
/**
* The context of an ability or an application. It allows access to
@@ -126,6 +130,97 @@ export interface Context extends BaseContext {
*/
getCallingBundle(callback: AsyncCallback): void
getCallingBundle(): Promise;
+
+ /**
+ * Obtains the file directory of this application on the internal storage.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getFilesDir(callback: AsyncCallback): void;
+ getFilesDir(): Promise;
+
+ /**
+ * Obtains the cache directory of this application on the internal storage.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getCacheDir(callback: AsyncCallback): void;
+ getCacheDir(): Promise;
+
+ /**
+ * Obtains the distributed file path for storing ability or application data files.
+ * If the distributed file path does not exist, the system will create a path and return the created path.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getOrCreateDistributedDir(): Promise;
+ getOrCreateDistributedDir(callback: AsyncCallback): void;
+
+ /**
+ * Obtains the application type.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getAppType(callback: AsyncCallback): void
+ getAppType(): Promise;
+
+ /**
+ * Obtains the ModuleInfo object for this application.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getHapModuleInfo(callback: AsyncCallback): void
+ getHapModuleInfo(): Promise;
+
+ /**
+ * Obtains the application version information.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getAppVersionInfo(callback: AsyncCallback): void
+ getAppVersionInfo(): Promise;
+
+ /**
+ * Obtains the context of this application.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getApplicationContext(): Context;
+
+ /**
+ * Checks the detailed information of this ability.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ getAbilityInfo(callback: AsyncCallback): void
+ getAbilityInfo(): Promise;
+
+ /**
+ * Checks whether the configuration of this ability is changing.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return true if the configuration of this ability is changing and false otherwise.
+ * @FAModelOnly
+ */
+ isUpdatingConfigurations(): Promise;
+ isUpdatingConfigurations(callback: AsyncCallback): void;
+
+ /**
+ * Informs the system of the time required for drawing this Page ability.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
+ */
+ printDrawnCompleted(): Promise;
+ printDrawnCompleted(callback: AsyncCallback): void;
}
/**
@@ -184,4 +279,4 @@ interface PermissionOptions {
* @FAModelOnly
*/
uid?: number;
-}
\ No newline at end of file
+}
diff --git a/api/app/processInfo.d.ts b/api/app/processInfo.d.ts
index 1074141503..5f3c2a825d 100644
--- a/api/app/processInfo.d.ts
+++ b/api/app/processInfo.d.ts
@@ -37,5 +37,5 @@ export interface ProcessInfo {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
- processName: string;
+ processName: string;
}
\ No newline at end of file
--
Gitee
From da077a3c7ae71d302287608c9e9aba8e7d93526f Mon Sep 17 00:00:00 2001
From: gudehe
Date: Tue, 1 Mar 2022 20:35:18 +0800
Subject: [PATCH 41/45] add permission for medialibrary
Signed-off-by: gudehe
---
api/@ohos.multimedia.mediaLibrary.d.ts | 54 +++++++++++++++++++-------
1 file changed, 39 insertions(+), 15 deletions(-)
diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts
index c2ff5cc72d..45a0cbd125 100644
--- a/api/@ohos.multimedia.mediaLibrary.d.ts
+++ b/api/@ohos.multimedia.mediaLibrary.d.ts
@@ -14,7 +14,7 @@
*/
import { AsyncCallback, Callback } from './basic';
-import Context from './app/context';
+import { Context } from './app/context';
import image from './@ohos.multimedia.image';
/**
@@ -262,6 +262,7 @@ declare namespace mediaLibrary {
* If it is a directory where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback return the result of isDerectory.
*/
isDirectory(callback: AsyncCallback): void;
@@ -269,27 +270,29 @@ declare namespace mediaLibrary {
* If it is a directory where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
*/
isDirectory():Promise;
/**
* Modify meta data where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param callback no value will be returned.
- * @systemapi
*/
commitModify(callback: AsyncCallback): void;
/**
* Modify meta data where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
*/
commitModify(): Promise;
/**
* Open the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param mode mode for open, for example: rw, r, w.
* @param callback Callback return the fd of the file.
*/
@@ -298,6 +301,7 @@ declare namespace mediaLibrary {
* Open the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param mode mode for open, for example: rw, r, w.
*/
open(mode: string): Promise;
@@ -305,6 +309,7 @@ declare namespace mediaLibrary {
* Close the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param fd fd of the file which had been opened
* @param callback no value will be returned.
*/
@@ -313,6 +318,7 @@ declare namespace mediaLibrary {
* Close the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param fd fd of the file which had been opened
*/
close(fd: number): Promise;
@@ -320,6 +326,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return the thumbnail's pixelmap.
*/
getThumbnail(callback: AsyncCallback): void;
@@ -327,6 +334,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param size thumbnail's size
* @param callback Callback used to return the thumbnail's pixelmap.
*/
@@ -335,6 +343,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param size thumbnail's size
*/
getThumbnail(size?: Size): Promise;
@@ -342,64 +351,64 @@ declare namespace mediaLibrary {
* Set favorite for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isFavorite ture is favorite file, false is not favorite file
* @param callback Callback used to return, No value is returned.
- * @systemapi
*/
favorite(isFavorite: boolean, callback: AsyncCallback): void;
/**
* Set favorite for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isFavorite ture is favorite file, false is not favorite file
- * @systemapi
*/
favorite(isFavorite: boolean): Promise;
/**
* If the file is favorite when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return true or false.
- * @systemapi
*/
isFavorite(callback: AsyncCallback): void;
/**
* If the file is favorite when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA
*/
isFavorite():Promise;
/**
* Set trash for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isTrash true is trashed file, false is not trashed file
* @param callback Callback used to return, No value is returned.
- * @systemapi
*/
trash(isTrash: boolean, callback: AsyncCallback): void;
/**
* Set trash for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isTrash true is trashed file, false is not trashed file
- * @systemapi
*/
- trash(isTrash: boolean,): Promise;
+ trash(isTrash: boolean): Promise;
/**
* If the file is in trash when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return true or false.
- * @systemapi
*/
isTrash(callback: AsyncCallback): void;
/**
* If the file is in trash when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA
*/
isTrash():Promise;
}
@@ -545,7 +554,7 @@ declare namespace mediaLibrary {
*/
selectionArgs: Array;
/**
- * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,_display_name DESC, _id DESC".
+ * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,display_name DESC, file_id DESC".
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
*/
@@ -741,21 +750,22 @@ declare namespace mediaLibrary {
* Modify the meta data for the album
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param callback, no value will be returned.
- * @systemapi
*/
commitModify(callback: AsyncCallback): void;
/**
* Modify the meta data for the album
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
*/
commitModify(): Promise;
/**
* SObtains files in an album. This method uses an asynchronous callback to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return the files in the format of a FetchFileResult instance.
*/
getFileAssets(callback: AsyncCallback): void;
@@ -763,6 +773,7 @@ declare namespace mediaLibrary {
* SObtains files in an album. This method uses an asynchronous callback to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @param callback Callback used to return the files in the format of a FetchFileResult instance.
*/
@@ -771,6 +782,7 @@ declare namespace mediaLibrary {
* Obtains files in an album. This method uses a promise to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @return A Promise instance used to return the files in the format of a FetchFileResult instance.
*/
@@ -849,6 +861,7 @@ declare namespace mediaLibrary {
* if need all data, getAllObject from FetchFileResult
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param options, Media retrieval options.
* @param callback, Callback return the FetchFileResult.
*/
@@ -858,6 +871,7 @@ declare namespace mediaLibrary {
* if need all data, getAllObject from FetchFileResult
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param options Media retrieval options.
* @return A promise instance used to return the files in the format of a FetchFileResult instance
*/
@@ -882,6 +896,7 @@ declare namespace mediaLibrary {
* Create File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE
* @param displayName file name
* @param relativePath relative path
@@ -892,6 +907,7 @@ declare namespace mediaLibrary {
* Create File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE
* @param displayName file name
* @param relativePath relative path
@@ -902,6 +918,7 @@ declare namespace mediaLibrary {
* Delete File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param uri FileAsset's URI
* @param callback no value returned
* @systemapi
@@ -911,6 +928,7 @@ declare namespace mediaLibrary {
* Delete File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param uri, FileAsset's URI
* @return A Promise instance, no value returned
* @systemapi
@@ -920,6 +938,7 @@ declare namespace mediaLibrary {
* Obtains albums based on the media retrieval options. This method uses an asynchronous callback to return.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @param callback Callback used to return an album array.
*/
@@ -928,6 +947,7 @@ declare namespace mediaLibrary {
* Obtains albums based on the media retrieval options. This method uses a promise to return the albums.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @return A Promise instance used to return an album array.
*/
@@ -999,6 +1019,7 @@ declare namespace mediaLibrary {
* Get Active Peer device information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @param callback, Callback return the list of the active peer devices' information
*/
@@ -1007,6 +1028,7 @@ declare namespace mediaLibrary {
* Get Active Peer device information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @return Promise used to return the list of the active peer devices' information
*/
@@ -1015,6 +1037,7 @@ declare namespace mediaLibrary {
* Get all the peer devices' information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @param callback Callback return the list of the all the peer devices' information
*/
@@ -1023,6 +1046,7 @@ declare namespace mediaLibrary {
* Get all the peer devices' information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @return Promise used to return the list of the all the peer devices' information
*/
--
Gitee
From a6319053f741bab04df7ed0e003443d44817f966 Mon Sep 17 00:00:00 2001
From: linjun9528
Date: Wed, 2 Mar 2022 17:32:06 +0800
Subject: [PATCH 42/45] alter js api description
Signed-off-by: linjun9528
---
api/common/@system.file.d.ts | 187 ++++++++++++++++++-----------------
1 file changed, 96 insertions(+), 91 deletions(-)
diff --git a/api/common/@system.file.d.ts b/api/common/@system.file.d.ts
index 7f2424a1f5..e5ef9f3e20 100644
--- a/api/common/@system.file.d.ts
+++ b/api/common/@system.file.d.ts
@@ -16,6 +16,7 @@
export interface FileResponse {
/**
* File URI.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -23,6 +24,7 @@ export interface FileResponse {
/**
* File size, in bytes.
* If type is dir, the length value is fixed to 0.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
length: number;
@@ -30,6 +32,7 @@ export interface FileResponse {
/**
* Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00.
* For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
lastModifiedTime: number;
@@ -38,6 +41,7 @@ export interface FileResponse {
* File type. The values are as follows:
* dir: directory
* file: file
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
type: "dir" | "file";
@@ -45,13 +49,14 @@ export interface FileResponse {
/**
* File list. When the recursive value is true and the type is dir, the file information under the subdirectory will be returned.
* Otherwise, no value will be returned.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
subFiles?: Array;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileMoveOption {
/**
@@ -59,7 +64,7 @@ export interface FileMoveOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
srcUri: string;
@@ -69,7 +74,7 @@ export interface FileMoveOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
dstUri: string;
@@ -77,39 +82,39 @@ export interface FileMoveOption {
/**
* Called when the source file is moved to the specified location successfully.
* This function returns the URI of the file moved to the target location.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (uri: string) => void;
/**
* Called when moving fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileListResponse {
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fileList: Array;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileListOption {
/**
@@ -117,28 +122,28 @@ export interface FileListOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
/**
* Called when the list is obtained successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (data: FileListResponse) => void;
/**
* Called when the list fails to be obtained.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
@@ -150,7 +155,7 @@ export interface FileCopyOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
srcUri: string;
@@ -160,7 +165,7 @@ export interface FileCopyOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
dstUri: string;
@@ -168,21 +173,21 @@ export interface FileCopyOption {
/**
* Called when the copy file is saved successful.
* This function returns the URI of the file saved to the target location.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (uri: string) => void;
/**
* Called when the copy or save operation fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
@@ -194,7 +199,7 @@ export interface FileGetOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -202,28 +207,28 @@ export interface FileGetOption {
/**
* Whether to recursively obtain the file list under a subdirectory.
* The default value is false.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
recursive?: boolean;
/**
* Called when file information is obtained successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (file: FileResponse) => void;
/**
* Called when file information fails to be obtained.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
@@ -235,35 +240,35 @@ export interface FileDeleteOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
/**
* Called when local files are deleted successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when the deletion fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileWriteTextOption {
/**
@@ -271,60 +276,60 @@ export interface FileWriteTextOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
/**
* Character string to write into the local file.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
text: string;
/**
* Encoding format. The default format is UTF-8.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
encoding?: string;
/**
* Whether to enable the append mode. The default value is false.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
append?: boolean;
/**
* Called when texts are written into a file successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when texts fail to be written into a file.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileReadTextResponse {
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
text: string;
@@ -336,7 +341,7 @@ export interface FileReadTextOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -344,7 +349,7 @@ export interface FileReadTextOption {
/**
* Encoding format. The default format is UTF-8.
* Currently, only UTF-8 is supported.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
encoding?: string;
@@ -352,7 +357,7 @@ export interface FileReadTextOption {
/**
* Position where the reading starts.
* The default value is the start position of the file.
- * @devices liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
position?: number;
@@ -360,35 +365,35 @@ export interface FileReadTextOption {
/**
* Position where the reading starts.
* The default value is the start position of the file.
- * @devices liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
length?: number;
/**
* Called when texts are read successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (data: FileReadTextResponse) => void;
/**
* Called when texts fail to be read.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileWriteArrayBufferOption {
/**
@@ -396,21 +401,21 @@ export interface FileWriteArrayBufferOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
/**
* Buffer from which the data is derived.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
buffer: Uint8Array;
/**
* Offset to the position where the writing starts. The default value is 0.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
position?: number;
@@ -418,46 +423,46 @@ export interface FileWriteArrayBufferOption {
/**
* Whether to enable the append mode.
* The default value is false. If the value is true, the position parameter will become invalid.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
append?: boolean;
/**
* Called when data from a buffer is written into a file successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when data from a buffer fails to be written into a file.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileReadArrayBufferResponse {
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
buffer: Uint8Array;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileReadArrayBufferOption {
/**
@@ -465,7 +470,7 @@ export interface FileReadArrayBufferOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -473,7 +478,7 @@ export interface FileReadArrayBufferOption {
/**
* Position where the reading starts.
* The default value is the start position of the file.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
position?: number;
@@ -481,35 +486,35 @@ export interface FileReadArrayBufferOption {
/**
* Length of the content to read.
* If this parameter is not set, all content of the file will be read.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
length?: number;
/**
* Called when the buffer data is read successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: (data: FileReadArrayBufferResponse) => void;
/**
* Called when the buffer data fails to be read.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileAccessOption {
/**
@@ -517,35 +522,35 @@ export interface FileAccessOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
/**
* Called when the check result is obtained successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when the check fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileMkdirOption {
/**
@@ -554,7 +559,7 @@ export interface FileMkdirOption {
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
* 3. A maximum of five recursions are allowed for creating the directory.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -562,35 +567,35 @@ export interface FileMkdirOption {
/**
* Whether to create the directory after creating its upper-level directory recursively.
* The default value is false.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
recursive?: boolean;
/**
* Called when the directory is created successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when the creation fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export interface FileRmdirOption {
/**
@@ -598,7 +603,7 @@ export interface FileRmdirOption {
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
uri: string;
@@ -606,118 +611,118 @@ export interface FileRmdirOption {
/**
* Whether to delete files and subdirectories recursively.
* The default value is false.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
recursive?: boolean;
/**
* Called when the directory is deleted successfully.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
success?: () => void;
/**
* Called when the deletion fails.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @since 3
*/
complete?: () => void;
}
/**
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
+ * @syscap SystemCapability.FileManagement.File.FileIO
*/
export default class File {
/**
* Moves the source file to a specified location.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static move(options: FileMoveOption): void;
/**
* Copies a source file and save the copy to a specified location.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static copy(options: FileCopyOption): void;
/**
* Obtains the list of files in a specified directory.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static list(options: FileListOption): void;
/**
* Obtains information about a local file.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static get(options: FileGetOption): void;
/**
* Deletes local files.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static delete(options: FileDeleteOption): void;
/**
* Writes texts into a file.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static writeText(options: FileWriteTextOption): void;
/**
* Reads texts from a file.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static readText(options: FileReadTextOption): void;
/**
* Writes data from a buffer into a file.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static writeArrayBuffer(options: FileWriteArrayBufferOption): void;
/**
* Reads buffer data from a file.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static readArrayBuffer(options: FileReadArrayBufferOption): void;
/**
* Checks whether a file or directory exists.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static access(options: FileAccessOption): void;
/**
* Creates a directory.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static mkdir(options: FileMkdirOption): void;
/**
* Deletes a directory.
+ * @syscap SystemCapability.FileManagement.File.FileIO
* @param options Options.
- * @devices tv, phone, tablet, wearable, liteWearable, smartVision
*/
static rmdir(options: FileRmdirOption): void;
}
--
Gitee
From d42f38751c577d10d5e26320a735971bbb42f8c9 Mon Sep 17 00:00:00 2001
From: wangyong1995626wywz
Date: Wed, 2 Mar 2022 17:59:47 +0800
Subject: [PATCH 43/45] Correct the interface of the D.T file of the container
class
Description
1. Correct some interface errors
2. Description of relevant errors
3. Complete the missing systemcapability Utils. Lang description
#I4W0R:Correct the interface of the D.T file of the container class
Signed-off-by: wangyong1995626wywz
---
api/@ohos.util.ArrayList.d.ts | 9 ++++----
api/@ohos.util.HashMap.d.ts | 2 +-
api/@ohos.util.LightWeightMap.d.ts | 6 +++---
api/@ohos.util.LightWeightSet.d.ts | 16 +++++++++-----
api/@ohos.util.LinkedList.d.ts | 34 ++++++++++++------------------
api/@ohos.util.List.d.ts | 14 ++++--------
api/@ohos.util.PlainArray.d.ts | 12 +++++------
api/@ohos.util.Queue.d.ts | 4 ++--
api/@ohos.util.Stack.d.ts | 5 +++--
api/@ohos.util.TreeMap.d.ts | 5 +++--
api/@ohos.util.Vector.d.ts | 3 ++-
11 files changed, 54 insertions(+), 56 deletions(-)
diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts
index af4b694e8f..ac7174e497 100644
--- a/api/@ohos.util.ArrayList.d.ts
+++ b/api/@ohos.util.ArrayList.d.ts
@@ -106,13 +106,13 @@ declare class ArrayList {
* each element in the arraylist,Returns the result of an operation
* @param Value (required) current element
* @param Index (Optional) The index value of the current element.
- * @param arraylist (Optional) The arraylist object to which the current element belongs.
+ * @param arrlist (Optional) The arraylist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- replaceAllElements(callbackfn: (value: T, index?: number, arraylist?: ArrayList) => T,
+ replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList) => T,
thisArg?: Object): void;
/**
* Executes a provided function once for each value in the arraylist object.
@@ -120,13 +120,13 @@ declare class ArrayList {
* be called for each element in the arraylist
* @param Value (required) current element
* @param Index (Optional) The index value of the current element.
- * @param arraylist (Optional) The arraylist object to which the current element belongs.
+ * @param arrlist (Optional) The arraylist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value: T, index?: number, arraylist?: ArrayList) => void,
+ forEach(callbackfn: (value: T, index?: number, arrlist?: ArrayList) => void,
thisArg?: Object): void;
/**
* Sorts this arraylist according to the order induced by the specified comparator,without comparator this parameter,
@@ -169,6 +169,7 @@ declare class ArrayList {
* returns the capacity of this arraylist
* @return the number type
* @since 8
+ * @syscap SystemCapability.Utils.Lang
*/
getCapacity(): number;
/**
diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts
index 0b014d6c07..db6a86247b 100644
--- a/api/@ohos.util.HashMap.d.ts
+++ b/api/@ohos.util.HashMap.d.ts
@@ -101,7 +101,7 @@ declare class HashMap {
/**
* Replace the old value by new value corresponding to the specified key
* @param key Updated targets
- * @param value Updated the target mapped value
+ * @param newValue Updated the target mapped value
* @returns the boolean type(Is there a target pointed to by the key)
* @since 8
* @syscap SystemCapability.Utils.Lang
diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts
index afff2630d5..cc34b5dfbf 100644
--- a/api/@ohos.util.LightWeightMap.d.ts
+++ b/api/@ohos.util.LightWeightMap.d.ts
@@ -64,9 +64,9 @@ declare class LightWeightMap {
*/
entries(): IterableIterator<[K, V]>;
/**
- * Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key
+ * Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
* @param key the index in LightWeightMap
- * @return value or null
+ * @return value or undefined
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@@ -86,7 +86,7 @@ declare class LightWeightMap {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- getIndexOfValue(value: K): number;
+ getIndexOfValue(value: V): number;
/**
* Returns whether the Map object contains elements
* @return the boolean type
diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts
index 27f078499b..e882104ee8 100644
--- a/api/@ohos.util.LightWeightSet.d.ts
+++ b/api/@ohos.util.LightWeightSet.d.ts
@@ -32,15 +32,15 @@ declare class LightWeightSet {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- add(value: T): boolean;
+ add(obj: T): boolean;
/**
* Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container
- * @param set the Map object to provide the added element
+ * @param set the Set object to provide the added element
* @returns the boolean type(Is there any new data added successfully)
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- addAll(set: LightWeightMap): boolean;
+ addAll(set: LightWeightSet): boolean;
/**
* Returns whether this set has all the object in a specified set
* @param set the Set object to compare
@@ -72,7 +72,7 @@ declare class LightWeightSet {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- ensureCapacityTo(minimumCapacity: number): void;
+ increaseCapacityTo(minimumCapacity: number): void;
/**
* Obtains the index of s key of a specified Object type in an LightWeightSet container
* @param key Looking for goals
@@ -110,7 +110,7 @@ declare class LightWeightSet {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value?: T, key?: T, map?: LightWeightSet) => void,
+ forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet) => void,
thisArg?: Object): void;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
@@ -150,6 +150,12 @@ declare class LightWeightSet {
* @syscap SystemCapability.Utils.Lang
*/
entries(): IterableIterator<[T, T]>;
+ /**
+ * Returns whether the set object contains elements
+ * @since 8
+ * @syscap SystemCapability.Utils.Lang
+ */
+ isEmpty(): boolean;
}
export default LightWeightSet;
diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts
index 14333ffb64..e81ef5c4d2 100644
--- a/api/@ohos.util.LinkedList.d.ts
+++ b/api/@ohos.util.LinkedList.d.ts
@@ -13,6 +13,12 @@
* limitations under the License.
*/
declare class LinkedList {
+ /**
+ * A constructor used to create a LinkedList object.
+ * @since 8
+ * @syscap SystemCapability.Utils.Lang
+ */
+ constructor();
/**
* Gets the element number of the LinkedList. This is a number one higher than the highest index in the linkedlist.
* @since 8
@@ -35,7 +41,7 @@ declare class LinkedList {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- insert(element: T, index: number): void;
+ insert(index: number, element: T): void;
/**
* Returns the element at the specified position in this linkedlist,
* or returns undefined if this linkedlist is empty
@@ -72,7 +78,7 @@ declare class LinkedList {
/**
* Check if linkedlist contains the specified element
* @param element element to be contained
- * @return the boolean type,if vector contains the specified element,return true,else return false
+ * @return the boolean type,if linkedList contains the specified element,return true,else return false
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@@ -137,7 +143,7 @@ declare class LinkedList {
/**
* Returns the first element (the item at index 0) of this linkedlist.
* or returns undefined if linkedlist is empty
- * @return the T type ,returns undefined if vector is empty
+ * @return the T type ,returns undefined if linkedList is empty
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@@ -145,7 +151,7 @@ declare class LinkedList {
/**
* Returns the Last element (the item at index length-1) of this linkedlist.
* or returns undefined if linkedlist is empty
- * @return the T type ,returns undefined if vector is empty
+ * @return the T type ,returns undefined if linkedList is empty
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
@@ -154,37 +160,25 @@ declare class LinkedList {
* Replaces the element at the specified position in this Vector with the specified element
* @param element replaced element
* @param index index to find
+ * @return the T type ,returns undefined if linkedList is empty
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- set(index: number, element: T): void;
+ set(index: number, element: T): T;
/**
* Replaces each element of this linkedlist with the result of applying the operator to that element.
* @param callbackfn (required) A function that accepts up to four arguments.
* The function to be called for each element in the linkedlist,Returns the result of an operation
* @param Value (required) current element
* @param Index (Optional) The index value of the current element.
- * @param linkedlist (Optional) The linkedlist object to which the current element belongs.
+ * @param LinkedList (Optional) The linkedlist object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value: T, index?: number, linkedlist?: ArrayList) => void,
+ forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList) => void,
thisArg?: Object): void;
- /**
- * Sorts this linkedlist according to the order induced by the specified comparator,without comparator this parameter,
- * it will default to ASCII sorting
- * @param comparator (Optional) A function that accepts up to two arguments.Specifies the sort order.
- * Must be a function,return number type,If it returns firstValue minus secondValue, it returns an linkedlist
- * sorted in ascending order;If it returns secondValue minus firstValue, it returns an linkedlist sorted in descending order;
- * @param firstValue (Optional) previous element
- * @param secondValue (Optional) next elements
- * If this parameter is empty, it will default to ASCII sorting
- * @since 8
- * @syscap SystemCapability.Utils.Lang
- */
- sort(comparator?: (firstValue: T, secondValue: T) => number): void;
/**
* Removes all of the elements from this linkedlist.The linkedlist will
* be empty after this call returns.length becomes 0
diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts
index 89d90ba06e..fa79586eca 100644
--- a/api/@ohos.util.List.d.ts
+++ b/api/@ohos.util.List.d.ts
@@ -116,10 +116,11 @@ declare class List {
* Replaces the element at the specified position in this List with the specified element
* @param element replaced element
* @param index index to find
+ * @return the T type
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- set(index: number, element: T): void;
+ set(index: number, element: T): T;
/**
* Compares the specified object with this list for equality.if the object are the same as this list
* return true, otherwise return false.
@@ -135,13 +136,13 @@ declare class List {
* The function to be called for each element in the list,Returns the result of an operation
* @param Value (required) current element
* @param Index (Optional) The index value of the current element.
- * @param list (Optional) The list object to which the current element belongs.
+ * @param List (Optional) The list object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value: T, index?: number, list?: ArrayList) => void,
+ forEach(callbackfn: (value: T, index?: number, List?: List) => void,
thisArg?: Object): void;
/**
* Sorts this list according to the order induced by the specified comparator
@@ -186,13 +187,6 @@ declare class List {
*/
replaceAllElements(callbackfn: (value: T, index?: number, list?: List) => T,
thisArg?: Object): void;
- /**
- * Returns a shallow copy of this instance. (The elements themselves are not copied.)
- * @return this list instance
- * @since 8
- * @syscap SystemCapability.Utils.Lang
- */
- clone(): List;
/**
* convert list to array
* @return the Array type
diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts
index 55495dd9c1..37012f6ad2 100644
--- a/api/@ohos.util.PlainArray.d.ts
+++ b/api/@ohos.util.PlainArray.d.ts
@@ -29,11 +29,11 @@ declare class PlainArray {
* Appends a key-value pair to PlainArray
* @param key Added the key of key-value
* @param value Added the value of key-value
- * @returns the boolean type(Is there contain this element)
+ * @throws Throws this exception if input is invaild
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- add(key: number, value: T): boolean;
+ add(key: number, value: T): void;
/**
* Clears the current PlainArray object
* @since 8
@@ -104,11 +104,11 @@ declare class PlainArray {
/**
* Remove the key-value pair at a specified index if it exists and return the value
* @param index Target subscript for search
- * @return the boolean type(Is there a delete value)
+ * @return the T type
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- removeAt(index: number): boolean;
+ removeAt(index: number): T;
/**
* Remove a group of key-value pairs from a specified index
* @param index remove start index
@@ -125,7 +125,7 @@ declare class PlainArray {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- setValueAt(index: number, newValue: T): void;
+ setValueAt(index: number, value: T): void;
/**
* Obtains the string representation of the PlainArray object
* @since 8
@@ -145,7 +145,7 @@ declare class PlainArray {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap) => void,
+ forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray) => void,
thisArg?: Object): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts
index c28ca9ebb1..69c2762bd4 100644
--- a/api/@ohos.util.Queue.d.ts
+++ b/api/@ohos.util.Queue.d.ts
@@ -56,13 +56,13 @@ declare class Queue {
* be called for each element in the queue
* @param Value (required) current element
* @param Index (Optional) The index value of the current element.
- * @param queue (Optional) The queue object to which the current element belongs.
+ * @param Queue (Optional) The queue object to which the current element belongs.
* @param thisArg (Optional) The value passed to the function generally uses the "this" value.
* If this parameter is empty, "undefined" will be passed to the "this" value
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- forEach(callbackfn: (value: T, index?: number, queue?: Queue) => void,
+ forEach(callbackfn: (value: T, index?: number, Queue?: Queue) => void,
thisArg?: Object): void;
/**
* returns an iterator.Each item of the iterator is a Javascript Object
diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts
index 6eea500a87..59ef60e5d4 100644
--- a/api/@ohos.util.Stack.d.ts
+++ b/api/@ohos.util.Stack.d.ts
@@ -16,6 +16,7 @@ declare class Stack {
/**
* A constructor used to create a Stack object.
* @since 8
+ * @syscap SystemCapability.Utils.Lang
*/
constructor();
/**
@@ -42,11 +43,11 @@ declare class Stack {
/**
* Removes the object at the top of this stack and returns that object as the value of this function
* an exception if the stack is empty
- * @returns Stack top value
+ * @returns Stack top value or undefined
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- pop(): boolean;
+ pop(): T;
/**
* Pushes an item onto the top of this stack
* @param item to be appended to this Stack
diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts
index 125b149ce5..2b4647f18f 100644
--- a/api/@ohos.util.TreeMap.d.ts
+++ b/api/@ohos.util.TreeMap.d.ts
@@ -19,6 +19,7 @@ declare class TreeMap {
* @param firstValue (Optional) previous element
* @param secondValue (Optional) next element
* @since 8
+ * @syscap SystemCapability.Utils.Lang
*/
constructor(comparator?: (firstValue: K, secondValue: K) => boolean);
/**
@@ -112,7 +113,7 @@ declare class TreeMap {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- getLowerByKey(key: K): K;
+ getLowerKey(key: K): K;
/**
* Returns the least element greater than or equal to the specified key
* if the key does not exist, undefied is returned
@@ -121,7 +122,7 @@ declare class TreeMap {
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- getHigherByKey(key: K): K;
+ getHigherKey(key: K): K;
/**
* Returns a new Iterator object that contains the keys contained in this map
* @since 8
diff --git a/api/@ohos.util.Vector.d.ts b/api/@ohos.util.Vector.d.ts
index bf061e7f4a..67d310c7b5 100644
--- a/api/@ohos.util.Vector.d.ts
+++ b/api/@ohos.util.Vector.d.ts
@@ -109,10 +109,11 @@ declare class Vector {
* Replaces the element at the specified position in this Vector with the specified element
* @param element replaced element
* @param index index to find
+ * @return the T type
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
- set(index: number, element: T): void;
+ set(index: number, element: T): T;
/**
* Returns in the index of the last occurrence of the specified element in this vector ,
* or -1 if the vector does not contain the element.
--
Gitee
From 800cb64127ed52e785dd32f3fcb820a9b85839f5 Mon Sep 17 00:00:00 2001
From: linjun9528
Date: Wed, 2 Mar 2022 19:10:04 +0800
Subject: [PATCH 44/45] alter file js api description
Signed-off-by: linjun9528
---
api/common/@system.file.d.ts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/api/common/@system.file.d.ts b/api/common/@system.file.d.ts
index e5ef9f3e20..b65af860dc 100644
--- a/api/common/@system.file.d.ts
+++ b/api/common/@system.file.d.ts
@@ -452,6 +452,7 @@ export interface FileWriteArrayBufferOption {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export interface FileReadArrayBufferResponse {
/**
@@ -463,6 +464,7 @@ export interface FileReadArrayBufferResponse {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export interface FileReadArrayBufferOption {
/**
@@ -515,6 +517,7 @@ export interface FileReadArrayBufferOption {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export interface FileAccessOption {
/**
@@ -551,6 +554,7 @@ export interface FileAccessOption {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export interface FileMkdirOption {
/**
@@ -596,6 +600,7 @@ export interface FileMkdirOption {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export interface FileRmdirOption {
/**
@@ -640,11 +645,13 @@ export interface FileRmdirOption {
/**
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
*/
export default class File {
/**
* Moves the source file to a specified location.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static move(options: FileMoveOption): void;
@@ -652,6 +659,7 @@ export default class File {
/**
* Copies a source file and save the copy to a specified location.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static copy(options: FileCopyOption): void;
@@ -659,6 +667,7 @@ export default class File {
/**
* Obtains the list of files in a specified directory.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static list(options: FileListOption): void;
@@ -666,6 +675,7 @@ export default class File {
/**
* Obtains information about a local file.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static get(options: FileGetOption): void;
@@ -673,6 +683,7 @@ export default class File {
/**
* Deletes local files.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static delete(options: FileDeleteOption): void;
@@ -680,6 +691,7 @@ export default class File {
/**
* Writes texts into a file.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static writeText(options: FileWriteTextOption): void;
@@ -687,6 +699,7 @@ export default class File {
/**
* Reads texts from a file.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static readText(options: FileReadTextOption): void;
@@ -694,6 +707,7 @@ export default class File {
/**
* Writes data from a buffer into a file.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static writeArrayBuffer(options: FileWriteArrayBufferOption): void;
@@ -701,6 +715,7 @@ export default class File {
/**
* Reads buffer data from a file.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static readArrayBuffer(options: FileReadArrayBufferOption): void;
@@ -708,6 +723,7 @@ export default class File {
/**
* Checks whether a file or directory exists.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static access(options: FileAccessOption): void;
@@ -715,6 +731,7 @@ export default class File {
/**
* Creates a directory.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static mkdir(options: FileMkdirOption): void;
@@ -722,6 +739,7 @@ export default class File {
/**
* Deletes a directory.
* @syscap SystemCapability.FileManagement.File.FileIO
+ * @since 3
* @param options Options.
*/
static rmdir(options: FileRmdirOption): void;
--
Gitee
From 2ee60faf79043c1c8f6819f03e84c9b2355b7a56 Mon Sep 17 00:00:00 2001
From: zhangfeng
Date: Wed, 2 Mar 2022 11:47:01 +0000
Subject: [PATCH 45/45] update syscap for class and enum
Signed-off-by: zhangfeng
---
api/@ohos.wifi.d.ts | 28 +++++++++++++++++++++++-----
api/@ohos.wifiext.d.ts | 1 +
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts
index 2df449ff62..e0cecd1eb2 100644
--- a/api/@ohos.wifi.d.ts
+++ b/api/@ohos.wifi.d.ts
@@ -850,6 +850,7 @@ declare namespace wifi {
*
* @since 6
* @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
interface WifiDeviceConfig {
/** Wi-Fi SSID: the maximum length is 32 */
@@ -900,7 +901,8 @@ declare namespace wifi {
* Wi-Fi IP configuration information.
*
* @since 7
- * @systemapi
+ * @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
interface IpConfig {
ipAddress: number;
@@ -913,6 +915,7 @@ declare namespace wifi {
* Describes the scanned Wi-Fi information.
*
* @since 6
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
interface WifiScanInfo {
/** Wi-Fi SSID: the maximum length is 32 */
@@ -947,6 +950,7 @@ declare namespace wifi {
* Describes the wifi security type.
*
* @since 6
+ * @syscap SystemCapability.Communication.WiFi.Core
*/
enum WifiSecurityType {
/** Invalid security type */
@@ -969,6 +973,7 @@ declare namespace wifi {
* Wi-Fi connection information.
*
* @since 7
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
interface WifiLinkedInfo {
/** The SSID of the Wi-Fi hotspot */
@@ -1025,6 +1030,7 @@ declare namespace wifi {
* Wi-Fi IP information.
*
* @since 7
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
interface IpInfo {
/** The IP address of the Wi-Fi connection */
@@ -1053,7 +1059,8 @@ declare namespace wifi {
* Wi-Fi hotspot configuration information.
*
* @since 7
- * @systemapi
+ * @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.AP
*/
interface HotspotConfig {
/** The SSID of the Wi-Fi hotspot */
@@ -1076,7 +1083,8 @@ declare namespace wifi {
* Wi-Fi station information.
*
* @since 7
- * @systemapi
+ * @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.AP
*/
interface StationInfo {
/** the network name of the Wi-Fi client */
@@ -1093,7 +1101,8 @@ declare namespace wifi {
* Wi-Fi IP type enumeration.
*
* @since 7
- * @systemapi
+ * @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
enum IpType {
/** Use statically configured IP settings */
@@ -1110,7 +1119,8 @@ declare namespace wifi {
* The state of the supplicant enumeration.
*
* @since 7
- * @systemapi
+ * @systemapi Hide this for inner system use.
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
export enum SuppState {
/** The supplicant is not associated with or is disconnected from the AP. */
@@ -1154,6 +1164,7 @@ declare namespace wifi {
* The state of Wi-Fi connection enumeration.
*
* @since 7
+ * @syscap SystemCapability.Communication.WiFi.STA
*/
export enum ConnState {
/** The device is searching for an available AP. */
@@ -1185,6 +1196,7 @@ declare namespace wifi {
* P2P device information.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
interface WifiP2pDevice {
/** Device name */
@@ -1207,6 +1219,7 @@ declare namespace wifi {
* P2P config.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
interface WifiP2PConfig {
/** Device mac address */
@@ -1232,6 +1245,7 @@ declare namespace wifi {
* P2P group information.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
interface WifiP2pGroupInfo {
/** Indicates whether it is group owner */
@@ -1266,6 +1280,7 @@ declare namespace wifi {
* P2P connection status.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
enum P2pConnectState {
DISCONNECTED = 0,
@@ -1276,6 +1291,7 @@ declare namespace wifi {
* P2P linked information.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
interface WifiP2pLinkedInfo {
/** Connection status */
@@ -1292,6 +1308,7 @@ declare namespace wifi {
* P2P device status.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
enum P2pDeviceStatus {
CONNECTED = 0,
@@ -1305,6 +1322,7 @@ declare namespace wifi {
* P2P group owner band.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.P2P
*/
enum GroupOwnerBand {
GO_BAND_AUTO = 0,
diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts
index eaad6e06a8..83c6bdade8 100644
--- a/api/@ohos.wifiext.d.ts
+++ b/api/@ohos.wifiext.d.ts
@@ -85,6 +85,7 @@ declare namespace wifiext {
* The power model enumeration.
*
* @since 8
+ * @syscap SystemCapability.Communication.WiFi.HotspotExt
*/
export enum PowerModel {
/** Sleeping model. */
--
Gitee