How to use the @microsoft/tsdoc/lib/beta/DeclarationReference.Navigation.Members function in @microsoft/tsdoc

To help you get started, we’ve selected a few @microsoft/tsdoc 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 microsoft / rushstack / apps / api-extractor-model / src / model / ApiCallSignature.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const parent: DeclarationReference = this.parent
      ? this.parent.canonicalReference
      // .withMeaning() requires some kind of component
      : DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');
    return parent
      .withMeaning(Meaning.CallSignature)
      .withOverloadIndex(this.overloadIndex);
  }
}
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiIndexSignature.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const parent: DeclarationReference = this.parent
      ? this.parent.canonicalReference
      // .withMeaning() requires some kind of component
      : DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');
    return parent
      .withMeaning(Meaning.IndexSignature)
      .withOverloadIndex(this.overloadIndex);
  }
}
github microsoft / rushstack / apps / api-extractor / src / generators / DeclarationReferenceGenerator.ts View on Github external
}

  // Next, try determining navigation to symbol by its node
  if (symbol.valueDeclaration) {
    const declaration: ts.Declaration = ts.isBindingElement(symbol.valueDeclaration)
      ? ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration)
      : symbol.valueDeclaration;
    if (ts.isClassElement(declaration) && ts.isClassLike(declaration.parent)) {
      // class members are an "export" if they have the static modifier.
      return ts.getCombinedModifierFlags(declaration) & ts.ModifierFlags.Static
        ? Navigation.Exports
        : Navigation.Members;
    }
    if (ts.isTypeElement(declaration) || ts.isObjectLiteralElement(declaration)) {
      // type and object literal element members are just members
      return Navigation.Members;
    }
    if (ts.isEnumMember(declaration)) {
      // enum members are exports
      return Navigation.Exports;
    }
    if (ts.isExportSpecifier(declaration)
      || ts.isExportAssignment(declaration)
      || ts.isExportSpecifier(declaration)
      || ts.isExportDeclaration(declaration)
      || ts.isNamedExports(declaration)
    ) {
      return Navigation.Exports;
    }
    // declarations are exports if they have an `export` modifier.
    if (ts.getCombinedModifierFlags(declaration) & ts.ModifierFlags.Export) {
      return Navigation.Exports;
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiConstructor.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const parent: DeclarationReference = this.parent
      ? this.parent.canonicalReference
      // .withMeaning() requires some kind of component
      : DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');
    return parent
      .withMeaning(Meaning.Constructor)
      .withOverloadIndex(this.overloadIndex);
  }
}
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiProperty.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const nameComponent: Component = DeclarationReference.parseComponent(this.name);
    return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
      .addNavigationStep(this.isStatic ? Navigation.Exports : Navigation.Members, nameComponent)
      .withMeaning(Meaning.Member);
  }
}
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiMethod.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const nameComponent: Component = DeclarationReference.parseComponent(this.name);
    return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
      .addNavigationStep(this.isStatic ? Navigation.Exports : Navigation.Members, nameComponent)
      .withMeaning(Meaning.Member)
      .withOverloadIndex(this.overloadIndex);
  }
}
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiPropertySignature.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const nameComponent: Component = DeclarationReference.parseComponent(this.name);
    return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
      .addNavigationStep(Navigation.Members, nameComponent)
      .withMeaning(Meaning.Member);
  }
}
github microsoft / rushstack / apps / api-extractor-model / src / model / ApiMethodSignature.ts View on Github external
public buildCanonicalReference(): DeclarationReference {
    const nameComponent: Component = DeclarationReference.parseComponent(this.name);
    return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
      .addNavigationStep(Navigation.Members, nameComponent)
      .withMeaning(Meaning.Member)
      .withOverloadIndex(this.overloadIndex);
  }
}