mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
emit import declarations without import clause in .d.ts files
This commit is contained in:
@@ -698,10 +698,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function writeImportDeclaration(node: ImportDeclaration) {
|
||||
if (!node.importClause && !(node.flags & NodeFlags.Export)) {
|
||||
// do not write non-exported import declarations that don't have import clauses
|
||||
return;
|
||||
}
|
||||
emitJsDocComments(node);
|
||||
if (node.flags & NodeFlags.Export) {
|
||||
write("export ");
|
||||
|
||||
@@ -17,3 +17,4 @@ import "es6ImportWithoutFromClause_0";
|
||||
//// [es6ImportWithoutFromClause_0.d.ts]
|
||||
export declare var a: number;
|
||||
//// [es6ImportWithoutFromClause_1.d.ts]
|
||||
import "es6ImportWithoutFromClause_0";
|
||||
|
||||
@@ -36,3 +36,5 @@ export declare var a: number;
|
||||
//// [es6ImportWithoutFromClauseAmd_1.d.ts]
|
||||
export declare var b: number;
|
||||
//// [es6ImportWithoutFromClauseAmd_2.d.ts]
|
||||
import "es6ImportWithoutFromClauseAmd_0";
|
||||
import "es6ImportWithoutFromClauseAmd_2";
|
||||
|
||||
@@ -18,3 +18,4 @@ require("es6ImportWithoutFromClauseInEs5_0");
|
||||
//// [es6ImportWithoutFromClauseInEs5_0.d.ts]
|
||||
export declare var a: number;
|
||||
//// [es6ImportWithoutFromClauseInEs5_1.d.ts]
|
||||
import "es6ImportWithoutFromClauseInEs5_0";
|
||||
|
||||
@@ -17,3 +17,4 @@ import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
export interface i {
|
||||
}
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_1.d.ts]
|
||||
import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
|
||||
@@ -73,3 +73,5 @@ declare module "./observable" {
|
||||
}
|
||||
export {};
|
||||
//// [main.d.ts]
|
||||
import "./map1";
|
||||
import "./map2";
|
||||
|
||||
@@ -66,3 +66,4 @@ declare module "./observable" {
|
||||
}
|
||||
export {};
|
||||
//// [main.d.ts]
|
||||
import "./map";
|
||||
|
||||
@@ -71,3 +71,4 @@ declare module "./observable" {
|
||||
}
|
||||
export {};
|
||||
//// [main.d.ts]
|
||||
import "./map";
|
||||
|
||||
@@ -63,3 +63,4 @@ declare module "observable" {
|
||||
export {};
|
||||
//// [main.d.ts]
|
||||
/// <reference path="observable.d.ts" />
|
||||
import "./map";
|
||||
|
||||
@@ -50,3 +50,4 @@ declare global {
|
||||
}
|
||||
export {};
|
||||
//// [f3.d.ts]
|
||||
import "./f2";
|
||||
|
||||
@@ -45,3 +45,5 @@ declare global {
|
||||
export { };
|
||||
export {};
|
||||
//// [f3.d.ts]
|
||||
import "./f1";
|
||||
import "./f2";
|
||||
|
||||
@@ -32,3 +32,5 @@ require("B");
|
||||
//// [f3.d.ts]
|
||||
/// <reference path="f1.d.ts" />
|
||||
/// <reference path="f2.d.ts" />
|
||||
import "A";
|
||||
import "B";
|
||||
|
||||
@@ -69,3 +69,4 @@ declare module "./f1" {
|
||||
}
|
||||
}
|
||||
//// [f4.d.ts]
|
||||
import "./f3";
|
||||
|
||||
@@ -74,3 +74,4 @@ export declare class B {
|
||||
n: number;
|
||||
}
|
||||
//// [f4.d.ts]
|
||||
import "./f3";
|
||||
|
||||
@@ -72,3 +72,4 @@ export declare class B {
|
||||
n: number;
|
||||
}
|
||||
//// [f4.d.ts]
|
||||
import "./f3";
|
||||
|
||||
@@ -76,3 +76,4 @@ export declare class B {
|
||||
n: number;
|
||||
}
|
||||
//// [f4.d.ts]
|
||||
import "./f3";
|
||||
|
||||
@@ -95,3 +95,4 @@ declare module "./f1" {
|
||||
}
|
||||
}
|
||||
//// [f4.d.ts]
|
||||
import "./f3";
|
||||
|
||||
@@ -33,3 +33,4 @@ var y = x.getA().x;
|
||||
|
||||
//// [f.d.ts]
|
||||
/// <reference path="array.d.ts" />
|
||||
import "array";
|
||||
|
||||
@@ -139,4 +139,6 @@ declare module "m4" {
|
||||
}
|
||||
}
|
||||
declare module "test" {
|
||||
import "m2";
|
||||
import "m4";
|
||||
}
|
||||
|
||||
@@ -101,4 +101,5 @@ declare module "d" {
|
||||
}
|
||||
}
|
||||
declare module "main" {
|
||||
import "d";
|
||||
}
|
||||
|
||||
@@ -111,4 +111,6 @@ declare module "e" {
|
||||
}
|
||||
}
|
||||
declare module "main" {
|
||||
import "d";
|
||||
import "e";
|
||||
}
|
||||
|
||||
@@ -98,4 +98,6 @@ declare module "e" {
|
||||
}
|
||||
}
|
||||
declare module "main" {
|
||||
import "D";
|
||||
import "e";
|
||||
}
|
||||
|
||||
@@ -87,4 +87,6 @@ declare module "b" {
|
||||
}
|
||||
}
|
||||
declare module "main" {
|
||||
import "D";
|
||||
import "E";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user