Enabled and auto generated forget() method for UsbDevice (#3821)

This commit is contained in:
G2 2024-02-02 17:53:19 -06:00 committed by GitHub
parent 9e699ac45d
commit 1f019db03a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View File

@ -17,6 +17,9 @@
* Introduce environment variable `WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATION` to disable origin isolation for `wasm-bindgen-test-runner`.
[#3807](https://github.com/rustwasm/wasm-bindgen/pull/3807)
* Add bindings for `USBDevice.forget()`.
[#3821](https://github.com/rustwasm/wasm-bindgen/pull/3821)
### Changed
* Stabilize `ClipboardEvent`.

View File

@ -306,6 +306,17 @@ extern "C" {
data: &mut [u8],
) -> ::js_sys::Promise;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = forget)]
#[doc = "The `forget()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/forget)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn forget(this: &UsbDevice) -> ::js_sys::Promise;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = isochronousTransferIn)]
#[doc = "The `isochronousTransferIn()` method."]
#[doc = ""]

View File

@ -62,6 +62,7 @@ interface USBDevice {
readonly attribute FrozenArray<USBConfiguration> configurations;
readonly attribute boolean opened;
Promise<undefined> open();
Promise<undefined> forget();
Promise<undefined> close();
Promise<undefined> selectConfiguration(octet configurationValue);
Promise<undefined> claimInterface(octet interfaceNumber);
@ -240,4 +241,4 @@ dictionary USBPermissionStorage {
[Exposed=(DedicatedWorker,SharedWorker,Window)]
interface USBPermissionResult : PermissionStatus {
attribute FrozenArray<USBDevice> devices;
};
};