From 5c3727b3ce8306c0679a44f3ca3c2dbabe46abae Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 15 Jul 2020 13:11:08 -0500 Subject: [PATCH] Update @types/web-bluetooth Now includes writeValueWithResponse and writeValueWithoutResponse --- package.json | 2 +- src/utils/web-bluetooth.ts | 7 ++----- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 6600dbe3..c01e68d8 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils/web-bluetooth.ts b/src/utils/web-bluetooth.ts index 81ced620..3196b65f 100644 --- a/src/utils/web-bluetooth.ts +++ b/src/utils/web-bluetooth.ts @@ -7,8 +7,6 @@ */ export interface PolyfillBluetoothRemoteGATTCharacteristic extends BluetoothRemoteGATTCharacteristic { - writeValueWithResponse?(value: BufferSource): Promise; - writeValueWithoutResponse?(value: BufferSource): Promise; /** * 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; } diff --git a/yarn.lock b/yarn.lock index d6fef639..ca09a256 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"