import { ShareAddress } from "../util/doc-types.ts";import { IReplica } from "../replica/replica-types.ts";import { SyncSessionStatus } from "../syncer/syncer-types.ts";
export type PeerId = string;
export interface IPeer { peerId: PeerId;
hasShare(share: ShareAddress): boolean; shares(): ShareAddress[]; replicas(): IReplica[]; size(): number; getReplica(share: ShareAddress): IReplica | undefined;
addReplica(replica: IReplica): Promise<void>; removeReplicaByShare(share: ShareAddress): Promise<void>; removeReplica(replica: IReplica): Promise<void>;
sync( target: IPeer | string, ): () => void;
stopSyncing(): void;
syncUntilCaughtUp( targets: (IPeer | string)[], ): Promise<Record<string, Record<ShareAddress, SyncSessionStatus>>>;}