Skip to content

Commit

Permalink
do it properly with webidl manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenHolstHansen committed Apr 26, 2024
1 parent f85010e commit 445c6c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions crates/web-sys/src/features/gen_EventTarget.rs
Expand Up @@ -155,15 +155,18 @@ extern "C" {
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Event`, `EventTarget`*"]
pub fn dispatch_event(this: &EventTarget, event: &Event) -> Result<bool, JsValue>;
pub fn dispatch_event_with_event(this: &EventTarget, event: &Event) -> Result<bool, JsValue>;
#[cfg(feature = "CustomEvent")]
# [wasm_bindgen (catch , method , structural , js_class = "EventTarget" , js_name = dispatchEvent)]
#[doc = "The `dispatchEvent()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CustomEvent`, `EventTarget`*"]
pub fn dispatch_custom_event(this: &EventTarget, event: &CustomEvent) -> Result<bool, JsValue>;
pub fn dispatch_event_with_custom_event(
this: &EventTarget,
event: &CustomEvent,
) -> Result<bool, JsValue>;
# [wasm_bindgen (catch , method , structural , js_class = "EventTarget" , js_name = removeEventListener)]
#[doc = "The `removeEventListener()` method."]
#[doc = ""]
Expand Down
2 changes: 1 addition & 1 deletion crates/web-sys/webidls/enabled/EventTarget.webidl
Expand Up @@ -37,5 +37,5 @@ interface EventTarget {
EventListener listener,
optional (EventListenerOptions or boolean) options);
[Throws, NeedsCallerType]
boolean dispatchEvent(Event event);
boolean dispatchEvent((Event or CustomEvent) event);
};

0 comments on commit 445c6c7

Please sign in to comment.