diff --git a/CHANGELOG.md b/CHANGELOG.md index f897db7..c5040f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +# v0.8.6 +New features in this release: + - You can ignore private members by default by adding the property "ignorePrivateMembers" + to the jsconfig.json + # v0.8.3 Bugfixes: - Not all supported items were added to their parent member diff --git a/README.md b/README.md index 6b9e09a..adc7b05 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ $> jsdoc -d /.d.ts **Important: If you want to change the file name of the result file your path has to end with the file ending ```d.ts```** ## Options +* **ignorePrivateMembers** Determines if private members should be omitted or not * **ignoreScopes** Array with scope names which should not be parsed. Possible values ``` [ @@ -75,6 +76,7 @@ module.exports = function(taggedVersion, latestVersion) { * @interface * @since * @module (function and variable declarations) +* @private (not completed yet) ## Ignored Tags * @file diff --git a/package.json b/package.json index 63b3646..89c5240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@otris/jsdoc-tsd", - "version": "0.8.5", + "version": "0.8.6", "description": "JSDoc Template for generate typescript definition files from JSDoc comments", "main": "src-out/core/publish.js", "repository": { diff --git a/src/core/jsdoc-tsd-parser.ts b/src/core/jsdoc-tsd-parser.ts index c8f4942..0057ee3 100644 --- a/src/core/jsdoc-tsd-parser.ts +++ b/src/core/jsdoc-tsd-parser.ts @@ -29,6 +29,10 @@ export class JSDocTsdParser { this.config.ignoreScopes = []; } + if (typeof this.config.ignorePrivateMembers === "undefined") { + this.config.ignorePrivateMembers = false; + } + if (typeof this.config.versionComparator !== "function" && (typeof this.config.versionComparator !== "string" || this.config.versionComparator === "")) { this.config.versionComparator = (taggedVersion: string, latestVersion: string): boolean => { if (taggedVersion.match(/v?([0-9]+\.){2}[0-9]+/i)) { @@ -96,7 +100,7 @@ export class JSDocTsdParser { jsdocItems.forEach((item) => { if (!this.evaluateSinceTag(item.since)) { this.rejectedItems.push(item.longname); - } else if (!item.ignore && this.config.ignoreScopes.indexOf(item.scope) === -1 && (!item.access || item.access !== "private")) { + } else if (!item.ignore && this.config.ignoreScopes.indexOf(item.scope) === -1 && !(this.config.ignorePrivateMembers && item.access === "private")) { let addItem = true; let addJsDocComment = true; let parsedItem: dom.DeclarationBase = {}; @@ -188,9 +192,6 @@ export class JSDocTsdParser { let domTopLevelDeclarations: { [key: string]: dom.TopLevelDeclaration } = {}; for (let jsdocItem of this.jsdocItems) { - if (jsdocItem.longname === "lcmContractTermHelper.ContractTermReminderConfiguration") { - let a = 0; - } let parentItem = this.findParentItem(jsdocItem, domTopLevelDeclarations); if (parentItem) {