apidoc-plugin-ts
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -49,3 +49,5 @@ "use strict"; | ||
var descriptionPrefix = inttype ? inttype + " > " : ''; | ||
var description = descriptionPrefix + (prop.getDocumentationComment() || prop.getName()); | ||
var propDocNode = prop.getDocNodes()[0]; | ||
var propComment = propDocNode ? propDocNode.getComment() : prop.getName(); | ||
var description = descriptionPrefix + propComment; | ||
var propType = prop.getType().getText(); | ||
@@ -58,3 +60,3 @@ var propLabel = propType; | ||
} | ||
newElements.push(getParam("{" + capitalize(propLabel) + "} " + typeDef + " " + description)); | ||
newElements.push(getParam("{" + capitalize(propLabel) + "} " + typeDef + " " + description, values.element)); | ||
if (propTypeIsObject) { | ||
@@ -100,8 +102,9 @@ var typeInterface = getInterface(filename, propType.replace('[]', '')); | ||
} | ||
function getParam(param) { | ||
function getParam(param, type) { | ||
if (type === void 0) { type = 'apiSuccess'; } | ||
return { | ||
content: param + "\n", | ||
name: 'apisuccess', | ||
source: "@apiSuccess " + param + "\n", | ||
sourceName: 'apiSuccess', | ||
name: type.toLowerCase(), | ||
source: "@" + type + " " + param + "\n", | ||
sourceName: type, | ||
}; | ||
@@ -108,0 +111,0 @@ } |
{ | ||
"name": "apidoc-plugin-ts", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A plugin for apidoc leveraging TypeScript interfaces.", | ||
@@ -39,5 +39,5 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/chai": "^4.0.4", | ||
"@types/chai": "^4.0.10", | ||
"@types/mocha": "^2.2.44", | ||
"@types/node": "^8.0.47", | ||
"@types/node": "^8.5.1", | ||
"apidoc": "^0.17.6", | ||
@@ -47,8 +47,8 @@ "chai": "^4.1.2", | ||
"mocha": "^4.0.1", | ||
"ts-node": "^3.3.0", | ||
"ts-node": "^4.0.1", | ||
"tslint": "^5.8.0" | ||
}, | ||
"dependencies": { | ||
"ts-simple-ast": "0.81.0", | ||
"typescript": "2.6.1" | ||
"ts-simple-ast": "3.2.0", | ||
"typescript": "2.6.2" | ||
}, | ||
@@ -55,0 +55,0 @@ "greenkeeper": { |
@@ -19,3 +19,3 @@ # apidoc-plugin-ts | ||
```javascript | ||
@apiInterface (optional path) {INTERFACE_NAME} | ||
@apiInterface (optional path) {INTERFACE_NAME} REPLACE-API-PARAM | ||
``` | ||
@@ -57,9 +57,8 @@ | ||
@apiSuccess {String} personalDetails.name | ||
@apiSuccess {Number} personalDetails.age | ||
@apiSuccess {Number} personalDetails.age | ||
``` | ||
*Note if the Person interface is defined in the same file then drop the path:* | ||
## Notes | ||
```javascript | ||
@apiInterface {Person} | ||
``` | ||
* If the Person interface is defined in the same file then drop the path e.g ```@apiInterface {Person}```. | ||
* REPLACE-API-PARAM is optional and defaults to apiSuccess. |
9212
119
63
+ Addedcode-block-writer@6.14.0(transitive)
+ Addedts-simple-ast@3.2.0(transitive)
+ Addedtypescript@2.6.2(transitive)
- Removedcode-block-writer@4.2.1(transitive)
- Removedts-simple-ast@0.81.0(transitive)
- Removedtypescript@2.6.1(transitive)
Updatedts-simple-ast@3.2.0
Updatedtypescript@2.6.2