Skip to content

Commit 75dc627

Browse files
committed
yarn: patch @types/w3c-web-usb
Fix issues with null vs. undefined. Based on DefinitelyTyped/DefinitelyTyped#73568
1 parent 1f81fbb commit 75dc627

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/index.d.ts b/index.d.ts
2+
index b59810ce0fcaaf647830359010987348e11b0479..0f9d24ab390ac12010b671bc8aab02909e93fa89 100644
3+
--- a/index.d.ts
4+
+++ b/index.d.ts
5+
@@ -39,7 +39,7 @@ interface USBConnectionEventInit extends EventInit {
6+
7+
declare class USBConfiguration {
8+
readonly configurationValue: number;
9+
- readonly configurationName?: string | undefined;
10+
+ readonly configurationName: string | null;
11+
readonly interfaces: USBInterface[];
12+
}
13+
14+
@@ -57,14 +57,14 @@ declare class USBAlternateInterface {
15+
readonly interfaceClass: number;
16+
readonly interfaceSubclass: number;
17+
readonly interfaceProtocol: number;
18+
- readonly interfaceName?: string | undefined;
19+
+ readonly interfaceName: string | null;
20+
readonly endpoints: USBEndpoint[];
21+
}
22+
23+
declare class USBInTransferResult {
24+
constructor(status: USBTransferStatus, data?: DataView);
25+
readonly data?: DataView | undefined;
26+
- readonly status?: USBTransferStatus | undefined;
27+
+ readonly status: USBTransferStatus;
28+
}
29+
30+
declare class USBOutTransferResult {
31+
@@ -76,7 +76,7 @@ declare class USBOutTransferResult {
32+
declare class USBIsochronousInTransferPacket {
33+
constructor(status: USBTransferStatus, data?: DataView);
34+
readonly data?: DataView | undefined;
35+
- readonly status?: USBTransferStatus | undefined;
36+
+ readonly status: USBTransferStatus;
37+
}
38+
39+
declare class USBIsochronousInTransferResult {
40+
@@ -140,10 +140,10 @@ declare class USBDevice {
41+
readonly deviceVersionMajor: number;
42+
readonly deviceVersionMinor: number;
43+
readonly deviceVersionSubminor: number;
44+
- readonly manufacturerName?: string | undefined;
45+
- readonly productName?: string | undefined;
46+
- readonly serialNumber?: string | undefined;
47+
- readonly configuration?: USBConfiguration | undefined;
48+
+ readonly manufacturerName: string | null;
49+
+ readonly productName: string | null;
50+
+ readonly serialNumber: string | null;
51+
+ readonly configuration: USBConfiguration | null;
52+
readonly configurations: USBConfiguration[];
53+
readonly opened: boolean;
54+
open(): Promise<void>;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
"react-error-overlay": "6.0.9",
174174
"react-dev-utils@^12.0.1": "patch:react-dev-utils@npm:12.0.1#.yarn/patches/react-dev-utils-npm-12.0.1-83ba06e3ee.patch",
175175
"jsdom@^20.0.0": "patch:jsdom@npm%3A20.0.0#./.yarn/patches/jsdom-npm-20.0.0-9c1ad43ab8.patch",
176-
"[email protected]": "patch:pyodide@npm%3A0.23.0#./.yarn/patches/pyodide-npm-0.23.0-64dc9bd6f1.patch"
176+
"[email protected]": "patch:pyodide@npm%3A0.23.0#./.yarn/patches/pyodide-npm-0.23.0-64dc9bd6f1.patch",
177+
"@types/w3c-web-usb@^1.0.10": "patch:@types/w3c-web-usb@npm%3A1.0.10#./.yarn/patches/@types-w3c-web-usb-npm-1.0.10-82b33e05cb.patch"
177178
},
178179
"jest": {
179180
"roots": [

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5472,13 +5472,20 @@ __metadata:
54725472
languageName: node
54735473
linkType: hard
54745474

5475-
"@types/w3c-web-usb@npm:^1.0.10":
5475+
"@types/w3c-web-usb@npm:1.0.10":
54765476
version: 1.0.10
54775477
resolution: "@types/w3c-web-usb@npm:1.0.10"
54785478
checksum: 6ac6786a0788f0846a48b103ab06ca5fde5eb95674217b522420a2f6157bee3e181a961c1b7011940f497c55f4f5cc46129657d881fdd8112b48764089679ad6
54795479
languageName: node
54805480
linkType: hard
54815481

5482+
"@types/w3c-web-usb@patch:@types/w3c-web-usb@npm%3A1.0.10#./.yarn/patches/@types-w3c-web-usb-npm-1.0.10-82b33e05cb.patch::locator=%40pybricks%2Fpybricks-code%40workspace%3A.":
5483+
version: 1.0.10
5484+
resolution: "@types/w3c-web-usb@patch:@types/w3c-web-usb@npm%3A1.0.10#./.yarn/patches/@types-w3c-web-usb-npm-1.0.10-82b33e05cb.patch::version=1.0.10&hash=171f12&locator=%40pybricks%2Fpybricks-code%40workspace%3A."
5485+
checksum: 9528b1c501a5a21f05e36998b58501f8e2a4790af82c41b88e86bed8a618dc3135d486ffd55771532837a4e4112c1093ada293986451fe665f937081c9f2b7d7
5486+
languageName: node
5487+
linkType: hard
5488+
54825489
"@types/web-bluetooth@npm:^0.0.20":
54835490
version: 0.0.20
54845491
resolution: "@types/web-bluetooth@npm:0.0.20"

0 commit comments

Comments
 (0)