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

Down-level type definitions #41

Merged
merged 15 commits into from
Nov 22, 2019
Merged

Conversation

MattiasBuelens
Copy link
Owner

This adds a new build step that takes the bundled type definitions generated by TypeScript and API Extractor, and "down-levels" them to be compatible with older versions of TypeScript. This allows us to compile with the latest and greatest version of TypeScript, while still preserving backwards compatibility.

The implementation was adapted from sandersn/downlevel-dts, which already handled converting get/set accessors to regular properties for TypeScript 3.5 and below. I've added an extra step to convert lib references for es2018.asynciterable to esnext.asynciterable for TypeScript 3.3 and below, to avoid regressing on #39.

By default, users will get the down-leveled type definitions from dist/types/polyfill.d.ts. If they are on TypeScript 3.6 or above, they will get the unmodified type definitions from dist/types/ts3.6/polyfill.d.ts using typesVersions.

@MattiasBuelens MattiasBuelens added this to the v2.0.7 milestone Nov 22, 2019
@MattiasBuelens MattiasBuelens merged commit 6e7c193 into master Nov 22, 2019
@MattiasBuelens MattiasBuelens deleted the downlevel-type-definitions branch November 22, 2019 19:07
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.

1 participant