Skip to content

Commit 1f019db

Browse files
authored
Enabled and auto generated forget() method for UsbDevice (#3821)
1 parent 9e699ac commit 1f019db

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
* Introduce environment variable `WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATION` to disable origin isolation for `wasm-bindgen-test-runner`.
1818
[#3807](https://github.com/rustwasm/wasm-bindgen/pull/3807)
1919

20+
* Add bindings for `USBDevice.forget()`.
21+
[#3821](https://github.com/rustwasm/wasm-bindgen/pull/3821)
22+
2023
### Changed
2124

2225
* Stabilize `ClipboardEvent`.

crates/web-sys/src/features/gen_UsbDevice.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,17 @@ extern "C" {
306306
data: &mut [u8],
307307
) -> ::js_sys::Promise;
308308
#[cfg(web_sys_unstable_apis)]
309+
# [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = forget)]
310+
#[doc = "The `forget()` method."]
311+
#[doc = ""]
312+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/forget)"]
313+
#[doc = ""]
314+
#[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
315+
#[doc = ""]
316+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
317+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
318+
pub fn forget(this: &UsbDevice) -> ::js_sys::Promise;
319+
#[cfg(web_sys_unstable_apis)]
309320
# [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = isochronousTransferIn)]
310321
#[doc = "The `isochronousTransferIn()` method."]
311322
#[doc = ""]

crates/web-sys/webidls/unstable/WebUSB.webidl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ interface USBDevice {
6262
readonly attribute FrozenArray<USBConfiguration> configurations;
6363
readonly attribute boolean opened;
6464
Promise<undefined> open();
65+
Promise<undefined> forget();
6566
Promise<undefined> close();
6667
Promise<undefined> selectConfiguration(octet configurationValue);
6768
Promise<undefined> claimInterface(octet interfaceNumber);
@@ -240,4 +241,4 @@ dictionary USBPermissionStorage {
240241
[Exposed=(DedicatedWorker,SharedWorker,Window)]
241242
interface USBPermissionResult : PermissionStatus {
242243
attribute FrozenArray<USBDevice> devices;
243-
};
244+
};

0 commit comments

Comments
 (0)