Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/earthstar/src/replica/replica-types.ts

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
import * as earthstar from "https://deno.land/x/earthstar@v10.0.0-beta.5/src/replica/replica-types.ts";

Interfaces

An attachment driver provides low-level access to a replica's attachments. ReplicaAttachmentDrivers are not meant to be used directly by users; let the Replica talk to it for you.

A document driver provides low-level access to a replica's documents. ReplicaDocDrivers are not meant to be used directly by users; let the Replica talk to it for you.

A replica driver provides low-level access to a replica's documents and attachments. ReplicaDrivers are not meant to be used directly by users; let the Replica talk to it for you.

Options for configuring a new replica.

  • validators: Validators for the kinds of documents this replica will replicate, e.g. FormatValidatorEs4.
  • driver: A driver the replica will use to read and persist documents.

Type Aliases

  • IngestEventSuccess β€” a new doc was written
  • IngestEventFailure β€” refused an invalid doc
  • IngestEventNothingHappened β€” ingested an obsolete or duplicate doc

An event representing when a QuerySource has processed all existing documents.

  • ExpireEvent - An ephemeral document has expired
  • IngestEvent β€” the result of a replica ingesting a document
  • DocAlreadyExists β€” processing an old doc as you catch up

A mode representing what kind of docs are desired from a query stream.

  • existing - Only pre-existing documents.
  • new - Only documents written after the stream is initiated
  • everything - Both pre-existing and incoming documents.
  • DocAlreadyExists β€” processing an old doc as you catch up
  • IngestEvent β€” the result of a replica ingesting a document
  • ExpireEvent - An ephemeral document has expired
  • AttachmentIngestEvent - A new attachment has been ingested
  • AttachmentPruneEvent - An attachment without a corresponding document has been pruned.
  • ReplicaEventWillClose β€” the replica is about to close
  • ReplicaEventDidClose β€” the replica has closed