index ↓

blob

client.blob

requests

you ask, the daemon answers. await the tagged result and check .ok

list(): Promise<TypedRequestResult<BlobListReply, never>>

push form: onList (subscribe instead of awaiting)

const res = await client.blob.list();
if (res.ok) {
  console.log(res.response.entries);
}

events

the daemon pushes these unprompted. subscribing returns an unsubscribe function

onChanged(handler: (BlobChanged) => void): () => void

const off = client.blob.onChanged((blobChanged) => {
  console.log(blobChanged.key);
});
// call off() to unsubscribe

types

shapes referenced above, as the sdk types them

type BlobChanged = {
  key: string;
  sha256?: string;
  url?: string;
};
type BlobListReply = {
  entries: BlobEntry[];
};
type BlobEntry = {
  key: string;
  sha256: string;
  mime: string;
  size: number;
  url: string;
};