@ionic-native/nfc
Version:
Ionic Native - Native plugins for ionic apps
230 lines (225 loc) • 14 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var tslib = require('tslib');
var core$1 = require('@angular/core');
var core = require('@ionic-native/core');
require('rxjs');
var NFC = /** @class */ (function (_super) {
tslib.__extends(NFC, _super);
function NFC() {
return _super !== null && _super.apply(this, arguments) || this;
}
NFC.prototype.readerMode = function (flags) { return core.cordova(this, "readerMode", { "observable": true, "clearFunction": "disableReaderMode", "clearWithArgs": false }, arguments); };
NFC.prototype.scanNdef = function (options) { return core.cordova(this, "scanNdef", { "sync": true }, arguments); };
NFC.prototype.scanTag = function (options) { return core.cordova(this, "scanTag", { "sync": true }, arguments); };
NFC.prototype.cancelScan = function () { return core.cordova(this, "cancelScan", { "sync": true }, arguments); };
NFC.prototype.connect = function (tech, timeout) { return core.cordova(this, "connect", { "sync": true }, arguments); };
NFC.prototype.close = function () { return core.cordova(this, "close", { "sync": true }, arguments); };
NFC.prototype.transceive = function (data) { return core.cordova(this, "transceive", { "sync": true }, arguments); };
NFC.prototype.beginSession = function (onSuccess, onFailure) { return core.cordova(this, "beginSession", { "observable": true, "successIndex": 0, "errorIndex": 3, "clearFunction": "invalidateSession", "clearWithArgs": true }, arguments); };
NFC.prototype.addNdefListener = function (onSuccess, onFailure) { return core.cordova(this, "addNdefListener", { "observable": true, "successIndex": 0, "errorIndex": 3, "clearFunction": "removeNdefListener", "clearWithArgs": true }, arguments); };
NFC.prototype.addTagDiscoveredListener = function (onSuccess, onFailure) { return core.cordova(this, "addTagDiscoveredListener", { "observable": true, "successIndex": 0, "errorIndex": 3, "clearFunction": "removeTagDiscoveredListener", "clearWithArgs": true }, arguments); };
NFC.prototype.addMimeTypeListener = function (mimeType, onSuccess, onFailure) { return core.cordova(this, "addMimeTypeListener", { "observable": true, "successIndex": 1, "errorIndex": 4, "clearFunction": "removeMimeTypeListener", "clearWithArgs": true }, arguments); };
NFC.prototype.addNdefFormatableListener = function (onSuccess, onFailure) { return core.cordova(this, "addNdefFormatableListener", { "observable": true, "successIndex": 0, "errorIndex": 3 }, arguments); };
NFC.prototype.write = function (message) { return core.cordova(this, "write", {}, arguments); };
NFC.prototype.makeReadOnly = function () { return core.cordova(this, "makeReadOnly", {}, arguments); };
NFC.prototype.share = function (message) { return core.cordova(this, "share", {}, arguments); };
NFC.prototype.unshare = function () { return core.cordova(this, "unshare", {}, arguments); };
NFC.prototype.erase = function () { return core.cordova(this, "erase", {}, arguments); };
NFC.prototype.handover = function (uris) { return core.cordova(this, "handover", {}, arguments); };
NFC.prototype.stopHandover = function () { return core.cordova(this, "stopHandover", {}, arguments); };
NFC.prototype.showSettings = function () { return core.cordova(this, "showSettings", {}, arguments); };
NFC.prototype.enabled = function () { return core.cordova(this, "enabled", {}, arguments); };
NFC.prototype.bytesToString = function (bytes) { return core.cordova(this, "bytesToString", { "sync": true }, arguments); };
NFC.prototype.stringToBytes = function (str) { return core.cordova(this, "stringToBytes", { "sync": true }, arguments); };
NFC.prototype.bytesToHexString = function (bytes) { return core.cordova(this, "bytesToHexString", { "sync": true }, arguments); };
Object.defineProperty(NFC.prototype, "FLAG_READER_NFC_A", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NFC_A"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NFC_A", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_NFC_B", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NFC_B"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NFC_B", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_NFC_F", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NFC_F"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NFC_F", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_NFC_V", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NFC_V"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NFC_V", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_NFC_BARCODE", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NFC_BARCODE"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NFC_BARCODE", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_SKIP_NDEF_CHECK", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_SKIP_NDEF_CHECK"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_SKIP_NDEF_CHECK", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(NFC.prototype, "FLAG_READER_NO_PLATFORM_SOUNDS", {
get: function () { return core.cordovaPropertyGet(this, "FLAG_READER_NO_PLATFORM_SOUNDS"); },
set: function (value) { core.cordovaPropertySet(this, "FLAG_READER_NO_PLATFORM_SOUNDS", value); },
enumerable: false,
configurable: true
});
NFC.pluginName = "NFC";
NFC.plugin = "phonegap-nfc";
NFC.pluginRef = "nfc";
NFC.repo = "https://github.com/chariotsolutions/phonegap-nfc";
NFC.platforms = ["Android", "iOS", "Windows"];
NFC.decorators = [
{ type: core$1.Injectable }
];
return NFC;
}(core.IonicNativePlugin));
var Ndef = /** @class */ (function (_super) {
tslib.__extends(Ndef, _super);
function Ndef() {
return _super !== null && _super.apply(this, arguments) || this;
}
Ndef.prototype.record = function (tnf, type, id, payload) { return core.cordova(this, "record", { "sync": true }, arguments); };
Ndef.prototype.textRecord = function (text, languageCode, id) { return core.cordova(this, "textRecord", { "sync": true }, arguments); };
Ndef.prototype.uriRecord = function (uri, id) { return core.cordova(this, "uriRecord", { "sync": true }, arguments); };
Ndef.prototype.absoluteUriRecord = function (uri, payload, id) { return core.cordova(this, "absoluteUriRecord", { "sync": true }, arguments); };
Ndef.prototype.mimeMediaRecord = function (mimeType, payload) { return core.cordova(this, "mimeMediaRecord", { "sync": true }, arguments); };
Ndef.prototype.smartPoster = function (ndefRecords, id) { return core.cordova(this, "smartPoster", { "sync": true }, arguments); };
Ndef.prototype.emptyRecord = function () { return core.cordova(this, "emptyRecord", { "sync": true }, arguments); };
Ndef.prototype.androidApplicationRecord = function (packageName) { return core.cordova(this, "androidApplicationRecord", { "sync": true }, arguments); };
Ndef.prototype.encodeMessage = function (ndefRecords) { return core.cordova(this, "encodeMessage", { "sync": true }, arguments); };
Ndef.prototype.decodeMessage = function (bytes) { return core.cordova(this, "decodeMessage", { "sync": true }, arguments); };
Ndef.prototype.decodeTnf = function (tnf_byte) { return core.cordova(this, "decodeTnf", { "sync": true }, arguments); };
Ndef.prototype.encodeTnf = function (mb, me, cf, sr, il, tnf) { return core.cordova(this, "encodeTnf", { "sync": true }, arguments); };
Ndef.prototype.tnfToString = function (tnf) { return core.cordova(this, "tnfToString", { "sync": true }, arguments); };
Object.defineProperty(Ndef.prototype, "TNF_EMPTY", {
get: function () { return core.cordovaPropertyGet(this, "TNF_EMPTY"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_EMPTY", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_WELL_KNOWN", {
get: function () { return core.cordovaPropertyGet(this, "TNF_WELL_KNOWN"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_WELL_KNOWN", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_MIME_MEDIA", {
get: function () { return core.cordovaPropertyGet(this, "TNF_MIME_MEDIA"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_MIME_MEDIA", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_ABSOLUTE_URI", {
get: function () { return core.cordovaPropertyGet(this, "TNF_ABSOLUTE_URI"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_ABSOLUTE_URI", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_EXTERNAL_TYPE", {
get: function () { return core.cordovaPropertyGet(this, "TNF_EXTERNAL_TYPE"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_EXTERNAL_TYPE", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_UNKNOWN", {
get: function () { return core.cordovaPropertyGet(this, "TNF_UNKNOWN"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_UNKNOWN", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_UNCHANGED", {
get: function () { return core.cordovaPropertyGet(this, "TNF_UNCHANGED"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_UNCHANGED", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "TNF_RESERVED", {
get: function () { return core.cordovaPropertyGet(this, "TNF_RESERVED"); },
set: function (value) { core.cordovaPropertySet(this, "TNF_RESERVED", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "textHelper", {
get: function () { return core.cordovaPropertyGet(this, "textHelper"); },
set: function (value) { core.cordovaPropertySet(this, "textHelper", value); },
enumerable: false,
configurable: true
});
Object.defineProperty(Ndef.prototype, "uriHelper", {
get: function () { return core.cordovaPropertyGet(this, "uriHelper"); },
set: function (value) { core.cordovaPropertySet(this, "uriHelper", value); },
enumerable: false,
configurable: true
});
Ndef.pluginName = "NFC";
Ndef.plugin = "phonegap-nfc";
Ndef.pluginRef = "ndef";
Ndef.decorators = [
{ type: core$1.Injectable }
];
return Ndef;
}(core.IonicNativePlugin));
var NfcUtil = /** @class */ (function (_super) {
tslib.__extends(NfcUtil, _super);
function NfcUtil() {
return _super !== null && _super.apply(this, arguments) || this;
}
NfcUtil.prototype.toHex = function (i) { return core.cordova(this, "toHex", { "sync": true }, arguments); };
NfcUtil.prototype.toPrintable = function (i) { return core.cordova(this, "toPrintable", { "sync": true }, arguments); };
NfcUtil.prototype.bytesToString = function (i) { return core.cordova(this, "bytesToString", { "sync": true }, arguments); };
NfcUtil.prototype.stringToBytes = function (s) { return core.cordova(this, "stringToBytes", { "sync": true }, arguments); };
NfcUtil.prototype.bytesToHexString = function (bytes) { return core.cordova(this, "bytesToHexString", { "sync": true }, arguments); };
NfcUtil.prototype.isType = function (record, tnf, type) { return core.cordova(this, "isType", { "sync": true }, arguments); };
NfcUtil.prototype.arrayBufferToHexString = function (buffer) { return core.cordova(this, "arrayBufferToHexString", { "sync": true }, arguments); };
NfcUtil.prototype.hexStringToArrayBuffer = function (hexString) { return core.cordova(this, "hexStringToArrayBuffer", { "sync": true }, arguments); };
NfcUtil.pluginName = "NFC";
NfcUtil.plugin = "phonegap-nfc";
NfcUtil.pluginRef = "util";
NfcUtil.decorators = [
{ type: core$1.Injectable }
];
return NfcUtil;
}(core.IonicNativePlugin));
var TextHelper = /** @class */ (function (_super) {
tslib.__extends(TextHelper, _super);
function TextHelper() {
return _super !== null && _super.apply(this, arguments) || this;
}
TextHelper.prototype.decodePayload = function (data) {
return;
};
TextHelper.prototype.encodePayload = function (text, lang) {
return;
};
return TextHelper;
}(core.IonicNativePlugin));
var UriHelper = /** @class */ (function (_super) {
tslib.__extends(UriHelper, _super);
function UriHelper() {
return _super !== null && _super.apply(this, arguments) || this;
}
UriHelper.prototype.decodePayload = function (data) {
return;
};
UriHelper.prototype.encodePayload = function (uri) {
return;
};
return UriHelper;
}(core.IonicNativePlugin));
exports.NFC = NFC;
exports.Ndef = Ndef;
exports.NfcUtil = NfcUtil;
exports.TextHelper = TextHelper;
exports.UriHelper = UriHelper;