Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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;
}
if (ts.isSourceFile(declaration.parent) && !ts.isExternalModule(declaration.parent)) {
// declarations in a source file are global if the source file is not a module.
return 'global';
}
}
// all other declarations are locals
return Navigation.Locals;
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Namespace);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Member);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.TypeAlias);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Variable);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Function)
.withOverloadIndex(this.overloadIndex);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Enum);
}
}
public buildCanonicalReference(): DeclarationReference {
const nameComponent: Component = DeclarationReference.parseComponent(this.name);
return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
.addNavigationStep(Navigation.Exports, nameComponent)
.withMeaning(Meaning.Class);
}
}