victor-bluetooth-plugin
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -29,4 +29,14 @@ { | ||
{ | ||
"name": "scan", | ||
"signature": "() => Promise<void>", | ||
"parameters": [], | ||
"returns": "Promise<void>", | ||
"tags": [], | ||
"docs": "", | ||
"complexTypes": [], | ||
"slug": "scan" | ||
}, | ||
{ | ||
"name": "connect", | ||
"signature": "(options: { address: string; }) => Promise<any>", | ||
"signature": "(options: { address: string; }) => Promise<void>", | ||
"parameters": [ | ||
@@ -39,3 +49,3 @@ { | ||
], | ||
"returns": "Promise<any>", | ||
"returns": "Promise<void>", | ||
"tags": [], | ||
@@ -42,0 +52,0 @@ "docs": "", |
@@ -11,5 +11,6 @@ declare module "@capacitor/core" { | ||
}>; | ||
scan(): Promise<void>; | ||
connect(options: { | ||
address: string; | ||
}): Promise<any>; | ||
}): Promise<void>; | ||
readData(): Promise<{ | ||
@@ -16,0 +17,0 @@ data: string; |
import { registerPlugin } from '@capacitor/core'; | ||
const BluetoothPlugin = registerPlugin('BluetoothPlugin', { | ||
web: () => import('./web').then(m => new m.BluetoothPluginWeb()), | ||
}); | ||
const BluetoothPlugin = registerPlugin('BluetoothPlugin'); | ||
export * from './definitions'; | ||
export { BluetoothPlugin }; | ||
//# sourceMappingURL=index.js.map |
@@ -7,39 +7,5 @@ 'use strict'; | ||
const BluetoothPlugin$1 = core.registerPlugin('BluetoothPlugin', { | ||
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BluetoothPluginWeb()), | ||
}); | ||
const BluetoothPlugin = core.registerPlugin('BluetoothPlugin'); | ||
class BluetoothPluginWeb extends core.WebPlugin { | ||
constructor() { | ||
super({ | ||
name: 'BluetoothPlugin', | ||
platforms: ['web'], | ||
}); | ||
} | ||
checkPermissions() { | ||
console.log('Checking permissions'); | ||
return Promise.resolve(); // Web implementation can be a mock or throw an error | ||
} | ||
async listDevices() { | ||
console.log('Listing devices'); | ||
return true; // Web implementation can be a mock or throw an error | ||
} | ||
async connect(options) { | ||
console.log('Connecting to device', options); | ||
return true; // Web implementation can be a mock or throw an error | ||
} | ||
async readData() { | ||
console.log('Reading data'); | ||
return { data: '' }; // Web implementation can be a mock or throw an error | ||
} | ||
} | ||
const BluetoothPlugin = new BluetoothPluginWeb(); | ||
var web = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
BluetoothPluginWeb: BluetoothPluginWeb, | ||
BluetoothPlugin: BluetoothPlugin | ||
}); | ||
exports.BluetoothPlugin = BluetoothPlugin$1; | ||
exports.BluetoothPlugin = BluetoothPlugin; | ||
//# sourceMappingURL=plugin.cjs.js.map |
var capacitorBluetoothPlugin = (function (exports, core) { | ||
'use strict'; | ||
'use strict'; | ||
const BluetoothPlugin$1 = core.registerPlugin('BluetoothPlugin', { | ||
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BluetoothPluginWeb()), | ||
}); | ||
const BluetoothPlugin = core.registerPlugin('BluetoothPlugin'); | ||
class BluetoothPluginWeb extends core.WebPlugin { | ||
constructor() { | ||
super({ | ||
name: 'BluetoothPlugin', | ||
platforms: ['web'], | ||
}); | ||
} | ||
checkPermissions() { | ||
console.log('Checking permissions'); | ||
return Promise.resolve(); // Web implementation can be a mock or throw an error | ||
} | ||
async listDevices() { | ||
console.log('Listing devices'); | ||
return true; // Web implementation can be a mock or throw an error | ||
} | ||
async connect(options) { | ||
console.log('Connecting to device', options); | ||
return true; // Web implementation can be a mock or throw an error | ||
} | ||
async readData() { | ||
console.log('Reading data'); | ||
return { data: '' }; // Web implementation can be a mock or throw an error | ||
} | ||
} | ||
const BluetoothPlugin = new BluetoothPluginWeb(); | ||
exports.BluetoothPlugin = BluetoothPlugin; | ||
var web = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
BluetoothPluginWeb: BluetoothPluginWeb, | ||
BluetoothPlugin: BluetoothPlugin | ||
}); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.BluetoothPlugin = BluetoothPlugin$1; | ||
return exports; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
return exports; | ||
})({}, capacitorExports); | ||
//# sourceMappingURL=plugin.js.map |
{ | ||
"name": "victor-bluetooth-plugin", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"description": "A plugin for connecting to classic BT devices on android", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -18,2 +18,3 @@ # victor-bluetooth-plugin | ||
* [`listDevices()`](#listdevices) | ||
* [`scan()`](#scan) | ||
* [`connect(...)`](#connect) | ||
@@ -47,6 +48,15 @@ * [`readData()`](#readdata) | ||
### scan() | ||
```typescript | ||
scan() => Promise<void> | ||
``` | ||
-------------------- | ||
### connect(...) | ||
```typescript | ||
connect(options: { address: string; }) => Promise<any> | ||
connect(options: { address: string; }) => Promise<void> | ||
``` | ||
@@ -58,4 +68,2 @@ | ||
**Returns:** <code>Promise<any></code> | ||
-------------------- | ||
@@ -62,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80
22185
23
111