Socket
Socket
Sign inDemoInstall

@types/web-bluetooth

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 0.0.6

154

web-bluetooth/index.d.ts
// Type definitions for Web Bluetooth
// Project: https://webbluetoothcg.github.io/web-bluetooth/
// Definitions by: Uri Shaked <https://github.com/urish>
// Xavier Lozinguez <http://github.com/xlozinguez>
// Rob Moran <https://github.com/thegecko>
// Xavier Lozinguez <http://github.com/xlozinguez>
// Rob Moran <https://github.com/thegecko>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -13,114 +13,114 @@

interface BluetoothRequestDeviceFilter {
services?: BluetoothServiceUUID[];
name?: string;
namePrefix?: string;
manufacturerId?: number;
serviceDataUUID?: BluetoothServiceUUID;
services?: BluetoothServiceUUID[];
name?: string;
namePrefix?: string;
manufacturerId?: number;
serviceDataUUID?: BluetoothServiceUUID;
}
type RequestDeviceOptions = {
filters: BluetoothRequestDeviceFilter[];
optionalServices?: BluetoothServiceUUID[];
filters: BluetoothRequestDeviceFilter[];
optionalServices?: BluetoothServiceUUID[];
} | {
acceptAllDevices: boolean;
optionalServices?: BluetoothServiceUUID[];
acceptAllDevices: boolean;
optionalServices?: BluetoothServiceUUID[];
};
interface BluetoothRemoteGATTDescriptor {
readonly characteristic: BluetoothRemoteGATTCharacteristic;
readonly uuid: string;
readonly value?: DataView;
readValue(): Promise<DataView>;
writeValue(value: BufferSource): Promise<void>;
readonly characteristic: BluetoothRemoteGATTCharacteristic;
readonly uuid: string;
readonly value?: DataView;
readValue(): Promise<DataView>;
writeValue(value: BufferSource): Promise<void>;
}
interface BluetoothCharacteristicProperties {
readonly broadcast: boolean;
readonly read: boolean;
readonly writeWithoutResponse: boolean;
readonly write: boolean;
readonly notify: boolean;
readonly indicate: boolean;
readonly authenticatedSignedWrites: boolean;
readonly reliableWrite: boolean;
readonly writableAuxiliaries: boolean;
readonly broadcast: boolean;
readonly read: boolean;
readonly writeWithoutResponse: boolean;
readonly write: boolean;
readonly notify: boolean;
readonly indicate: boolean;
readonly authenticatedSignedWrites: boolean;
readonly reliableWrite: boolean;
readonly writableAuxiliaries: boolean;
}
interface CharacteristicEventHandlers {
oncharacteristicvaluechanged: (this: this, ev: Event) => any;
oncharacteristicvaluechanged: (this: this, ev: Event) => any;
}
interface BluetoothRemoteGATTCharacteristic extends EventTarget, CharacteristicEventHandlers {
readonly service?: BluetoothRemoteGATTService;
readonly uuid: string;
readonly properties: BluetoothCharacteristicProperties;
readonly value?: DataView;
getDescriptor(descriptor: BluetoothDescriptorUUID): Promise<BluetoothRemoteGATTDescriptor>;
getDescriptors(descriptor?: BluetoothDescriptorUUID): Promise<BluetoothRemoteGATTDescriptor[]>;
readValue(): Promise<DataView>;
writeValue(value: BufferSource): Promise<void>;
startNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
stopNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
addEventListener(type: "characteristicvaluechanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
readonly service?: BluetoothRemoteGATTService;
readonly uuid: string;
readonly properties: BluetoothCharacteristicProperties;
readonly value?: DataView;
getDescriptor(descriptor: BluetoothDescriptorUUID): Promise<BluetoothRemoteGATTDescriptor>;
getDescriptors(descriptor?: BluetoothDescriptorUUID): Promise<BluetoothRemoteGATTDescriptor[]>;
readValue(): Promise<DataView>;
writeValue(value: BufferSource): Promise<void>;
startNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
stopNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
addEventListener(type: "characteristicvaluechanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface ServiceEventHandlers {
onserviceadded: (this: this, ev: Event) => any;
onservicechanged: (this: this, ev: Event) => any;
onserviceremoved: (this: this, ev: Event) => any;
onserviceadded: (this: this, ev: Event) => any;
onservicechanged: (this: this, ev: Event) => any;
onserviceremoved: (this: this, ev: Event) => any;
}
interface BluetoothRemoteGATTService extends EventTarget, CharacteristicEventHandlers, ServiceEventHandlers {
readonly device: BluetoothDevice;
readonly uuid: string;
readonly isPrimary: boolean;
getCharacteristic(characteristic: BluetoothCharacteristicUUID): Promise<BluetoothRemoteGATTCharacteristic>;
getCharacteristics(characteristic?: BluetoothCharacteristicUUID): Promise<BluetoothRemoteGATTCharacteristic[]>;
getIncludedService(service: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService>;
getIncludedServices(service?: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService[]>;
addEventListener(type: "serviceadded", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "servicechanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "serviceremoved", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
readonly device: BluetoothDevice;
readonly uuid: string;
readonly isPrimary: boolean;
getCharacteristic(characteristic: BluetoothCharacteristicUUID): Promise<BluetoothRemoteGATTCharacteristic>;
getCharacteristics(characteristic?: BluetoothCharacteristicUUID): Promise<BluetoothRemoteGATTCharacteristic[]>;
getIncludedService(service: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService>;
getIncludedServices(service?: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService[]>;
addEventListener(type: "serviceadded", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "servicechanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "serviceremoved", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface BluetoothRemoteGATTServer {
readonly device: BluetoothDevice;
readonly connected: boolean;
connect(): Promise<BluetoothRemoteGATTServer>;
disconnect(): void;
getPrimaryService(service: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService>;
getPrimaryServices(service?: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService[]>;
readonly device: BluetoothDevice;
readonly connected: boolean;
connect(): Promise<BluetoothRemoteGATTServer>;
disconnect(): void;
getPrimaryService(service: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService>;
getPrimaryServices(service?: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService[]>;
}
interface BluetoothDeviceEventHandlers {
onadvertisementreceived: (this: this, ev: Event) => any;
ongattserverdisconnected: (this: this, ev: Event) => any;
onadvertisementreceived: (this: this, ev: Event) => any;
ongattserverdisconnected: (this: this, ev: Event) => any;
}
interface BluetoothDevice extends EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers {
readonly id: string;
readonly name?: string;
readonly gatt?: BluetoothRemoteGATTServer;
readonly uuids?: string[];
watchAdvertisements(): Promise<void>;
unwatchAdvertisements(): void;
readonly watchingAdvertisements: boolean;
addEventListener(type: "gattserverdisconnected", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "advertisementreceived", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
readonly id: string;
readonly name?: string;
readonly gatt?: BluetoothRemoteGATTServer;
readonly uuids?: string[];
watchAdvertisements(): Promise<void>;
unwatchAdvertisements(): void;
readonly watchingAdvertisements: boolean;
addEventListener(type: "gattserverdisconnected", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "advertisementreceived", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface Bluetooth extends EventTarget, BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers {
getAvailability(): Promise<boolean>;
onavailabilitychanged: (this: this, ev: Event) => any;
readonly referringDevice?: BluetoothDevice;
requestDevice(options?: RequestDeviceOptions): Promise<BluetoothDevice>;
addEventListener(type: "availabilitychanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
getAvailability(): Promise<boolean>;
onavailabilitychanged: (this: this, ev: Event) => any;
readonly referringDevice?: BluetoothDevice;
requestDevice(options?: RequestDeviceOptions): Promise<BluetoothDevice>;
addEventListener(type: "availabilitychanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
interface Navigator {
bluetooth: Bluetooth;
bluetooth: Bluetooth;
}
{
"name": "@types/web-bluetooth",
"version": "0.0.5",
"version": "0.0.6",
"description": "TypeScript definitions for Web Bluetooth",

@@ -31,4 +31,4 @@ "license": "MIT",

"dependencies": {},
"typesPublisherContentHash": "b5a6540173e128aa98bc795a8342291ebbf6450eca10e3cdb1dd4465115d7f71",
"typeScriptVersion": "2.8"
"typesPublisherContentHash": "d56194c8b4f832546284eafea8e180e5a3e8820d7f90e32afc28b6f7364366fb",
"typeScriptVersion": "3.0"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Fri, 03 Jan 2020 20:58:49 GMT
* Last updated: Fri, 15 May 2020 13:12:56 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Uri Shaked (https://github.com/urish), Xavier Lozinguez (http://github.com/xlozinguez), and Rob Moran (https://github.com/thegecko).
These definitions were written by [Uri Shaked](https://github.com/urish), [Xavier Lozinguez](http://github.com/xlozinguez), and [Rob Moran](https://github.com/thegecko).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc