diff --git a/api/@ohos.connectedTag.d.ts b/api/@ohos.connectedTag.d.ts old mode 100755 new mode 100644 index 23eaa844f73ee3de038cab6460826c4d22658e4f..8e627049233e4a61e94d44f5ff5d7d5ee1e72872 --- a/api/@ohos.connectedTag.d.ts +++ b/api/@ohos.connectedTag.d.ts @@ -20,14 +20,13 @@ import { AsyncCallback, Callback } from './basic'; * * @since 8 * @syscap SystemCapability.Communication.ConnectedTag - * @import import connectedTag from '@ohos.connectedTag'; */ declare namespace connectedTag { /** * Initializes Connected Tag. * - * @return Returns true or false. - * @permissions ohos.permission.NFC_TAG + * @returns Returns true or false. + * @permission ohos.permission.NFC_TAG * * @since 8 */ @@ -36,8 +35,8 @@ declare namespace connectedTag { /** * UnInitializes Connected Tag. * - * @return Returns true or false. - * @permissions ohos.permission.NFC_TAG + * @returns Returns true or false. + * @permission ohos.permission.NFC_TAG * * @since 8 */ @@ -46,8 +45,8 @@ declare namespace connectedTag { /** * Reads the NDEF Data. * - * @return Returns the NDEF Data. - * @permissions ohos.permission.NFC_TAG + * @returns Returns the NDEF Data. + * @permission ohos.permission.NFC_TAG * * @since 8 */ @@ -58,8 +57,8 @@ declare namespace connectedTag { * Writes the NDEF Data. * * @param data The Data to write. - * @return Returns true or false. - * @permissions ohos.permission.NFC_TAG + * @returns Returns true or false. + * @permission ohos.permission.NFC_TAG * * @since 8 */ @@ -71,8 +70,8 @@ declare namespace connectedTag { * * @type The callback type. * @param callback The callback function to be registered. - * @return Returns NFC_RF_LEAVE or NFC_RF_ENTER - * @permissions ohos.permission.NFC_TAG + * @returns Returns NFC_RF_LEAVE or NFC_RF_ENTER + * @permission ohos.permission.NFC_TAG * * @since 8 */ @@ -85,7 +84,7 @@ declare namespace connectedTag { * * @type The callback type. * @param callback The callback function to be unregistered. - * @permissions ohos.permission.NFC_TAG + * @permission ohos.permission.NFC_TAG * * @since 8 */ diff --git a/api/@ohos.nfc.cardEmulation.d.ts b/api/@ohos.nfc.cardEmulation.d.ts old mode 100755 new mode 100644 index a31e7366929f3b4498933fca78c841717cd06016..b9ec0cc12a841340f33ac8eb17b78b42e03f7a9e --- a/api/@ohos.nfc.cardEmulation.d.ts +++ b/api/@ohos.nfc.cardEmulation.d.ts @@ -13,14 +13,13 @@ * limitations under the License. */ import { AsyncCallback } from './basic'; +import { ElementName } from './bundle/elementName'; /** * Provides methods to operate or manage NFC card emulation. * - * @import import cardEmulation from '@ohos.nfc.cardEmulation'; - * * @since 6 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.CardEmulation */ declare namespace cardEmulation { enum FeatureType { @@ -34,19 +33,46 @@ declare namespace cardEmulation { ESE = 2, } + /** + * Define the card emulation type, payment or other. + * + * @since 9 + */ + enum CardType { + /** payment type of card emulation */ + PAYMENT = "payment", + + /** other type of card emulation */ + OTHER = "other", + } + /** * 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 + * @returns Returns {@code true} if the specified type of card emulation is supported; returns * {@code false} otherwise. * * @since 6 */ function isSupported(feature: number): boolean; + /** + * Checks whether a service is default for given type. + * + * @param { ElementName } elementName - The element name of the service ability + * @param { CardType } type - The type to query, pyament or other. + * @returns { boolean } Returns true if the service is default, otherwise false. + * @permission ohos.permission.NFC_CARD_EMULATION + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @since 9 + */ + function isDefaultService(elementName: ElementName, type: CardType): boolean; + /** * A class for NFC host application. * @@ -54,13 +80,13 @@ declare namespace cardEmulation { * installation information and connect to services of the application. * * @since 8 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.CardEmulation */ export class HceService { /** * start HCE * - * @return Returns {@code true} if HCE is enabled or has been enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if HCE is enabled or has been enabled; returns {@code false} otherwise. * @permission ohos.permission.NFC_CARD_EMULATION * * @since 8 @@ -70,7 +96,7 @@ declare namespace cardEmulation { /** * stop HCE * - * @return Returns {@code true} if HCE is disabled or has been disabled; returns {@code false} otherwise. + * @returns Returns {@code true} if HCE is disabled or has been disabled; returns {@code false} otherwise. * @permission ohos.permission.NFC_CARD_EMULATION * * @since 8 diff --git a/api/@ohos.nfc.controller.d.ts b/api/@ohos.nfc.controller.d.ts index 0074db7b242df0b3c2a282def53b7a8080e0a109..4358599718159cee92004e04b0ded288fa0cdb47 100755 --- a/api/@ohos.nfc.controller.d.ts +++ b/api/@ohos.nfc.controller.d.ts @@ -41,7 +41,7 @@ declare namespace nfcController { /** * Checks whether a device supports NFC. * - * @return Returns {@code true} if the device supports NFC; returns {@code false} otherwise. + * @returns Returns {@code true} if the device supports NFC; returns {@code false} otherwise. * * @since 7 */ @@ -70,7 +70,7 @@ declare namespace nfcController { /** * Enables NFC. * - * @return Returns {@code true} if NFC is enabled or has been enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if NFC is enabled or has been enabled; returns {@code false} otherwise. * @permission ohos.permission.MANAGE_SECURE_SETTINGS * * @since 7 @@ -80,7 +80,7 @@ declare namespace nfcController { /** * Disables NFC. * - * @return Returns {@code true} if NFC is disabled or has been disabled; returns {@code false} otherwise. + * @returns Returns {@code true} if NFC is disabled or has been disabled; returns {@code false} otherwise. * @permission ohos.permission.MANAGE_SECURE_SETTINGS * * @since 7 @@ -90,7 +90,7 @@ declare namespace nfcController { /** * Checks whether NFC is enabled. * - * @return Returns {@code true} if NFC is enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if NFC is enabled; returns {@code false} otherwise. * * @since 7 */ @@ -104,7 +104,7 @@ declare namespace nfcController { *

  • {@link #STATE_ON}: Indicates that NFC is enabled.
  • {@link #STATE_TURNING_OFF}: Indicates * that NFC is being disabled. * - * @return Returns the NFC status. + * @returns Returns the NFC status. * * @since 7 */ diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts index 20ac89240b326b0e8ddc0e072d06fd10a65241e4..8e10d116de6bb77fceffb69b4d06f0c97ebca4fc 100644 --- a/api/@ohos.nfc.tag.d.ts +++ b/api/@ohos.nfc.tag.d.ts @@ -32,10 +32,8 @@ import Want from './@ohos.application.Want'; /** * Provides methods to operate or manage NFC tag. * - * @import import tag from '@ohos.nfc.tag'; - * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ declare namespace tag { /** Indicates an NFC-A tag. */ @@ -73,7 +71,7 @@ declare namespace tag { * TNF types definitions, see NFCForum-TS-NDEF_1.0. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ enum TnfType { /** Empty */ @@ -102,7 +100,7 @@ declare namespace tag { * NfcForum Type definition. The NDEF tag may use one of them. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ enum NfcForumType { /** NFC FORUM TYPE 1 */ @@ -139,7 +137,7 @@ declare namespace tag { * MifareClassic Type definition * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ enum MifareClassicType { /** Mifare Type unknown */ @@ -159,7 +157,7 @@ declare namespace tag { * MifareClassic Tag size. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ enum MifareClassicSize { /** 5 sectors per tag, 4 blocks per sector */ @@ -179,7 +177,7 @@ declare namespace tag { * MifareUltralight Type definition * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ enum MifareUltralightType { /** Mifare Type unknown */ @@ -254,7 +252,7 @@ declare namespace tag { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getIsoDep(tagInfo: TagInfo): IsoDepTag @@ -269,7 +267,7 @@ declare namespace tag { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getNdef(tagInfo: TagInfo): NdefTag @@ -284,7 +282,7 @@ declare namespace tag { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getMifareClassic(tagInfo: TagInfo): MifareClassicTag @@ -299,7 +297,7 @@ declare namespace tag { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getMifareUltralight(tagInfo: TagInfo): MifareUltralightTag @@ -314,7 +312,7 @@ declare namespace tag { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getNdefFormatable(tagInfo: TagInfo): NdefFormatableTag @@ -325,7 +323,7 @@ declare namespace tag { * @param { Want } want - The want object that contains the values of TagInfo. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function getTagInfo(want: Want): TagInfo @@ -337,7 +335,7 @@ declare namespace tag { * different tags based on the supported technology. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @permission ohos.permission.NFC_TAG */ export interface TagInfo { @@ -384,6 +382,7 @@ declare namespace tag { * * @since 7 * @deprecated since 9 + * @useinstead tag.TagInfo#technology */ supportedProfiles: number[]; } @@ -392,7 +391,7 @@ declare namespace tag { * NDEF records definition, see NFCForum-TS-NDEF_1.0. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NdefRecord { /** tnf of NdefRecord */ @@ -413,9 +412,9 @@ declare namespace tag { * Creates an NDEF record with uri data. * * @param { string } uri - Uri data for new NDEF record. - * @return { NdefRecord } The instance of NdefRecord. + * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function makeUriRecord(uri: string): NdefRecord; @@ -425,9 +424,9 @@ declare namespace tag { * * @param { string } text - Text data for new an NDEF record. * @param { string } locale - Language code for the NDEF record. if locale is null, use default locale. - * @return { NdefRecord } The instance of NdefRecord. + * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function makeTextRecord(text: string, locale: string): NdefRecord; @@ -437,9 +436,9 @@ declare namespace tag { * * @param { string } mimeType type of mime data for new an NDEF record. * @param { string } mimeData mime data for new an NDEF record. - * @return { NdefRecord } The instance of NdefRecord. + * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function makeMimeRecord(mimeType: string, mimeData: number[]): NdefRecord; @@ -450,9 +449,9 @@ declare namespace tag { * @param { string } domainName - Domain name of issuing organization for the external data. * @param { string } type - Domain specific type of data for the external data. * @param { number[] } externalData - Data payload of an NDEF record. - * @return { NdefRecord } The instance of NdefRecord. + * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function makeExternalRecord(domainName: string, type: string, externalData: number[]): NdefRecord; @@ -460,9 +459,9 @@ declare namespace tag { * Creates an NDEF message with raw bytes. * * @param { number[] } data - The raw bytes to parse NDEF message. - * @return { NdefMessage } The instance of NdefMessage. + * @returns { NdefMessage } The instance of NdefMessage. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function createNdefMessage(data: number[]): NdefMessage; @@ -471,9 +470,9 @@ declare namespace tag { * Creates an NDEF message with record list. * * @param { NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message. - * @return { NdefMessage } The instance of NdefMessage. + * @returns { NdefMessage } The instance of NdefMessage. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function createNdefMessage(ndefRecords: NdefRecord[]): NdefMessage; @@ -482,9 +481,9 @@ declare namespace tag { * Parses an NDEF message into raw bytes. * * @param { NdefMessage } ndefMessage - An NDEF message to parse. - * @return { number[] } Returns the raw bytes of an NDEF message. + * @returns { number[] } Returns the raw bytes of an NDEF message. * @throws { BusinessError } 401 - The parameter check failed. - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ function messageToBytes(ndefMessage: NdefMessage): number[]; diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index 7fa6ba118aed306fcd06620cb47b1a9398c9ce2d..c581809acbac1133012945208602d43832051ed9 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -23,13 +23,13 @@ import { AsyncCallback, Callback } from '../basic'; * {@code NfcATag} objects and obtain the ATQA and SAK. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NfcATag extends TagSession { /** * Obtains the SAK of an NFC-A tag. * - * @return Returns the SAK of the NFC-A tag. + * @returns Returns the SAK of the NFC-A tag. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -39,7 +39,7 @@ export interface NfcATag extends TagSession { /** * Obtains the ATQA of an NFC-A tag. * - * @return Returns the ATQA of the NFC-A tag. + * @returns Returns the ATQA of the NFC-A tag. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -54,13 +54,13 @@ export interface NfcATag extends TagSession { * {@code NfcBTag} and obtain the tag information. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NfcBTag extends TagSession { /** * Obtains the application data of a tag. * - * @return Returns the application data of the tag. + * @returns Returns the application data of the tag. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -70,7 +70,7 @@ export interface NfcBTag extends TagSession { /** * Obtains the protocol information of a tag. * - * @return Returns the protocol information of the tag. + * @returns Returns the protocol information of the tag. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -85,13 +85,13 @@ export interface NfcBTag extends TagSession { * {@code NfcFTag} and obtain the tag information. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NfcFTag extends TagSession { /** * Obtains the system code from this {@code NfcFTag} instance. * - * @return Returns the system code. + * @returns Returns the system code. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -101,7 +101,7 @@ export interface NfcFTag extends TagSession { /** * Obtains the PMm (consisting of the IC code and manufacturer parameters) from this {@code NfcFTag} instance. * - * @return Returns the PMm. + * @returns Returns the PMm. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -116,13 +116,13 @@ export interface NfcFTag extends TagSession { * {@code NfcVTag} and obtain the tag information. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NfcVTag extends TagSession { /** * Obtains the response flags from this {@code NfcVTag} instance. * - * @return Returns the response flags. + * @returns Returns the response flags. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -132,7 +132,7 @@ export interface NfcVTag extends TagSession { /** * Obtains the data storage format identifier (DSFID) from this {@code NfcVTag} instance. * - * @return Returns the DSFID. + * @returns Returns the DSFID. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -144,14 +144,14 @@ export interface NfcVTag extends TagSession { * Provides methods for accessing IsoDep tag. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface IsoDepTag extends TagSession { /** * Gets IsoDep Historical bytes of the tag, which is based on NfcA RF technology. * It could be null if not based on NfcA. * - * @return { number[] } Returns the Historical bytes, the length could be 0. + * @returns { number[] } Returns the Historical bytes, the length could be 0. * @since 9 */ getHistoricalBytes(): number[]; @@ -160,7 +160,7 @@ export interface IsoDepTag extends TagSession { * Gets IsoDep HiLayer Response bytes of the tag, which is based on NfcB RF technology. * It could be null if not based on NfcB. * - * @return { number[] } Returns HiLayer Response bytes, the length could be 0. + * @returns { number[] } Returns HiLayer Response bytes, the length could be 0. * @since 9 */ getHiLayerResponse(): number[]; @@ -168,7 +168,7 @@ export interface IsoDepTag extends TagSession { /** * Checks if extended apdu length supported or not. * - * @return { boolean } Returns true if extended apdu length supported, otherwise false. + * @returns { boolean } Returns true if extended apdu length supported, otherwise false. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. @@ -183,7 +183,8 @@ export interface NdefMessage { /** * Obtains all records of an NDEF message. * - * @return { tag.NdefRecord[] } Records the list of NDEF records. + * @returns { tag.NdefRecord[] } Records the list of NDEF records. + * @syscap SystemCapability.Communication.NFC.Tag * @since 9 */ getNdefRecords(): tag.NdefRecord[]; @@ -193,13 +194,13 @@ export interface NdefMessage { * Provides methods for accessing NDEF tag. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NdefTag extends TagSession { /** * Gets the type of NDEF tag. * - * @return { tag.NfcForumType } The type of NDEF tag. + * @returns { tag.NfcForumType } The type of NDEF tag. * @since 9 */ getNdefTagType(): tag.NfcForumType; @@ -207,7 +208,7 @@ export interface NdefTag extends TagSession { /** * Gets the NDEF message that was read from NDEF tag when tag discovery. * - * @return { NdefMessage } The instance of NdefMessage. + * @returns { NdefMessage } The instance of NdefMessage. * @since 9 */ getNdefMessage(): NdefMessage; @@ -215,7 +216,7 @@ export interface NdefTag extends TagSession { /** * Checks if NDEF tag is writable. * - * @return { boolean } Returns true if the tag is writable, otherwise returns false. + * @returns { boolean } Returns true if the tag is writable, otherwise returns false. * @since 9 */ isNdefWritable(): boolean; @@ -223,7 +224,7 @@ export interface NdefTag extends TagSession { /** * Reads NDEF message on this tag. * - * @return { NdefMessage } The NDEF message in tag. + * @returns { NdefMessage } The NDEF message in tag. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. @@ -249,7 +250,7 @@ export interface NdefTag extends TagSession { /** * Checks NDEF tag can be set read-only. * - * @return { boolean } Returns true if the tag can be set readonly, otherwise returns false. + * @returns { boolean } Returns true if the tag can be set readonly, otherwise returns false. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. @@ -273,7 +274,7 @@ export interface NdefTag extends TagSession { * Converts the NFC forum type into string defined in NFC forum. * * @param { tag.NfcForumType } type - NFC forum type of NDEF tag. - * @return { string } The NFC forum string type. + * @returns { string } The NFC forum string type. * @throws { BusinessError } 401 - The parameter check failed. * @since 9 */ @@ -284,7 +285,7 @@ export interface NdefTag extends TagSession { * Provides methods for accessing MifareClassic tag. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface MifareClassicTag extends TagSession { /** @@ -306,7 +307,7 @@ export interface MifareClassicTag extends TagSession { * Reads a block, one block size is 16 bytes. * * @param { number } blockIndex - The index of block to read. - * @return { number[] } Returns the block data. + * @returns { number[] } Returns the block data. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. @@ -387,7 +388,7 @@ export interface MifareClassicTag extends TagSession { /** * Gets the number of sectors in MifareClassic tag. * - * @return { number } Returns the number of sectors. + * @returns { number } Returns the number of sectors. * @since 9 */ getSectorCount(): number; @@ -396,7 +397,7 @@ export interface MifareClassicTag extends TagSession { * Gets the number of blocks in the sector. * * @param { number } sectorIndex - The index of sector. - * @return { number } Returns the number of blocks. + * @returns { number } Returns the number of blocks. * @throws { BusinessError } 401 - The parameter check failed. * @since 9 */ @@ -405,7 +406,7 @@ export interface MifareClassicTag extends TagSession { /** * Gets the type of the MifareClassic tag. * - * @return { tag.MifareClassicType } Returns type of MifareClassic tag. + * @returns { tag.MifareClassicType } Returns type of MifareClassic tag. * @since 9 */ getType(): tag.MifareClassicType; @@ -413,7 +414,7 @@ export interface MifareClassicTag extends TagSession { /** * Gets size of the tag in bytes. * - * @return { number } Returns the size of the tag. + * @returns { number } Returns the size of the tag. * @since 9 */ getTagSize(): number; @@ -421,7 +422,7 @@ export interface MifareClassicTag extends TagSession { /** * Checks if the tag is emulated or not. * - * @return { boolean } Returns true if tag is emulated, otherwise false. + * @returns { boolean } Returns true if tag is emulated, otherwise false. * @since 9 */ isEmulatedTag(): boolean; @@ -430,7 +431,7 @@ export interface MifareClassicTag extends TagSession { * Gets the first block of the specific sector. * * @param { number } sectorIndex - The index of sector. - * @return { number } Returns index of first block in the sector. + * @returns { number } Returns index of first block in the sector. * @throws { BusinessError } 401 - The parameter check failed. * @since 9 */ @@ -440,7 +441,7 @@ export interface MifareClassicTag extends TagSession { * Gets the sector index, that the sector contains the specific block. * * @param { number } blockIndex - The index of block. - * @return { number } Returns the sector index. + * @returns { number } Returns the sector index. * @throws { BusinessError } 401 - The parameter check failed. * @since 9 */ @@ -451,14 +452,14 @@ export interface MifareClassicTag extends TagSession { * Provides methods for accessing MifareUltralight tag. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface MifareUltralightTag extends TagSession { /** * Reads 4 pages, total is 16 bytes. Page size is 4 bytes. * * @param { number } pageIndex - The index of page to read. - * @return { number[] } Returns 4 pages data. + * @returns { number[] } Returns 4 pages data. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. @@ -485,7 +486,7 @@ export interface MifareUltralightTag extends TagSession { /** * Gets the type of the MifareUltralight tag. * - * @return { tag.MifareUltralightType } Returns the type of MifareUltralight tag. + * @returns { tag.MifareUltralightType } Returns the type of MifareUltralight tag. * @since 9 */ getType(): tag.MifareUltralightType; @@ -495,7 +496,7 @@ export interface MifareUltralightTag extends TagSession { * Provides methods for accessing NdefFormatable tag. * * @since 9 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface NdefFormatableTag extends TagSession { /** diff --git a/api/tag/tagSession.d.ts b/api/tag/tagSession.d.ts index 2d7d7f8cb3cb20e20b6be05e36cc361411289778..c8fde1d14ef0fdd80d6b1c7c8691d976951f28e6 100755 --- a/api/tag/tagSession.d.ts +++ b/api/tag/tagSession.d.ts @@ -22,13 +22,13 @@ import { AsyncCallback } from '../basic'; * tags, read data from tags, and write data to tags. * * @since 7 - * @syscap SystemCapability.Communication.NFC.Core + * @syscap SystemCapability.Communication.NFC.Tag */ export interface TagSession { /** * Obtains the tag information. * - * @return Returns the tag information, which is a {@link TagInfo} object. + * @returns Returns the tag information, which is a {@link TagInfo} object. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -40,7 +40,7 @@ export interface TagSession { * *

    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. + * @returns Returns {@code true} if the connection is set up; returns {@code false} otherwise. * @permission ohos.permission.NFC_TAG * * @since 7 @@ -59,7 +59,7 @@ export interface TagSession { /** * 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 Returns {@code true} if a connection has been set up with the tag; * returns {@code false} otherwise. * * @permission ohos.permission.NFC_TAG @@ -74,7 +74,7 @@ export interface TagSession { *

    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. + * @returns Returns {@code true} if the setting is successful; returns {@code false} otherwise. * * @permission ohos.permission.NFC_TAG * @@ -85,7 +85,7 @@ export interface TagSession { /** * Queries the timeout duration (ms) for sending data to a tag. * - * @return Returns the timeout duration. + * @returns Returns the timeout duration. * * @permission ohos.permission.NFC_TAG * @@ -97,7 +97,7 @@ export interface TagSession { * 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 + * @returns 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 @@ -110,7 +110,7 @@ export interface TagSession { /** * 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. + * @returns Returns the maximum length of the data to be sent to the tag. * * @permission ohos.permission.NFC_TAG *