downlevel-dts
Advanced tools
Comparing version 0.10.0 to 0.10.1
16
index.js
@@ -75,3 +75,2 @@ #!/usr/bin/env node | ||
return ts.factory.createFunctionDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -99,3 +98,2 @@ n.asteriskToken, | ||
ts.factory.createPropertyDeclaration( | ||
n.decorators, | ||
modifiers, | ||
@@ -117,3 +115,2 @@ n.name, | ||
ts.factory.createPropertyDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -143,3 +140,2 @@ n.name, | ||
return ts.factory.createPropertyDeclaration( | ||
n.decorators, | ||
modifiers, | ||
@@ -165,3 +161,2 @@ ts.factory.createStringLiteral(parentName + ".#private"), | ||
ts.factory.createImportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -175,3 +170,2 @@ ts.factory.createImportClause(false, /*name*/ undefined, ts.factory.createNamespaceImport(tempName)), | ||
undefined, | ||
undefined, | ||
false, | ||
@@ -183,3 +177,3 @@ ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, tempName, n.exportClause.name)]) | ||
} else if (semver.lt(targetVersion, "3.8.0") && ts.isExportDeclaration(n) && n.isTypeOnly) { | ||
return ts.factory.createExportDeclaration(n.decorators, n.modifiers, false, n.exportClause, n.moduleSpecifier); | ||
return ts.factory.createExportDeclaration(n.modifiers, false, n.exportClause, n.moduleSpecifier); | ||
} else if (semver.lt(targetVersion, "3.8.0") && ts.isImportClause(n) && n.isTypeOnly) { | ||
@@ -206,3 +200,2 @@ return ts.factory.createImportClause(false, n.name, n.namedBindings); | ||
ts.factory.createImportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -237,3 +230,2 @@ ts.factory.createImportClause( | ||
ts.factory.createImportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -243,3 +235,3 @@ ts.factory.createImportClause( | ||
n.importClause.name, | ||
ts.createNamedImports( | ||
ts.factory.createNamedImports( | ||
typeElements.map(e => ts.factory.createImportSpecifier(false, e.propertyName, e.name)) | ||
@@ -265,3 +257,2 @@ ) | ||
ts.factory.createImportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -299,3 +290,2 @@ ts.factory.createImportClause( | ||
ts.factory.createExportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -329,3 +319,2 @@ false, | ||
ts.factory.createExportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -358,3 +347,2 @@ true, | ||
ts.factory.createExportDeclaration( | ||
n.decorators, | ||
n.modifiers, | ||
@@ -361,0 +349,0 @@ false, |
{ | ||
"name": "downlevel-dts", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Convert d.ts to be compatible with older typescript compilers", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/sandersn/downlevel-dts", |
@@ -297,2 +297,26 @@ downlevel-dts rewrites .d.ts files created by any version of TypeScript so | ||
### `in out T` (4.7) | ||
Typescript 4.7 supports variance annotations on type parameter declarations: | ||
```ts | ||
interface State<in out T> { | ||
get: () => T; | ||
set: (value: T) => void; | ||
} | ||
``` | ||
becomes: | ||
```ts | ||
interface State<T> { | ||
get: () => T; | ||
set: (value: T) => void; | ||
} | ||
``` | ||
#### Semantics | ||
The downlevel .d.ts omits the variance annotations, which will change the variance in the cases where they were added because the compiler gets it wrong. | ||
## Target | ||
@@ -299,0 +323,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67422
347
2029