@@ -14,27 +14,37 @@ dictionary USBDeviceRequestOptions {
14
14
required sequence<USBDeviceFilter> filters;
15
15
};
16
16
17
+ [Exposed=(DedicatedWorker, SharedWorker, Window), SecureContext]
17
18
interface USB : EventTarget {
18
19
attribute EventHandler onconnect;
19
20
attribute EventHandler ondisconnect;
20
21
Promise<sequence<USBDevice>> getDevices();
21
- Promise<USBDevice> requestDevice(USBDeviceRequestOptions options);
22
+ [Exposed=Window] Promise<USBDevice> requestDevice(USBDeviceRequestOptions options);
22
23
};
23
24
24
- [SecureContext]
25
+ [Exposed=Window, SecureContext]
25
26
partial interface Navigator {
26
27
[SameObject] readonly attribute USB usb;
27
28
};
28
29
30
+ [Exposed=(DedicatedWorker, SharedWorker), SecureContext]
31
+ partial interface WorkerNavigator {
32
+ [SameObject] readonly attribute USB usb;
33
+ };
34
+
29
35
dictionary USBConnectionEventInit : EventInit {
30
36
required USBDevice device;
31
37
};
32
38
33
- [Constructor(DOMString type, USBConnectionEventInit eventInitDict)]
39
+ [
40
+ Constructor(DOMString type, USBConnectionEventInit eventInitDict),
41
+ Exposed=(DedicatedWorker, SharedWorker, Window)
42
+ ]
34
43
interface USBConnectionEvent : Event {
35
44
[SameObject] readonly attribute USBDevice device;
36
45
};
37
46
47
+ [Exposed=(DedicatedWorker, SharedWorker, Window)]
38
48
interface USBDevice {
39
49
readonly attribute octet usbVersionMajor;
40
50
readonly attribute octet usbVersionMinor;
@@ -96,57 +106,84 @@ dictionary USBControlTransferParameters {
96
106
required unsigned short index;
97
107
};
98
108
99
- [Constructor(USBTransferStatus status, optional DataView? data)]
109
+ [
110
+ Constructor(USBTransferStatus status, optional DataView? data),
111
+ Exposed=(DedicatedWorker, SharedWorker, Window)
112
+ ]
100
113
interface USBInTransferResult {
101
114
readonly attribute DataView? data;
102
115
readonly attribute USBTransferStatus status;
103
116
};
104
117
105
- [Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0)]
118
+ [
119
+ Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0),
120
+ Exposed=(DedicatedWorker, SharedWorker, Window)
121
+ ]
106
122
interface USBOutTransferResult {
107
123
readonly attribute unsigned long bytesWritten;
108
124
readonly attribute USBTransferStatus status;
109
125
};
110
126
111
- [Constructor(USBTransferStatus status, optional DataView? data)]
127
+ [
128
+ Constructor(USBTransferStatus status, optional DataView? data),
129
+ Exposed=(DedicatedWorker, SharedWorker, Window)
130
+ ]
112
131
interface USBIsochronousInTransferPacket {
113
132
readonly attribute DataView? data;
114
133
readonly attribute USBTransferStatus status;
115
134
};
116
135
117
- [Constructor(sequence<USBIsochronousInTransferPacket> packets, optional DataView? data)]
136
+ [
137
+ Constructor(sequence<USBIsochronousInTransferPacket> packets, optional DataView? data),
138
+ Exposed=(DedicatedWorker, SharedWorker, Window)
139
+ ]
118
140
interface USBIsochronousInTransferResult {
119
141
readonly attribute DataView? data;
120
142
readonly attribute FrozenArray<USBIsochronousInTransferPacket> packets;
121
143
};
122
144
123
- [Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0)]
145
+ [
146
+ Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0),
147
+ Exposed=(DedicatedWorker, SharedWorker, Window)
148
+ ]
124
149
interface USBIsochronousOutTransferPacket {
125
150
readonly attribute unsigned long bytesWritten;
126
151
readonly attribute USBTransferStatus status;
127
152
};
128
153
129
- [Constructor(sequence<USBIsochronousOutTransferPacket> packets)]
154
+ [
155
+ Constructor(sequence<USBIsochronousOutTransferPacket> packets),
156
+ Exposed=(DedicatedWorker, SharedWorker, Window)
157
+ ]
130
158
interface USBIsochronousOutTransferResult {
131
159
readonly attribute FrozenArray<USBIsochronousOutTransferPacket> packets;
132
160
};
133
161
134
- [Constructor(USBDevice device, octet configurationValue)]
162
+ [
163
+ Constructor(USBDevice device, octet configurationValue),
164
+ Exposed=(DedicatedWorker, SharedWorker, Window)
165
+ ]
135
166
interface USBConfiguration {
136
167
readonly attribute octet configurationValue;
137
168
readonly attribute DOMString? configurationName;
138
169
readonly attribute FrozenArray<USBInterface> interfaces;
139
170
};
140
171
141
- [Constructor(USBConfiguration configuration, octet interfaceNumber)]
172
+ [
173
+ Constructor(USBConfiguration configuration, octet interfaceNumber),
174
+ Exposed=(DedicatedWorker, SharedWorker, Window)
175
+ ]
142
176
interface USBInterface {
143
177
readonly attribute octet interfaceNumber;
144
178
readonly attribute USBAlternateInterface alternate;
145
179
readonly attribute FrozenArray<USBAlternateInterface> alternates;
146
180
readonly attribute boolean claimed;
147
181
};
148
182
149
- [Constructor(USBInterface deviceInterface, octet alternateSetting)]
183
+ [
184
+ Constructor(USBInterface deviceInterface, octet alternateSetting),
185
+ Exposed=(DedicatedWorker, SharedWorker, Window)
186
+ ]
150
187
interface USBAlternateInterface {
151
188
readonly attribute octet alternateSetting;
152
189
readonly attribute octet interfaceClass;
@@ -167,7 +204,10 @@ enum USBEndpointType {
167
204
"isochronous"
168
205
};
169
206
170
- [Constructor(USBAlternateInterface alternate, octet endpointNumber, USBDirection direction)]
207
+ [
208
+ Constructor(USBAlternateInterface alternate, octet endpointNumber, USBDirection direction),
209
+ Exposed=(DedicatedWorker, SharedWorker, Window)
210
+ ]
171
211
interface USBEndpoint {
172
212
readonly attribute octet endpointNumber;
173
213
readonly attribute USBDirection direction;
0 commit comments