Skip to content
1 min read · 82 words

Function: registerArtifactEncodables()

ts
function registerArtifactEncodables(): Promise<void>;

Defined in: src/batteries/artifacts/index.ts:40

Registers the four artifact classes with the '@nhtio/encoder' decoder.

Returns

Promise<void>

A promise that resolves when registration is complete.

Remarks

This function must be called once before decoding artifact instances that were previously encoded. It is idempotent and safe to call multiple times. Consumers who need both core primitives and artifacts typically call registerAdkEncodables() (from the encoding battery) followed by this function.

Throws

If '@nhtio/encoder' is not available or registration fails.

Example

ts
import { registerArtifactEncodables } from "@nhtio/adk/batteries/artifacts";
await registerArtifactEncodables();