Skip to content

navigator.mimeTypes type definition problem in lib.es2016.full.d.ts #26502

@doggy8088

Description

@doggy8088

TypeScript Version: 3.1.0-dev.20180813

Search Terms: navigator.mimeTypes

Code

http://www.typescriptlang.org/play/index.html#src=var%20a%3A%20Plugin%20%3D%20navigator.mimeTypes%5B0%5D%0D%0Avar%20b%3A%20MimeType%20%3D%20a%5B0%5D%3B%0D%0A%0D%0Aconsole.log(b.type)

Expected behavior:

I expected MimeTypeArray object which contains a list of MimeType objects representing the MIME types recognized by the browser. This one is right in TypeScript.

Reference: NavigatorPlugins.mimeTypes - Web APIs | MDN

When I get an array item in the navigator.mimeTypes, such as navigator.mimeTypes[0]. TypeScript should reference to MimeType, but it reference to a Plugin type and then Plugin's reference is also different from MDN docs.

image

Actual behavior:

image

image

image

Playground Link:
http://www.typescriptlang.org/play/index.html#src=var%20a%20%3D%20navigator.mimeTypes%5B0%5D%3B%0D%0Avar%20b%20%3D%20a%5B0%5D%3B%0D%0A%0D%0Aconsole.log(b.type)%3B%0D%0A%0D%0A%0D%0A

Related Issues:
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions