@capacitor-community/bluetooth-le
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,6 +0,18 @@ | ||
## 0.1.1 (2021-01-09) | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
### [0.1.2](https://github.com/capacitor-community/bluetooth-le/compare/v0.1.1...v0.1.2) (2021-01-23) | ||
### Bug Fixes | ||
* **definitions:** fix typo in definitions ([#26](https://github.com/capacitor-community/bluetooth-le/issues/26)) ([1cd93f6](https://github.com/capacitor-community/bluetooth-le/commit/1cd93f6fcf1d0e38eb40c71b61fb6b4670939695)) | ||
* **web:** use getPlatform instead of platform ([dac82e4](https://github.com/capacitor-community/bluetooth-le/commit/dac82e4fa56f2d1c96a8d2f5d3830def5d037b08)) | ||
### 0.1.1 (2021-01-09) | ||
- use commonjs output as main entry point (#14) | ||
## 0.1.0 (2020-12-28) | ||
### 0.1.0 (2020-12-28) | ||
@@ -15,12 +27,12 @@ - add requestLEScan | ||
## 0.0.3 (2020-12-14) | ||
### 0.0.3 (2020-12-14) | ||
- fix dependencies | ||
## 0.0.2 (2020-12-14) | ||
### 0.0.2 (2020-12-14) | ||
- update readme and add code of conduct and contributing | ||
## 0.0.1 (2020-12-14) | ||
### 0.0.1 (2020-12-14) | ||
- initial release |
@@ -1,3 +0,3 @@ | ||
import { PluginListenerHandle } from '@capacitor/core'; | ||
import { BleDevice, RequestBleDeviceOptions, ScanResult } from './definitions'; | ||
import type { PluginListenerHandle } from '@capacitor/core'; | ||
import type { BleDevice, RequestBleDeviceOptions, ScanResult } from './definitions'; | ||
export interface BleClientInterface { | ||
@@ -4,0 +4,0 @@ /** |
@@ -75,3 +75,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
let writeValue = value; | ||
if (Capacitor.platform !== 'web') { | ||
if (Capacitor.getPlatform() !== 'web') { | ||
// on native we can only write strings | ||
@@ -78,0 +78,0 @@ writeValue = dataViewToHexString(value); |
@@ -1,2 +0,2 @@ | ||
import { PluginListenerHandle } from '@capacitor/core'; | ||
import type { PluginListenerHandle } from '@capacitor/core'; | ||
declare module '@capacitor/core' { | ||
@@ -156,5 +156,5 @@ interface PluginRegistry { | ||
read(options: ReadOptions): Promise<ReadResult>; | ||
write(otpions: WriteOptions): Promise<void>; | ||
write(options: WriteOptions): Promise<void>; | ||
startNotifications(options: ReadOptions): Promise<void>; | ||
stopNotifications(options: ReadOptions): Promise<void>; | ||
} |
/// <reference types="web-bluetooth" /> | ||
import { WebPlugin } from '@capacitor/core'; | ||
import { BleDevice, BluetoothLePlugin, ConnectOptions, ReadOptions, ReadResult, RequestBleDeviceOptions, WriteOptions } from './definitions'; | ||
import type { BleDevice, BluetoothLePlugin, ConnectOptions, ReadOptions, ReadResult, RequestBleDeviceOptions, WriteOptions } from './definitions'; | ||
export declare class BluetoothLeWeb extends WebPlugin implements BluetoothLePlugin { | ||
@@ -5,0 +5,0 @@ private deviceMap; |
@@ -10,3 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { WebPlugin } from '@capacitor/core'; | ||
import { WebPlugin, registerWebPlugin } from '@capacitor/core'; | ||
import { hexStringToDataView, mapToObject, webUUIDToString, } from './conversion'; | ||
@@ -77,4 +77,5 @@ export class BluetoothLeWeb extends WebPlugin { | ||
stopLEScan() { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (this.scan && this.scan.active) { | ||
if ((_a = this.scan) === null || _a === void 0 ? void 0 : _a.active) { | ||
this.scan.stop(); | ||
@@ -144,4 +145,4 @@ } | ||
var _a; | ||
let filters = []; | ||
for (let service of (_a = options === null || options === void 0 ? void 0 : options.services) !== null && _a !== void 0 ? _a : []) { | ||
const filters = []; | ||
for (const service of (_a = options === null || options === void 0 ? void 0 : options.services) !== null && _a !== void 0 ? _a : []) { | ||
filters.push({ | ||
@@ -171,4 +172,3 @@ services: [service], | ||
export { BluetoothLe }; | ||
import { registerWebPlugin } from '@capacitor/core'; | ||
registerWebPlugin(BluetoothLe); | ||
//# sourceMappingURL=web.js.map |
@@ -158,4 +158,5 @@ var capacitorCommunityBluetoothLe = (function (exports, core) { | ||
stopLEScan() { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (this.scan && this.scan.active) { | ||
if ((_a = this.scan) === null || _a === void 0 ? void 0 : _a.active) { | ||
this.scan.stop(); | ||
@@ -225,4 +226,4 @@ } | ||
var _a; | ||
let filters = []; | ||
for (let service of (_a = options === null || options === void 0 ? void 0 : options.services) !== null && _a !== void 0 ? _a : []) { | ||
const filters = []; | ||
for (const service of (_a = options === null || options === void 0 ? void 0 : options.services) !== null && _a !== void 0 ? _a : []) { | ||
filters.push({ | ||
@@ -325,3 +326,3 @@ services: [service], | ||
let writeValue = value; | ||
if (core.Capacitor.platform !== 'web') { | ||
if (core.Capacitor.getPlatform() !== 'web') { | ||
// on native we can only write strings | ||
@@ -328,0 +329,0 @@ writeValue = dataViewToHexString(value); |
{ | ||
"name": "@capacitor-community/bluetooth-le", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Capacitor Bluetooth Low Energy Plugin", | ||
"main": "dist/index.js", | ||
"unpkg": "dist/plugin.js", | ||
"main": "dist/plugin.cjs.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/esm/index.d.ts", | ||
"unpkg": "dist/plugin.js", | ||
"scripts": { | ||
"lint": "npm run prettier -- --check && npm run swiftlint -- lint", | ||
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web", | ||
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..", | ||
"verify:android": "cd android && ./gradlew clean build test && cd ..", | ||
"verify:web": "npm run build", | ||
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", | ||
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format", | ||
"eslint": "eslint . --ext ts", | ||
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"", | ||
"swiftlint": "node-swiftlint", | ||
"docgen": "docgen --api BleClientInterface --output-readme README.md", | ||
"build": "npm run clean && tsc && rollup -c rollup.config.js", | ||
"docgen": "docgen --api BleClientInterface --output-readme README.md --output-json dist/docs.json", | ||
"postdocgen": "prettier README.md --write", | ||
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", | ||
"clean": "rimraf ./dist", | ||
@@ -20,3 +27,4 @@ "watch": "tsc --watch", | ||
"version:dev": "npm version --no-git-tag-version $(git describe)", | ||
"publish:dev": "npm publish --tag dev" | ||
"publish:dev": "npm publish --tag dev", | ||
"release": "standard-version" | ||
}, | ||
@@ -33,6 +41,8 @@ "author": "pwespi", | ||
"@capacitor/ios": "^2.4.5", | ||
"@ionic/eslint-config": "^0.3.0", | ||
"@ionic/prettier-config": "^1.0.1", | ||
"@ionic/swiftlint-config": "^1.1.2", | ||
"@rollup/plugin-node-resolve": "^11.0.1", | ||
"@types/jest": "^26.0.19", | ||
"@types/jest": "^26.0.20", | ||
"eslint": "^7.17.0", | ||
"jest": "^26.6.3", | ||
@@ -42,3 +52,4 @@ "prettier": "^2.2.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.35.1", | ||
"rollup": "^2.36.1", | ||
"standard-version": "^9.1.0", | ||
"swiftlint": "^1.0.1", | ||
@@ -71,3 +82,5 @@ "ts-jest": "^26.4.4", | ||
"prettier": "@ionic/prettier-config", | ||
"swiftlint": "@ionic/swiftlint-config", | ||
"eslintConfig": { | ||
"extends": "@ionic/eslint-config/recommended" | ||
}, | ||
"repository": { | ||
@@ -74,0 +87,0 @@ "type": "git", |
@@ -0,0 +0,0 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p> |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 13 instances 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
1105930
73
2521
19
13