mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 12:15:34 -06:00
Declaration comments for accessors in .d.ts
This commit is contained in:
parent
83ea28cf39
commit
758fc937e4
@ -2041,8 +2041,10 @@ module ts {
|
||||
}
|
||||
|
||||
function writeJsDocComments(declaration: Declaration) {
|
||||
var jsDocComments = getJsDocComments(declaration, currentSourceFile);
|
||||
emitComments(jsDocComments, writer, writeCommentRange);
|
||||
if (declaration) {
|
||||
var jsDocComments = getJsDocComments(declaration, currentSourceFile);
|
||||
emitComments(jsDocComments, writer, writeCommentRange);
|
||||
}
|
||||
}
|
||||
|
||||
function emitSourceTextOfNode(node: Node) {
|
||||
@ -2459,6 +2461,8 @@ module ts {
|
||||
function emitAccessorDeclaration(node: AccessorDeclaration) {
|
||||
var accessors = getAllAccessorDeclarations(<ClassDeclaration>node.parent, node);
|
||||
if (node === accessors.firstAccessor) {
|
||||
emitJsDocComments(accessors.getAccessor);
|
||||
emitJsDocComments(accessors.setAccessor);
|
||||
emitDeclarationFlags(node);
|
||||
emitSourceTextOfNode(node.name);
|
||||
if (!(node.flags & NodeFlags.Private)) {
|
||||
|
||||
@ -476,15 +476,21 @@ declare class c1 {
|
||||
/** p1 is property of c1*/
|
||||
p1: number;
|
||||
p2(b: number): number;
|
||||
/** getter property*/
|
||||
/** setter property*/
|
||||
p3: number;
|
||||
/** pp1 is property of c1*/
|
||||
private pp1;
|
||||
private pp2(b);
|
||||
/** getter property*/
|
||||
/** setter property*/
|
||||
private pp3;
|
||||
constructor();
|
||||
/** s1 is static property of c1*/
|
||||
static s1: number;
|
||||
static s2(b: number): number;
|
||||
/** static getter property*/
|
||||
/** setter property*/
|
||||
static s3: number;
|
||||
nc_p1: number;
|
||||
nc_p2(b: number): number;
|
||||
@ -507,14 +513,22 @@ declare class c1 {
|
||||
/** p1 is property of c1 */
|
||||
b_p1: number;
|
||||
b_p2(b: number): number;
|
||||
/** getter property */
|
||||
/** setter property */
|
||||
b_p3: number;
|
||||
/** pp1 is property of c1 */
|
||||
private b_pp1;
|
||||
private b_pp2(b);
|
||||
/** getter property */
|
||||
/** setter property */
|
||||
private b_pp3;
|
||||
/** s1 is static property of c1 */
|
||||
static b_s1: number;
|
||||
static b_s2(b: number): number;
|
||||
/** static getter property
|
||||
*/
|
||||
/** setter property
|
||||
*/
|
||||
static b_s3: number;
|
||||
}
|
||||
declare var i1: c1;
|
||||
@ -537,8 +551,10 @@ declare var i1_s_ncprop: number;
|
||||
declare var i1_c: typeof c1;
|
||||
declare class cProperties {
|
||||
private val;
|
||||
/** getter only property*/
|
||||
p1: number;
|
||||
nc_p1: number;
|
||||
/**setter only property*/
|
||||
p2: number;
|
||||
nc_p2: number;
|
||||
}
|
||||
|
||||
@ -309,6 +309,7 @@ declare class c2 {
|
||||
/** c2 c2_p1*/
|
||||
c2_p1: number;
|
||||
c2_f1(): void;
|
||||
/** c2 c2_prop*/
|
||||
c2_prop: number;
|
||||
c2_nc_p1: number;
|
||||
c2_nc_f1(): void;
|
||||
@ -316,6 +317,7 @@ declare class c2 {
|
||||
/** c2 p1*/
|
||||
p1: number;
|
||||
f1(): void;
|
||||
/** c2 prop*/
|
||||
prop: number;
|
||||
nc_p1: number;
|
||||
nc_f1(): void;
|
||||
@ -327,6 +329,7 @@ declare class c3 extends c2 {
|
||||
/** c3 p1*/
|
||||
p1: number;
|
||||
f1(): void;
|
||||
/** c3 prop*/
|
||||
prop: number;
|
||||
nc_p1: number;
|
||||
nc_f1(): void;
|
||||
|
||||
@ -157,6 +157,8 @@ declare class c {
|
||||
/** property comment */
|
||||
b: number;
|
||||
myFoo(): number;
|
||||
/** getter comment*/
|
||||
/** setter comment*/
|
||||
prop1: number;
|
||||
foo1(a: number): string;
|
||||
foo1(b: string): string;
|
||||
|
||||
@ -271,8 +271,14 @@ var c2 = (function () {
|
||||
//// [declFileAccessors_0.d.ts]
|
||||
/** This is comment for c1*/
|
||||
export declare class c1 {
|
||||
/** getter property*/
|
||||
/** setter property*/
|
||||
p3: number;
|
||||
/** private getter property*/
|
||||
/** private setter property*/
|
||||
private pp3;
|
||||
/** static getter property*/
|
||||
/** setter property*/
|
||||
static s3: number;
|
||||
nc_p3: number;
|
||||
private nc_pp3;
|
||||
@ -283,8 +289,14 @@ export declare class c1 {
|
||||
//// [declFileAccessors_1.d.ts]
|
||||
/** This is comment for c2 - the global class*/
|
||||
declare class c2 {
|
||||
/** getter property*/
|
||||
/** setter property*/
|
||||
p3: number;
|
||||
/** private getter property*/
|
||||
/** private setter property*/
|
||||
private pp3;
|
||||
/** static getter property*/
|
||||
/** setter property*/
|
||||
static s3: number;
|
||||
nc_p3: number;
|
||||
private nc_pp3;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user