diff --git a/plugins/org.eclipse.n4js.transpiler.dts/src/org/eclipse/n4js/transpiler/dts/print/PrettyPrinterDts.java b/plugins/org.eclipse.n4js.transpiler.dts/src/org/eclipse/n4js/transpiler/dts/print/PrettyPrinterDts.java index a98e46467b..2bc5c6a22d 100644 --- a/plugins/org.eclipse.n4js.transpiler.dts/src/org/eclipse/n4js/transpiler/dts/print/PrettyPrinterDts.java +++ b/plugins/org.eclipse.n4js.transpiler.dts/src/org/eclipse/n4js/transpiler/dts/print/PrettyPrinterDts.java @@ -218,11 +218,17 @@ public Boolean caseImportDeclaration(ImportDeclaration original) { if (original.getModuleSpecifierForm() != ModuleSpecifierForm.PROJECT && Strings.isNullOrEmpty(URIUtils.fileExtension(URIUtils.toFileUri(moduleSpecifier)))) { - moduleSpecifier += "." + N4JSGlobals.DTS_FILE_EXTENSION; + + String extension = original.isBare() ? N4JSGlobals.JS_FILE_EXTENSION : N4JSGlobals.DTS_FILE_EXTENSION; + moduleSpecifier += "." + extension; } processAnnotations(original.getAnnotations()); - write("import type "); + write("import "); + if (!original.isBare()) { + write("type "); + } + // 1) import specifiers List importSpecifiers = new ArrayList<>(original.getImportSpecifiers()); if (!importSpecifiers.isEmpty() && importSpecifiers.get(0) instanceof DefaultImportSpecifier) {