Skip to content

[lib.d.ts BUG] navigator.mediaDevices.getUserMedia returns PromiseLike (actually returns a Promise) #10242

@jhm-ciberman

Description

@jhm-ciberman

TypeScript Version: atom-typescript

Code

var a = navigator.mediaDevices.getUserMedia(options);
a.catch( () => console.log ); 
//ERROR: 'catch' does not exists on type 'PromiseLike<MediaStream>'

Expected behavior:
Acording to MDN, navigator.mediaDevices.getUserMedia returns a Promise (with a catch method), not a PromiseLike (without catch method).

Actual behavior:
navigator.mediaDevices.getUserMedia returns a PromiseLike<MediaStream>
It needs to return a Promise<MediaStream>

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptDuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions