Add bindings for queueMicrotask (#3981)

This commit is contained in:
daxpedda
2024-06-12 10:56:17 +02:00
committed by GitHub
parent c108c7520a
commit f1c840fd1c
4 changed files with 22 additions and 0 deletions

View File

@@ -30,6 +30,9 @@
* Add bindings for `VisualViewport`.
[#3931](https://github.com/rustwasm/wasm-bindgen/pull/3931)
* Add bindings for `queueMicrotask`.
[#3981](https://github.com/rustwasm/wasm-bindgen/pull/3981)
### Changed
* Stabilize Web Share API.

View File

@@ -3001,6 +3001,13 @@ extern "C" {
input: &str,
init: &RequestInit,
) -> ::js_sys::Promise;
# [wasm_bindgen (method , structural , js_class = "Window" , js_name = queueMicrotask)]
#[doc = "The `queueMicrotask()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Window`*"]
pub fn queue_microtask(this: &Window, callback: &::js_sys::Function);
# [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = setInterval)]
#[doc = "The `setInterval()` method."]
#[doc = ""]

View File

@@ -820,6 +820,13 @@ extern "C" {
input: &str,
init: &RequestInit,
) -> ::js_sys::Promise;
# [wasm_bindgen (method , structural , js_class = "WorkerGlobalScope" , js_name = queueMicrotask)]
#[doc = "The `queueMicrotask()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/queueMicrotask)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"]
pub fn queue_microtask(this: &WorkerGlobalScope, callback: &::js_sys::Function);
# [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = setInterval)]
#[doc = "The `setInterval()` method."]
#[doc = ""]

View File

@@ -68,3 +68,8 @@ partial interface mixin WindowOrWorkerGlobalScope {
[Throws, Func="mozilla::dom::DOMPrefs::DOMCachesEnabled", SameObject]
readonly attribute CacheStorage caches;
};
// https://html.spec.whatwg.org/#microtask-queuing
partial interface mixin WindowOrWorkerGlobalScope {
undefined queueMicrotask(VoidFunction callback);
};