mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-12 05:41:34 +08:00
feat(nfc): add new functions (#853)
Added: - bytesToHexString - stringToBytes - bytesToString Fixed: - addTagDiscoveredListener
This commit is contained in:
parent
ad6badef1f
commit
c44fb75adc
@ -47,19 +47,18 @@ export class NFC {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an event listener for tags matching any tag type.
|
* Registers an event listener for tags matching any tag type.
|
||||||
* @param mimeType
|
|
||||||
* @param onSuccess
|
* @param onSuccess
|
||||||
* @param onFailure
|
* @param onFailure
|
||||||
* @returns {Observable<any>}
|
* @returns {Observable<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
observable: true,
|
observable: true,
|
||||||
successIndex: 1,
|
successIndex: 0,
|
||||||
errorIndex: 4,
|
errorIndex: 3,
|
||||||
clearFunction: 'removeTagDiscoveredListener',
|
clearFunction: 'removeTagDiscoveredListener',
|
||||||
clearWithArgs: true
|
clearWithArgs: true
|
||||||
})
|
})
|
||||||
static addTagDiscoveredListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
static addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||||
@ -152,6 +151,27 @@ export class NFC {
|
|||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static enabled(): Promise<any> {return; }
|
static enabled(): Promise<any> {return; }
|
||||||
|
/**
|
||||||
|
* Convert bytes to string
|
||||||
|
* @param bytes {number[]}
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
static bytesToString(bytes: number[]): string {return; }
|
||||||
|
/**
|
||||||
|
* Convert string to bytes
|
||||||
|
* @param str {string}
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
static stringToBytes(str: string): number[] {return; };
|
||||||
|
/**
|
||||||
|
* Convert bytes to hex string
|
||||||
|
* @param bytes {number[]}
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
static bytesToHexString(bytes: number[]): string {return; };
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user