import { BehaviorSubject, Subject, Subscription } from 'rxjs'; import type { RxCollection, RxError, RxReplicationHandler, RxTypeError } from '../../types'; import type { P2PConnectionHandler, P2PPeer, P2PPeerState, P2PReplicationCheckpoint, RxP2PReplicationState, SyncOptionsP2P } from './p2p-types'; export declare function replicateP2P(options: SyncOptionsP2P): Promise>; /** * Because the P2P replication runs between many instances, * we use a Pool instead of returning a single replication state. */ export declare class RxP2PReplicationPool { readonly collection: RxCollection; readonly options: SyncOptionsP2P; readonly connectionHandler: P2PConnectionHandler; peerStates$: BehaviorSubject>>; canceled: boolean; masterReplicationHandler: RxReplicationHandler; subs: Subscription[]; error$: Subject; constructor(collection: RxCollection, options: SyncOptionsP2P, connectionHandler: P2PConnectionHandler); addPeer(peer: P2PPeer, replicationState?: RxP2PReplicationState): void; removePeer(peer: P2PPeer): void; awaitFirstPeer(): Promise>>; cancel(): Promise; } export * from './p2p-helper'; export * from './p2p-types'; export * from './connection-handler-simple-peer';