mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
Update @types/web-bluetooth
Now includes writeValueWithResponse and writeValueWithoutResponse
This commit is contained in:
committed by
David Lechner
parent
70d98511c2
commit
5c3727b3ce
+1
-1
@@ -18,7 +18,7 @@
|
||||
"@types/react-redux": "^7.1.9",
|
||||
"@types/react-splitter-layout": "^3.0.0",
|
||||
"@types/redux-logger": "^3.0.8",
|
||||
"@types/web-bluetooth": "^0.0.6",
|
||||
"@types/web-bluetooth": "^0.0.8",
|
||||
"@types/zen-push": "^0.1.1",
|
||||
"ace-builds": "^1.4.11",
|
||||
"file-saver": "^2.0.2",
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
*/
|
||||
export interface PolyfillBluetoothRemoteGATTCharacteristic
|
||||
extends BluetoothRemoteGATTCharacteristic {
|
||||
writeValueWithResponse?(value: BufferSource): Promise<void>;
|
||||
writeValueWithoutResponse?(value: BufferSource): Promise<void>;
|
||||
/**
|
||||
* Calls writeValueWithResponse() if available otherwise falls back to writeValue()
|
||||
* @param value data to send
|
||||
@@ -30,9 +28,8 @@ export function polyfillBluetoothRemoteGATTCharacteristic(
|
||||
char: BluetoothRemoteGATTCharacteristic,
|
||||
): PolyfillBluetoothRemoteGATTCharacteristic {
|
||||
const polyfill = (char as unknown) as PolyfillBluetoothRemoteGATTCharacteristic;
|
||||
polyfill.xWriteValueWithResponse =
|
||||
polyfill.writeValueWithResponse || char.writeValue;
|
||||
polyfill.xWriteValueWithResponse = char.writeValueWithResponse || char.writeValue;
|
||||
polyfill.xWriteValueWithoutResponse =
|
||||
polyfill.writeValueWithoutResponse || char.writeValue;
|
||||
char.writeValueWithoutResponse || char.writeValue;
|
||||
return polyfill;
|
||||
}
|
||||
|
||||
@@ -1824,10 +1824,10 @@
|
||||
dependencies:
|
||||
"@types/jest" "*"
|
||||
|
||||
"@types/web-bluetooth@^0.0.6":
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.6.tgz#71b56427353d3495ac7ba9a4d7a13c8f312f9c1e"
|
||||
integrity sha512-S/Dhk1sMzYZMNNXvG1CHKz1X+HbabMf2l+FkdRStcvvuQVVlMvq0nPd/fQ3skniRKj0LqBPy19in3JN/XsB6Qg==
|
||||
"@types/web-bluetooth@^0.0.8":
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.8.tgz#440808ba4c705377f35b0ac35078c7c77cee7158"
|
||||
integrity sha512-LxKTVUOLauVRZxgOmqxKT9n8xBRukUkP/vyG5QfFmTWN58zuOgiGT3BIIIJbjmSSZ2iSlC/kky5xSWBS1PIgtQ==
|
||||
|
||||
"@types/yargs-parser@*":
|
||||
version "15.0.0"
|
||||
|
||||
Reference in New Issue
Block a user