Skip to content
1 min read · 177 words

Function: registerAdkResolver()

ts
function registerAdkResolver<TBundle>(resolver: AdkResolverFn<TBundle>): void;

Defined in: src/shims/index.ts:445

Register (or replace) the resolver the ambient adk shim delegates to.

Type Parameters

Type ParameterDefault typeDescription
TBundle extends object@nhtio/adkThe shape the supplied resolver produces. Defaults to AdkNamespace.

Parameters

ParameterTypeDescription
resolverAdkResolverFn<TBundle>The resolver adk will delegate to going forward.

Returns

void

Remarks

Call once, early, before anything reads adk. Re-registering before the ambient shim's first successful resolution silently overwrites the previous registration — the newest call wins, no throw, no warning; this is the expected shape for a speculative registration made during bootstrap that gets superseded before anything actually resolves. Re-registering after the first successful resolution throws E_SHIM_RESOLVER_ALREADY_RESOLVED — see that exception's docs for why swapping resolvers under already-resolved consumers is treated as a hard error rather than a silent replace.

Throws

E_SHIM_RESOLVER_ALREADY_RESOLVED if the ambient shim already resolved once.