How to use the @microsoft/api-extractor-model.ApiItemKind.Class function in @microsoft/api-extractor-model

To help you get started, we’ve selected a few @microsoft/api-extractor-model examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / packages / api-docs / src / PageJsonGenerator.tsx View on Github external
console.log('Writing ' + pageJsonPath);

      const pageData: PageData = collectedData.pageDataByPageName.get(pageName)!;

      const pageJson: IPageJson = { tables: [], name: pageName };
      for (const apiItem of pageData.apiItems) {
        switch (apiItem.kind) {
          case ApiItemKind.Interface: {
            pageJson.tables.push(createInterfacePageJson(collectedData, apiItem as ApiInterface));
            break;
          }
          case ApiItemKind.Enum: {
            pageJson.tables.push(createEnumPageJson(apiItem as ApiEnum));
            break;
          }
          case ApiItemKind.Class: {
            pageJson.tables.push(createClassPageJson(collectedData, apiItem as ApiClass));
            break;
          }
          case ApiItemKind.TypeAlias: {
            pageJson.tables.push(createTypeAliasPageJson(collectedData, apiItem as ApiTypeAlias));
            break;
          }
        }
      }

      if (value.kind === 'References') {
        referencesList.pages.push(value.pageName);
      }

      JsonFile.save(pageJson, pageJsonPath);
    }
github microsoft / rushstack / apps / api-documenter / src / documenters / YamlDocumenter.ts View on Github external
yamlItem.extends = [];
        for (const extendsType of apiItem.extendsTypes) {
          yamlItem.extends.push(this._linkToUidIfPossible(extendsType.excerpt.text));
        }
      }

      const typeParameters: IYamlParameter[] = this._populateYamlTypeParameters(apiItem);
      if (typeParameters.length) {
        yamlItem.syntax = { typeParameters };
      }
    }

    if (apiItem.tsdocComment) {
      if (apiItem.tsdocComment.modifierTagSet.isSealed()) {
        let sealedMessage: string;
        if (apiItem.kind === ApiItemKind.Class) {
          sealedMessage = 'This class is marked as `@sealed`. Subclasses should not extend it.';
        } else {
          sealedMessage = 'This interface is marked as `@sealed`. Other interfaces should not extend it.';
        }
        if (!yamlItem.remarks) {
          yamlItem.remarks = sealedMessage;
        } else {
          yamlItem.remarks = sealedMessage + '\n\n' + yamlItem.remarks;
        }
      }
    }
  }
github microsoft / rushstack / apps / api-documenter / src / documenters / MarkdownDocumenter.ts View on Github external
output.appendNode(
          new DocParagraph({ configuration }, [
            new DocEmphasisSpan({ configuration, bold: true}, [
              new DocPlainText({ configuration, text: 'Signature:' })
            ])
          ])
        );
        output.appendNode(
          new DocFencedCode({ configuration, code: apiItem.getExcerptWithModifiers(), language: 'typescript' })
        );
      }
    }

    let appendRemarks: boolean = true;
    switch (apiItem.kind) {
      case ApiItemKind.Class:
      case ApiItemKind.Interface:
      case ApiItemKind.Namespace:
      case ApiItemKind.Package:
        this._writeRemarksSection(output, apiItem);
        appendRemarks = false;
        break;
    }

    switch (apiItem.kind) {
      case ApiItemKind.Class:
        this._writeClassTables(output, apiItem as ApiClass);
        break;
      case ApiItemKind.Enum:
        this._writeEnumTables(output, apiItem as ApiEnum);
        break;
      case ApiItemKind.Interface:
github ifiokjr / remirror / @remirror / api-documenter / src / documenters / markdown-documenter.ts View on Github external
headerTitles: ['Type Alias', 'Description'],
    });

    const apiMembers: ReadonlyArray =
      apiContainer.kind === ApiItemKind.Package
        ? (apiContainer as ApiPackage).entryPoints[0].members
        : (apiContainer as ApiNamespace).members;

    for (const apiMember of apiMembers) {
      const row: DocTableRow = new DocTableRow({ configuration }, [
        this._createTitleCell(apiMember),
        this._createDescriptionCell(apiMember),
      ]);

      switch (apiMember.kind) {
        case ApiItemKind.Class:
          classesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Enum:
          enumerationsTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Interface:
          interfacesTable.addRow(row);
          this._writeApiItemPage(apiMember);
          break;

        case ApiItemKind.Namespace:
          namespacesTable.addRow(row);