nativescript-nfc-uid
Advanced tools
Comparing version 6.0.0 to 6.0.1
106
common.d.ts
import { Observable } from '@nativescript/core'; | ||
import { NdefListenerOptions, NfcNdefData } from './interface'; | ||
export declare class NativescriptNfcUidCommon extends Observable { | ||
getName(): string; | ||
setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): string; | ||
export declare const NfcUriProtocols: string[]; | ||
export interface NdefListenerOptions { | ||
/** | ||
* iOS only (for now). | ||
* Default false. | ||
*/ | ||
stopAfterFirstRead?: boolean; | ||
/** | ||
* On iOS the scan UI can show a scan hint (fi. "Scan a tag"). | ||
* By default no hint is shown. | ||
*/ | ||
scanHint?: string; | ||
} | ||
export interface TextRecord { | ||
/** | ||
* String of text to encode. | ||
*/ | ||
text: string; | ||
/** | ||
* ISO/IANA language code. Examples: 'fi', 'en-US'. | ||
* Default 'en'. | ||
*/ | ||
languageCode?: string; | ||
/** | ||
* Default []. | ||
*/ | ||
id?: Array<number>; | ||
} | ||
export interface UriRecord { | ||
/** | ||
* String representing the uri to encode. | ||
*/ | ||
uri: string; | ||
/** | ||
* Default []. | ||
*/ | ||
id?: Array<number>; | ||
} | ||
export interface WriteTagOptions { | ||
textRecords?: Array<TextRecord>; | ||
uriRecords?: Array<UriRecord>; | ||
} | ||
export interface NfcTagData { | ||
id?: Array<number>; | ||
techList?: Array<string>; | ||
} | ||
export interface NfcNdefRecord { | ||
id: Array<number>; | ||
tnf: number; | ||
type: number; | ||
payload: string; | ||
payloadAsHexString: string; | ||
payloadAsStringWithPrefix: string; | ||
payloadAsString: string; | ||
} | ||
export interface NfcNdefData extends NfcTagData { | ||
message: Array<NfcNdefRecord>; | ||
/** | ||
* Android only | ||
*/ | ||
type?: string; | ||
/** | ||
* Android only | ||
*/ | ||
maxSize?: number; | ||
/** | ||
* Android only | ||
*/ | ||
writable?: boolean; | ||
/** | ||
* Android only | ||
*/ | ||
canMakeReadOnly?: boolean; | ||
} | ||
export interface OnTagDiscoveredOptions { | ||
/** | ||
* On iOS the scan UI can show a message (fi. "Scan a tag"). | ||
* By default no message is shown. | ||
*/ | ||
message?: string; | ||
} | ||
export interface NfcApi { | ||
available(): Promise<boolean>; | ||
enabled(): Promise<boolean>; | ||
writeTag(arg: WriteTagOptions): Promise<any>; | ||
eraseTag(): Promise<any>; | ||
/** | ||
* Set to null to remove the listener. | ||
*/ | ||
setOnTagDiscoveredListener(callback: (data: NfcTagData) => void): Promise<any>; | ||
/** | ||
* Set to null to remove the listener. | ||
*/ | ||
setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): Promise<any>; | ||
} | ||
export declare class NativescriptNfcUidCommon extends Observable implements NfcApi { | ||
available(): Promise<boolean>; | ||
enabled(): Promise<boolean>; | ||
eraseTag(): Promise<any>; | ||
setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): Promise<any>; | ||
setOnTagDiscoveredListener(callback: (data: NfcTagData) => void): Promise<any>; | ||
writeTag(arg: WriteTagOptions): Promise<any>; | ||
} |
import { Observable } from '@nativescript/core'; | ||
export const NfcUriProtocols = [ | ||
"", | ||
"http://www.", | ||
"https://www.", | ||
"http://", | ||
"https://", | ||
"tel:", | ||
"mailto:", | ||
"ftp://anonymous:anonymous@", | ||
"ftp://ftp.", | ||
"ftps://", | ||
"sftp://", | ||
"smb://", | ||
"nfs://", | ||
"ftp://", | ||
"dav://", | ||
"news:", | ||
"telnet://", | ||
"imap:", | ||
"rtsp://", | ||
"urn:", | ||
"pop:", | ||
"sip:", | ||
"sips:", | ||
"tftp:", | ||
"btspp://", | ||
"btl2cap://", | ||
"btgoep://", | ||
"tcpobex://", | ||
"irdaobex://", | ||
"file://", | ||
"urn:epc:id:", | ||
"urn:epc:tag:", | ||
"urn:epc:pat:", | ||
"urn:epc:raw:", | ||
"urn:epc:", | ||
"urn:nfc:" | ||
]; | ||
export class NativescriptNfcUidCommon extends Observable { | ||
getName() { | ||
return "HelloWorld"; | ||
available() { | ||
return undefined; | ||
} | ||
enabled() { | ||
return undefined; | ||
} | ||
eraseTag() { | ||
return undefined; | ||
} | ||
setOnNdefDiscoveredListener(callback, options) { | ||
return "Testing"; | ||
return undefined; | ||
} | ||
setOnTagDiscoveredListener(callback) { | ||
return undefined; | ||
} | ||
writeTag(arg) { | ||
return undefined; | ||
} | ||
} | ||
//# sourceMappingURL=common.js.map |
import { NativescriptNfcUidCommon } from './common'; | ||
import { NdefListenerOptions, NfcNdefData } from './interface'; | ||
export declare class NativescriptNfcUid extends NativescriptNfcUidCommon { | ||
getName(): string; | ||
setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): Promise<string>; | ||
} |
import { NativescriptNfcUidCommon } from './common'; | ||
export class NativescriptNfcUid extends NativescriptNfcUidCommon { | ||
getName() { | ||
return "HelloWorld"; | ||
} | ||
setOnNdefDiscoveredListener(callback, options) { | ||
alert("custom pluign"); | ||
return Promise.resolve("Testing"); | ||
} | ||
} | ||
//# sourceMappingURL=index.ios.js.map |
{ | ||
"name": "nativescript-nfc-uid", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Add a plugin description", | ||
@@ -5,0 +5,0 @@ "main": "index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20853
262
0