mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 17:28:18 +00:00
Improve d.ts comments generation
- Remove " - " after @param paramname, and @return because it is useless. - Improve alignement of multiline param comments.
This commit is contained in:
parent
af41e9919f
commit
a5fde63486
3 changed files with 4320 additions and 4299 deletions
|
@ -121,7 +121,15 @@ var TypeScriptDocGenerator = (function () {
|
|||
if ((p.default != null) && (p.default !== "")) {
|
||||
def = " - Default: " + p.default;
|
||||
}
|
||||
comments.push("@param " + p.name + " - " + p.description + def);
|
||||
var paramComments = p.description.split("\n");
|
||||
for (var k = 0; k < paramComments.length; k++) {
|
||||
if (k === 0) {
|
||||
comments.push("@param " + p.name + " " + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
|
||||
}
|
||||
else {
|
||||
comments.push(this.repeatSpaces(("@param " + p.name + " ").length) + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
|
@ -149,10 +157,23 @@ var TypeScriptDocGenerator = (function () {
|
|||
if ((p.default != null) && (p.default !== "")) {
|
||||
def = " - Default: " + p.default;
|
||||
}
|
||||
comments.push("@param " + p.name + " - " + p.description + def);
|
||||
|
||||
var paramComments = p.description.split("\n");
|
||||
for (var k = 0; k < paramComments.length; k++)
|
||||
{
|
||||
if (k === 0)
|
||||
{
|
||||
comments.push("@param " + p.name + " " + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
|
||||
}
|
||||
else
|
||||
{
|
||||
comments.push(this.repeatSpaces(("@param " + p.name + " ").length) + paramComments[k].trim() + ((k === paramComments.length - 1) ? def : ""));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (f.returns != null) {
|
||||
comments.push("@return - " + f.returns.description);
|
||||
comments.push("@return " + f.returns.description);
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
|
|
7676
typescript/phaser.comments.d.ts
vendored
7676
typescript/phaser.comments.d.ts
vendored
File diff suppressed because it is too large
Load diff
916
typescript/pixi.comments.d.ts
vendored
916
typescript/pixi.comments.d.ts
vendored
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue