本文整理汇总了TypeScript中cordova/exec.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: launchNativeNfc
export function launchNativeNfc (success, failure) {
function hexToBytes (hex) {
let bytes = []
for (let c = 0; c < hex.length; c += 2) {
bytes.push(parseInt(hex.substr(c, 2), 16))
}
return bytes
}
function formatRecord (record) {
const formatted = ndef.record(record.tnf,
hexToBytes(record.type),
hexToBytes(record.id),
hexToBytes(record.payload)
)
return formatted
}
exec(
(ndefMessage) => {
success(ndefMessage.map(formatRecord))
},
failure,
'FlomioPlugin', 'launchNativeNfc', [])
}
示例2: function
LocationManager.prototype._registerDelegateCallbackId = function () {
this.appendToDeviceLog('registerDelegateCallbackId()');
var d = Q.defer();
exec(_.bind(this._onDelegateCallback, this, d), _.bind(this._onDelegateCallback, this, d), "LocationManager",
"registerDelegateCallbackId", []);
return d.promise;
};
示例3: sendApdu
export function sendApdu (deviceId: string, apdu: string | Buffer, success, failure) {
if (deviceId == null) {
throw new ReferenceError('`deviceId` parameter is `null`')
}
if (apdu == null) {
throw new ReferenceError('`apdu` parameter is `null`')
}
let apduString: string
if (Buffer.isBuffer(apdu)) {
apduString = apdu.toString('hex')
}
if (typeof apdu === 'string') {
apduString = apdu
} else {
throw new ReferenceError('`apdu` parameter needs to be a `Buffer` or a `string`')
}
exec(success, failure, 'FlomioPlugin', 'sendApdu', [deviceId, apduString])
}
示例4: setConfiguration
export function setConfiguration (configuration, success, failure) {
exec(success, failure, 'FlomioPlugin', 'setConfiguration', [configuration])
}
示例5: getCommunicationStatus
export function getCommunicationStatus (success, failure) {
exec(success, failure, 'FlomioPlugin', 'getCommunicationStatus', [])
}
示例6: getBatteryLevel
export function getBatteryLevel (success, failure) {
exec(success, failure, 'FlomioPlugin', 'getBatteryLevel', [])
}
示例7: selectSpecificDeviceId
export function selectSpecificDeviceId (specificDeviceId: string, success, failure) {
exec(success, failure, 'FlomioPlugin', 'selectSpecificDeviceId', [specificDeviceId])
}
示例8: init
export function init (success, failure) {
exec(success, failure, 'FlomioPlugin', 'init', [])
}
示例9: startReaders
export function startReaders (success, failure) {
exec(success, failure, 'FlomioPlugin', 'startReaders', [])
}