Prometheus Entity Management API
    Preparing search index...

    Minimal transport channel for exchanging Loro binary snapshots with peers.

    Consumers implement this once for their transport (WebSocket, Supabase Realtime broadcast, etc.) and pass it to createLoroProvider.

    interface LoroChannel {
        connect?(): Promise<void>;
        disconnect?(): void;
        getStatus?(): LoroChannelStatus;
        onReceive(handler: (type: string, bytes: Uint8Array) => void): () => void;
        onStatusChange?(handler: (status: LoroChannelStatus) => void): () => void;
        send(type: string, bytes: Uint8Array): void;
    }
    Index
    • Optional lifecycle hook called when the provider starts.

      Returns Promise<void>

    • Optional lifecycle hook called when the provider stops.

      Returns void

    • Optional observable transport state for diagnostics and UI adapters.

      Returns LoroChannelStatus

    • Register a handler the channel calls whenever it receives bytes from a remote peer. The provider uses these to import the update into the local Loro doc and then call onPeerChange.

      Returns an unsubscribe function.

      Parameters

      • handler: (type: string, bytes: Uint8Array) => void

      Returns () => void

    • Optional subscription to transport-state changes.

      Parameters

      Returns () => void

    • Send a binary snapshot/update to all connected peers. Called by the provider after every local entity write.

      Parameters

      • type: string
      • bytes: Uint8Array

      Returns void