Skip to content

Commit

Permalink
Cannot find namespace 'android' #51
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Nov 6, 2019
1 parent e67253d commit 39d2825
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export * from "./nfc.android";

// Export any shared classes, constants, etc.
export * from "./nfc.common";
27 changes: 27 additions & 0 deletions src/nfc.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,30 @@ export interface NfcApi {
*/
setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): Promise<any>;
}

// this was done to generate a nice API for our users
export class Nfc implements NfcApi {
available(): Promise<boolean> {
return undefined;
}

enabled(): Promise<boolean> {
return undefined;
}

eraseTag(): Promise<any> {
return undefined;
}

setOnNdefDiscoveredListener(callback: (data: NfcNdefData) => void, options?: NdefListenerOptions): Promise<any> {
return undefined;
}

setOnTagDiscoveredListener(callback: (data: NfcTagData) => void): Promise<any> {
return undefined;
}

writeTag(arg: WriteTagOptions): Promise<any> {
return undefined;
}
}
5 changes: 1 addition & 4 deletions src/nfc.ios.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
NdefListenerOptions, NfcApi, NfcNdefData, NfcNdefRecord, NfcTagData, NfcUriProtocols,
WriteTagOptions
} from "./nfc.common";
import { NdefListenerOptions, NfcApi, NfcNdefData, NfcNdefRecord, NfcTagData, NfcUriProtocols, WriteTagOptions } from "./nfc.common";

export interface NfcSessionInvalidator {
invalidateSession(): void;
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-nfc",
"version": "4.0.4",
"version": "4.1.0",
"description": "NFC plugin for your NativeScript app",
"main": "nfc",
"typings": "index.d.ts",
Expand Down

0 comments on commit 39d2825

Please sign in to comment.