import { Earthstar } from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/deps.ts";
const { ClientSettings } = Earthstar;
Properties
private
authorChangedCbs: Set<(keypair: AuthorKeypair | null) => void>author: AuthorKeypair | null
Methods
private
fireAuthorEvent()private
fireSecretsEvent()private
fireServersEvent()addSecret(shareAddress: ShareAddress, secret: string)
addServer(address: string): string[] | ValidationError
clear()
getPeer(unnamed 0: { sync: "once" | "continuous" | false; onCreateReplica: (addr: ShareAddress, secret?: string) => Replica; }): { peer: Peer; unsubscribeFromSettings: () => void; }
Get a new Peer
preconfigured with shares, secrets, and syncers derived from these settings.
When settings are updated, the peer's replicas and syncers will be updated too.
onAuthorChanged(cb: (keypair: AuthorKeypair | null) => void)
onServersChanged(cb: (shares: string[]) => void)
removeSecret(shareAddress: ShareAddress)
removeServer(addressToRemove: string)