Skip to content

HTMLImageElement#crossOrigin should use literal union type from allowable values #39829

Description

TypeScript Version: Nightly 2020-07-29

Search Terms: htmlimageelement crossorigin

Code

const i = new Image(10, 10);
// @ts-expect-error
i.crossOrigin = "abc"; // Must be "anonymous" or "use-credentials"

Expected behavior:

Type should be defined with string literals, per this MDN page

Actual behavior:

Property is typed as string | null.


Playground Link

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptNeeds Human ReviewThis issue has a backlog check awaiting maintainer review.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions