From 7667ce68fb4f893f50b568cc5e42a426e7e8ac03 Mon Sep 17 00:00:00 2001 From: amunra03 Date: Thu, 31 Jul 2025 20:39:32 +0800 Subject: [PATCH] Signed-off-by: jason_5683 --- api/@ohos.nfc.cardEmulation.d.ts | 16 +-- api/@ohos.nfc.controller.d.ts | 2 +- api/@ohos.nfc.tag.d.ts | 66 ++++++------ api/tag/nfctech.d.ts | 166 +++++++++++++++---------------- api/tag/tagSession.d.ts | 24 ++--- 5 files changed, 137 insertions(+), 137 deletions(-) diff --git a/api/@ohos.nfc.cardEmulation.d.ts b/api/@ohos.nfc.cardEmulation.d.ts index 7731d7ec91d..b2af3d8b7e0 100644 --- a/api/@ohos.nfc.cardEmulation.d.ts +++ b/api/@ohos.nfc.cardEmulation.d.ts @@ -333,7 +333,7 @@ declare namespace cardEmulation { * * @permission ohos.permission.NFC_CARD_EMULATION * @param { 'hceCmd' } type The type to register. - * @param { AsyncCallback } callback Callback used to listen to HCE data that local device received. + * @param { AsyncCallback } callback Callback used to listen to HCE data that local device received. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Invalid parameter. * @throws { BusinessError } 801 - Capability not supported. @@ -341,21 +341,21 @@ declare namespace cardEmulation { * @atomicservice * @since 12 */ - on(type: 'hceCmd', callback: AsyncCallback): void; + on(type: 'hceCmd', callback: AsyncCallback): void; /** * Unsubscribe the event to receive the APDU data. * * @permission ohos.permission.NFC_CARD_EMULATION * @param { 'hceCmd' } type - The type to unregister event. - * @param { AsyncCallback } callback - The callback used to listen for the event. + * @param { AsyncCallback } callback - The callback used to listen for the event. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.Communication.NFC.CardEmulation * @atomicservice * @since 18 */ - off(type: 'hceCmd', callback?: AsyncCallback): void; + off(type: 'hceCmd', callback?: AsyncCallback): void; /** * Sends a response APDU to the remote device. @@ -390,7 +390,7 @@ declare namespace cardEmulation { * Sends a response APDU to the remote device. * * @permission ohos.permission.NFC_CARD_EMULATION - * @param { number[] } response Indicates the response to send, which is a byte array. + * @param { int[] } response Indicates the response to send, which is a byte array. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -403,7 +403,7 @@ declare namespace cardEmulation { * @atomicservice * @since 12 */ - transmit(response: number[]): Promise; + transmit(response: int[]): Promise; /** * Sends a response APDU to the remote device. @@ -425,7 +425,7 @@ declare namespace cardEmulation { * Sends a response APDU to the remote device. * * @permission ohos.permission.NFC_CARD_EMULATION - * @param { number[] } response Indicates the response to send, which is a byte array. + * @param { int[] } response Indicates the response to send, which is a byte array. * @param { AsyncCallback } callback The callback * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -438,7 +438,7 @@ declare namespace cardEmulation { * @atomicservice * @since 12 */ - transmit(response: number[], callback: AsyncCallback): void; + transmit(response: int[], callback: AsyncCallback): void; } } export default cardEmulation; diff --git a/api/@ohos.nfc.controller.d.ts b/api/@ohos.nfc.controller.d.ts index 63aa9d95448..03b5d65c614 100644 --- a/api/@ohos.nfc.controller.d.ts +++ b/api/@ohos.nfc.controller.d.ts @@ -46,7 +46,7 @@ declare namespace nfcController { /** * NFC changed states. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Core * @atomicservice * @since 12 diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts index da104445a27..0778febba7b 100644 --- a/api/@ohos.nfc.tag.d.ts +++ b/api/@ohos.nfc.tag.d.ts @@ -224,7 +224,7 @@ declare namespace tag { /** * TNF types definitions, see NFCForum-TS-NDEF_1.0. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -346,7 +346,7 @@ declare namespace tag { /** * NfcForum Type definition. The NDEF tag may use one of them. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -443,7 +443,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - const RTD_TEXT: number[]; + const RTD_TEXT: int[]; /** * RTD type URI, see NFC Record Type Definition (RTD) Specification. @@ -460,7 +460,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - const RTD_URI: number[]; + const RTD_URI: int[]; /** * MifareClassic Type definition @@ -472,7 +472,7 @@ declare namespace tag { /** * MifareClassic Type definition * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -549,7 +549,7 @@ declare namespace tag { /** * MifareClassic Tag size. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -626,7 +626,7 @@ declare namespace tag { /** * MifareUltralight Type definition * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1118,7 +1118,7 @@ declare namespace tag { * * @permission ohos.permission.NFC_TAG * @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName. - * @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}. + * @param { int[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}. * @param { AsyncCallback } callback - The callback to dispatched the TagInfo object for application. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1134,7 +1134,7 @@ declare namespace tag { */ function registerForegroundDispatch( elementName: ElementName, - discTech: number[], + discTech: int[], callback: AsyncCallback ): void; @@ -1194,7 +1194,7 @@ declare namespace tag { * @permission ohos.permission.NFC_TAG * @param { 'readerMode' } type - The callback type to be registered. * @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName. - * @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}. + * @param { int[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}. * @param { AsyncCallback } callback - The callback to dispatched the TagInfo object for application. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1208,7 +1208,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - function on(type: 'readerMode', elementName: ElementName, discTech: number[], callback: AsyncCallback): void; + function on(type: 'readerMode', elementName: ElementName, discTech: int[], callback: AsyncCallback): void; /** * Disable foreground reader mode settings explicitly. @@ -1279,12 +1279,12 @@ declare namespace tag { * The uid of this tag, it. * * @permission ohos.permission.NFC_TAG - * @type { number[] } + * @type { int[] } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - uid: number[]; + uid: int[]; /** * The supported technology list of this tag. @@ -1297,12 +1297,12 @@ declare namespace tag { * The supported technology list of this tag. * * @permission ohos.permission.NFC_TAG - * @type { number[] } + * @type { int[] } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - technology: number[]; + technology: int[]; /** * The extra data for each technology of this tag. @@ -1319,12 +1319,12 @@ declare namespace tag { * The the RF discovery id of this tag. * * @permission ohos.permission.NFC_TAG - * @type { number } + * @type { int } * @syscap SystemCapability.Communication.NFC.Tag * @systemapi hide for inner use. * @since 9 */ - tagRfDiscId: number; + tagRfDiscId: int; /** * The extra data for the technology of this tag. @@ -1374,12 +1374,12 @@ declare namespace tag { /** * tnf of NdefRecord * - * @type { number } + * @type { int } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - tnf: number; + tnf: int; /** * RTD type of NdefRecord @@ -1391,12 +1391,12 @@ declare namespace tag { /** * RTD type of NdefRecord * - * @type { number[] } + * @type { int[] } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - rtdType: number[]; + rtdType: int[]; /** * id of NdefRecord @@ -1407,12 +1407,12 @@ declare namespace tag { /** * id of NdefRecord * - * @type { number[] } + * @type { int[] } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - id: number[]; + id: int[]; /** * payload of NdefRecord @@ -1423,12 +1423,12 @@ declare namespace tag { /** * payload of NdefRecord * - * @type { number[] } + * @type { int[] } * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - payload: number[]; + payload: int[]; } /** @@ -1535,7 +1535,7 @@ declare namespace tag { * Creates an NDEF record with mime data. * * @param { string } mimeType type of mime data for new an NDEF record. - * @param { number[] } mimeData mime data for new an NDEF record. + * @param { int[] } mimeData mime data for new an NDEF record. * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -1545,7 +1545,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - function makeMimeRecord(mimeType: string, mimeData: number[]): NdefRecord; + function makeMimeRecord(mimeType: string, mimeData: int[]): NdefRecord; /** * Creates an NDEF record with external data. @@ -1566,7 +1566,7 @@ 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. + * @param { int[] } externalData - Data payload of an NDEF record. * @returns { NdefRecord } The instance of NdefRecord. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -1576,7 +1576,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - function makeExternalRecord(domainName: string, type: string, externalData: number[]): NdefRecord; + function makeExternalRecord(domainName: string, type: string, externalData: int[]): NdefRecord; /** * Creates an NDEF message with raw bytes. * @@ -1592,7 +1592,7 @@ declare namespace tag { /** * Creates an NDEF message with raw bytes. * - * @param { number[] } data - The raw bytes to parse NDEF message. + * @param { int[] } data - The raw bytes to parse NDEF message. * @returns { NdefMessage } The instance of NdefMessage. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -1602,7 +1602,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - function createNdefMessage(data: number[]): NdefMessage; + function createNdefMessage(data: int[]): NdefMessage; /** * Creates an NDEF message with record list. @@ -1644,7 +1644,7 @@ declare namespace tag { * Parses an NDEF message into raw bytes. * * @param { NdefMessage } ndefMessage - An NDEF message to parse. - * @returns { number[] } Returns the raw bytes of an NDEF message. + * @returns { int[] } Returns the raw bytes of an NDEF message. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -1653,7 +1653,7 @@ declare namespace tag { * @atomicservice * @since 12 */ - function messageToBytes(ndefMessage: NdefMessage): number[]; + function messageToBytes(ndefMessage: NdefMessage): int[]; } /** diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index c8d7eff1e6f..a654e797ef7 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -52,12 +52,12 @@ export interface NfcATag extends TagSession { /** * Obtains the SAK of an NFC-A tag. * - * @returns { number } Returns the SAK of the NFC-A tag. + * @returns { int } Returns the SAK of the NFC-A tag. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getSak(): number; + getSak(): int; /** * Obtains the ATQA of an NFC-A tag. @@ -69,12 +69,12 @@ export interface NfcATag extends TagSession { /** * Obtains the ATQA of an NFC-A tag. * - * @returns { number[] } Returns the ATQA of the NFC-A tag. + * @returns { int[] } Returns the ATQA of the NFC-A tag. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getAtqa(): number[]; + getAtqa(): int[]; } /** @@ -107,12 +107,12 @@ export interface NfcBTag extends TagSession { /** * Obtains the application data of a tag. * - * @returns { number[] } Returns the application data of the tag. + * @returns { int[] } Returns the application data of the tag. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getRespAppData(): number[]; + getRespAppData(): int[]; /** * Obtains the protocol information of a tag. @@ -124,12 +124,12 @@ export interface NfcBTag extends TagSession { /** * Obtains the protocol information of a tag. * - * @returns { number[] } Returns the protocol information of the tag. + * @returns { int[] } Returns the protocol information of the tag. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getRespProtocol(): number[]; + getRespProtocol(): int[]; } /** @@ -162,12 +162,12 @@ export interface NfcFTag extends TagSession { /** * Obtains the system code from this {@code NfcFTag} instance. * - * @returns { number[] } Returns the system code. + * @returns { int[] } Returns the system code. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getSystemCode(): number[]; + getSystemCode(): int[]; /** * Obtains the PMm (consisting of the IC code and manufacturer parameters) from this {@code NfcFTag} instance. @@ -179,12 +179,12 @@ export interface NfcFTag extends TagSession { /** * Obtains the PMm (consisting of the IC code and manufacturer parameters) from this {@code NfcFTag} instance. * - * @returns { number[] } Returns the PMm. + * @returns { int[] } Returns the PMm. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getPmm(): number[]; + getPmm(): int[]; } /** @@ -217,12 +217,12 @@ export interface NfcVTag extends TagSession { /** * Obtains the response flags from this {@code NfcVTag} instance. * - * @returns { number } Returns the response flags. + * @returns { int } Returns the response flags. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getResponseFlags(): number; + getResponseFlags(): int; /** * Obtains the response flags from this {@code NfcVTag} instance. @@ -234,12 +234,12 @@ export interface NfcVTag extends TagSession { /** * Obtains the response flags from this {@code NfcVTag} instance. * - * @returns { number } Returns the response flags. + * @returns { int } Returns the response flags. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getDsfId(): number; + getDsfId(): int; } /** @@ -270,12 +270,12 @@ 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. * - * @returns { number[] } Returns the Historical bytes, the length could be 0. + * @returns { int[] } Returns the Historical bytes, the length could be 0. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getHistoricalBytes(): number[]; + getHistoricalBytes(): int[]; /** * Gets IsoDep HiLayer Response bytes of the tag, which is based on NfcB RF technology. @@ -289,12 +289,12 @@ 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. * - * @returns { number[] } Returns HiLayer Response bytes, the length could be 0. + * @returns { int[] } Returns HiLayer Response bytes, the length could be 0. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getHiLayerResponse(): number[]; + getHiLayerResponse(): int[]; /** * Checks if extended apdu length supported or not. @@ -746,8 +746,8 @@ export interface MifareClassicTag extends TagSession { * Authenticates a sector with the key. Only successful authentication sector can be operated. * * @permission ohos.permission.NFC_TAG - * @param { number } sectorIndex - Index of sector to authenticate. - * @param { number[] } key - The key(6-bytes) to authenticate. + * @param { int } sectorIndex - Index of sector to authenticate. + * @param { int[] } key - The key(6-bytes) to authenticate. * @param { boolean } isKeyA - KeyA flag. true means KeyA, otherwise KeyB. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. @@ -761,7 +761,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean): Promise; + authenticateSector(sectorIndex: int, key: int[], isKeyA: boolean): Promise; /** * Authenticates a sector with the key.Only successful authentication sector can be operated. @@ -784,8 +784,8 @@ export interface MifareClassicTag extends TagSession { * Authenticates a sector with the key. Only successful authentication sector can be operated. * * @permission ohos.permission.NFC_TAG - * @param { number } sectorIndex - Index of sector to authenticate. - * @param { number[] } key - The key(6-bytes) to authenticate. + * @param { int } sectorIndex - Index of sector to authenticate. + * @param { int[] } key - The key(6-bytes) to authenticate. * @param { boolean } isKeyA - KeyA flag. true means KeyA, otherwise KeyB. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. @@ -799,7 +799,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean, callback: AsyncCallback): void; + authenticateSector(sectorIndex: int, key: int[], isKeyA: boolean, callback: AsyncCallback): void; /** * Reads a block, one block size is 16 bytes. @@ -820,8 +820,8 @@ export interface MifareClassicTag extends TagSession { * Reads a block, one block size is 16 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to read. - * @returns { Promise } Returns the block data. + * @param { int } blockIndex - The index of block to read. + * @returns { Promise } Returns the block data. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -833,7 +833,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - readSingleBlock(blockIndex: number): Promise; + readSingleBlock(blockIndex: int): Promise; /** * Reads a block, one block size is 16 bytes. @@ -854,8 +854,8 @@ export interface MifareClassicTag extends TagSession { * Reads a block, one block size is 16 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to read. - * @param { AsyncCallback } callback The callback. + * @param { int } blockIndex - The index of block to read. + * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -867,7 +867,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - readSingleBlock(blockIndex: number, callback: AsyncCallback): void; + readSingleBlock(blockIndex: int, callback: AsyncCallback): void; /** * Writes a block, one block size is 16 bytes. @@ -889,8 +889,8 @@ export interface MifareClassicTag extends TagSession { * Writes a block, one block size is 16 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to write. - * @param { number[] } data - The block data to write. + * @param { int } blockIndex - The index of block to write. + * @param { int[] } data - The block data to write. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -903,7 +903,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - writeSingleBlock(blockIndex: number, data: number[]): Promise; + writeSingleBlock(blockIndex: int, data: int[]): Promise; /** * Writes a block, one block size is 16 bytes. @@ -925,8 +925,8 @@ export interface MifareClassicTag extends TagSession { * Writes a block, one block size is 16 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to write. - * @param { number[] } data - The block data to write. + * @param { int } blockIndex - The index of block to write. + * @param { int[] } data - The block data to write. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -939,7 +939,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - writeSingleBlock(blockIndex: number, data: number[], callback: AsyncCallback): void; + writeSingleBlock(blockIndex: int, data: int[], callback: AsyncCallback): void; /** * Increments the contents of a block, and stores the result in the internal transfer buffer. @@ -961,8 +961,8 @@ export interface MifareClassicTag extends TagSession { * Increments the contents of a block, and stores the result in the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to increment. - * @param { number } value - The value to increment, none-negative. + * @param { int } blockIndex - The index of block to increment. + * @param { int } value - The value to increment, none-negative. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -975,7 +975,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - incrementBlock(blockIndex: number, value: number): Promise; + incrementBlock(blockIndex: int, value: int): Promise; /** * Increments the contents of a block, and stores the result in the internal transfer buffer. @@ -997,8 +997,8 @@ export interface MifareClassicTag extends TagSession { * Increments the contents of a block, and stores the result in the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to increment. - * @param { number } value - The value to increment, none-negative. + * @param { int } blockIndex - The index of block to increment. + * @param { int } value - The value to increment, none-negative. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1011,7 +1011,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - incrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; + incrementBlock(blockIndex: int, value: int, callback: AsyncCallback): void; /** * Decreases the contents of a block, and stores the result in the internal transfer buffer. @@ -1033,8 +1033,8 @@ export interface MifareClassicTag extends TagSession { * Decreases the contents of a block, and stores the result in the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to decrease. - * @param { number } value - The value to decrease, none-negative. + * @param { int } blockIndex - The index of block to decrease. + * @param { int } value - The value to decrease, none-negative. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1047,7 +1047,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - decrementBlock(blockIndex: number, value: number): Promise; + decrementBlock(blockIndex: int, value: int): Promise; /** * Decreases the contents of a block, and stores the result in the internal transfer buffer. @@ -1069,8 +1069,8 @@ export interface MifareClassicTag extends TagSession { * Decreases the contents of a block, and stores the result in the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of block to decrease. - * @param { number } value - The value to decrease, none-negative. + * @param { int } blockIndex - The index of block to decrease. + * @param { int } value - The value to decrease, none-negative. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1083,7 +1083,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - decrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; + decrementBlock(blockIndex: int, value: int, callback: AsyncCallback): void; /** * Writes the contents of the internal transfer buffer to a value block. @@ -1104,7 +1104,7 @@ export interface MifareClassicTag extends TagSession { * Writes the contents of the internal transfer buffer to a value block. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of value block to be written. + * @param { int } blockIndex - The index of value block to be written. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1117,7 +1117,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - transferToBlock(blockIndex: number): Promise; + transferToBlock(blockIndex: int): Promise; /** * Writes the contents of the internal transfer buffer to a value block. @@ -1138,7 +1138,7 @@ export interface MifareClassicTag extends TagSession { * Writes the contents of the internal transfer buffer to a value block. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of value block to be written. + * @param { int } blockIndex - The index of value block to be written. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1151,7 +1151,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - transferToBlock(blockIndex: number, callback: AsyncCallback): void; + transferToBlock(blockIndex: int, callback: AsyncCallback): void; /** * Moves the contents of a block into the internal transfer buffer. @@ -1172,7 +1172,7 @@ export interface MifareClassicTag extends TagSession { * Moves the contents of a block into the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of value block to be moved from. + * @param { int } blockIndex - The index of value block to be moved from. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1185,7 +1185,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - restoreFromBlock(blockIndex: number): Promise; + restoreFromBlock(blockIndex: int): Promise; /** * Moves the contents of a block into the internal transfer buffer. @@ -1206,7 +1206,7 @@ export interface MifareClassicTag extends TagSession { * Moves the contents of a block into the internal transfer buffer. * * @permission ohos.permission.NFC_TAG - * @param { number } blockIndex - The index of value block to be moved from. + * @param { int } blockIndex - The index of value block to be moved from. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1219,7 +1219,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - restoreFromBlock(blockIndex: number, callback: AsyncCallback): void; + restoreFromBlock(blockIndex: int, callback: AsyncCallback): void; /** * Gets the number of sectors in MifareClassic tag. @@ -1231,12 +1231,12 @@ export interface MifareClassicTag extends TagSession { /** * Gets the number of sectors in MifareClassic tag. * - * @returns { number } Returns the number of sectors. + * @returns { int } Returns the number of sectors. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getSectorCount(): number; + getSectorCount(): int; /** * Gets the number of blocks in the sector. @@ -1253,8 +1253,8 @@ export interface MifareClassicTag extends TagSession { /** * Gets the number of blocks in the sector. * - * @param { number } sectorIndex - The index of sector. - * @returns { number } Returns the number of blocks. + * @param { int } sectorIndex - The index of sector. + * @returns { int } Returns the number of blocks. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -1263,7 +1263,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - getBlockCountInSector(sectorIndex: number): number; + getBlockCountInSector(sectorIndex: int): int; /** * Gets the type of the MifareClassic tag. @@ -1292,12 +1292,12 @@ export interface MifareClassicTag extends TagSession { /** * Gets size of the tag in bytes. * - * @returns { number } Returns the size of the tag. + * @returns { int } Returns the size of the tag. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 */ - getTagSize(): number; + getTagSize(): int; /** * Checks if the tag is emulated or not. @@ -1331,8 +1331,8 @@ export interface MifareClassicTag extends TagSession { /** * Gets the first block of the specific sector. * - * @param { number } sectorIndex - The index of sector. - * @returns { number } Returns index of first block in the sector. + * @param { int } sectorIndex - The index of sector. + * @returns { int } Returns index of first block in the sector. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -1341,7 +1341,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - getBlockIndex(sectorIndex: number): number; + getBlockIndex(sectorIndex: int): int; /** * Gets the sector index, that the sector contains the specific block. @@ -1358,8 +1358,8 @@ export interface MifareClassicTag extends TagSession { /** * Gets the sector index, that the sector contains the specific block. * - * @param { number } blockIndex - The index of block. - * @returns { number } Returns the sector index. + * @param { int } blockIndex - The index of block. + * @returns { int } Returns the sector index. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. @@ -1368,7 +1368,7 @@ export interface MifareClassicTag extends TagSession { * @atomicservice * @since 12 */ - getSectorIndex(blockIndex: number): number; + getSectorIndex(blockIndex: int): int; } /** @@ -1406,8 +1406,8 @@ export interface MifareUltralightTag extends TagSession { * Reads 4 pages, total is 16 bytes. Page size is 4 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } pageIndex - The index of page to read. - * @returns { Promise } Returns 4 pages data. + * @param { int } pageIndex - The index of page to read. + * @returns { Promise } Returns 4 pages data. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -1419,7 +1419,7 @@ export interface MifareUltralightTag extends TagSession { * @atomicservice * @since 12 */ - readMultiplePages(pageIndex: number): Promise; + readMultiplePages(pageIndex: int): Promise; /** * Reads 4 pages, total is 16 bytes. Page size is 4 bytes. @@ -1440,8 +1440,8 @@ export interface MifareUltralightTag extends TagSession { * Reads 4 pages, total is 16 bytes. Page size is 4 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } pageIndex - The index of page to read. - * @param { AsyncCallback } callback The callback. + * @param { int } pageIndex - The index of page to read. + * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -1453,7 +1453,7 @@ export interface MifareUltralightTag extends TagSession { * @atomicservice * @since 12 */ - readMultiplePages(pageIndex: number, callback: AsyncCallback): void; + readMultiplePages(pageIndex: int, callback: AsyncCallback): void; /** * Writes a page, total 4 bytes. @@ -1475,8 +1475,8 @@ export interface MifareUltralightTag extends TagSession { * Writes a page, total 4 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } pageIndex - The index of page to write. - * @param { number[] } data - The page data to write. + * @param { int } pageIndex - The index of page to write. + * @param { int[] } data - The page data to write. * @returns { Promise } The void * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1489,7 +1489,7 @@ export interface MifareUltralightTag extends TagSession { * @atomicservice * @since 12 */ - writeSinglePage(pageIndex: number, data: number[]): Promise; + writeSinglePage(pageIndex: int, data: int[]): Promise; /** * Writes a page, total 4 bytes. @@ -1511,8 +1511,8 @@ export interface MifareUltralightTag extends TagSession { * Writes a page, total 4 bytes. * * @permission ohos.permission.NFC_TAG - * @param { number } pageIndex - The index of page to write. - * @param { number[] } data - The page data to write. + * @param { int } pageIndex - The index of page to write. + * @param { int[] } data - The page data to write. * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -1525,7 +1525,7 @@ export interface MifareUltralightTag extends TagSession { * @atomicservice * @since 12 */ - writeSinglePage(pageIndex: number, data: number[], callback: AsyncCallback): void; + writeSinglePage(pageIndex: int, data: int[], callback: AsyncCallback): void; /** * Gets the type of the MifareUltralight tag. diff --git a/api/tag/tagSession.d.ts b/api/tag/tagSession.d.ts index f7f4785f2d9..21ec84f0fc0 100644 --- a/api/tag/tagSession.d.ts +++ b/api/tag/tagSession.d.ts @@ -187,7 +187,7 @@ export interface TagSession { * Sets the timeout duration (ms) for sending data to a tag. * * @permission ohos.permission.NFC_TAG - * @param { number } timeout Indicates the timeout duration to be set. + * @param { int } timeout Indicates the timeout duration to be set. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -199,7 +199,7 @@ export interface TagSession { * @atomicservice * @since 12 */ - setTimeout(timeout: number): void; + setTimeout(timeout: int): void; /** * Queries the timeout duration (ms) for sending data to a tag. @@ -228,7 +228,7 @@ export interface TagSession { * Obtains the timeout duration (ms) for sending data to a tag. * * @permission ohos.permission.NFC_TAG - * @returns { number } Returns the timeout duration. + * @returns { int } Returns the timeout duration. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - The tag running state is abnormal in the service. @@ -236,7 +236,7 @@ export interface TagSession { * @atomicservice * @since 12 */ - getTimeout(): number; + getTimeout(): int; /** * Writes data to a tag. @@ -287,8 +287,8 @@ export interface TagSession { * Writes data to a tag. * * @permission ohos.permission.NFC_TAG - * @param { number[] } data Indicates the data to be written to the tag. - * @returns { Promise } Returns bytes received in response. Or bytes with a length of 0 if the + * @param { int[] } data Indicates the data to be written to the tag. + * @returns { Promise } Returns bytes received in response. Or bytes with a length of 0 if the * data fails to be written to the tag. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: @@ -302,7 +302,7 @@ export interface TagSession { * @atomicservice * @since 12 */ - transmit(data: number[]): Promise; + transmit(data: int[]): Promise; /** * Writes data to a tag. @@ -324,8 +324,8 @@ export interface TagSession { * Writes data to a tag. * * @permission ohos.permission.NFC_TAG - * @param { number[] } data Indicates the data to be written to the tag. - * @param { AsyncCallback } callback The callback. + * @param { int[] } data Indicates the data to be written to the tag. + * @param { AsyncCallback } callback The callback. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -338,7 +338,7 @@ export interface TagSession { * @atomicservice * @since 12 */ - transmit(data: number[], callback: AsyncCallback): void; + transmit(data: int[], callback: AsyncCallback): void; /** * Queries the maximum length of data that can be sent to a tag. @@ -367,7 +367,7 @@ export interface TagSession { * Obtains the maximum length of data that can be sent to a tag. * * @permission ohos.permission.NFC_TAG - * @returns { number } Returns the maximum length of the data to be sent to the tag. + * @returns { int } Returns the maximum length of the data to be sent to the tag. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - The tag running state is abnormal in the service. @@ -375,5 +375,5 @@ export interface TagSession { * @atomicservice * @since 12 */ - getMaxTransmitSize(): number; + getMaxTransmitSize(): int; } -- Gitee