Definitely assigned fields in return value dictionaries should be marked as `required`
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.3k
- Forks
- 194
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
The TypeScript definition for webcodecs in DefinitelyTyped is outdated, so I'm trying to generate a new one from official IDL using a modified version of microsoft/TypeScript-DOM-lib-generator. It worked, but old tests didn't pass.
The reason is that the old version was generated from Chromium IDL, which differs from official IDL.
For example, AudioDecoderSupport dictionary in official IDL is
and Chromium version
dictionary AudioDecoderSupport {
required boolean supported;
required AudioDecoderConfig config;
};
Looking at related steps, these fields are definitely assigned, so the required keyword is correct.
Marking them as required more precisely reflects shape of the value, and TypeScript-DOM-lib-generator needs them to generate more correct type definitions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked official WebCodecs IDL in index.src.html and compare the AudioDecoderSupport definition with the Chromium IDL linked in the issue. Check the related algorithm steps and the old test results, then verify that definitely assigned dictionary fields are represented as required and that the existing tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100