navigator.mimeTypes type definition problem in lib.es2016.full.d.ts #26502
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Help Wanted
You can do this
Milestone
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 asnavigator.mimeTypes[0]
. TypeScript should reference toMimeType
, but it reference to aPlugin
type and thenPlugin
's reference is also different from MDN docs.Actual behavior:
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
The text was updated successfully, but these errors were encountered: