当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript exec.default函数代码示例

本文整理汇总了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', [])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:25,代码来源:flomioPlugin.ts

示例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;
};
开发者ID:justinschuldt,项目名称:ibeacon-ts,代码行数:9,代码来源:LocationManager.ts

示例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])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:18,代码来源:flomioPlugin.ts

示例4: setConfiguration

export function setConfiguration (configuration, success, failure) {
  exec(success, failure, 'FlomioPlugin', 'setConfiguration', [configuration])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts

示例5: getCommunicationStatus

export function getCommunicationStatus (success, failure) {
  exec(success, failure, 'FlomioPlugin', 'getCommunicationStatus', [])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts

示例6: getBatteryLevel

export function getBatteryLevel (success, failure) {
  exec(success, failure, 'FlomioPlugin', 'getBatteryLevel', [])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts

示例7: selectSpecificDeviceId

export function selectSpecificDeviceId (specificDeviceId: string, success, failure) {
  exec(success, failure, 'FlomioPlugin', 'selectSpecificDeviceId', [specificDeviceId])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts

示例8: init

export function init (success, failure) {
  exec(success, failure, 'FlomioPlugin', 'init', [])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts

示例9: startReaders

export function startReaders (success, failure) {
  exec(success, failure, 'FlomioPlugin', 'startReaders', [])
}
开发者ID:flomio,项目名称:flomio_cordova_plugin,代码行数:3,代码来源:flomioPlugin.ts


注:本文中的cordova/exec.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。