Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
}
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);
}
}
}
// 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;
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}