Skip to content
1 min read · 179 words

Interface: ReaderDescriptor

Defined in: src/lib/contracts/reader_descriptor.ts:40

A tagged, serialisable description of where a reader's bytes live — never the bytes themselves.

Remarks

Reader-backed primitives (@nhtio/adk!Media, @nhtio/adk!SpooledArtifact) serialise as handles. On encode(), the reader emits this descriptor via its optional describe() method; on decode(), the registered resolver for tag re-binds the locator to a live reader (re-injecting the ambient Disk/OPFS root/fetch the locator alone cannot carry).

  • tag — the resolver key (e.g. "spool:flydrive", "media:in-memory", "media:fetch"). Namespaced media: / spool: so the two reader families never collide in their respective registries.
  • locator — the JSON pointer the resolver needs: a storage key, a URL, or (for in-memory readers that own their bytes) the buffer itself, base64-encoded.

Properties

PropertyTypeDescriptionDefined in
locatorLocatorValueJSON-expressible pointer the resolver consumes to re-open the byte source.src/lib/contracts/reader_descriptor.ts:44
tagstringResolver key identifying which registered resolver re-binds this handle on decode.src/lib/contracts/reader_descriptor.ts:42