Skip to content

MemberScope

Declare a member scope, which is a lexical scope whose symbols are provided by the owner symbol.

Declare a member scope by providing an already created scope. The scope is exposed via Scope context.

import { MemberScope } from "@alloy-js/core";
<MemberScope value={OutputScope}>
{children}
</MemberScope>
childrenoptionalChildren
valueScope context interface

The scope to use. If not provided, a new scope will be created.

Create a member scope by providing a name and optional metadata.

import { MemberScope } from "@alloy-js/core";
<MemberScope
metadata={Record<string, unknown>}
name="string"
ownerSymbol={OutputSymbol}
>
{children}
</MemberScope>
childrenoptionalChildren
metadataoptionalRecord<string, unknown>

Additional metadata for the scope.

nameoptionalstring

The name of this scope.

ownerSymbolMemberDeclaration context interface

The symbol whose members provide the symbols for this scope.

This is used to create members of a symbol, e.g. for class members and the like. In some languages, this scope may provide symbols which are can be referenced lexically, but in other languages, these members may not be in scope and instead must be referenced via the owner symbol itself.