Hierarchy

  • TypedEmitter
    • SyncApi

Constructors

Properties

[kSyncState]: SyncState

Methods

  • Add some blob blocks this peer wants.

    Parameters

    • peerId: string
    • start: number
    • length: number

    Returns void

  • Clear the blob blocks this peer wants.

    Parameters

    • peerId: string

    Returns void

  • Parameters

    • discoveryKey: Buffer
    • protomux: Protomux<NoiseSecretStream<Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>>>

    Returns void

  • Request a graceful stop to all sync.

    Returns void

  • Rescind any requests for a full stop.

    Returns void

  • Parameters

    Returns void

  • Parameters

    • deviceId: string
    • abortSignal: AbortSignal

    Returns Promise<void>

  • Returns void

  • Returns void

  • Get the current sync state (initial and full). Also emitted via the 'sync-state' event

    Returns State

  • Parameters

    • autostopDataSyncAfter: null | number

    Returns void

  • Start syncing data cores.

    If the app is backgrounded and sync has already completed, this will do nothing until the app is foregrounded.

    Parameters

    • Optionaloptions: {
          autostopDataSyncAfter: undefined | null | number;
      } = {}
      • autostopDataSyncAfter: undefined | null | number

        If no data sync happens after this duration in milliseconds, sync will be automatically stopped as if stop was called.

    Returns void

  • Stop syncing data cores.

    Pre-sync cores will continue syncing unless the app is backgrounded.

    Returns void

  • Parameters

    Returns Promise<void>