import { type IPeer } from "https://deno.land/x/earthstar@v10.0.0-beta.5/src/peer/peer-types.ts";
Holds many shares' replicas and manages their synchronisation with other peers. Recommended as the point of contact between your application and Earthstar shares.
Methods
replicas(): Replica[]
getReplica(share: ShareAddress): Replica | undefined
addReplica(replica: Replica): Promise<void>
removeReplica(replica: Replica): Promise<void>
sync<F>(): Syncer<unknown, F>
addSyncPartner<I, F>(): Syncer<unknown, F>
getSyncers(): Map<string, { description: string; syncer: Syncer<unknown, unknown>; }>
onReplicasChange(callback: (map: Map<ShareAddress, Replica>) => void | Promise<void>): () => void
onSyncersChange(callback: (map: Map<string, { description: string; syncer: Syncer<unknown, unknown>; }>) => void | Promise<void>): () => void