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
| Parameter | Type | Description |
|---|---|---|
resolver | SyncArtifactResolver | A constructor or a sync resolver. |
onInvalid | (reason: string) => never | Throws a battery-scoped error; receives a human-readable reason. |
Returns
A sync () => SpooledArtifactCtor suitable for Tool.artifactConstructor.
() => SpooledArtifactCtor