Skip to content

Split out types and values #1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Split out types and values #1144

wants to merge 4 commits into from

Conversation

orta
Copy link
Contributor

@orta orta commented Sep 13, 2021

This should allow something like Node / React Native to be able to write /// <reference lib="dom.types" /> and have access to all of the global types, but none of the values. Re: microsoft/TypeScript#43972

The concept is reasonably simple, we create two separate printers one focused on values and another on types. When we don't care to split they are the same printer and so no changes. Then the printer is DI'd down from whatever decides if it's printing a type or value.

@saschanaz
Copy link
Contributor

saschanaz commented Sep 13, 2021

Hmm, as I said in Discord, I think this:

So my current idea is that we just duplicate the whole types into the module, while keeping the current lib as-is.

export interface AbortSignal {
  // ...
};

export var AbortSignal: {
  // ...
};
// on Node.js:
import { AbortSignal } from "typescript/dom";

@Bashamega
Copy link
Contributor

Hello @orta, @saschanaz
Do you have any plans to update this PR and merge it?

@orta
Copy link
Contributor Author

orta commented Mar 31, 2025

No, not from me, so I'll close it 👍🏻

@orta orta closed this Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants