Skip to content

Commit 5f8f184

Browse files
committed
Declaration comments for the interface declaration in .d.ts
1 parent 84dc3ff commit 5f8f184

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

src/compiler/emitter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,6 +2360,7 @@ module ts {
23602360

23612361
function emitInterfaceDeclaration(node: InterfaceDeclaration) {
23622362
if (resolver.isDeclarationVisible(node)) {
2363+
emitJsDocComments(node);
23632364
emitDeclarationFlags(node);
23642365
write("interface ");
23652366
emitSourceTextOfNode(node.name);

tests/baselines/reference/commentsInheritance.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ i2_i = i3_i;
268268

269269

270270
//// [commentsInheritance.d.ts]
271+
/** i1 is interface with properties*/
271272
interface i1 {
272273
i1_p1: number;
273274
i1_f1(): void;

tests/baselines/reference/commentsInterface.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ i3_i.nc_l(10);
104104

105105

106106
//// [commentsInterface.d.ts]
107+
/** this is interface 1*/
107108
interface i1 {
108109
}
109110
declare var i1_i: i1;
110111
interface nc_i1 {
111112
}
112113
declare var nc_i1_i: nc_i1;
114+
/** this is interface 2 with memebers*/
113115
interface i2 {
114116
x: number;
115117
foo: (b: number) => string;

tests/baselines/reference/commentsemitComments.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ declare class c {
159159
foo1(b: string): string;
160160
}
161161
declare var i: c;
162+
/** interface comments*/
162163
interface i1 {
163164
(a: number): number;
164165
new (b: string): any;

0 commit comments

Comments
 (0)