Skip to content

Commit

Permalink
cockpit.js: Add missing options field to addEventListener()
Browse files Browse the repository at this point in the history
See
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

Let's not add the `useCapture` boolean. It can be spelled out as
`{ capture: true }`.
  • Loading branch information
martinpitt committed Oct 17, 2024
1 parent c7fddca commit 26846d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lib/cockpit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ declare module 'cockpit' {
(event: CustomEvent<Parameters<E>>, ...args: Parameters<E>) => void;

interface EventSource<EM extends EventMap> {
addEventListener<E extends keyof EM>(event: E, listener: EventListener<EM[E]>): void;
addEventListener<E extends keyof EM>(event: E, listener: EventListener<EM[E]>, options?: JsonObject): void;
removeEventListener<E extends keyof EM>(event: E, listener: EventListener<EM[E]>): void;
dispatchEvent<E extends keyof EM>(event: E, ...args: Parameters<EM[E]>): void;
}
Expand Down

0 comments on commit 26846d6

Please sign in to comment.