diff --git a/README.md b/README.md index 997aa1617..ca225f4f9 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ in order to change the behaviour of TypeDoc. Prevent externally resolved TypeScript files from being documented. * `--excludePrivate`
Prevent private members from being included in the generated documentation. +* `--excludeProtected`
+ Prevent protected members from being included in the generated documentation. #### TypeScript compiler * `--module `
diff --git a/src/lib/converter/converter.ts b/src/lib/converter/converter.ts index 7fd642260..625c2f7f3 100644 --- a/src/lib/converter/converter.ts +++ b/src/lib/converter/converter.ts @@ -74,6 +74,13 @@ export class Converter extends ChildableComponent}; diff --git a/src/lib/converter/nodes/class.ts b/src/lib/converter/nodes/class.ts index 30a092f99..66d13be6f 100644 --- a/src/lib/converter/nodes/class.ts +++ b/src/lib/converter/nodes/class.ts @@ -40,7 +40,9 @@ export class ClassConverter extends ConverterNodeComponent node.members.forEach((member) => { const modifiers = ts.getCombinedModifierFlags(member); const privateMember = (modifiers & ts.ModifierFlags.Private) > 0; - const exclude = context.converter.excludePrivate ? privateMember : false; + const protectedMember = (modifiers & ts.ModifierFlags.Protected) > 0; + const exclude = (context.converter.excludePrivate && privateMember) + || (context.converter.excludeProtected && protectedMember); if (!exclude) { this.owner.convertNode(context, member); diff --git a/src/lib/converter/nodes/constructor.ts b/src/lib/converter/nodes/constructor.ts index 06f931301..341926b6f 100644 --- a/src/lib/converter/nodes/constructor.ts +++ b/src/lib/converter/nodes/constructor.ts @@ -73,6 +73,11 @@ export class ConstructorConverter extends ConverterNodeComponentSource file handling Prevent externally resolved TypeScript files from being documented.
  • --excludePrivate
    Prevent private members from being included in the generated documentation.
  • +
  • --excludeProtected
    + Prevent protected members from being included in the generated documentation.
  • TypeScript compiler