Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doggy8088 opened this issue Aug 17, 2018 · 1 comment
Closed

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

doggy8088 opened this issue Aug 17, 2018 · 1 comment
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

Comments

@doggy8088
Copy link

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

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Aug 20, 2018
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Oct 9, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@jakebailey
Copy link
Member

Just looking at ancient issues; this was fixed in #32335.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants