Skip to content

HTML File constructor does not declare the required parameters #3999

Closed
@corruptmem

Description

@corruptmem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions