Skip to main content
Module

x/earthstar/mod.ts>ISyncPartner

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
interface ISyncPartner
Re-export
import { type ISyncPartner } from "https://deno.land/x/earthstar@v10.0.0-alpha.2/mod.ts";

Provides a syncer with the means to connect the peer being synced with (the partner).

Type Parameters

IncomingAttachmentSourceType

Properties

A stream of inbound syncer events from the partner.

A stream of outbound syncer events to the partner

concurrentTransfers: number

The number of permitted concurrent attachment transfers

Methods

getDownload(opts: GetTransferOpts): Promise<ReadableStream<Uint8Array> | undefined>

Attempt to download an attachment directly from the partner.

handleUploadRequest(opts: GetTransferOpts): Promise<WritableStream<Uint8Array> | undefined>

Handles (usually in-band) request from the other peer to upload an attachment.

handleTransferRequest(source: IncomingAttachmentSourceType, kind: "upload" | "download"): Promise<ReadableStream<Uint8Array> | WritableStream<Uint8Array> | undefined>

Handles an out-of-band request from the other peer to start a transfer.