CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.0.1-dev (changelog, source)
Search

Class LocalNamespaceName

The local name for a namespace in a particular scope.

Namespace declarations and imports can give rise to local namespace names. For example, the following declarations declare two local namespace names, A and B:

import A from './A';
namespace B {}

It is possible for a namespace to have multiple aliases; each alias corresponds to a distinct local namespace name. For example, there are three distinct local namespace names for A in this example:

namespace A {}
namespace Q {
  import B = A;
  import C = A;
}

There is one local namespace name for the declaration of A and one for each import.

Import path

import javascript

Direct supertypes

Indirect supertypes

Predicates

getADeclaration

Gets a declaration of this namespace name.

getAMemberAccess

Gets an access to a type member of this namespace alias, such as http.ServerRequest where http is a reference to this namespace.

getATypeAccess

Gets a use of this namespace name in a type annotation.

getAnAccess

Gets an identifier that refers to this namespace name.

getAnExportAccess

Gets a use of this namespace in an export.

getDeclarationSpace

Gets the declaration space this name belongs to.

getFirstDeclaration

Gets the first declaration of this namespace name.

getName

Gets the local name of this namespace.

getNamespace

Gets the canonical name of the namespace referenced by this name.

getScope

Gets the scope this namespace name is declared in.

toString

Gets a textual representation of this element.