microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.73k stars 12.45k forks source link

HTMLElement missing style and innerHTML #26123

Closed ghost closed 6 years ago

ghost commented 6 years ago

TypeScript Version: 3.1.0-dev.20180801 (works in 3.1.0-dev.20170731)

Code

function f(h: HTMLElement) {
    h.style;
    h.innerHTML;
}

Expected behavior:

No error.

Actual behavior:

src/a.ts:2:7 - error TS2339: Property 'style' does not exist on type 'HTMLElement'.

2     h.style;
        ~~~~~

src/a.ts:3:7 - error TS2339: Property 'innerHTML' does not exist on type 'HTMLElement'.

3     h.innerHTML;

Think this was broken by #25944 (CC @mhegazy).

Affects these DefinitelyTyped packages: ace, clamp-js, countdown, devexpress-web, domurl, dygraphs, fabric, fetch-jsonp, gapi.auth2, gapi.calendar, gapi.drive, gapi.people, google-earth, heremaps, highcharts, humane, jasmine/v1, jest/v16, jquery, jsurl, knockout.deferred.updates, mainloop.js, mapbox, mermaid, microsoft-ajax, modernizr, nightmare, nvd3, page, phonegap, phonon, photonui, photoswipe, pkijs, plupload, puppeteer, qunit/v1, raphael, safari-extension, safari-extension-content, scrollreveal, scroller, sharepoint, simplemde, skatejs, slickgrid, sortablejs, stripe-v3, swipeview, three, tingle.js, to-markdown, viewporter, ydn-db, zeroclipboard

falsandtru commented 6 years ago

Also outerHTML.