HTML File constructor does not declare the required parameters #3999
Labels
Breaking Change
Would introduce errors in existing code
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Milestone
The HTML5 File API specifies that the File constructor has two required parameters and one optional parameter: http://www.w3.org/TR/FileAPI/#file-constructor-params
However the dom.generated.d.ts file specifies that the File constructor has no parameters:
https://github.com/Microsoft/TypeScript/blob/84a6ee1fb9b6f820840bac227c039ef6d1d830b9/src/lib/dom.generated.d.ts#L3033
This leads to the following error: TS2346: Supplied parameters do not match any signature of call target.
It also appears to be impossible to extend that declaration as it is inside a var rather than an interface. As per #182 this appears to have been fixed for the lib.d.ts typings by moving all the declarations into an interface, but the DOM typings haven't been changed to follow this pattern, so I can't extend them.
The text was updated successfully, but these errors were encountered: