OutputScope
A container of symbols accessible within some scope in your output code.
Members
Section titled “Members”| __v_skip | boolean | |
| [inspect.custom] | () => string | |
| constructor | (name: string, parentScope: OutputScope | undefined, options: OutputScopeOptions) | Subclasses must forward all three positional arguments to super. See createScope for the preferred instantiation path. |
| binder | Binder | undefined | The binder that created this scope. |
| children | Set<OutputScope> | The scopes nested within this scope. |
| debugInfo | Record<string, unknown> | |
| declarationSpaces | Readonly<string[]> | The declaration space keys for this scope type. Subclasses override this to declare which declaration spaces are created on construction (e.g., ["types", "values"]). |
| id | number | The unique id of this scope. |
| isMemberScope | boolean | Check if this is scope is a member scope. Member scopes have no member spaces of their own, but instead put members of their owner symbol in scope. |
| isTransient | boolean | Whether this scope is a transient scope. Transient scopes are used for temporary values that are to be combined with other non-transient symbols. Scopes are transient when their owner symbol is transient. |
| metadata | Record<string, unknown> | Arbitrary metadata associated with this scope. This property is not reactive but the metadata object is a reactive object. |
| name | string | The name of the scope. |
| ownerSymbol | OutputSymbol | undefined | The symbol whose members are in scope. When an owner symbol is present, this scope is considered a member scope, and does not provide its own declaration spaces. |
| parent | OutputScope | undefined | The parent scope of this scope. Undefined if this is a root scope. |
| spaceFor | (key: string) => OutputSpace | undefined | Get the declaration space for the given key (e.g., "types", "values"). Returns undefined when no space with that key exists on this scope. |
| spaces | OutputDeclarationSpace[] | Get all the declaration spaces in this scope. |
| toString | () => string |
Remarks
Section titled “Remarks”Scopes form a tree. All scopes except the global scope have a parent scope
identified by parent. Scopes can have nested scopes which can be accessed
using the children property. Whether a child scope can be accessed from
the parent scope is determined by each language’s scoping rules.
This interface is the base implementation of scope. Generally, most languages will have subtypes of this interface that provide additional metadata about the scope. For example, TypeScript scopes need to track whether the scope represents a package, module, class, function, etc.
Scopes are reactive values, which allows you to observe changes to the scope within a reactive context.