microsoft / microsoft/TypeScript

USVString type definition

Open
#28,775 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Breaking Change Domain: lib.d.ts Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 3.2.0-dev.201xxxxx

Search Terms:
USVString

Code

function example(uri: USVString) {
    // Do some work
}

Expected behavior:
Until typescript version 3.0.3 USVString used to be an existing type defined in lib.dom.d.ts
in version 3.1, according to the breaking changes page, some vendor-specific types are removed from lib.d.ts, a full list of removed types is included.
USVString is not on that list, yet it's type definition was also removed.

USVString is defined under webIDL, as can be seen here.

Actual behavior:
error TS2304: Cannot find name 'USVString'.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the lib.dom.d.ts changes between TypeScript 3.0.3 and 3.1, then compare them with the TypeScript 3.1 breaking-changes list and the WebIDL definition linked in the issue. Verify the intended handling of a function parameter typed as USVString and confirm that the resulting declaration no longer produces TS2304.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.