Skip to main content

Module scope

Module scope 

Source
Expand description

TypeScript type scope tracking with arena-based ownership.

Each scope maps type names to TypeIds — indices into the global type arena. Scopes form a tree via parent links, enabling JS-like scoping where child scopes shadow or extend parent scopes.

Scopes are stored in a flat arena (ScopeArena) and referenced by well-typed ScopeId indices.

Structs§

PendingImport
An unresolved import that needs to be resolved during import resolution. Stored in a side table on GlobalContext, not in the scope.
ScopeArena
Arena that owns all scopes. Scopes are created via create_root and create_child, and referenced by ScopeId.
ScopeId
Index into a ScopeArena. Lightweight, Copy, and well-typed.
TypeScope
A single level of type scope.