Skip to content

[lib.webworker.d.ts] Worker constructor type missing optional options #28136

Closed
microsoft/TypeScript-DOM-lib-generator
#587
@AviVahl

Description

@AviVahl

TypeScript Version: 3.1.3 (not fixed in master as well)
https://github.com/Microsoft/TypeScript/blob/release-3.1/lib/lib.webworker.d.ts#L2699

Search Terms:
web worker options

Code

new Worker('https://some-url', {type: 'module'})

Expected behavior:
Type check should pass.

Actual behavior:
Second (options) parameter isn't specified in Worker types, so type check fails.

Playground Link:
http://www.typescriptlang.org/play/#src=new%20Worker('https%3A%2F%2Fsome-url'%2C%20%7Btype%3A%20'module'%7D)

Related Issues:
Couldn't find existing issue discussing this.

Reference:
https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions