MemberScope
Declare a member scope, which is a lexical scope whose symbols are provided by the owner symbol.
Overload 1
Section titled “Overload 1”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>
import { MemberScope } from "@alloy-js/core/stc";
MemberScope({ value: OutputScope }).children(children)
children | optionalChildren |
value | Scope context interface The scope to use. If not provided, a new scope will be created. |
Overload 2
Section titled “Overload 2”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>
import { MemberScope } from "@alloy-js/core/stc";
MemberScope({ metadata: Record<string, unknown>, name: string, ownerSymbol: OutputSymbol,}).children(children)
children | optionalChildren |
metadata | optionalRecord<string, unknown> Additional metadata for the scope. |
name | optionalstring The name of this scope. |
ownerSymbol | MemberDeclaration context interface The symbol whose members provide the symbols for this scope. |
Remarks
Section titled “Remarks”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.