Skip to content
1 min read · 91 words

Function: resolveArtifactSync()

ts
function resolveArtifactSync(
  resolver: SyncArtifactResolver,
  onInvalid: (reason: string) => never,
): () => SpooledArtifactCtor;

Defined in: batteries/tools/_shared/index.ts:139

Synchronous resolveArtifact: accepts only the SyncArtifactResolver subset and throws (via onInvalid) on an async resolver — a runtime guard for JS callers who bypass the compile-time narrowing.

Parameters

ParameterTypeDescription
resolverSyncArtifactResolverA constructor or a sync resolver.
onInvalid(reason: string) => neverThrows a battery-scoped error; receives a human-readable reason.

Returns

A sync () => SpooledArtifactCtor suitable for Tool.artifactConstructor.

() => SpooledArtifactCtor