Skip to content

MemberResolver

A callback that performs access-control filtering during member resolution.

Call signature(owner: TSymbol, member: TSymbol, context: MemberResolutionContext<TScope>) => void

When provided to ResolveDeclarationByKeyOptions, it entirely replaces the default checks (ownership assertion and isMemberSymbol assertion).

Contract:

  • Return void to accept the member.
  • Throw an error to reject the member — the error propagates to the caller, matching the behavior of the default checks.
const resolver: MemberResolver<MyScope, MySymbol> = (owner, member, ctx) => {
  if (member.isPrivate && !ctx.isMemberAccess) {
    throw new Error(`${member.name} is not accessible here`);
  }
};