Skip to content

Binder

The binder tracks all output scopes and symbols. Scopes are nested containers for symbols.

getSymbolForRefkey(refkey: Refkeyable) => Ref<TSymbol | undefined>Get a ref to the symbol associated with the given refkey. The value of the ref is undefined if the symbol has not been created yet.
nameConflictResolveroptionalNameConflictResolverThe name conflict resolver to use for this binder.
notifyScopeCreated(scope: OutputScope) => voidNotifies the binder that a scope has been created.
notifySymbolCreated(symbol: OutputSymbol) => voidNotifies the binder that a symbol has been created.
notifySymbolDeleted(symbol: OutputSymbol) => voidNotifies the binder that a symbol has been deleted.
resolveDeclarationByKey(currentScope: TScope | undefined, key: Refkey, options: ResolveDeclarationByKeyOptions<TScope, TSymbol>) => Ref<ResolutionResult<TScope, TSymbol> | undefined>Resolve the given refkey in the current scope.

Symbol information is reactive because in certain situations this data may change. For example, when a symbol becomes conflicted with another symbol, one of the symbol names may change. Ensure that you interact with binder values in a reactive context (i.e. within JSX/code template, or within memo/computed/etc).