Emit `object` for Web IDL `object` types?

Open
#2,475 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
tooling

Research direction

The mapping is in TS.fsx at the linked line; start there and compare how Web IDL object types are currently emitted. Done means object types emit TypeScript object rather than any, with the generated declaration behavior described in #2459 verified.

Written by the indexing model from the issue text.

Description

This generator has been treating object as any ever since it's created in 2017: https://github.com/microsoft/TypeScript-DOM-lib-generator/blame/317c27a36a49528e86f6f16ab8f01f3239f80ea0/TS.fsx#L719

But in the same year TypeScript introduced object type: https://devblogs.microsoft.com/typescript/announcing-typescript-2-2/#the-object-type

In #2459 I got a reason to make it actually object, since Origin.from() should ideally receive object | string. (That's still not the most strict type, but I don't think we can do anything more than that.)

@jakebailey Thoughts about any reason we should not do this?

Dominant language
TypeScript
Stars
740
Forks
474
Avg merge
2d 8h
Merged PRs (30d)
15

Contributor guide

No contributing guide indexed for this repository

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.

More from microsoft/TypeScript-DOM-lib-generator

All issues in microsoft/TypeScript-DOM-lib-generator

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.