@types/web-bluetooth
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -28,2 +28,46 @@ // Type definitions for Web Bluetooth | ||
type BluetoothManufacturerData = Map<number, DataView>; | ||
type BluetoothServiceData = Map<BluetoothServiceUUID, DataView>; | ||
interface BluetoothDataFilter { | ||
readonly dataPrefix: DataView; | ||
readonly mask: DataView; | ||
} | ||
interface BluetoothManufacturerDataFilter { | ||
readonly [manufacturerId: number]: BluetoothDataFilter; | ||
} | ||
type BluetoothServiceDataFilter = { | ||
readonly [serviceUUID in BluetoothServiceUUID]: BluetoothDataFilter; | ||
}; | ||
interface BluetoothLEScanFilter { | ||
readonly name?: string; | ||
readonly namePrefix?: string; | ||
readonly services?: BluetoothServiceUUID[]; | ||
readonly manufacturerData?: BluetoothManufacturerDataFilter; | ||
readonly serviceData?: BluetoothServiceDataFilter; | ||
} | ||
interface RequestLEScanOptions { | ||
readonly filters?: BluetoothLEScanFilter[]; | ||
readonly keepRepeatedDevices?: boolean; | ||
readonly acceptAllAdvertisements?: boolean; | ||
} | ||
interface BluetoothLEScan extends RequestLEScanOptions { | ||
active: boolean; | ||
stop: () => void; | ||
} | ||
interface BluetoothAdvertisementEvent extends Event { | ||
device: BluetoothDevice; | ||
rssi: number; | ||
txPower: number; | ||
manufacturerData?: BluetoothManufacturerData; | ||
serviceData?: BluetoothServiceData; | ||
uuids?: BluetoothServiceUUID[]; | ||
} | ||
interface BluetoothRemoteGATTDescriptor { | ||
@@ -120,3 +164,5 @@ readonly characteristic: BluetoothRemoteGATTCharacteristic; | ||
requestDevice(options?: RequestDeviceOptions): Promise<BluetoothDevice>; | ||
requestLEScan(options?: RequestLEScanOptions): Promise<BluetoothLEScan>; | ||
addEventListener(type: "availabilitychanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; | ||
addEventListener(type: "advertisementreceived", listener: (this: this, ev: BluetoothAdvertisementEvent) => any, useCapture?: boolean): void; | ||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; | ||
@@ -123,0 +169,0 @@ } |
{ | ||
"name": "@types/web-bluetooth", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "TypeScript definitions for Web Bluetooth", | ||
@@ -31,4 +31,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "d56194c8b4f832546284eafea8e180e5a3e8820d7f90e32afc28b6f7364366fb", | ||
"typesPublisherContentHash": "205465f876c44bdbf5736092cb611da80b36c00913c88133cf5153ad49fe72f2", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 15 May 2020 13:12:56 GMT | ||
* Last updated: Fri, 26 Jun 2020 10:06:00 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
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
9939
149