Skip to main content
Module

x/earthstar/src/entries/browser.ts>AttachmentDriverIndexedDB

Storage for private, distributed, offline-first applications.
Go to Latest
class AttachmentDriverIndexedDB
implements IReplicaAttachmentDriver
import { AttachmentDriverIndexedDB } from "https://deno.land/x/earthstar@v10.0.2/src/entries/browser.ts";

Constructors

new
AttachmentDriverIndexedDB(share: ShareAddress, namespace?: string)

Properties

private
closed: boolean
private
db
private
share: ShareAddress

Methods

private
getIndexKey(formatName: string, attachmentHash: string)
clearStaging(): Promise<void>
close(erase: boolean)
erase(formatName: string, attachmentHash: string): Promise<true | ValidationError>
filter(attachments: Record<string, Set<string>>): Promise<{ format: string; hash: string; }[]>
getAttachment(formatName: string, attachmentHash: string): Promise<DocAttachment | undefined>
isClosed(): boolean
stage(formatName: string, attachment: Uint8Array | ReadableStream<Uint8Array>): Promise<{ hash: string; size: number; commit: () => Promise<void>; reject: () => Promise<void>; } | ValidationError>
wipe(): Promise<void>