Field Notes
    Preparing search index...

    Interface ManagedSyncConnection

    interface ManagedSyncConnection {
        getStatus(): ManagedSyncStatus;
        getUnsupportedReason(): string | undefined;
        onPresence(handler: (from: string, data: unknown) => void): () => void;
        onPresenceLeave(handler: (from: string) => void): () => void;
        publishLayerRemove(id: string): void;
        publishLayerUpsert(definition: Layer): void;
        sendPresence(data: unknown): void;
        stop(): void;
    }
    Index
    • Observes room presence frames. from is the relay's server-owned sender id for the originating connection — an opaque per-sender key, not the remote clientId. Handlers survive credential rebuilds: they are attached to every client the manager creates. Returns unsubscribe.

      Parameters

      • handler: (from: string, data: unknown) => void

      Returns () => void

    • Observes presence departures (a sender's connection closed). Same from key and rebuild semantics as onPresence. Returns unsubscribe.

      Parameters

      • handler: (from: string) => void

      Returns () => void

    • Publishes a local layer definition edit. While no client is connected (between rebuilds) the edit is recorded in the manager's ledger and delivered by the re-push that follows the next authoritative snapshot. Throws when the layers option was not configured.

      Parameters

      Returns void

    • Sends ephemeral presence data to the room. Presence is fire-and-forget: while the connection is not live the data is DROPPED, never queued — stale presence (a laser trail, a cursor) must not replay after a reconnect. Presence never enters the durable operation queue.

      Parameters

      • data: unknown

      Returns void

    • Cancels timers, listeners, the client, and the transport, and invalidates any in-flight resolveUrl result. A stopped connection never reconnects.

      Returns void