Skip to content
Roomful is in public beta — install with the @beta tag. Share feedback →

Interface: PresenceEngine\<TPresence\>

@roomful/core


@roomful/core / PresenceEngine

Defined in: packages/core/src/types.ts:983

Exposes presence operations for a room.

TPresence extends PresenceData = PresenceData

The custom peer presence shape.

get(peerId): Peer<TPresence> | null

Defined in: packages/core/src/types.ts:1014

Looks up a peer by identifier.

string

The peer identifier to resolve.

Peer<TPresence> | null

The matching peer when present, otherwise null.


getAll(): Peer<TPresence>[]

Defined in: packages/core/src/types.ts:1021

Returns every known peer, including the local peer.

Peer<TPresence>[]

A snapshot of all known peers.


getSelf(): Peer<TPresence>

Defined in: packages/core/src/types.ts:1028

Returns the local peer snapshot.

Peer<TPresence>

The local peer.


replace(this, data): void

Defined in: packages/core/src/types.ts:998

Replaces the local presence payload.

void

Partial<TPresence>

The partial presence payload to publish for the local peer.

void

Nothing.


subscribe(cb): Unsubscribe

Defined in: packages/core/src/types.ts:1006

Subscribes to peer presence changes.

(peers) => void

The callback invoked with the full peer list.

Unsubscribe

A function that removes the listener.


update(this, data): void

Defined in: packages/core/src/types.ts:990

Partially updates the local presence payload.

void

Partial<TPresence>

The partial presence payload to merge into the local peer.

void

Nothing.