Skip to content

symbolForRefkey

Get a ref to the symbol for the given refkey using the current binder. The value of the ref will be undefined when no symbol with that refkey has been created.

import { symbolForRefkey } from "@alloy-js/core";
function symbolForRefkey(refkey: Refkeyable): Ref<OutputSymbol | undefined, OutputSymbol | undefined>;
refkey

Refkeyable

Ref<MemberDeclaration context interface | undefined, MemberDeclaration context interface | undefined>

This API may return a ref for undefined, but that does not mean that the symbol is not found. The symbol you’re looking for may not have been declared yet. When the symbol is declared, the ref will be updated with the symbol.