dts-downlevel
v0.4.0
Published
Remove TS 2.1 syntax from .d.ts files for backwards compatibility with TS 1.8
Downloads
353
Readme
dts-downlevel
Remove TS 2.1 syntax from .d.ts files for backwards compatibility with TS 1.8
This utility modifies .d.ts files generated using TS 2.1. It removes any new syntax that is incompatible with TS 1.8.
This allows a library to be develped using TS 2.1, but consumed by an app that uses TS 1.8.
Get
npm i --save-dev dts-downlevel
Use
Command line use:
dts-downlevel [paths]
If [paths]
is omitted, all .d.ts files in the current directory and below are modified.
Example
dts-downlevel 'dist/**/*.d.ts' 'build/**/*.d.ts'
Rules
To see the rules that this utility currently supports, view the source code: https://github.com/christopherthielen/dts-downlevel/blob/master/rules.js