mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Merge pull request #22144 from xlozinguez/master
Fixed web-bluetooth types as filters are optionals
This commit is contained in:
Vendored
+6
-6
@@ -1,6 +1,7 @@
|
||||
// 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>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type BluetoothServiceUUID = number | string;
|
||||
@@ -15,11 +16,13 @@ interface BluetoothRequestDeviceFilter {
|
||||
serviceDataUUID?: BluetoothServiceUUID;
|
||||
}
|
||||
|
||||
interface RequestDeviceOptions {
|
||||
type RequestDeviceOptions = {
|
||||
filters: BluetoothRequestDeviceFilter[];
|
||||
optionalServices?: BluetoothServiceUUID[];
|
||||
acceptAllDevices?: boolean;
|
||||
}
|
||||
} | {
|
||||
acceptAllDevices: boolean;
|
||||
optionalServices?: BluetoothServiceUUID[];
|
||||
};
|
||||
|
||||
interface BluetoothRemoteGATTDescriptor {
|
||||
readonly characteristic: BluetoothRemoteGATTCharacteristic;
|
||||
@@ -98,11 +101,9 @@ interface BluetoothDevice extends EventTarget, BluetoothDeviceEventHandlers, Cha
|
||||
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;
|
||||
@@ -113,7 +114,6 @@ interface Bluetooth extends EventTarget, BluetoothDeviceEventHandlers, Character
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user