TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

onerror for Elements is incorrect

Open trusktr opened this issue 1 year ago • 3 comments

const img = document.createElement('img')

// type error:
img.onerror = (e: Event) => e
Screenshot 2024-10-07 at 8 03 39 PM

playground

Only Window.onerror should have the alternative signature, but not elements. See:

  • https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event
  • https://udn.realityripple.com/docs/Web/API/GlobalEventHandlers/onerror

trusktr avatar Oct 08 '24 03:10 trusktr