<commit_before>import {DocCollection, Processor} from 'dgeni';
import {BaseApiDoc} from 'dgeni-packages/typescript/api-doc-types/ApiDoc';
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
import {getDocsPublicTag, isPublicDoc} from '../common/private-docs';

/**
 * Processor to filter out symbols that should not be shown in the Material docs.
 */
export class DocsPrivateFilter implements Processor {
  name = 'docs-private-filter';
  $runBefore = ['categorizer'];
  $runAfter = ['mergeInheritedProperties'];

  $process(docs: DocCollection) {
    return docs.filter(doc => {
      const isPublic = isPublicDoc(doc);

      // Update the API document name in case the "@docs-public" tag is used
      // with an alias name.
      if (isPublic && doc instanceof BaseApiDoc) {
        const docsPublicTag = getDocsPublicTag(doc);
        if (docsPublicTag !== undefined && docsPublicTag.description) {
          doc.name = docsPublicTag.description;
        }
      }

      // Filter out private class members which could be annotated
      // with the "@docs-private" tag.
      if (isPublic && doc instanceof ClassExportDoc) {
        doc.members = doc.members.filter(isPublicDoc);
        doc.statics = doc.statics.filter(isPublicDoc);
      }

      return isPublic;
    });
  }
}
<commit_msg>build: filter out docs private members from interfaces (#22831)<commit_after>import {DocCollection, Processor} from 'dgeni';
import {BaseApiDoc} from 'dgeni-packages/typescript/api-doc-types/ApiDoc';
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
import {InterfaceExportDoc} from 'dgeni-packages/typescript/api-doc-types/InterfaceExportDoc';
import {getDocsPublicTag, isPublicDoc} from '../common/private-docs';

/**
 * Processor to filter out symbols that should not be shown in the Material docs.
 */
export class DocsPrivateFilter implements Processor {
  name = 'docs-private-filter';
  $runBefore = ['categorizer'];
  $runAfter = ['mergeInheritedProperties'];

  $process(docs: DocCollection) {
    const publicDocs = docs.filter(isPublicDoc);

    publicDocs.forEach(doc => {
      // Update the API document name in case the "@docs-public" tag is used
      // with an alias name.
      if (doc instanceof BaseApiDoc) {
        const docsPublicTag = getDocsPublicTag(doc);
        if (docsPublicTag !== undefined && docsPublicTag.description) {
          doc.name = docsPublicTag.description;
        }
      }

      if (doc instanceof InterfaceExportDoc) {
        doc.members = doc.members.filter(isPublicDoc);
      }

      // Filter out private class members which could be annotated
      // with the "@docs-private" tag.
      if (doc instanceof ClassExportDoc) {
        doc.members = doc.members.filter(isPublicDoc);
        doc.statics = doc.statics.filter(isPublicDoc);
      }
    });

    return publicDocs;
  }
}

{'fraction_non_alphanumeric': 0.11237113402061856, 'fraction_numerical': 0.001718213058419244, 'mean_word_length': 3.3189910979228485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4660717', 'n_tokens_mistral': 862, 'n_tokens_neox': 832, 'n_words': 223}