Skip to content
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

typedef downleveling to use with typesVersions #28797

Closed
5 tasks done
mikehaas763 opened this issue Dec 1, 2018 · 2 comments
Closed
5 tasks done

typedef downleveling to use with typesVersions #28797

mikehaas763 opened this issue Dec 1, 2018 · 2 comments
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@mikehaas763
Copy link

Search Terms

typedef
downleveling
typesVersions

Suggestion

@RyanCavanaugh mentioned in #22605 (comment) regarding the typesVersion feature for typedef files that he "would expect these files to be either hand-created, or generated through some downleveling process". I think it'd be a great addition if the compiler would optionally emit the typedef files for any versions specified. I really don't want to manage my typedef files by hand. 🙂

Use Cases

Examples

For example, using tsc --build --downlevel-version 2.8 with typescript 3.1 would emit something like this dir structure

index.d.ts
ts3.0/index.d.ts
ts2.9/index.d.ts
ts2.8/index.d.ts

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@weswigham weswigham added Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Dec 4, 2018
@cordiosd
Copy link

I personally would like this change to be practically transparent and instantly applied. I had not found all of these suggestions when I suggested the following: #31907

@RyanCavanaugh
Copy link
Member

We've created downlevel-dts, which is as far as we intend to go in this space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants